All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.core.JavaPlatformToolkit
java.lang.Object
|
+----com.sun.wizards.core.JavaPlatformToolkit
- public class JavaPlatformToolkit
- extends Object
- implements PlatformToolkit
The JavaPlatformToolkit is an interface that creates a means
of access to system-specific functionality.
-
JavaPlatformToolkit()
- Creates a new JavaPlatformToolkit.
-
attach()
- Try to load the native support.
-
createDesktopFolder(String)
- Creates a desktop folder
The JavaPlatformToolkit cannot do native windowing system
operations, so this will not actually do anything.
-
createDesktopItem(String, String, String, String)
- Creates a desktop item for the specified command.
-
createDesktopItems(Vector)
- Creates many desktop item for the specified commands.
-
detach()
- Try to unload the native support.
-
getComponent(String)
- Return an install description of the specified component.
-
getComponent(String, String)
- Return an install description of the specified component.
-
getComponent(String, String, int)
- Return an install description of the specified component.
-
getFileAttributes(File)
- Returns a string representing the file attributes of the specified
file.
-
getHomeDirectory()
- Returns the user's home directory.
-
getJavaCommand(String, String[], String)
- Returns a string that can be used to execute the specified Java
application with the specified CLASSPATH.
-
getLibraryDirectory()
- Returns the directory in which shared libraries should be
installed.
-
getLogFileDirectory()
- Returns the directory in which system log files should be
written.
-
getNamedFolderList(String, String)
- Gets a list of folders that are in the specified folder.
-
getPartitionFreeSpace(String)
- Returns the space available on the specified partition.
-
getPartitionNames()
- Returns an array of String representing all
partition names.
-
getStandardInstallDirectory()
- Returns the directory in which programs should be installed
by default.
-
getStaticNativeLibraryDir()
- Returns the directory in which the native library support
for this wizard should be written.
-
getTempDirectory()
- Returns the temporary directory.
-
registerComponent(ComponentDescription)
- Register the specified component.
-
removeDesktopFolder(String)
- Removes a desktop folder.
-
removeDesktopItem(String, String)
- Removes a desktop item.
-
setFileAttributes(File, String)
- Sets the attributes of the specified file.
-
setFileAttributes(File[], String[])
- Sets the attributes of the specified files.
-
unregisterComponent(ComponentDescription)
- Unregister the specified component.
JavaPlatformToolkit
public JavaPlatformToolkit()
- Creates a new JavaPlatformToolkit.
getStaticNativeLibraryDir
public String getStaticNativeLibraryDir()
- Returns the directory in which the native library support
for this wizard should be written.
The pure Java behavior is to write the native support into the
current directory.
- Returns:
- The directory in which the native support should be written.
attach
public void attach()
- Try to load the native support. Since no native binaries are
associated with the Java platform, this method does nothing.
It is provided here to fulfill the PlatformToolkit interface.
detach
public void detach()
- Try to unload the native support. Since no native binaries are
associated with the Java platform, this method does nothing.
It is provided here to fulfill the PlatformToolkit interface.
getLibraryDirectory
public String getLibraryDirectory()
- Returns the directory in which shared libraries should be
installed. The behavior for this pure Java implementation
is to return the current directory.
- Returns:
- The current directory.
getLogFileDirectory
public String getLogFileDirectory()
- Returns the directory in which system log files should be
written. The behavior for this pure Java implementation
is to return the temporary directory.
- Returns:
- The temporary directory.
getStandardInstallDirectory
public String getStandardInstallDirectory()
- Returns the directory in which programs should be installed
by default. The behavior for this pure Java implementation
is to return the root directory.
- Returns:
- The common program install directory.
getTempDirectory
public String getTempDirectory()
- Returns the temporary directory. An attempt to find the
real current directory is made by looking at the platform's
type (i.e. Unix, Windows, etc). If that attempt is unsuccessful,
the current directory is returned.
- Returns:
- The temporary directory.
getJavaCommand
public String getJavaCommand(String applicationName,
String applicationArgs[],
String classpath)
- Returns a string that can be used to execute the specified Java
application with the specified CLASSPATH. The pure Java version
of this method returns a string that will set the correct flags
for the reference Java VM.
- Parameters:
- applicationName - The name of the Java application class.
- applicationArgs - The arguments to pass into the Java application.
- classpath - The CLASSPATH required to execute the specified application.
getHomeDirectory
public String getHomeDirectory()
- Returns the user's home directory.
getPartitionNames
public String[] getPartitionNames()
- Returns an array of String representing all
partition names. The pure Java version of this
method can only return the root.
- Returns:
- The list of partition names.
getPartitionFreeSpace
public long getPartitionFreeSpace(String partitionName)
- Returns the space available on the specified partition. This
pure Java implementation returns a flag indicating that the
disk space check should not be performed.
- Parameters:
- partitionName - The name of the partition to query.
- Returns:
- The free space on the named partition, in bytes.
getFileAttributes
public String getFileAttributes(File file)
- Returns a string representing the file attributes of the specified
file.
- Parameters:
- file - The file to get the attributes from.
- Returns:
- A String representation of the file attributes that can be
passed in to SystemInterface.setFileAttributes().
setFileAttributes
public void setFileAttributes(File file,
String attributes)
- Sets the attributes of the specified file. This pure Java
implementation cannot set attributes. This method is a
noop.
- Parameters:
- file - The file the attributes should be applied to.
- attributes - The String representation of the desired file attributes.
setFileAttributes
public void setFileAttributes(File file[],
String attributes[])
- Sets the attributes of the specified files. This pure Java implementation
cannot set the attributes.
- Parameters:
- file - The files the attributes should be applied to.
- attributes - The String representation of the desired file attributes.
registerComponent
public void registerComponent(ComponentDescription component)
- Register the specified component.
- Parameters:
- component - The component description of the shared component to register.
unregisterComponent
public void unregisterComponent(ComponentDescription component)
- Unregister the specified component.
- Parameters:
- component - The component description of the shared component to unregister.
getComponent
public ComponentDescription getComponent(String guid)
- Return an install description of the specified component.
- Parameters:
- guid - The Universal Unique Identifier of the desired component.
- Returns:
- The shared component description if the component is registered;
null otherwise.
getComponent
public ComponentDescription getComponent(String guid,
String installLocation)
- Return an install description of the specified component.
- Parameters:
- guid - The Universal Unique Identifier of the desired component.
- installLocation - The directory in which the component should be installed.
- Returns:
- The shared component description if the component is registered;
null otherwise.
getComponent
public ComponentDescription getComponent(String guid,
String version,
int instance)
- Return an install description of the specified component.
- Parameters:
- guid - The Universal Unique Identifier of the desired component.
- version - The version of the desired component.
- instance - The installed instance of the desired component.
- Returns:
- The shared component description if the component is registered;
null otherwise.
getNamedFolderList
public String[] getNamedFolderList(String folderName,
String param)
- Gets a list of folders that are in the specified folder.
You can use the names to search recursively through the
folder tree.
The JavaPlatformToolkit cannot do native windowing system
operations, so this will not actually do anything.
- Parameters:
- folderName - The name of the folder to search in.
- param - An optional param used by implementations to
specify additional parameters
- Returns:
- The list of items in this folder, or
null if the folder does not exist or is not
readable.
createDesktopItems
public boolean createDesktopItems(Vector targets)
- Creates many desktop item for the specified commands. For
example, on Microsoft Windows, an icon is placed on the
"Start" menu. This JavaPlatformToolkit cannot perform native
operations, hence this class cannot do anything.
This version is useful for adding many desktop items at once, where the
act of adding something to the desktop is very expensive.
The list passed to this method should be a
Vector, with each member being a
String[] which contains (in order):
{folderName, title, target, iconName}, with
iconName being optional (as in
createDesktopItem() API).
- Parameters:
- targets - The list of desktop items to add. The list is
a
Vector, with each member being a
String[] which contains (in order):
{folderName, title, target, iconName}, with
iconName being optional (as in
createDesktopItem() API).
- Returns:
- Whether the item was able to be added or not.
createDesktopItem
public boolean createDesktopItem(String folderName,
String title,
String command,
String iconName)
- Creates a desktop item for the specified command. For
example, on Microsoft Windows, an icon is placed on the
"Start" menu.
The JavaPlatformToolkit cannot do native windowing system
operations, so this will not actually do anything.
- Parameters:
- folderName - The name of the folder to search in.
- title - The name of the item as it should appear
on-screen.
- command - The platform-specific command to activate when
this desktop item is selected by the user.
- iconPath - The absolute path To the file representing
the icon. The icon file format should be the correct one
for the platform. For example, on Sun Solaris, the icon
must be in
.xpm format. If no icon name is
supplied, none is used, or the default one is used for the
supplied command.
- Returns:
- Whether the item was able to be added or not.
removeDesktopItem
public boolean removeDesktopItem(String folderName,
String title)
- Removes a desktop item.
The JavaPlatformToolkit cannot do native windowing system
operations, so this will not actually do anything.
- Parameters:
- folderName - The name of the folder that the item to
remove is in.
- title - The name of the item as it appears on-screen.
- Returns:
- Whether the item was removed or not. If the item did
not exist in the first place,
false is returned.
createDesktopFolder
public boolean createDesktopFolder(String folderName)
- Creates a desktop folder
The JavaPlatformToolkit cannot do native windowing system
operations, so this will not actually do anything.
- Parameters:
- folderName - The name of the folder to search in.
- Returns:
- Whether the folder was created or not.
removeDesktopFolder
public boolean removeDesktopFolder(String folderName)
- Removes a desktop folder.
The JavaPlatformToolkit cannot do native windowing system
operations, so this will not actually do anything.
- Parameters:
- folderName - The name of the folder that the folder to
remove is in.
- title - The name of the folder as it appears on-screen.
- Returns:
- Whether the folder was removed or not. If the folder
did not exist in the first place,
false is
returned.
All Packages Class Hierarchy This Package Previous Next Index