Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.shells.ui.view
Class SystemViewRemoteOutputAdapter


java.lang.Object
  extended by 

org.eclipse.rse.ui.view.AbstractSystemViewAdapter
      extended by 
org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter
All Implemented Interfaces:
IRemoteObjectIdentifier, ISystemDragDropAdapter, ISystemRemoteObjectMatchProvider, ISystemRemoteElementAdapter, ISystemViewElementAdapter, IActionFilter, IWorkbenchAdapter, IDeferredWorkbenchAdapter, IPropertySource

public class SystemViewRemoteOutputAdapter
extends AbstractSystemViewAdapter
implements ISystemRemoteElementAdapter

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 org.eclipse.rse.ui.view. AbstractSystemViewAdapter
addCommonRemoteActions, addDynamicPopupMenuActions, canDrag, checkForEmptyList, checkForNull, createSimplePropertyDescriptor, doDelete, doDeleteBatch, doDrag, doDrop, doDrop, exists, fetchDeferredChildren, getAlternateText, getCancelledMessageObject, getCanonicalNewName, getChildren, getChildren, getChildrenUsingExpandToFilter, getCurrentTreeView, getDefaultDescriptors, getEditableValue, getEmptyMessageObject, getFailedMessageObject, getFilterString, getFirstSelection, getInput, getInputMementoHandle, getLabel, getMementoHandle, getMementoHandleKey, getName, getNameValidator, getPropertyDescriptors, getPropertyValue, getRemoteAdapter, getRule, getShell, getStatusLineText, getSystemFetchOperation, getSystemTree, getSystemViewElementAdapter, getTranslatedFalse, getTranslatedNo, getTranslatedNotApplicable, getTranslatedNotAvailable, getTranslatedTrue, getTranslatedYes, getViewer, hasChildren, initMsgObjects, isContainer, isPromptable, isPropertySet, isRemote, namesAreEqual, resetPropertyValue, saveExpansionState, 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 org.eclipse.rse.core.subsystems. ISystemRemoteObjectMatchProvider
getName
 

Field Detail

_propertyDescriptors

protected 
IPropertyDescriptor[] _propertyDescriptors
Constructor Detail

SystemViewRemoteOutputAdapter

public SystemViewRemoteOutputAdapter()
Method Detail

addActions

public void addActions(
SystemMenuManager menu,
                       
IStructuredSelection selection,
                       
Shell shell,
                       
String menuGroup)
Used to add context menu actions for the given remote output

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)

getShellActions

public 
List getShellActions(
IRemoteCmdSubSystemConfiguration factory)

getParent

public 
Object getParent(
Object element)
Returns the parent command object for a line of output

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

getText

public 
String getText(
Object element)
Returns the text to display in a view for this element.

Specified by:
getText in interface ISystemRemoteObjectMatchProvider
Specified by:
getText in interface ISystemViewElementAdapter
Parameters:
element - the element for which to return the internal name.
Returns:
a String representing the UI visible label of the given element.
See Also:
ISystemRemoteObjectMatchProvider.getName(Object)

translateTabs

protected 
String translateTabs(
String tabbedString)

getType

public 
String getType(
Object element)
Returns the type attribute of a line of output or command.

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

getChildren

public 
Object[] getChildren(
IAdaptable element,
                            
IProgressMonitor monitor)
Returns the children of a remote command if the element is a remote command

Specified by:
getChildren in interface ISystemViewElementAdapter
Specified by:
getChildren in class AbstractSystemViewAdapter
Parameters:
element - the model object to get children from
monitor - the progress monitor
Returns:
the children of element

hasChildren

public boolean hasChildren(
IAdaptable element)
Returns true if the element is a remote command and false if it is a remote output.

Specified by:
hasChildren in interface ISystemViewElementAdapter
Specified by:
hasChildren in class AbstractSystemViewAdapter
Parameters:
element - the element to check
Returns:
true if this element can have children.

outputToFile

public static 
IRemoteFile outputToFile(
IRemoteOutput output)
Returns the associated IRemoteFile for this line of remote output if one exists

Parameters:
output - the line of remote output
Returns:
the associated remote file, or null if an error occurred

getEditorRegistry

protected 
IEditorRegistry getEditorRegistry()

getDefaultTextEditor

protected 
IEditorDescriptor getDefaultTextEditor()

handleDoubleClick

public boolean handleDoubleClick(
Object element)
Opens the appropriate editor for a remote output object

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

getSubSystem

public 
ISubSystem getSubSystem(
Object element)
Returns the associated subsystem for this line of remote output or remote command

Specified by:
getSubSystem in interface ISystemDragDropAdapter
Specified by:
getSubSystem in interface ISystemRemoteObjectMatchProvider
Specified by:
getSubSystem in interface ISystemViewElementAdapter
Overrides:
getSubSystem in class AbstractSystemViewAdapter
Parameters:
element - 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.
Returns:
the subsystem owning this remote object. Must not return null.

getAbsoluteName

public 
String getAbsoluteName(
Object element)
Description copied from interface: IRemoteObjectIdentifier
Return a String ID for the given remote object, that is unique within the subsystem.

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:

  • The subsystem itself is identified as
    subsystemID ::= (profileName).(connectionName).(subsystemName)
    - see SystemViewSubSystemAdapter
  • Filter Pool References are identified as
    filterPoolID ::= (subsystemID).(poolManagerName).(poolReferenceName)
    - see SystemViewFilterPoolReferenceAdapter
  • Filter References are identified as
    filterRefID ::= (filterPoolID).(filterName)
    - see SystemViewFilterReferenceAdapter
  • Search Results are identified by the IHostSearchResult.SEARCH_RESULT_DELIMITER embedded in the ID.
All these IDs for internal elements like the subsystem itself or the filters start with a profile name which must not contain any of the / \ or : characters. Fully qualified path names, on the other hand, always start with a / or \ character (UNIX style paths, Windows UNC paths) or have a : character on the second position (Windows drive letters). The SEARCH_RESULT_DELIMITER is ":SEARCH" which cannot be part of a valid filename. Therefore, this naming scheme is guaranteed to be unique.

Specified by:
getAbsoluteName in interface IRemoteObjectIdentifier
Parameters:
element - the remote element to be identified.
Returns:
a String uniquely identifying the remote object within the subsystem. Must not return null.
See Also:
IRemoteObjectResolver.getObjectWithAbsoluteName(String, IProgressMonitor)

getAbsoluteParentName

public 
String getAbsoluteParentName(
Object element)
Return fully qualified name that uniquely identifies this remote object's remote parent within its subsystem

Specified by:
getAbsoluteParentName in interface ISystemRemoteElementAdapter
Returns:
a String uniquely identifying the parent of this remote object, if it is known and exists. May also return null if the parent can not be determined or is not unique.
See Also:
IRemoteObjectIdentifier.getAbsoluteName(Object)

getSubSystemConfigurationId

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

Specified by:
getSubSystemConfigurationId in interface ISystemRemoteObjectMatchProvider
Returns:
the ID of the subsystem configuration that created the subsystem which owns this remote object.

getRemoteTypeCategory

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

Specified by:
getRemoteTypeCategory in interface ISystemRemoteObjectMatchProvider
Returns:
the category id of this remote object for filtering.

getRemoteType

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

Specified by:
getRemoteType in interface ISystemRemoteObjectMatchProvider
Returns:
the type id of this remote object for filtering.

getRemoteSubType

public 
String getRemoteSubType(
Object element)
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 ISystemRemoteObjectMatchProvider
Returns:
the subtype id of this remote object for filtering. May return null.

getRemoteSubSubType

public 
String getRemoteSubSubType(
Object element)
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 ISystemRemoteObjectMatchProvider
Overrides:
getRemoteSubSubType in class AbstractSystemViewAdapter
Returns:
the subsubtype id of this remote object for filtering. May return null.

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 ISystemRemoteObjectMatchProvider
Overrides:
getRemoteSourceType in class AbstractSystemViewAdapter
Returns:
the sourcetype id of this remote object, or null if not applicable.

refreshRemoteObject

public boolean refreshRemoteObject(
Object oldElement,
                                   
Object newElement)
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.

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.

getRemoteParent

public 
Object getRemoteParent(
Object element,
                              
IProgressMonitor monitor)
                       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
Parameters:
element - The element for which to get the parent
monitor - Optional progress monitor for long-running operation. May be null.
Returns:
the parent element, or null if not applicable.
Throws:
Exception
See Also:
ISystemRemoteElementAdapter.getAbsoluteParentName(Object)

getRemoteParentNamesInUse

public 
String[] getRemoteParentNamesInUse(
Object element,
                                          
IProgressMonitor monitor)
                                   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
Parameters:
element - The element for which to get names in use
monitor - Optional progress monitor for long-running operation. May be null.
Returns:
a list of unqualified names contained in this folder to check for uniqueness, or null if not applicable or no such names were found.
Throws:
Exception

internalGetPropertyValue

protected 
Object internalGetPropertyValue(
Object key)
Returns the current collection of property descriptors. By default returns descriptors for name and type only. Override if desired.

Specified by:
internalGetPropertyValue in class AbstractSystemViewAdapter
Parameters:
key - the name of the property as named by its property descriptor
Returns:
an array containing all descriptors.

getImageDescriptor

public 
ImageDescriptor getImageDescriptor(
Object element)
Returns the icon to display for this object

Specified by:
getImageDescriptor in interface ISystemViewElementAdapter
Specified by:
getImageDescriptor in interface IWorkbenchAdapter
Specified by:
getImageDescriptor in class AbstractSystemViewAdapter
Parameters:
element - the remote output object
Returns:
the associated image descriptor

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)

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. By default, returns false. Override if your object is deletable.

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

showRefresh

public boolean showRefresh(
Object element)
Return true if we should show the refresh action in the popup for the given element.

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

showOpenViewActions

public boolean showOpenViewActions(
Object element)
Return true if we should show the refresh action in the popup for the given element.

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

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 rename 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, IProgressMonitor)

canRename

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

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

doRename

public boolean doRename(
Shell shell,
                        
Object element,
                        
String name,
                        
IProgressMonitor monitor)
                 throws 
Exception
Perform the rename action. By default does nothing. Override if your object is renamable. Return true if this was successful. Return false if it failed and you issued a msg. Throw an exception if it failed and you want to use the generic msg.

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

canDrop

public boolean canDrop(
Object element)
Indicates whether the specified object can have another object copied to it

Specified by:
canDrop in interface ISystemDragDropAdapter
Overrides:
canDrop in class AbstractSystemViewAdapter
Parameters:
element - the object to copy to
Returns:
whether this object can be copied to or not
See Also:
AbstractSystemViewAdapter.canDrag(Object), AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor), AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor), AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)

canDrag

public boolean canDrag(
Object element)
Indicates whether the specified object can be copied

Specified by:
canDrag in interface ISystemDragDropAdapter
Overrides:
canDrag in class AbstractSystemViewAdapter
Parameters:
element - the object to copy
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)
Copy the specified remote output object. This method returns a string representing the text of the remote output;

Specified by:
doDrag in interface ISystemDragDropAdapter
Overrides:
doDrag in class AbstractSystemViewAdapter
Parameters:
element - the output to copy
sameSystemType - not applicable for remote output
monitor - the progress monitor
Returns:
a temporary local copy of the object that was copied
See Also:
AbstractSystemViewAdapter.canDrag(Object), AbstractSystemViewAdapter.canDrop(Object), AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor), AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)

validateDrop

public boolean validateDrop(
Object src,
                            
Object target,
                            boolean sameSystem)
Return true if it is valid for the src object to be dropped in the target

Specified by:
validateDrop in interface ISystemDragDropAdapter
Overrides:
validateDrop in class AbstractSystemViewAdapter
Parameters:
src - the object to drop
target - the object which src is dropped in
sameSystem - whether this is the same system
Returns:
whether this is a valid operation
See Also:
AbstractSystemViewAdapter.canDrag(Object), AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor), AbstractSystemViewAdapter.canDrop(Object), AbstractSystemViewAdapter.doDrop(Object,Object,boolean,boolean,IProgressMonitor)

doDrop

public 
Object doDrop(
Object src,
                     
Object target,
                     boolean sameSystemType,
                     boolean sameSystem,
                     int srcType,
                     
IProgressMonitor monitor)
Perform a copy via drag and drop.

Specified by:
doDrop in interface ISystemDragDropAdapter
Overrides:
doDrop in class AbstractSystemViewAdapter
Parameters:
src - 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 system
sameSystem - an indication whether the target and source reside on the same system
srcType - the type of source
monitor - the progress monitor
Returns:
an indication whether the operation was successful or not.
See Also:
AbstractSystemViewAdapter.canDrag(Object), AbstractSystemViewAdapter.doDrag(Object,boolean,IProgressMonitor), AbstractSystemViewAdapter.canDrop(Object), AbstractSystemViewAdapter.validateDrop(Object,Object,boolean)

canEdit

public boolean canEdit(
Object element)
Determines whether the line of remote output can be edited in an editor

Specified by:
canEdit in interface ISystemRemoteElementAdapter
Overrides:
canEdit in class AbstractSystemViewAdapter
Parameters:
element - the remote output object
Returns:
true if this can be edited in an editor

getEditableRemoteObject

public 
ISystemEditableRemoteObject getEditableRemoteObject(
Object element)
Returns the associated remote editable object for this line of output

Specified by:
getEditableRemoteObject in interface ISystemRemoteElementAdapter
Overrides:
getEditableRemoteObject in class AbstractSystemViewAdapter
Parameters:
element - the remote output object
Returns:
the associated ediable object if one exists

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

internalGetPropertyDescriptors

protected 
IPropertyDescriptor[] internalGetPropertyDescriptors()
Description copied from class: AbstractSystemViewAdapter
Implement this to return the property descriptors for the properties in the property sheet. This is beyond the Name, Type and NbrOfChildren properties which already implemented and done for you.

Override 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:

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, String, String)

getUniquePropertyDescriptors

public 
IPropertyDescriptor[] getUniquePropertyDescriptors()
Description copied from class: AbstractSystemViewAdapter
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.

If internalGetPropertyDescriptors() returns non-null, then returns that, else computes the difference. This is called by the table views like SystemTableView.

Callable by subclasses. Do not override.

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

getPropertyValue

public 
Object getPropertyValue(
Object property,
                               boolean formatted)
Returns the current value for the named property.

Specified by:
getPropertyValue in interface ISystemViewElementAdapter
Overrides:
getPropertyValue in class AbstractSystemViewAdapter
Parameters:
property - the name or key of the property as named by its property descriptor
formatted - indication of whether to return the value in formatted or raw form
Returns:
the current value of the given property

showProperties

public boolean showProperties(
Object element)
Don't show properties for remote output

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

RSE
Release 3.0

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire