|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISystemViewElementAdapter
This is the interface for an adapter on objects in the system viewer. Any input into the system viewer must register an adapter that implements this interface.
This interface supports a union of all the methods needed to support a TreeViewer
content provider and label provider. The SystemViewLabelAndContentProvider
delegates to objects of this interface almost completely. It gets such an
object by calling:
isve = object.getAdapter(ISystemViewElementAdapter.class);
interestingInfo = isve.getXXXX(object);
This interface also supports IPropertySource via inheritance, so we can feed the PropertySheet.
For remote resource objects, their adapter should also implement
ISystemRemoteElementAdapter
AbstractSystemViewAdapter
Field Summary | |
---|---|
static IAction[] |
noActions
|
Method Summary | |
---|---|
void |
addActions(SystemMenuManager menu,
IStructuredSelection selection,
Shell parent,
String menuGroup)
This is your opportunity to add actions to the popup menu for the given selection. |
boolean |
canDelete(Object element)
Return true if this object is deletable by the user. |
boolean |
canRename(Object element)
Return true if this object is renamable by the user. |
boolean |
doDelete(Shell shell,
Object element,
IProgressMonitor monitor)
Perform the delete action on single item. |
boolean |
doDeleteBatch(Shell shell,
List resourceSet,
IProgressMonitor monitor)
Perform the delete on the given set of items. |
boolean |
doRename(Shell shell,
Object element,
String name,
IProgressMonitor monitor)
Perform the rename on the given item. |
boolean |
exists(Object element)
Returns whether the specified element is represented as existing. |
String |
getAlternateText(Object element)
Return the alternate label for this object. |
String |
getCanonicalNewName(Object element,
String newName)
Form and return a new canonical (unique) name for this object, given a candidate for the new name. |
Object[] |
getChildren(IAdaptable element,
IProgressMonitor monitor)
Return the children of this model object. |
Object[] |
getChildren(IContextObject contextObject,
IProgressMonitor monitor)
Return the children of this object. |
Object[] |
getChildrenUsingExpandToFilter(Object element,
String expandToFilter)
Return the children of this object, using the given Expand-To filter |
String |
getFilterString()
|
ImageDescriptor |
getImageDescriptor(Object element)
Returns an image descriptor for the image. |
ISystemViewInputProvider |
getInput()
Get the input object used to populate the viewer with the roots. |
String |
getInputMementoHandle(Object element)
Return what to save to disk to identify this element when it is the input object to a secondary Remote System Explorer perspective. |
String |
getMementoHandle(Object element)
Return what to save to disk to identify this element in the persisted list of expanded elements. |
String |
getMementoHandleKey(Object element)
Return a short string to uniquely identify the type of resource. |
String |
getName(Object element)
Return the name of this object, which may be different than the display text ({#link #getText(Object)}. |
ISystemValidator |
getNameValidator(Object element)
Return a validator for verifying the new name is correct. |
Object |
getParent(Object element)
Return the parent of this object. |
Object |
getPropertyValue(Object key,
boolean formatted)
Wrapper to getPropertyValue(Object key) that takes an argument for determining whether to return a raw value or formatted value. |
Shell |
getShell()
Get the shell currently hosting the objects in this adapter, as last set by the label or content provider that retrieved this adapter. |
String |
getStatusLineText(Object element)
Return the string to display in the status line when the given object is selected. |
ISubSystem |
getSubSystem(Object element)
Get the subsystem that corresponds to this object if one exists. |
String |
getText(Object element)
Return the label for this object. |
String |
getType(Object element)
Return a value for the type property for this object. |
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. |
Viewer |
getViewer()
Return the current viewer, as set via setViewer or its deduced from the setInput input object if set. |
boolean |
handleDoubleClick(Object element)
User has double clicked on an object. |
boolean |
hasChildren(IAdaptable element)
Return true if this object has children. |
boolean |
hasChildren(IContextObject element)
Return true if this object has children. |
boolean |
isPromptable(Object element)
Return true if this object is a "prompting" object that prompts the user when expanded. |
boolean |
isRemote(Object element)
Return true if this object is a "remote" object. |
boolean |
namesAreEqual(Object element,
String newName)
Compare the name of the given element to the given new name to decide if they are equal. |
boolean |
saveExpansionState(Object element)
Somtimes we don't want to remember an element's expansion state, such as for temporarily inserted messages. |
void |
selectionChanged(Object element)
|
void |
setFilterString(String filterString)
|
void |
setInput(ISystemViewInputProvider input)
Set the input object used to populate the viewer with the roots. |
void |
setPropertySourceInput(Object propertySourceInput)
Set input object for property source queries. |
void |
setShell(Shell shell)
Set the shell to be used by any method that requires it. |
void |
setViewer(Viewer viewer)
Set the viewer that is driving this adapter. |
boolean |
showDelete(Object element)
Return true if we should show the delete action in the popup for the given element. |
boolean |
showGenericShowInTableAction(Object element)
Return true if we should show the generic show in table 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)
Return true if we should show the properties action in the popup for the given element. |
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. |
boolean |
supportsDeferredQueries(ISubSystem subSys)
Return whether deferred queries are supported. |
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, canDrag, canDrop, doDrag, doDrag, doDrop, doDrop, validateDrop, validateDrop |
Methods inherited from interface org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier |
---|
getAbsoluteName |
Methods inherited from interface org.eclipse.ui.IActionFilter |
---|
testAttribute |
Field Detail |
---|
static final IAction[] noActions
Method Detail |
---|
void setShell(Shell shell)
void setViewer(Viewer viewer)
void setInput(ISystemViewInputProvider input)
Shell getShell()
Viewer getViewer()
ISystemViewInputProvider getInput()
ISubSystem getSubSystem(Object element)
getSubSystem
in interface ISystemDragDropAdapter
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.Object getPropertyValue(Object key, boolean formatted)
IPropertyDescriptor[] getUniquePropertyDescriptors()
void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell parent, String menuGroup)
To put your action into the given menu, use the menu's add
method.
If you don't care where it goes within the popup, just pass the given menuGroup location id,
otherwise pass one of the GROUP_XXX values from ISystemContextMenuConstants
. If you pass one that
identifies a pre-defined cascading menu, such as GROUP_OPENWITH, your action will magically appear in that
cascading menu, even if it was otherwise empty.
For the actions themselves, you will probably use one of the base action classes:
SystemBaseAction
. For a simple action doesn't present any UI.
SystemBaseDialogAction
. For an action that presents a dialog
.
SystemBaseWizardAction
. For an action that presents a wizard
.
SystemBaseSubMenuAction
. For an action that cascades into a submenu with other actions.
menu
- the popup menu you can contribute toselection
- the current selection in the calling tree or table viewparent
- 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.ImageDescriptor getImageDescriptor(Object element)
IWorkbenchAdapter.getImageDescriptor(Object)
.
element
- The element for which an image is desiredString getText(Object element)
String getAlternateText(Object element)
String getName(Object element)
String getType(Object element)
String getStatusLineText(Object element)
boolean exists(Object element)
element
- the element to check
Object getParent(Object element)
Object[] getChildren(IAdaptable element, IProgressMonitor monitor)
supportsDeferredQueries(ISubSystem)
returns false,
this query will be called in the dispatch thread, so the implementation
needs to make sure that SWT thread exceptions are avoided.
element
- the model object to querymonitor
- the progress monitor
Object[] getChildren(IContextObject contextObject, IProgressMonitor monitor)
supportsDeferredQueries(ISubSystem)
returns false,
this query will be called in the dispatch thread, so the implementation
needs to make sure that SWT thread exceptions are avoided.
contextObject
- a wrapper object that contains the model object plus context informationmonitor
- the progress monitor
Object[] getChildrenUsingExpandToFilter(Object element, String expandToFilter)
boolean hasChildren(IAdaptable element)
In case this adapter returns true for supportsDeferredQueries(ISubSystem)
,
it is expected that the underlying subsystem caches the hasChildren() attribute
such that it does not necessarily perform a server round trip. In this case, it
has more the semantics of "can have children". In that case,
a deferred getChildren(IAdaptable, IProgressMonitor)
call is still allowed to return an empty array indicating no children.
element
- the element to check
true
if this element can have children.boolean hasChildren(IContextObject element)
element
- the element to check
true
if this element can have children.hasChildren(IAdaptable)
boolean isPromptable(Object element)
boolean isRemote(Object element)
element
- the object to check
void setPropertySourceInput(Object propertySourceInput)
boolean handleDoubleClick(Object element)
boolean showDelete(Object element)
boolean canDelete(Object element)
boolean doDelete(Shell shell, Object element, IProgressMonitor monitor) throws Exception
Implementers have two choices of dealing with error conditions:
handle the error themselves (for example, by showing an error dialog) and returning
false
; or by throwing an Exception and having the framework
handle the error.
If the operation is cancelled, the implementation is free to either
return false
or throw a
SystemOperationCancelledException
, since in both cases the
framework will refresh the element to see whether it has
actually been deleted or not, but not show any other message.
shell
- The shell that can act as a parent for an adapter-issued
message dialog.element
- The element that should be deleted.monitor
- The progress monitor for progress and cancellation. May be
null
.
true
indicates that the deletion succeeded,
false
indicates that the deletion failed but no user
feedback is required by the framework because the implementation
has already handled the error or cancellation.
Exception
- if the deletion failed and the adapter did not show a
message dialog.showDelete(Object)
,
canDelete(Object)
boolean doDeleteBatch(Shell shell, List resourceSet, IProgressMonitor monitor) throws Exception
See doDelete(Shell, Object, IProgressMonitor)
for semantics of
error handling and cancellation.
shell
- the shell that can act as a parent for an adapter-issued
message dialog.resourceSet
- a list of resources that should be deleted.monitor
- The progress monitor for progress and cancellation. May be
null
.
true
if all deletions were successful,
false
if any deletion was not successful but proper
error reporting has been done by the adapter already. The
framework will only refresh the items to see which ones have
actually been deleted.
Exception
- if any deletion was not successful and the adapter did
not perform any error reporting. If this is a
SystemMessageException
then the caller should examine
the results and fire any necessary events.boolean showRename(Object element)
boolean canRename(Object element)
boolean doRename(Shell shell, Object element, String name, IProgressMonitor monitor) throws Exception
Exception
ISystemValidator getNameValidator(Object element)
String getCanonicalNewName(Object element, String newName)
For example, two connections or filter pools can have the same name if they are in different profiles. Two iSeries QSYS objects can have the same name if their object types are different.
This method returns a name that can be used for uniqueness checking because it is qualified sufficiently to make it unique.
boolean namesAreEqual(Object element, String newName)
boolean showRefresh(Object element)
boolean showProperties(Object element)
boolean showOpenViewActions(Object element)
boolean showGenericShowInTableAction(Object element)
String getMementoHandle(Object element)
String getInputMementoHandle(Object element)
String getMementoHandleKey(Object element)
boolean saveExpansionState(Object element)
void selectionChanged(Object element)
void setFilterString(String filterString)
String getFilterString()
boolean supportsDeferredQueries(ISubSystem subSys)
subSys
- subsystem to use for deferred queries.
true
if it supports deferred queries, false
otherwise.
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |