|
RSE Release 3.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.rse.ui.view.AbstractSystemViewAdapter
org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter
public class SystemViewRemoteOutputAdapter
This is the adapter for smart output from remote commands, such that they can support right click actions and such.
| Field Summary | |
|---|---|
protected IPropertyDescriptor[] |
_propertyDescriptors
|
| Fields inherited from class org.eclipse.rse.ui.view.AbstractSystemViewAdapter |
|---|
_lastResults, _lastSelected, cancelledObject, EMPTY_STRING_LIST, emptyList, errorObject, MEMENTO_DELIM, MSG_SUB_PREFIX, MSG_SUB1, MSG_SUB2, msgList, nullObject, propertySourceInput, shell, viewer |
| Fields inherited from interface org.eclipse.rse.ui.view.ISystemViewElementAdapter |
|---|
noActions |
| Constructor Summary | |
|---|---|
SystemViewRemoteOutputAdapter()
|
|
| Method Summary | |
|---|---|
void |
addActions(SystemMenuManager menu,
IStructuredSelection selection,
Shell shell,
String menuGroup)
Used to add context menu actions for the given remote output |
boolean |
canDelete(Object element)
Return true if this object is deletable by the user. |
boolean |
canDrag(Object element)
Indicates whether the specified object can be copied |
boolean |
canDrop(Object element)
Indicates whether the specified object can have another object copied to it |
boolean |
canEdit(Object element)
Determines whether the line of remote output can be edited in an editor |
boolean |
canRename(Object element)
Return true if this object is renamable by the user. |
Object |
doDrag(Object element,
boolean sameSystemType,
IProgressMonitor monitor)
Copy the specified remote output object. |
Object |
doDrop(Object src,
Object target,
boolean sameSystemType,
boolean sameSystem,
int srcType,
IProgressMonitor monitor)
Perform a copy via drag and drop. |
boolean |
doRename(Shell shell,
Object element,
String name,
IProgressMonitor monitor)
Perform the rename action. |
String |
getAbsoluteName(Object element)
Return a String ID for the given remote object, that is unique within the subsystem. |
String |
getAbsoluteParentName(Object element)
Return fully qualified name that uniquely identifies this remote object's remote parent within its subsystem |
Object[] |
getChildren(IAdaptable element,
IProgressMonitor monitor)
Returns the children of a remote command if the element is a remote command |
protected IEditorDescriptor |
getDefaultTextEditor()
|
ISystemEditableRemoteObject |
getEditableRemoteObject(Object element)
Returns the associated remote editable object for this line of output |
protected IEditorRegistry |
getEditorRegistry()
|
String |
getFilterStringFor(Object object)
Return a filter string that corresponds to this object. |
ImageDescriptor |
getImageDescriptor(Object element)
Returns the icon to display for this object |
Object |
getParent(Object element)
Returns the parent command object for a line of output |
Object |
getPropertyValue(Object property,
boolean formatted)
Returns the current value for the named property. |
Object |
getRemoteParent(Object element,
IProgressMonitor monitor)
Given a remote object, returns it remote parent object. |
String[] |
getRemoteParentNamesInUse(Object element,
IProgressMonitor monitor)
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. |
List |
getShellActions(IRemoteCmdSubSystemConfiguration factory)
|
ISubSystem |
getSubSystem(Object element)
Returns the associated subsystem for this line of remote output or remote command |
String |
getSubSystemConfigurationId(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 text to display in a view for this element. |
String |
getType(Object element)
Returns the type attribute of a line of output or command. |
IPropertyDescriptor[] |
getUniquePropertyDescriptors()
Returns the list of property descriptors that are unique for this particular adapter - that is the difference between the default property descriptors and the total list of property descriptors. |
boolean |
handleDoubleClick(Object element)
Opens the appropriate editor for a remote output object |
boolean |
hasChildren(IAdaptable element)
Returns true if the element is a remote command and false if it is a remote output. |
protected IPropertyDescriptor[] |
internalGetPropertyDescriptors()
Implement this to return the property descriptors for the properties in the property sheet. |
protected Object |
internalGetPropertyValue(Object key)
Returns the current collection of property descriptors. |
static IRemoteFile |
outputToFile(IRemoteOutput output)
Returns the associated IRemoteFile for this line of remote output if one exists |
boolean |
refreshRemoteObject(Object oldElement,
Object newElement)
Some view has updated the name or properties of this remote object. |
boolean |
showDelete(Object element)
Return true if we should show the delete action in the popup for the given element. |
boolean |
showOpenViewActions(Object element)
Return true if we should show the refresh action in the popup for the given element. |
boolean |
showProperties(Object element)
Don't show properties for remote output |
boolean |
showRefresh(Object element)
Return true if we should show the refresh 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. |
protected String |
translateTabs(String tabbedString)
|
boolean |
validateDrop(Object src,
Object target,
boolean sameSystem)
Return true if it is valid for the src object to be dropped in the target |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.rse.ui.view.ISystemViewElementAdapter |
|---|
doDelete, doDeleteBatch, exists, getAlternateText, getCanonicalNewName, getChildren, getChildrenUsingExpandToFilter, getFilterString, getInput, getInputMementoHandle, getMementoHandle, getMementoHandleKey, getName, getNameValidator, getShell, getStatusLineText, getViewer, hasChildren, isPromptable, isRemote, namesAreEqual, saveExpansionState, selectionChanged, setFilterString, setInput, setPropertySourceInput, setShell, setViewer, showGenericShowInTableAction, supportsDeferredQueries |
| Methods inherited from interface org.eclipse.ui.views.properties.IPropertySource |
|---|
getEditableValue, getPropertyDescriptors, getPropertyValue, isPropertySet, resetPropertyValue, setPropertyValue |
| Methods inherited from interface org.eclipse.rse.core.subsystems.ISystemDragDropAdapter |
|---|
canDrag, doDrag, doDrop, validateDrop |
| Methods inherited from interface org.eclipse.ui.IActionFilter |
|---|
testAttribute |
| Methods inherited from interface org.eclipse.rse.core.subsystems.ISystemRemoteObjectMatchProvider |
|---|
getName |
| Field Detail |
|---|
protected IPropertyDescriptor[] _propertyDescriptors
| Constructor Detail |
|---|
public SystemViewRemoteOutputAdapter()
| Method Detail |
|---|
public void addActions(SystemMenuManager menu,
IStructuredSelection selection,
Shell shell,
String menuGroup)
addActions in interface ISystemViewElementAdapteraddActions in class AbstractSystemViewAdaptermenu - the popup menu you can contribute toselection - the current selection in the calling tree or table viewshell - the shell of the calling tree or table viewmenuGroup - the default menu group to place actions into if you
don't care where they. Pass this to the SystemMenuManager add method.ISystemViewElementAdapter.addActions(
SystemMenuManager, IStructuredSelection, Shell, String)public List getShellActions(IRemoteCmdSubSystemConfiguration factory)
public Object getParent(Object element)
getParent in interface ISystemViewElementAdaptergetParent in interface IWorkbenchAdaptergetParent in class AbstractSystemViewAdapterpublic String getText(Object element)
getText in interface ISystemRemoteObjectMatchProvidergetText in interface ISystemViewElementAdapterelement - the element for which to return the internal name.
ISystemRemoteObjectMatchProvider.getName(Object)protected String translateTabs(String tabbedString)
public String getType(Object element)
getType in interface ISystemViewElementAdaptergetType in class AbstractSystemViewAdapter
public Object[] getChildren(IAdaptable element,
IProgressMonitor monitor)
getChildren in interface ISystemViewElementAdaptergetChildren in class AbstractSystemViewAdapterelement - the model object to get children frommonitor - the progress monitor
public boolean hasChildren(IAdaptable element)
hasChildren in interface ISystemViewElementAdapterhasChildren in class AbstractSystemViewAdapterelement - the element to check
true if this element can have children.public static IRemoteFile outputToFile(IRemoteOutput output)
output - the line of remote output
protected IEditorRegistry getEditorRegistry()
protected IEditorDescriptor getDefaultTextEditor()
public boolean handleDoubleClick(Object element)
handleDoubleClick in interface ISystemViewElementAdapterhandleDoubleClick in class AbstractSystemViewAdapterpublic ISubSystem getSubSystem(Object element)
getSubSystem in interface ISystemDragDropAdaptergetSubSystem in interface ISystemRemoteObjectMatchProvidergetSubSystem in interface ISystemViewElementAdaptergetSubSystem in class AbstractSystemViewAdapterelement - The element to be identified. May be of type
IContextObject (including the context of the element),
String (giving the absolute path of a remote object),
or the actual remote data element itself.
null.public String getAbsoluteName(Object element)
IRemoteObjectIdentifier
This must be implemented by subsystem element adapters in order to
marshal a reference to the remote object for drag and drop, and clipboard
support. It is also used for uniquely identifying objects with changing
properties in the SystemView. This method is the functional opposite of
IRemoteObjectResolver.getObjectWithAbsoluteName(String, IProgressMonitor).
The unique ID for an object must remain the same over the entire lifetime of that object, such that it can always be identified. When an object is renamed, it should be removed from the views with the old ID and then re-added with the new ID. This is especially important for the SystemView, where the String ID is used for finding multiple occurrences of the same remote resource in different contexts during refresh events. In this case, the String ID can be used to find the remote object even if its hashCode changes due to updated properties. So even if a subsystem does not support drag and drop, or clipboard operations, it does need to return unique IDs for its object to support refresh in the SystemView.
Because each subsystem maintains its own objects, it is the
responsibility of the subsystem and its adapters to come up with a
mapping that is unique for the subsystem. Some subsystems use fully
qualified path names, while others may use other methods. Extenders just
need to ensure that objects of different type (such as filters, actual
resources or error messages) all have different IDs within the subsystem,
and the corresponding
IRemoteObjectResolver.getObjectWithAbsoluteName(String, IProgressMonitor)
method actually finds the object by the given ID. Other subsystems do not
need to be considered.
Uniqueness and Multiple Contexts
The RSE
SystemView allows the same remote object to be displayed in multiple
different contexts, i.e. under multiple different filters. In this case,
each occurrence of the same object must return the same absolute name.
For the reverse mapping, however, it is up to the subsystem whether its
IRemoteObjectResolver returns only one internal model object for
the given identifier, or multiple context objects which all refer to the
same remote object but also hold context information.
Examples
In the File Subsystem, a fully qualified
pathname is used to uniquely identify remote objects. For other kinds of
objects maintained by the same subsystem, the following schemes are used:
IHostSearchResult.SEARCH_RESULT_DELIMITER embedded in the ID.
getAbsoluteName in interface IRemoteObjectIdentifierelement - the remote element to be identified.
null.IRemoteObjectResolver.getObjectWithAbsoluteName(String,
IProgressMonitor)public String getAbsoluteParentName(Object element)
getAbsoluteParentName in interface ISystemRemoteElementAdapternull if the
parent can not be determined or is not unique.IRemoteObjectIdentifier.getAbsoluteName(Object)public String getSubSystemConfigurationId(Object element)
getSubSystemConfigurationId in interface ISystemRemoteObjectMatchProviderpublic String getRemoteTypeCategory(Object element)
getRemoteTypeCategory in interface ISystemRemoteObjectMatchProviderpublic String getRemoteType(Object element)
getRemoteType in interface ISystemRemoteObjectMatchProviderpublic String getRemoteSubType(Object element)
getRemoteSubType in interface ISystemRemoteObjectMatchProvidernull.public String getRemoteSubSubType(Object element)
getRemoteSubSubType in interface ISystemRemoteObjectMatchProvidergetRemoteSubSubType in class AbstractSystemViewAdapternull.public String getRemoteSourceType(Object element)
getRemoteSourceType in interface ISystemRemoteObjectMatchProvidergetRemoteSourceType in class AbstractSystemViewAdapternull if not applicable.
public boolean refreshRemoteObject(Object oldElement,
Object newElement)
This is called by viewers like SystemView in response to rename and property change events.
refreshRemoteObject in interface ISystemRemoteElementAdapteroldElement - the element that was found in the treenewElement - the updated element that was passed in the REFRESH_REMOTE event
public Object getRemoteParent(Object element,
IProgressMonitor monitor)
throws Exception
getRemoteParent in interface ISystemRemoteElementAdapterelement - The element for which to get the parentmonitor - Optional progress monitor for long-running operation.
May be null.
null if not applicable.
ExceptionISystemRemoteElementAdapter.getAbsoluteParentName(Object)
public String[] getRemoteParentNamesInUse(Object element,
IProgressMonitor monitor)
throws Exception
getRemoteParentNamesInUse in interface ISystemRemoteElementAdapterelement - The element for which to get names in usemonitor - Optional progress monitor for long-running operation.
May be null.
null if not applicable or
no such names were found.
Exceptionprotected Object internalGetPropertyValue(Object key)
internalGetPropertyValue in class AbstractSystemViewAdapterkey - the name of the property as named by its property descriptor
public ImageDescriptor getImageDescriptor(Object element)
getImageDescriptor in interface ISystemViewElementAdaptergetImageDescriptor in interface IWorkbenchAdaptergetImageDescriptor in class AbstractSystemViewAdapterelement - the remote output object
public boolean showDelete(Object element)
showDelete in interface ISystemViewElementAdaptershowDelete in class AbstractSystemViewAdapterAbstractSystemViewAdapter.canDelete(Object)public boolean canDelete(Object element)
canDelete in interface ISystemViewElementAdaptercanDelete in class AbstractSystemViewAdapterAbstractSystemViewAdapter.showDelete(Object)public boolean showRefresh(Object element)
showRefresh in interface ISystemViewElementAdaptershowRefresh in class AbstractSystemViewAdapterpublic boolean showOpenViewActions(Object element)
showOpenViewActions in interface ISystemViewElementAdaptershowOpenViewActions in class AbstractSystemViewAdapterpublic boolean showRename(Object element)
showRename in interface ISystemViewElementAdaptershowRename in class AbstractSystemViewAdapterAbstractSystemViewAdapter.canRename(Object),
AbstractSystemViewAdapter.doRename(Shell,Object,String, IProgressMonitor)public boolean canRename(Object element)
canRename in interface ISystemViewElementAdaptercanRename in class AbstractSystemViewAdapterAbstractSystemViewAdapter.showRename(Object),
AbstractSystemViewAdapter.doRename(Shell,Object,String,IProgressMonitor),
AbstractSystemViewAdapter.getNameValidator(Object),
AbstractSystemViewAdapter.getCanonicalNewName(Object,String),
AbstractSystemViewAdapter.namesAreEqual(Object,String)
public boolean doRename(Shell shell,
Object element,
String name,
IProgressMonitor monitor)
throws Exception
doRename in interface ISystemViewElementAdapterdoRename in class AbstractSystemViewAdapterExceptionAbstractSystemViewAdapter.showRename(Object),
AbstractSystemViewAdapter.canRename(Object)public boolean canDrop(Object element)
canDrop in interface ISystemDragDropAdaptercanDrop in class AbstractSystemViewAdapterelement - the object to copy to
AbstractSystemViewAdapter.canDrag(Object),
AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor),
AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor),
AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)public boolean canDrag(Object element)
canDrag in interface ISystemDragDropAdaptercanDrag in class AbstractSystemViewAdapterelement - the object to copyAbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor),
AbstractSystemViewAdapter.canDrop(Object),
AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor),
AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)
public Object doDrag(Object element,
boolean sameSystemType,
IProgressMonitor monitor)
doDrag in interface ISystemDragDropAdapterdoDrag in class AbstractSystemViewAdapterelement - the output to copysameSystemType - not applicable for remote outputmonitor - the progress monitor
AbstractSystemViewAdapter.canDrag(Object),
AbstractSystemViewAdapter.canDrop(Object),
AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor),
AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)
public boolean validateDrop(Object src,
Object target,
boolean sameSystem)
validateDrop in interface ISystemDragDropAdaptervalidateDrop in class AbstractSystemViewAdaptersrc - the object to droptarget - the object which src is dropped insameSystem - whether this is the same system
AbstractSystemViewAdapter.canDrag(Object),
AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor),
AbstractSystemViewAdapter.canDrop(Object),
AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor)
public Object doDrop(Object src,
Object target,
boolean sameSystemType,
boolean sameSystem,
int srcType,
IProgressMonitor monitor)
doDrop in interface ISystemDragDropAdapterdoDrop in class AbstractSystemViewAdaptersrc - the object to be copied. If the target and source are not on the same system, then this is a
temporary object produced by the doDrag.target - the object to be copied to.sameSystemType - an indication whether the target and source reside on the same type of systemsameSystem - an indication whether the target and source reside on the same systemsrcType - the type of sourcemonitor - the progress monitor
AbstractSystemViewAdapter.canDrag(Object),
AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor),
AbstractSystemViewAdapter.canDrop(Object),
AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)public boolean canEdit(Object element)
canEdit in interface ISystemRemoteElementAdaptercanEdit in class AbstractSystemViewAdapterelement - the remote output object
public ISystemEditableRemoteObject getEditableRemoteObject(Object element)
getEditableRemoteObject in interface ISystemRemoteElementAdaptergetEditableRemoteObject in class AbstractSystemViewAdapterelement - the remote output object
public String getFilterStringFor(Object object)
getFilterStringFor in interface ISystemRemoteElementAdaptergetFilterStringFor in class AbstractSystemViewAdapterobject - the object to obtain a filter string for
protected IPropertyDescriptor[] internalGetPropertyDescriptors()
AbstractSystemViewAdapterOverride if want to include more properties in the property sheet,
If you override this for read-only properties, you must also override:
If you override this for editable properties, you must also override:
AbstractSystemViewAdapter.isPropertySet(Object)
AbstractSystemViewAdapter.resetPropertyValue(Object)
AbstractSystemViewAdapter.setPropertyValue(Object,Object)
internalGetPropertyDescriptors in class AbstractSystemViewAdapterAbstractSystemViewAdapter.createSimplePropertyDescriptor(String, String, String)public IPropertyDescriptor[] getUniquePropertyDescriptors()
AbstractSystemViewAdapter
If internalGetPropertyDescriptors() returns non-null, then returns that,
else computes the difference. This is called by the table views like
SystemTableView.
getUniquePropertyDescriptors in interface ISystemViewElementAdaptergetUniquePropertyDescriptors in class AbstractSystemViewAdapter
public Object getPropertyValue(Object property,
boolean formatted)
getPropertyValue in interface ISystemViewElementAdaptergetPropertyValue in class AbstractSystemViewAdapterproperty - the name or key of the property as named by its property descriptorformatted - indication of whether to return the value in formatted or raw form
public boolean showProperties(Object element)
showProperties in interface ISystemViewElementAdaptershowProperties in class AbstractSystemViewAdapter
|
RSE Release 3.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||