|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mospace.swing.ExtensionInstaller
de.mospace.swing.LaFInstaller
public final class LaFInstaller
This class provides a convenient way to install new LookAndFeels in a Sun
JRE. Given an archive with a LookAndFeel it will try to copy the jar file to
a java extensions directory as per the system property java.ext.dirs
or a client specified directory and add an entry to the property file
swing.properties.
If the installation was succesfull, the LookAndFeel will be accessible
through UIManager.getInstalledLookAndFeels() with the next invocation
of the JVM. In particular, applications can let the user switch to the new
LookAndFeel with a LookAndFeelMenu.
| Nested Class Summary | |
|---|---|
static class |
LaFInstaller.LaFPackage
Description of the Class |
| Field Summary |
|---|
| Fields inherited from class de.mospace.swing.ExtensionInstaller |
|---|
parent |
| Constructor Summary | |
|---|---|
LaFInstaller()
Constructs a new LaFInstaller with a null parent component. |
|
LaFInstaller(Component parent)
Constructs a new LaFInstaller. |
|
LaFInstaller(Component parent,
File installdir,
File lafProperties)
|
|
| Method Summary | |
|---|---|
static boolean |
canInstall()
Returns whether we can install new LookAndFeels. |
static boolean |
canInstall(File props)
Returns whether we can install new LookAndFeels. |
boolean |
installExtension(File jarFile)
Calling this method on a LafInstaller will cause an UnsupportedOperationException. |
boolean |
installExtension(File zip,
String extjars)
Calling this method on a LafInstaller will cause an UnsupportedOperationException. |
boolean |
installLaF(LaFInstaller.LaFPackage laf)
Tries to install the specified LookAndFeel and returns whether the installation was successful. |
boolean |
installLaF(LaFInstaller.LaFPackage laf,
ClassLoaderProvider clp)
|
static void |
main(String[] argv)
Allows direct invocation of the LaFInstaller from the command line. |
LaFInstaller.LaFPackage |
pickLaF(LaFInstaller.LaFPackage[] lafs)
Asks the user to pick one of several LookAndFeels. |
LaFInstaller.LaFPackage |
queryLaF()
Aks the user to specify an archive wich will be searched for LookAndFeels as per LaFInstaller.LaFPackage.fromJar(java.io.File) and
LaFInstaller.LaFPackage.fromZip(java.io.File). |
void |
updateUIManagerInstalledLafs()
Updates UIManagers installedLookAndFeels with the current state of installedlafs. |
static void |
warnCannotInstall(Component pparent,
File iprops)
Checks whether we can install new LookAndFeels and displays a dialog with an error message if not. |
| Methods inherited from class de.mospace.swing.ExtensionInstaller |
|---|
ask, canWrite, getFallbackTargetDirectory, getTargetDirectory, getWritableExtensionDirectory, installExtension, installExtension, isTemporary, queryFile, setFallbackTargetDirectory, setTargetDirectory, warn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LaFInstaller()
null parent component.
public LaFInstaller(Component parent)
parent - The parent component to use for dialogs. Can be null
public LaFInstaller(Component parent,
File installdir,
File lafProperties)
| Method Detail |
|---|
public static void main(String[] argv)
throws IOException
argv - No arguments are expected.
IOException - if an I/O error occurred during modification
of swing.properties.public static boolean canInstall(File props)
public static boolean canInstall()
public static void warnCannotInstall(Component pparent,
File iprops)
pparent - Description of the Parameterpublic LaFInstaller.LaFPackage queryLaF()
LaFInstaller.LaFPackage.fromJar(java.io.File) and
LaFInstaller.LaFPackage.fromZip(java.io.File). If no LaF is found displays a warning
message and returns. If more than one LookandFeel is found
asks the user to pick one.
public LaFInstaller.LaFPackage pickLaF(LaFInstaller.LaFPackage[] lafs)
lafs - the LookAndFeels to choose from.
null if the user
cancelled the dialog.
public boolean installLaF(LaFInstaller.LaFPackage laf)
throws IOException
laf.getJar() to this installer's
target directory and modifies swing.properties to include
the LookAndFeel referenced by jar.
laf - The LookAndFeel to install. May be null.
IOException - when an error occurs during modification of swing.properties
.
public boolean installLaF(LaFInstaller.LaFPackage laf,
ClassLoaderProvider clp)
throws IOException
IOExceptionpublic boolean installExtension(File jarFile)
installLaF(de.mospace.swing.LaFInstaller.LaFPackage) if you want to
install a LookAndFeel or a generic ExtensionInstaller if you want
to install a different kind of extension.
installExtension in class ExtensionInstallerjarFile - ...
UnsupportedOperationException
public boolean installExtension(File zip,
String extjars)
installLaF(de.mospace.swing.LaFInstaller.LaFPackage) if you want to
install a LookAndFeel or a generic ExtensionInstaller if you want
to install a different kind of extension.
installExtension in class ExtensionInstallerzip - ...extjars - ...
UnsupportedOperationExceptionpublic void updateUIManagerInstalledLafs()
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||