Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.view
Class SystemViewSubSystemAdapter

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
      extended bycom.ibm.etools.systems.core.ui.view.SystemViewSubSystemAdapter
All Implemented Interfaces:
IRemoteObjectIdentifier, ISystemDragDropAdapter, ISystemPropertyConstants, ISystemUserIdConstants, ISystemViewActionFilter, ISystemViewElementAdapter

public class SystemViewSubSystemAdapter
extends AbstractSystemViewAdapter
implements ISystemViewElementAdapter, ISystemPropertyConstants, ISystemUserIdConstants

Adapter for displaying SubSystem objects in tree views. These are children of SystemConnection objects


Field Summary
static String copyright
           
protected  String translatedType
           
 
Fields inherited from class com.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
_lastResults, _lastSelected, canceledObject, EMPTY_STRING_LIST, emptyList, errorObject, filterString, MEMENTO_DELIM, MSG_SUB_PREFIX, MSG_SUB1, MSG_SUB2, msgList, nullObject, propertySourceInput, shell, viewer
 
Fields inherited from interface com.ibm.etools.systems.core.ui.view.ISystemViewElementAdapter
noActions
 
Fields inherited from interface com.ibm.etools.systems.subsystems.IRemoteObjectIdentifier
Copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.view.ISystemPropertyConstants
P_ARCHIVE_COMMENT, P_ARCHIVE_EXPANDEDSIZE, P_CCSID, P_COMMAND, P_COMMENT, P_COMPILETYPE_TYPES, P_DEFAULTUSERID, P_DESCRIPTION, P_ENVLIST, P_ERROR, P_ERROR_FILENAME, P_ERROR_LINENO, P_FILE_CANONICAL_PATH, P_FILE_CLASSIFICATION, P_FILE_HIDDEN, P_FILE_LASTMODIFIED, P_FILE_PATH, P_FILE_READABLE, P_FILE_READONLY, P_FILE_SIZE, P_FILE_WRITABLE, P_FILTER, P_FILTERS, P_FILTERSTRING, P_FILTERSTRINGS, P_FILTERSTRINGS_COUNT, P_HAS_CHILDREN, P_HOSTNAME, P_IS_ACTIVE, P_IS_CONNECTED, P_IS_CONNECTION_PRIVATE, P_NBRCHILDREN, P_NEWNAME, P_OK, P_ORIGIN, P_PARENT_FILTER, P_PARENT_FILTERPOOL, P_PASSWORD, P_PORT, P_PREFIX, P_PROFILE, P_RELATED_CONNECTION, P_SEARCH_LINE, P_SHELL_CONTEXT, P_SHELL_STATUS, P_SYSTEMTYPE, P_TYPE, P_USERACTION_DOMAIN, P_USERID, P_VENDOR, P_VIRTUAL_COMMENT, P_VIRTUAL_COMPRESSEDSIZE, P_VIRTUAL_COMPRESSIONMETHOD, P_VIRTUAL_COMPRESSIONRATIO, P_VRM
 
Fields inherited from interface com.ibm.etools.systems.core.ISystemUserIdConstants
USERID_LOCATION_CONNECTION, USERID_LOCATION_DEFAULT_OVERALL, USERID_LOCATION_DEFAULT_SYSTEMTYPE, USERID_LOCATION_NOTSET, USERID_LOCATION_SUBSYSTEM
 
Constructor Summary
SystemViewSubSystemAdapter()
           
 
Method Summary
 void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
          Returns any actions that should be contributed to the popup menu for the given subsystem object.
 boolean canDelete(Object element)
          Return true if this object is deletable by the user.
 boolean canDrag(Object element)
          Indicates whether the subsystem can be dragged.
 boolean canRename(Object element)
          Return true if this object is renamable by the user.
 boolean doDelete(Shell shell, Object element)
          Perform the delete action.
 Object doDrag(Object element, boolean sameSystemType, IProgressMonitor monitor)
          Returns the subsystem (no phyiscal operation required to drag and subsystem (because it's local)
 boolean doRename(Shell shell, Object element, String name)
          Perform the rename action.
 String getAbsoluteName(Object element)
          Return the absolute name, versus just display name, of this object.
 Object[] getChildren(Object element)
          Return the children of this object
 ImageDescriptor getImageDescriptor(Object element)
          Returns an image descriptor for the image.
 String getInputMementoHandle(Object element)
          Return what to save to disk to identify this element when it is the input object to a secondary Remote Systems Explorer perspective.
 String getMementoHandle(Object element)
          Return what to save to disk to identify this element in the persisted list of expanded elements.
 String getMementoHandleKey(Object element)
          Return a short string to uniquely identify the type of resource.
 String getName(Object element)
          Return the name of this object, which may be different than the display text ({#link #getText(Object)}.
 ISystemValidator getNameValidator(Object element)
          Return a validator for verifying the new name is correct on a rename action.
 Object getParent(Object element)
          Return the parent of this object.
 IPropertyDescriptor[] getPropertyDescriptors()
          Returns the current collection of property descriptors for connection objects.
 Object getPropertyValue(Object property)
          Returns the current value for the named property.
 SubSystem getSubSystem(Object element)
          Returns itself
 String getText(Object element)
          Return the label for this object.
 String getType(Object element)
          Return the type label for this object
 boolean hasChildren(Object element)
          Return true if this object has children
protected  org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
          Return our unique property descriptors
 Object internalGetPropertyValue(Object key)
          Return our unique property values
 boolean isPropertySet(Object propertyObject)
          Returns whether the property value has changed from the default.
 void resetPropertyValue(Object propertyObject)
          Called when user selects the reset button in property sheet.
 void setPropertySourceInput(Object propertySourceInput)
          Set input object for property source queries.
 void setPropertyValue(Object property, Object value)
          Called when user changes property via property sheet.
 boolean showDelete(Object element)
          Return true if we should show the delete action in the popup for the given element.
 boolean showRename(Object element)
          Return true if we should show the rename action in the popup for the given element.
 boolean testAttribute(Object target, String name, String value)
          Override of AbstractSystemViewAdapter.testAttribute(Object, String, String).
 
Methods inherited from class com.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
addCommonRemoteActions, addDynamicPopupMenuActions, canDrop, canEdit, checkForNull, createSimplePropertyDescriptor, createSimplePropertyDescriptor, doDrop, doDrop, fetchDeferredChildren, getAdapter, getCancelledMessageObject, getCanonicalNewName, getChildren, getChildrenUsingExpandToFilter, getCurrentTreeView, getDefaultDescriptors, getEditableRemoteObject, getEditableValue, getEmptyMessageObject, getFailedMessageObject, getFilterString, getFilterStringFor, getFirstSelection, getInput, getLabel, getPropertyValue, getRemoteAdapter, getRemoteSourceType, getRemoteSubSubType, getRule, getShell, getStatusLineText, getSystemFetchOperation, getSystemTree, getTranslatedFalse, getTranslatedNo, getTranslatedNotApplicable, getTranslatedNotAvailable, getTranslatedTrue, getTranslatedYes, getUniquePropertyDescriptors, getViewer, handleDoubleClick, initMsgObjects, isContainer, isPromptable, namesAreEqual, saveExpansionState, selectionChanged, setFilterString, setInput, setShell, setViewer, showGenericShowInTableAction, showOpenViewActions, showRefresh, sub, supportsDeferredQueries, validateDrop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.etools.systems.core.ui.view.ISystemViewElementAdapter
getCanonicalNewName, getChildren, getChildrenUsingExpandToFilter, getFilterString, getInput, getPropertyValue, getShell, getStatusLineText, getUniquePropertyDescriptors, getViewer, handleDoubleClick, isPromptable, namesAreEqual, saveExpansionState, selectionChanged, setFilterString, setInput, setShell, setViewer, showGenericShowInTableAction, showOpenViewActions, showRefresh, supportsDeferredQueries
 
Methods inherited from interface com.ibm.etools.systems.core.ui.view.ISystemDragDropAdapter
canDrop, doDrop, doDrop, validateDrop
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

translatedType

protected String translatedType
Constructor Detail

SystemViewSubSystemAdapter

public SystemViewSubSystemAdapter()
Method Detail

addActions

public void addActions(SystemMenuManager menu,
                       IStructuredSelection selection,
                       Shell shell,
                       String menuGroup)
Returns any actions that should be contributed to the popup menu for the given subsystem object. Calls the method getActions on the subsystem's factory, and places all action objects returned from the call, into the menu.

Specified by:
addActions in interface ISystemViewElementAdapter
Specified by:
addActions in class AbstractSystemViewAdapter
Parameters:
menu - The menu to contribute actions to
selection - The window's current selection.
shell - Shell of viewer
menuGroup - recommended menu group to add actions to. If added to another group, you must be sure to create that group first.
See Also:
ISystemViewElementAdapter.addActions(SystemMenuManager, IStructuredSelection, Shell, String)

getImageDescriptor

public ImageDescriptor getImageDescriptor(Object element)
Returns an image descriptor for the image. More efficient than getting the image.

Specified by:
getImageDescriptor in interface ISystemViewElementAdapter
Specified by:
getImageDescriptor in class AbstractSystemViewAdapter
Parameters:
element - The element for which an image is desired

getText

public String getText(Object element)
Return the label for this object. Uses getName() on the subsystem object.

Specified by:
getText in interface ISystemViewElementAdapter
Specified by:
getText in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.getName(Object), AbstractSystemViewAdapter.getAbsoluteName(Object)

getName

public String getName(Object element)
Return the name of this object, which may be different than the display text ({#link #getText(Object)}.

Called by common rename and delete actions.

Specified by:
getName in interface ISystemViewElementAdapter
Overrides:
getName in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.getText(Object), AbstractSystemViewAdapter.getAbsoluteName(Object)

getAbsoluteName

public String getAbsoluteName(Object element)
Return the absolute name, versus just display name, of this object. Returns profileName.connectionName.subsystemName;

Specified by:
getAbsoluteName in interface IRemoteObjectIdentifier
Specified by:
getAbsoluteName in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.getText(Object), AbstractSystemViewAdapter.getName(Object)

getType

public String getType(Object element)
Return the type label for this object

Specified by:
getType in interface ISystemViewElementAdapter
Specified by:
getType in class AbstractSystemViewAdapter

getParent

public Object getParent(Object element)
Return the parent of this object. This is a connection object.

Specified by:
getParent in interface ISystemViewElementAdapter
Specified by:
getParent in class AbstractSystemViewAdapter

getChildren

public Object[] getChildren(Object element)
Return the children of this object

Specified by:
getChildren in interface ISystemViewElementAdapter
Specified by:
getChildren in class AbstractSystemViewAdapter

hasChildren

public boolean hasChildren(Object element)
Return true if this object has children

Specified by:
hasChildren in interface ISystemViewElementAdapter
Specified by:
hasChildren in class AbstractSystemViewAdapter

getPropertyDescriptors

public IPropertyDescriptor[] getPropertyDescriptors()
Returns the current collection of property descriptors for connection objects.

Overrides:
getPropertyDescriptors in class AbstractSystemViewAdapter
Returns:
an array containing all descriptors.
See Also:
AbstractSystemViewAdapter.internalGetPropertyDescriptors()

internalGetPropertyDescriptors

protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors()
Return our unique property descriptors

Specified by:
internalGetPropertyDescriptors in class AbstractSystemViewAdapter
Returns:
an array containing all descriptors to be added to the default set of descriptors, or null if no additional properties desired.
See Also:
AbstractSystemViewAdapter.createSimplePropertyDescriptor(String,ResourceBundle,String)

getPropertyValue

public Object getPropertyValue(Object property)
Returns the current value for the named property. The parent handles P_TEXT and P_TYPE only, and we augment that here.

Overrides:
getPropertyValue in class AbstractSystemViewAdapter
Parameters:
property - the name of the property as named by its property descriptor
Returns:
the current value of the property

getSubSystem

public SubSystem getSubSystem(Object element)
Returns itself

Specified by:
getSubSystem in interface ISystemViewElementAdapter
Overrides:
getSubSystem in class AbstractSystemViewAdapter

internalGetPropertyValue

public Object internalGetPropertyValue(Object key)
Return our unique property values

Specified by:
internalGetPropertyValue in class AbstractSystemViewAdapter
Parameters:
key - the name of the property as named by its property descriptor
Returns:
the current value of the property or null if not a known property.

setPropertySourceInput

public void setPropertySourceInput(Object propertySourceInput)
Set input object for property source queries. This is called by the SystemViewAdaptorFactory before returning this adapter object.

Specified by:
setPropertySourceInput in interface ISystemViewElementAdapter
Overrides:
setPropertySourceInput in class AbstractSystemViewAdapter

isPropertySet

public boolean isPropertySet(Object propertyObject)
Returns whether the property value has changed from the default. Only applicable for editable properties. Called by PropertySheet viewer when user presses reset.

Overrides:
isPropertySet in class AbstractSystemViewAdapter
Returns:
true if the value of the specified property has changed from its original default value; false otherwise.

resetPropertyValue

public void resetPropertyValue(Object propertyObject)
Called when user selects the reset button in property sheet.

Overrides:
resetPropertyValue in class AbstractSystemViewAdapter
Parameters:
propertyObject - the key identifying property to reset

setPropertyValue

public void setPropertyValue(Object property,
                             Object value)
Called when user changes property via property sheet.

Overrides:
setPropertyValue in class AbstractSystemViewAdapter
Parameters:
property - the key identifying property to reset
value - the new value for the property

testAttribute

public boolean testAttribute(Object target,
                             String name,
                             String value)
Override of AbstractSystemViewAdapter.testAttribute(Object, String, String). We add one more attribute for subsystems:
  1. name="serverLaunchPP". Returns "true" if the given subsystem supports the Server Launch Settings property page, which is determined by calling it's factory's SubSystemFactory.supportsServerLaunchProperties() method.
This property is used to filter the existence of the Server Launch Settings property page.

Overrides:
testAttribute in class AbstractSystemViewAdapter
See Also:
IActionFilter

showDelete

public boolean showDelete(Object element)
Return true if we should show the delete action in the popup for the given element. If true, then canDelete will be called to decide whether to enable delete or not.

Specified by:
showDelete in interface ISystemViewElementAdapter
Overrides:
showDelete in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.canDelete(Object), AbstractSystemViewAdapter.doDelete(Shell,Object)

canDelete

public boolean canDelete(Object element)
Return true if this object is deletable by the user. If so, when selected, the Edit->Delete menu item will be enabled.

Specified by:
canDelete in interface ISystemViewElementAdapter
Overrides:
canDelete in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.showDelete(Object), AbstractSystemViewAdapter.doDelete(Shell,Object)

doDelete

public boolean doDelete(Shell shell,
                        Object element)
Perform the delete action.

Specified by:
doDelete in interface ISystemViewElementAdapter
Overrides:
doDelete in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.showDelete(Object), AbstractSystemViewAdapter.canDelete(Object)

showRename

public boolean showRename(Object element)
Return true if we should show the rename action in the popup for the given element. If true, then canRename will be called to decide whether to enable delete or not.

Specified by:
showRename in interface ISystemViewElementAdapter
Overrides:
showRename in class AbstractSystemViewAdapter
Returns:
true if we should show the rename action in the popup for the given element.
See Also:
AbstractSystemViewAdapter.canRename(Object), AbstractSystemViewAdapter.doRename(Shell,Object,String)

canRename

public boolean canRename(Object element)
Return true if this object is renamable by the user. If so, when selected, the Rename menu item will be enabled.

Specified by:
canRename in interface ISystemViewElementAdapter
Overrides:
canRename in class AbstractSystemViewAdapter
Returns:
true if this object is renamable by the user
See Also:
AbstractSystemViewAdapter.showRename(Object), AbstractSystemViewAdapter.doRename(Shell,Object,String), AbstractSystemViewAdapter.getNameValidator(Object), AbstractSystemViewAdapter.getCanonicalNewName(Object,String), AbstractSystemViewAdapter.namesAreEqual(Object,String)

doRename

public boolean doRename(Shell shell,
                        Object element,
                        String name)
Perform the rename action. Assumes uniqueness checking was done already.

Specified by:
doRename in interface ISystemViewElementAdapter
Overrides:
doRename in class AbstractSystemViewAdapter
Returns:
true if the rename was successful
See Also:
AbstractSystemViewAdapter.showRename(Object), AbstractSystemViewAdapter.canRename(Object)

getNameValidator

public ISystemValidator getNameValidator(Object element)
Return a validator for verifying the new name is correct on a rename action. The default implementation is not to support rename hence this method returns null. Override if appropriate.

Specified by:
getNameValidator in interface ISystemViewElementAdapter
Overrides:
getNameValidator in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.canRename(Object)

canDrag

public boolean canDrag(Object element)
Indicates whether the subsystem can be dragged. Can't be used for physical copies but rather for views (like the Scratchpad)

Specified by:
canDrag in interface ISystemDragDropAdapter
Overrides:
canDrag in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor), AbstractSystemViewAdapter.canDrop(Object), AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor), AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)

doDrag

public Object doDrag(Object element,
                     boolean sameSystemType,
                     IProgressMonitor monitor)
Returns the subsystem (no phyiscal operation required to drag and subsystem (because it's local)

Specified by:
doDrag in interface ISystemDragDropAdapter
Overrides:
doDrag in class AbstractSystemViewAdapter
See Also:
AbstractSystemViewAdapter.canDrag(Object), AbstractSystemViewAdapter.canDrop(Object), AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor), AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)

getMementoHandle

public String getMementoHandle(Object element)
Return what to save to disk to identify this element in the persisted list of expanded elements. This just defaults to getName, but if that is not sufficient override it here.

Specified by:
getMementoHandle in interface ISystemViewElementAdapter
Overrides:
getMementoHandle in class AbstractSystemViewAdapter

getInputMementoHandle

public String getInputMementoHandle(Object element)
Return what to save to disk to identify this element when it is the input object to a secondary Remote Systems Explorer perspective.

Specified by:
getInputMementoHandle in interface ISystemViewElementAdapter
Overrides:
getInputMementoHandle in class AbstractSystemViewAdapter

getMementoHandleKey

public String getMementoHandleKey(Object element)
Return a short string to uniquely identify the type of resource. Eg "conn" for connection. This just defaults to getType, but if that is not sufficient override it here, since that is a translated string.

Specified by:
getMementoHandleKey in interface ISystemViewElementAdapter
Overrides:
getMementoHandleKey in class AbstractSystemViewAdapter

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.