RSE
Release 1.0

org.eclipse.rse.ui
Class RSESystemTypeAdapter

java.lang.Object
  extended byorg.eclipse.ui.model.WorkbenchAdapter
      extended byorg.eclipse.rse.ui.RSEAdapter
          extended byorg.eclipse.rse.ui.RSESystemTypeAdapter
All Implemented Interfaces:
IRSEAdapter, IRSESystemTypeConstants, IWorkbenchAdapter, IWorkbenchAdapter2

public class RSESystemTypeAdapter
extends RSEAdapter
implements IRSESystemTypeConstants

Adapter for RSE system types.


Field Summary
 
Fields inherited from class org.eclipse.ui.model.WorkbenchAdapter
NO_CHILDREN
 
Fields inherited from interface org.eclipse.rse.core.IRSESystemTypeConstants
ENABLE_OFFLINE, ICON, ICON_LIVE
 
Constructor Summary
RSESystemTypeAdapter()
           
 
Method Summary
 String getDefaultUserId(Object object)
          Return the default user id for a particular system type.
 String getDescription(Object object)
          Returns the description of the system type if the object passed in is of type IRSESystemType.
static ImageDescriptor getImage(String value, Bundle definingBundle)
          Create a descriptor from the argument absolute or relative path to an image file. bundle parameter is used as the base for relative paths and is allowed to be null.
 ImageDescriptor getImageDescriptor(Object object)
          Returns the image descriptor for the icon of this system type.
 String getLabel(Object object)
          Returns the name of the system type if the object passed in is of type IRSESystemType.
 ImageDescriptor getLiveImageDescriptor(Object object)
          Returns the "live" image descriptor for this system type.
static URL getUrl(String value, Bundle definingBundle)
          Create a URL from the argument absolute or relative path.
 boolean isEnabled(Object object)
          Returns the enabled state of a particular system type.
 boolean isEnableOffline(Object object)
           
 void setDefaultUserId(Object object, String defaultUserId)
          Set the default user id for this system type.
 void setIsEnabled(Object object, boolean isEnabled)
          Sets the enabled state of a particular system type.
 
Methods inherited from class org.eclipse.rse.ui.RSEAdapter
getRegistry
 
Methods inherited from class org.eclipse.ui.model.WorkbenchAdapter
getBackground, getChildren, getFont, getForeground, getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.model.IWorkbenchAdapter
getChildren, getParent
 
Methods inherited from interface org.eclipse.ui.model.IWorkbenchAdapter2
getBackground, getFont, getForeground
 

Constructor Detail

RSESystemTypeAdapter

public RSESystemTypeAdapter()
Method Detail

getImageDescriptor

public ImageDescriptor getImageDescriptor(Object object)
Returns the image descriptor for the icon of this system type. Returns the default live connection image descriptor if no icon has been configured.

Specified by:
getImageDescriptor in interface IWorkbenchAdapter
See Also:
WorkbenchAdapter.getImageDescriptor(java.lang.Object)

getLiveImageDescriptor

public ImageDescriptor getLiveImageDescriptor(Object object)
Returns the "live" image descriptor for this system type. If no "live" icon is found, but a non-live icon was specified, the non-live icon is returned instead. If a non-live icon also was not specified, the default live connection image descriptor is returned.

Parameters:
object - The object to get an image descriptor for.
Returns:
ImageDescriptor

getImage

public static ImageDescriptor getImage(String value,
                                       Bundle definingBundle)
Create a descriptor from the argument absolute or relative path to an image file. bundle parameter is used as the base for relative paths and is allowed to be null.

Parameters:
value - the absolute or relative path
definingBundle - bundle to be used for relative paths (may be null)
Returns:
ImageDescriptor

getUrl

public static URL getUrl(String value,
                         Bundle definingBundle)
Create a URL from the argument absolute or relative path. The bundle parameter is used as the base for relative paths and may be null.

Parameters:
value - the absolute or relative path
definingBundle - bundle to be used for relative paths (may be null)
Returns:
the URL to the resource

getLabel

public String getLabel(Object object)
Returns the name of the system type if the object passed in is of type IRSESystemType. Otherwise, returns the value of the parent implementation.

Specified by:
getLabel in interface IWorkbenchAdapter
See Also:
WorkbenchAdapter.getLabel(java.lang.Object)

getDescription

public String getDescription(Object object)
Returns the description of the system type if the object passed in is of type IRSESystemType. Otherwise, returns the value of the parent implementation.

Specified by:
getDescription in interface IRSEAdapter
Overrides:
getDescription in class RSEAdapter
See Also:
RSEAdapter.getDescription(java.lang.Object)

isEnableOffline

public boolean isEnableOffline(Object object)

isEnabled

public boolean isEnabled(Object object)
Returns the enabled state of a particular system type.

Parameters:
object - the object being adapted, usually a system type.
Returns:
true if that system type is enabled. false if the object is not a system type or if it is not enabled.

setIsEnabled

public void setIsEnabled(Object object,
                         boolean isEnabled)
Sets the enabled state of a particular system type.

Parameters:
object - The system type being adapted.
isEnabled - true if the system type is enabled. false if it is not.

getDefaultUserId

public String getDefaultUserId(Object object)
Return the default user id for a particular system type. If none is defined then the "user.name" system property is used.

Parameters:
object - The system type being adapted.
Returns:
The default user id. Will be null if the object is not a system type

setDefaultUserId

public void setDefaultUserId(Object object,
                             String defaultUserId)
Set the default user id for this system type. Stored in the RSE core preferences.

Parameters:
object - the system type that we are adapting
defaultUserId - the id to set for this system type

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.