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.


Constructor Index

 o JavaPlatformToolkit()
Creates a new JavaPlatformToolkit.

Method Index

 o attach()
Try to load the native support.
 o createDesktopFolder(String)
Creates a desktop folder

The JavaPlatformToolkit cannot do native windowing system operations, so this will not actually do anything.

 o createDesktopItem(String, String, String, String)
Creates a desktop item for the specified command.
 o createDesktopItems(Vector)
Creates many desktop item for the specified commands.
 o detach()
Try to unload the native support.
 o getComponent(String)
Return an install description of the specified component.
 o getComponent(String, String)
Return an install description of the specified component.
 o getComponent(String, String, int)
Return an install description of the specified component.
 o getFileAttributes(File)
Returns a string representing the file attributes of the specified file.
 o getHomeDirectory()
Returns the user's home directory.
 o getJavaCommand(String, String[], String)
Returns a string that can be used to execute the specified Java application with the specified CLASSPATH.
 o getLibraryDirectory()
Returns the directory in which shared libraries should be installed.
 o getLogFileDirectory()
Returns the directory in which system log files should be written.
 o getNamedFolderList(String, String)
Gets a list of folders that are in the specified folder.
 o getPartitionFreeSpace(String)
Returns the space available on the specified partition.
 o getPartitionNames()
Returns an array of String representing all partition names.
 o getStandardInstallDirectory()
Returns the directory in which programs should be installed by default.
 o getStaticNativeLibraryDir()
Returns the directory in which the native library support for this wizard should be written.
 o getTempDirectory()
Returns the temporary directory.
 o registerComponent(ComponentDescription)
Register the specified component.
 o removeDesktopFolder(String)
Removes a desktop folder.
 o removeDesktopItem(String, String)
Removes a desktop item.
 o setFileAttributes(File, String)
Sets the attributes of the specified file.
 o setFileAttributes(File[], String[])
Sets the attributes of the specified files.
 o unregisterComponent(ComponentDescription)
Unregister the specified component.

Constructors

 o JavaPlatformToolkit
 public JavaPlatformToolkit()
Creates a new JavaPlatformToolkit.

Methods

 o 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.
 o 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.

 o 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.

 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o getHomeDirectory
 public String getHomeDirectory()
Returns the user's home directory.

 o 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.
 o 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.
 o 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().
 o 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.
 o 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.
 o registerComponent
 public void registerComponent(ComponentDescription component)
Register the specified component.

Parameters:
component - The component description of the shared component to register.
 o unregisterComponent
 public void unregisterComponent(ComponentDescription component)
Unregister the specified component.

Parameters:
component - The component description of the shared component to unregister.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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