Remote Systems
v6.4.1

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

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

public class SystemViewRemoteSearchResultSetAdapter
extends AbstractSystemViewAdapter
implements ISystemRemoteElementAdapter, ISystemRemoveElementAdapter

Adapter for a search result set.


Field Summary
static String Copyright
           
 
Fields inherited from class com.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
_lastResults, _lastSelected, canceledObject, copyright, 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.ISystemRemoteElementAdapter
copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.view.ISystemViewElementAdapter
noActions
 
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
SystemViewRemoteSearchResultSetAdapter()
           
 
Method Summary
 void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup)
          No actions are provided on a search results container
 boolean canDelete(Object element)
          Overridable by subclasses, and usually is.
 boolean canEdit(Object obj)
          Returns false
 String getAbsoluteName(Object element)
          Return the fully qualified name of this remote object.
 String getAbsoluteParentName(Object element)
          Return fully qualified name that uniquely identifies this remote object's remote parent within its subsystem.
 Object[] getChildren(Object element)
          Returns the search results for the given search handle
 ISystemEditableRemoteObject getEditableRemoteObject(Object obj)
          Returns null since a search results container can't be edited
 String getFilterStringFor(Object object)
          Return a filter string that corresponds to this object.
 ImageDescriptor getImageDescriptor(Object element)
          Returns the associated icon for a search handle
 Object getParent(Object element)
          Returns null since a search handle has no parent
 Object getRemoteParent(Shell shell, Object element)
          Given a remote object, returns it remote parent object.
 String[] getRemoteParentNamesInUse(Shell shell, Object element)
          Given a remote object, return the unqualified names of the objects contained in that parent.
 String getRemoteSourceType(Object element)
          Return the source type of the selected object.
 String getRemoteSubSubType(Object element)
          Return a value for the sub-subtype property for this object.
 String getRemoteSubType(Object element)
          Return a value for the subtype property for this object.
 String getRemoteType(Object element)
          Return a value for the type property for this object The value must not be translated, so that property pages registered via xml can subset by it.
 String getRemoteTypeCategory(Object element)
          Return a value for the type category property for this object The value must not be translated, so that property pages registered via xml can subset by it.
 SubSystem getSubSystem(Object element)
          Returns the associated file subsystem for this search operation
 String getSubSystemFactoryId(Object element)
          Return the subsystem factory id that owns this remote object The value must not be translated, so that property pages registered via xml can subset by it.
 String getText(Object element)
          Returns the display text for a search handle.
 String getType(Object element)
          Returns the type property of a search.
 boolean handleDoubleClick(Object element)
          Returns false since a search handle can't be edited
 boolean hasChildren(Object element)
          Returns true if it has children, otherwise returns false.
protected  IPropertyDescriptor[] internalGetPropertyDescriptors()
          Return our unique property descriptors
protected  Object internalGetPropertyValue(Object key)
          Return our unique property values
 boolean refreshRemoteObject(Object oldElement, Object newElement)
          Short answer: treat this like clone(), and just copy any important instance variables Imagine the same remote resource is shown multiple times in the same tree view.... say because multiple filters resolve to it, or there are two connections to the same host.
 boolean remove(Object element, Object child)
          Remove a child from the element.
 boolean removeAllChildren(Object element)
          Remove all children from the element.
 boolean showDelete(Object element)
          Overridable by subclasses, but usually is not.
 boolean supportsUserDefinedActions(Object object)
          Returns false.
 
Methods inherited from class com.ibm.etools.systems.core.ui.view.AbstractSystemViewAdapter
addCommonRemoteActions, addDynamicPopupMenuActions, canDrag, canDrop, canRename, checkForNull, createSimplePropertyDescriptor, createSimplePropertyDescriptor, doDelete, doDrag, doDrop, doDrop, doRename, fetchDeferredChildren, getAdapter, getCancelledMessageObject, getCanonicalNewName, getChildren, getChildrenUsingExpandToFilter, getCurrentTreeView, getDefaultDescriptors, getEditableValue, getEmptyMessageObject, getFailedMessageObject, getFilterString, getFirstSelection, getInput, getInputMementoHandle, getLabel, getMementoHandle, getMementoHandleKey, getName, getNameValidator, getPropertyDescriptors, getPropertyValue, getPropertyValue, getRemoteAdapter, getRule, getShell, getStatusLineText, getSystemFetchOperation, getSystemTree, getTranslatedFalse, getTranslatedNo, getTranslatedNotApplicable, getTranslatedNotAvailable, getTranslatedTrue, getTranslatedYes, getUniquePropertyDescriptors, getViewer, initMsgObjects, isContainer, isPromptable, isPropertySet, namesAreEqual, resetPropertyValue, saveExpansionState, selectionChanged, setFilterString, setInput, setPropertySourceInput, setPropertyValue, setShell, setViewer, showGenericShowInTableAction, showOpenViewActions, showRefresh, showRename, 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.ISystemRemoteElementAdapter
getName
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

SystemViewRemoteSearchResultSetAdapter

public SystemViewRemoteSearchResultSetAdapter()
Method Detail

addActions

public void addActions(SystemMenuManager menu,
                       IStructuredSelection selection,
                       Shell shell,
                       String menuGroup)
No actions are provided on a search results container

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)

canEdit

public boolean canEdit(Object obj)
Returns false

Specified by:
canEdit in interface ISystemRemoteElementAdapter
Overrides:
canEdit in class AbstractSystemViewAdapter
Parameters:
obj - the object to edit
Returns:
true if the object can be edited. Returns false by default.

getEditableRemoteObject

public ISystemEditableRemoteObject getEditableRemoteObject(Object obj)
Returns null since a search results container can't be edited

Specified by:
getEditableRemoteObject in interface ISystemRemoteElementAdapter
Overrides:
getEditableRemoteObject in class AbstractSystemViewAdapter
Parameters:
obj - the object to edit
Returns:
the editor wrapper for this object

getImageDescriptor

public ImageDescriptor getImageDescriptor(Object element)
Returns the associated icon for a search handle

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

getParent

public Object getParent(Object element)
Returns null since a search handle has no parent

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

getText

public String getText(Object element)
Returns the display text for a search handle. The display text indicates the search string as well as whether the operation is in progress on not.

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

getType

public String getType(Object element)
Returns the type property of a search.

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

getChildren

public Object[] getChildren(Object element)
Returns the search results for the given search handle

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

hasChildren

public boolean hasChildren(Object element)
Returns true if it has children, otherwise returns false.

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

handleDoubleClick

public boolean handleDoubleClick(Object element)
Returns false since a search handle can't be edited

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

getSubSystem

public SubSystem getSubSystem(Object element)
Returns the associated file subsystem for this search operation

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

getAbsoluteName

public String getAbsoluteName(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return the fully qualified name of this remote object. Unlike getName, this should include the full path to the name. This should be enough information to uniquely identify this object within its subsystem.

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

getAbsoluteParentName

public String getAbsoluteParentName(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return fully qualified name that uniquely identifies this remote object's remote parent within its subsystem. This is used when deleting a remote resource for example, all occurrences of its parent are found and refreshed in the RSE views.

Specified by:
getAbsoluteParentName in interface ISystemRemoteElementAdapter

getSubSystemFactoryId

public String getSubSystemFactoryId(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return the subsystem factory id that owns this remote object The value must not be translated, so that property pages registered via xml can subset by it.

Specified by:
getSubSystemFactoryId in interface ISystemRemoteElementAdapter

getRemoteTypeCategory

public String getRemoteTypeCategory(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return a value for the type category property for this object The value must not be translated, so that property pages registered via xml can subset by it.

Specified by:
getRemoteTypeCategory in interface ISystemRemoteElementAdapter

getRemoteType

public String getRemoteType(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return a value for the type property for this object The value must not be translated, so that property pages registered via xml can subset by it.

Specified by:
getRemoteType in interface ISystemRemoteElementAdapter

getRemoteSubType

public String getRemoteSubType(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return a value for the subtype property for this object. Not all object types support a subtype, so returning null is ok. The value must not be translated, so that property pages registered via xml can subset by it.

Specified by:
getRemoteSubType in interface ISystemRemoteElementAdapter

getRemoteSubSubType

public String getRemoteSubSubType(Object element)
Description copied from interface: ISystemRemoteElementAdapter
Return a value for the sub-subtype property for this object. Not all object types support a sub-subtype, so returning null is ok. The value must not be translated, so that property pages registered via xml can subset by it.

Specified by:
getRemoteSubSubType in interface ISystemRemoteElementAdapter
Overrides:
getRemoteSubSubType in class AbstractSystemViewAdapter

getRemoteSourceType

public String getRemoteSourceType(Object element)
Return the source type of the selected object. Typically, this only makes sense for compilable source members. For non-compilable remote objects, this typically just returns null.

Specified by:
getRemoteSourceType in interface ISystemRemoteElementAdapter
Overrides:
getRemoteSourceType in class AbstractSystemViewAdapter

refreshRemoteObject

public boolean refreshRemoteObject(Object oldElement,
                                   Object newElement)
Description copied from interface: ISystemRemoteElementAdapter

Short answer: treat this like clone(), and just copy any important instance variables

Imagine the same remote resource is shown multiple times in the same tree view.... say because multiple filters resolve to it, or there are two connections to the same host. Typically it is a different object in memory within the tree, but it refers to the same remote resource.
Now imagine one of the references is selected by the user and renamed via the rename action. This might only update the selected reference. What about the other objects which refer to the same remote resource... they need to update their in-memory "name" variable too.
That is what this method. Every reference to the same remote resource is found (they have the same absolute name and come from a system with the same hostname) and this method is called on those other references. This is your opportunity to copy the attributes from the new element to the old element.

Some view has updated the name or properties of this remote object. As a result, the remote object's contents need to be refreshed. You are given the old remote object that has old data, and you are given the new remote object that has the new data. For example, on a rename the old object still has the old name attribute while the new object has the new new attribute. You can copy the new name into the old object. Similar for any properties you allow the user to edit via the property sheet.

This is called by viewers like SystemView in response to rename and property change events.

Specified by:
refreshRemoteObject in interface ISystemRemoteElementAdapter
Parameters:
oldElement - the element that was found in the tree
newElement - the updated element that was passed in the REFRESH_REMOTE event
Returns:
true if you want the viewer that called this to refresh the children of this object, such as is needed on a rename of a folder, say, if the child object cache the parent folder name or an absolute file name.

getRemoteParent

public Object getRemoteParent(Shell shell,
                              Object element)
                       throws Exception
Given a remote object, returns it remote parent object. Eg, given a file, return the folder it is contained in.

Specified by:
getRemoteParent in interface ISystemRemoteElementAdapter
Throws:
Exception

getRemoteParentNamesInUse

public String[] getRemoteParentNamesInUse(Shell shell,
                                          Object element)
                                   throws Exception
Given a remote object, return the unqualified names of the objects contained in that parent. This is used for testing for uniqueness on a rename operation, for example. Sometimes, it is not enough to just enumerate all the objects in the parent for this purpose, because duplicate names are allowed if the types are different, such as on iSeries. In this case return only the names which should be used to do name-uniqueness validation on a rename operation.

Specified by:
getRemoteParentNamesInUse in interface ISystemRemoteElementAdapter
Throws:
Exception

internalGetPropertyDescriptors

protected 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

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

getFilterStringFor

public String getFilterStringFor(Object object)
Return a filter string that corresponds to this object.

Specified by:
getFilterStringFor in interface ISystemRemoteElementAdapter
Overrides:
getFilterStringFor in class AbstractSystemViewAdapter
Parameters:
object - the object to obtain a filter string for
Returns:
the corresponding filter string if applicable

canDelete

public boolean canDelete(Object element)
Description copied from class: AbstractSystemViewAdapter
Overridable by subclasses, and usually is.
Return true if this object is deletable by the user. If so, when selected, the Edit->Delete menu item will be enabled.

By default, returns false. Override if your object is deletable.

Specified by:
canDelete in interface ISystemViewElementAdapter
Overrides:
canDelete in class AbstractSystemViewAdapter
See Also:
ISystemViewElementAdapter.canDelete(java.lang.Object)

showDelete

public boolean showDelete(Object element)
Description copied from class: AbstractSystemViewAdapter
Overridable by subclasses, but usually is not.
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.

By default, returns true.

Specified by:
showDelete in interface ISystemViewElementAdapter
Overrides:
showDelete in class AbstractSystemViewAdapter
See Also:
ISystemViewElementAdapter.showDelete(java.lang.Object)

remove

public boolean remove(Object element,
                      Object child)
Description copied from interface: ISystemRemoveElementAdapter
Remove a child from the element.

Specified by:
remove in interface ISystemRemoveElementAdapter
Parameters:
element - the element.
child - the child to remove. Does not have to be an immediate child of the element.
Returns:
true if the child has been removed, false otherwise.
See Also:
ISystemRemoveElementAdapter.remove(java.lang.Object, java.lang.Object)

removeAllChildren

public boolean removeAllChildren(Object element)
Description copied from interface: ISystemRemoveElementAdapter
Remove all children from the element.

Specified by:
removeAllChildren in interface ISystemRemoveElementAdapter
Parameters:
element - the element.
Returns:
true if the children have been removed, false otherwise.
See Also:
ISystemRemoveElementAdapter.removeAllChildren(java.lang.Object)

supportsUserDefinedActions

public boolean supportsUserDefinedActions(Object object)
Returns false.

Specified by:
supportsUserDefinedActions in interface ISystemRemoteElementAdapter
Parameters:
object - the object.
Returns:
true if the object supports user defined actions, false otherwise.
See Also:
ISystemRemoteElementAdapter.supportsUserDefinedActions(java.lang.Object)

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.