Remote Systems
v6.4.1

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

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
      extended bycom.ibm.etools.systems.core.ui.view.SystemViewPromptableAdapter
All Implemented Interfaces:
IRemoteObjectIdentifier, ISystemDragDropAdapter, ISystemPropertyConstants, ISystemViewActionFilter, ISystemViewElementAdapter
Direct Known Subclasses:
SystemViewNewConnectionPromptAdapter

public class SystemViewPromptableAdapter
extends AbstractSystemViewAdapter
implements ISystemViewElementAdapter

Adapter for displaying special-case prompt objects in the system views. These are objects that, when expanded, launch a wizard to create something.


Field Summary
static String copyright
           
protected  SystemRunAction runAction
           
 
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
 
Constructor Summary
SystemViewPromptableAdapter()
           
 
Method Summary
 void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
          Return the actions to show in the popup menu for the current selection
 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 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.
 Object getParent(Object element)
          Return the parent of this object.
protected  SystemRunAction getRunAction(Shell shell)
          Only called if the selected object has no children.
 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 saveExpansionState(Object element)
          Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted messages.
 boolean showDelete(Object element)
          Don't show delete
 boolean showOpenViewActions(Object element)
          Don't show "Open in new perspective"
 boolean showRefresh(Object element)
          Do show refresh, expand and collapse, but only if there are children
 boolean showRename(Object element)
          Don't show rename
 
Methods inherited from class com.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
addCommonRemoteActions, addDynamicPopupMenuActions, canDelete, canDrag, canDrop, canEdit, canRename, checkForNull, createSimplePropertyDescriptor, createSimplePropertyDescriptor, doDelete, doDrag, doDrop, doDrop, doRename, fetchDeferredChildren, getAdapter, getCancelledMessageObject, getCanonicalNewName, getChildren, getChildrenUsingExpandToFilter, getCurrentTreeView, getDefaultDescriptors, getEditableRemoteObject, getEditableValue, getEmptyMessageObject, getFailedMessageObject, getFilterString, getFilterStringFor, getFirstSelection, getInput, getInputMementoHandle, getLabel, getName, getNameValidator, getPropertyDescriptors, getPropertyValue, getPropertyValue, getRemoteAdapter, getRemoteSourceType, getRemoteSubSubType, getRule, getShell, getStatusLineText, getSubSystem, getSystemFetchOperation, getSystemTree, getTranslatedFalse, getTranslatedNo, getTranslatedNotApplicable, getTranslatedNotAvailable, getTranslatedTrue, getTranslatedYes, getUniquePropertyDescriptors, getViewer, handleDoubleClick, initMsgObjects, isContainer, isPromptable, isPropertySet, namesAreEqual, resetPropertyValue, selectionChanged, setFilterString, setInput, setPropertySourceInput, setPropertyValue, setShell, setViewer, showGenericShowInTableAction, sub, supportsDeferredQueries, testAttribute, 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
canDelete, canRename, doDelete, doRename, getCanonicalNewName, getChildren, getChildrenUsingExpandToFilter, getFilterString, getInput, getInputMementoHandle, getName, getNameValidator, getPropertyValue, getShell, getStatusLineText, getSubSystem, getUniquePropertyDescriptors, getViewer, handleDoubleClick, isPromptable, namesAreEqual, selectionChanged, setFilterString, setInput, setPropertySourceInput, setShell, setViewer, showGenericShowInTableAction, supportsDeferredQueries
 
Methods inherited from interface com.ibm.etools.systems.core.ui.view.ISystemDragDropAdapter
canDrag, canDrop, doDrag, doDrop, doDrop, validateDrop
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

runAction

protected SystemRunAction runAction
Constructor Detail

SystemViewPromptableAdapter

public SystemViewPromptableAdapter()
Method Detail

addActions

public void addActions(SystemMenuManager menu,
                       IStructuredSelection selection,
                       Shell shell,
                       String menuGroup)
Return the actions to show in the popup menu for the current selection

Specified by:
addActions in interface ISystemViewElementAdapter
Specified by:
addActions in class AbstractSystemViewAdapter
Parameters:
menu - the popup menu you can contribute to
selection - the current selection in the calling tree or table view
shell - the shell of the calling tree or table view
menuGroup - the default menu group to place actions into if you don't care where they. Pass this to the SystemMenuManager add method.
See Also:
ISystemViewElementAdapter.addActions(SystemMenuManager, IStructuredSelection, Shell, String)

getRunAction

protected SystemRunAction getRunAction(Shell shell)
Only called if the selected object has no children.

Parameters:
shell - the shell.
Returns:
the run action.

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.

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

getAbsoluteName

public String getAbsoluteName(Object element)
Return the absolute name, versus just display name, of this object. Just uses getText(element);

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.

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

getChildren

public Object[] getChildren(Object element)
Return the children of this object. Not applicable for us.

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. We return true, as either we'll expand and prompt, or expand and show child prompts

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

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)

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.

showDelete

public boolean showDelete(Object element)
Don't show delete

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

showRename

public boolean showRename(Object element)
Don't show rename

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)

showRefresh

public boolean showRefresh(Object element)
Do show refresh, expand and collapse, but only if there are children

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

showOpenViewActions

public boolean showOpenViewActions(Object element)
Don't show "Open in new perspective"

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

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

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

saveExpansionState

public boolean saveExpansionState(Object element)
Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted messages. In these cases return false from this method. The default is true.

WE RETURN FALSE.

Specified by:
saveExpansionState in interface ISystemViewElementAdapter
Overrides:
saveExpansionState 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.