|
RSE Release 1.0 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.jface.viewers.StructuredViewer
org.eclipse.jface.viewers.AbstractTreeViewer
org.eclipse.jface.viewers.TreeViewer
org.eclipse.rse.ui.view.SystemView
This subclass of the standard JFace tree viewer is used to show a tree view of connections to remote systems, which can be manipulated and expanded to access remote objects in the remote system.
| Nested Class Summary | |
|---|---|
protected class |
SystemView.FilterMatch
Inner class to ensapsulate what is put in the vector for the recursiveFindAllRemoteItemFilterReferences() method. |
class |
SystemView.ResourceChangedJob
Inner class which extends UIJob to connect this connection on the UI Thread when no Shell is available from the caller |
| Nested classes inherited from class org.eclipse.jface.viewers.StructuredViewer |
|---|
StructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders |
| Fields inherited from class org.eclipse.jface.viewers.AbstractTreeViewer |
|---|
ALL_LEVELS |
| Fields inherited from class org.eclipse.jface.viewers.Viewer |
|---|
WIDGET_DATA_KEY |
| Constructor Summary | |
|---|---|
SystemView(Shell shell,
Composite parent,
int style,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine)
Constructor to use when you want to specify styles for the tree widget |
|
SystemView(Shell shell,
Composite parent,
int style,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine,
ViewerFilter[] initViewerFilters)
Constructor to use when you want to specify styles for the tree widget |
|
SystemView(Shell shell,
Composite parent,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine)
Constructor |
|
SystemView(Shell shell,
Tree tree,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine)
Constructor to use when you create your own tree widget. |
|
| Method Summary | |
|---|---|
void |
add(Object parentElementOrTreePath,
Object[] childElements)
|
protected void |
addObjectActions(SystemMenuManager menu)
Contributes popup menu actions and submenus registered for the object type(s) in the current selection. |
protected boolean |
affectsInput(Object element)
Test if the given input is our view's input object. |
protected boolean |
affectsInput(Object[] elements)
Test if the given input is our view's input object. |
boolean |
areAnySelectedItemsExpandable()
Returns true if any of the selected items are expandable but not yet expanded |
boolean |
areAnySelectedItemsExpanded()
Returns true if any of the selected items are currently expanded |
protected boolean |
areSelectionsRemote()
Decides whether all the selected objects are remote objects or not Assumes scanSelections() has already been called |
boolean |
canDelete()
Required method from ISystemDeleteTarget Decides whether to enable the delete menu item. |
boolean |
canRename()
Required method from ISystemRenameTarget Decides whether to enable the rename menu item. |
void |
clearMessage()
Clear message/status shown on the message/status line |
protected void |
clearSelection()
Clear current selection. |
protected void |
close()
Close us! |
void |
collapseNode(Object element,
boolean forceRefresh)
Helper method to collapse a node in the tree. |
void |
collapseSelected()
Handles a collapse-selected request |
static IMenuManager |
createStandardGroups(IMenuManager menu)
Creates the Systems plugin standard groups in a context menu. |
protected void |
deleteRemoteObject(Object deleteObject,
ISubSystem subsystem)
Delete all occurrences of a given remote object |
void |
displayMessage(String msg)
Display a message/status on the message/status line |
boolean |
doDelete(IProgressMonitor monitor)
Required method from ISystemDeleteTarget |
protected Widget |
doFindItem(Object element)
|
protected void |
doOurInternalRefresh(Widget widget,
Object element,
boolean doStruct,
boolean doTimings,
boolean firstCall)
|
boolean |
doRename(String[] newNames)
Required method from ISystemRenameTarget |
void |
doSelectAll(IStructuredSelection selection)
When this action is run via Edit->Select All or via Ctrl+A, perform the select all action. |
boolean |
enableSelectAll(IStructuredSelection selection)
Return true if select all should be enabled for the given object. |
Item |
expandRemoteObject(Object remoteObject,
ISubSystem subsystem,
Object parentObject)
Expand a remote object within the tree. |
void |
expandSelected()
Handles an expand-selected request |
void |
expandTo(String filterString)
Called when user selects an Expand To action to expand the selected remote object with a quick filter |
void |
fillContextMenu(IMenuManager menu)
This is method is called to populate the popup menu |
protected Vector |
findAllRemoteItemFilterReferences(String elementName,
ISubSystem subsystem,
Vector matches)
Recursively tries to find all filters affected by a given remote object. |
protected Vector |
findAllRemoteItemReferences(Object element,
Object elementObject,
Vector matches)
Recursively tries to find a given remote object. |
protected Vector |
findAllRemoteItemReferences(String searchString,
Object elementObject,
ISubSystem subsystem,
Vector matches)
Recursively tries to find all occurrences of a given remote object, starting at the tree root. |
protected void |
findAndUpdateFilter(ISystemResourceChangeEvent event,
int type)
We don't show actual filters, only filter references that are unique generated for each subtree of each subsystem. |
protected void |
findAndUpdateFilterParent(ISystemResourceChangeEvent event,
int type)
We don't show actual filters, only filter references that are unique generated for each subtree of each subsystem. |
protected void |
findAndUpdateFilterString(ISystemResourceChangeEvent event,
int type)
|
Item |
findFirstRemoteItemReference(Object remoteObject,
Item parentItem)
Find the first binary-match or name-match of a remote object, given its binary object. |
Item |
findFirstRemoteItemReference(String remoteObjectName,
ISubSystem subsystem,
Item parentItem)
Find the first binary-match or name-match of remote object, given its absolute name. |
protected void |
gatherExpandedChildren(TreeItem parentItem,
TreeItem startingItem,
ArrayList listToPopulate)
Gather up all expanded children of the given tree item into a list that can be used later to reexpand. |
protected ISystemViewElementAdapter |
getAdapter(Object o)
Returns the implementation of ISystemViewElement for the given object. |
int |
getChildCount(Object element)
Return the number of immediate children in the tree, for the given tree node |
IAction |
getCollapseAction()
|
Menu |
getContextMenu()
Return the popup menu for the tree |
MenuManager |
getContextMenuManager()
Return the popup menu for the tree |
IAction |
getDeleteAction()
Rather than pre-defined this common action we wait until it is first needed, for performance reasons. |
Object[] |
getElementNodes(Object element)
This returns an array containing each element in the tree, up to but not including the root. |
Object[] |
getElementNodes(TreeItem item)
This returns an array containing each element in the tree, up to but not including the root. |
protected Object |
getElementParent(Object inputObj)
|
IAction |
getExpandAction()
|
String |
getExpandToFilter(Object element)
Callback from the input provider to test if the given node has expand-to filtering criteria |
Hashtable |
getExpandToFilterTable()
To support restoring state we need to write out to disk out current table that maps tree items to their current expand-to filter. |
protected Object |
getFirstRemoteObject(Vector matches)
Given the result of findAllRemoteItemReferences, scan for first non-filter object |
protected TreeItem |
getFirstSelectedTreeItem()
Return the tree item of the first selected object |
protected String |
getFirstSelectionName(ISelection s)
|
GoIntoAction |
getGoIntoAction()
Get the common "Go Into" action for drilling down in the Remote System Explorer view, scoped to the currently selected object. |
SystemCascadingGoToAction |
getGoToActions()
Get the common "Go To->" cascading menu action for navigating the frame list. |
protected IHost |
getInputConnection(Object inputObj)
|
ISystemViewInputProvider |
getInputProvider()
Return the input provider |
protected int |
getItemIndex(Widget parent,
Object element)
Get index of item given its data element |
protected String |
getItemNodeID(TreeItem item)
Return the string identifying this node in the tree |
TreeItem[] |
getItemNodes(TreeItem item)
This returns an array containing each element in the tree, up to but not including the root. |
protected String |
getItemPath(TreeItem item)
Return the fully-qualified path up to the given item, expressible as a string |
IAction |
getNewConnectionAction()
Rather than pre-defining this common action we wait until it is first needed, for performance reasons. |
Object |
getNextElement()
This returns the element immediately after the last selected element in this tree level Often needed for enablement decisions for move down actions. |
SystemOpenExplorerPerspectiveAction |
getOpenToPerspectiveAction()
Get the common "Open to->" action for opening a new Remote System Explorer view, scoped to the currently selected object. |
Object |
getPreviousElement()
This returns the element immediately before the first selected element in this tree level. |
PropertyDialogAction |
getPropertyDialogAction()
Rather than pre-defining this common action we wait until it is first needed, for performance reasons. |
protected Object[] |
getRawChildren(Widget w)
|
protected Object |
getReferencedObject(Object inputObj)
|
IAction |
getRefreshAction()
Return the refresh action |
protected ISystemRemoteElementAdapter |
getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElement for the given object. |
protected ISystemRemoteElementAdapter |
getRemoteData(Item item,
Object rawData)
|
SystemRemotePropertiesAction |
getRemotePropertyDialogAction()
Rather than pre-defining this common action we wait until it is first needed, for performance reasons. |
protected String |
getRemoteResourceAbsoluteName(Object remoteResource)
Turn a given remote object reference into a fully qualified absolute name |
protected Vector |
getRemoteSelection()
Turn selection into an array of remote object names |
IAction |
getRenameAction()
Rather than pre-defined this common action we wait until it is first needed, for performance reasons. |
Object |
getRootParent()
This is called to walk the tree back up to the roots and return the visible root node for the first selected object. |
IAction |
getSelectAllAction()
Return the select All action |
IHost |
getSelectedConnection()
Return the connection of the selected object, whatever it is. |
Object |
getSelectedParent()
This is called to accurately get the parent object for the current selection for this viewer. |
TreeItem |
getSelectedParentItem()
Return the TreeItem of the parent of the selected node. |
protected Item[] |
getSelection(Control widget)
We override getSelection(Control) so that a list of items under the same parent always gets returned in the order in which they appear in the tree view. |
protected SystemRemoteElementResourceSet |
getSetFor(ISubSystem subSystem,
ISystemViewElementAdapter adapter)
|
Shell |
getShell()
Convenience method for returning the shell of this viewer. |
SystemShowInMonitorAction |
getShowInMonitorAction()
|
SystemShowInTableAction |
getShowInTableAction()
|
protected ISubSystem |
getSubSystem(ISystemRemoteChangeEvent event,
Object remoteResource,
Object remoteParent)
Deduce the subsystem from the event or remote object |
SystemViewPart |
getSystemViewPart()
Get the SystemViewPart that encapsulates us. |
protected int |
getTreeItemPosition(Item childItem,
Item[] children)
Get the position of a tree item within its parent |
Item |
getViewerItem()
Returns the tree item of the first selected object. |
protected IWorkbenchPart |
getWorkbenchPart()
Get the workbench part containing this view. |
protected IWorkbenchWindow |
getWorkbenchWindow()
Get the workbench window containing this view part. |
void |
handleDispose(DisposeEvent event)
|
protected void |
handleDoubleClick(DoubleClickEvent event)
Handles double clicks in viewer. |
protected void |
handleTreeCollapse(TreeEvent event)
|
protected void |
handleTreeExpand(TreeEvent event)
|
protected boolean |
hasAncestorRelationSelection()
Determines whether the view has an ancestor relation selection so that actions can be enable/disabled appropriately. |
protected boolean |
hasSelectedAncestor(TreeItem[] items)
|
protected void |
init()
|
protected void |
initDragAndDrop()
Initialize drag and drop support for this view. |
protected void |
initRefreshKey()
Create the KeyListener for doing the refresh on the viewer. |
protected Item |
internalFindFirstRemoteItemReference(String searchString,
Object elementObject,
ISubSystem subsystem)
Recursively tries to find the first occurrence of a given remote object, starting at the tree root. |
protected Widget |
internalFindReferencedItem(Widget parent,
Object element,
int searchLimit)
Recursively tries to find a reference to the given referenced item |
protected Widget |
internalFindRelativeItem(Widget parent,
Object element,
int searchLimit)
Recursively tries to find an item starting at the given item. |
protected boolean |
isAncestorOf(TreeItem container,
TreeItem[] items)
|
protected boolean |
isSelected(Object element)
Helper method to determine if a given object is currently selected. |
protected boolean |
isSelected(Object[] elementArray)
Helper method to determine if any of a given array of objects is currently selected Does not consider if a child node of the given object is currently selected. |
protected boolean |
isSelected(Object[] elementArray,
IStructuredSelection selection)
Helper method to determine if any of a given array of objects is in given selection Does not consider if a child node of the given object is currently selected. |
protected boolean |
isSelected(Object element,
IStructuredSelection selection)
Helper method to determine if a given object is in given selection Does not consider if a child node of the given object is currently selected. |
boolean |
isSelectedOrChildSelected(Object parentElement)
Helper method to determine if a given object is currently selected. |
protected boolean |
isSelectedOrChildSelected(Object[] parentElements)
Helper method to determine if a given object is currently selected. |
protected boolean |
isSelectionRemote()
|
protected boolean |
isTreeItemSelected(Widget w)
Helper method to determine if a given tree item is currently selected. |
boolean |
isTreeItemSelectedOrChildSelected(Widget w)
Override that takes a widget. |
protected boolean |
itemsShareParent(Widget parentItem,
Item[] items)
|
protected void |
logDebugMsg(String msg)
|
protected void |
logMyDebugMessage(String prefix,
String msg)
|
void |
menuAboutToShow(IMenuManager menu)
Called when the context menu is about to open. |
protected void |
menuAdd(MenuManager menu,
IAction action)
protected helper method to add an Action to a given menu. |
protected void |
moveReferencedTreeItems(Widget parentItem,
Object[] masterSrc,
int delta)
Move existing items a given number of positions within the same node. |
protected void |
moveTreeItem(Widget parentItem,
Item item,
Object src,
int newPosition)
Move one tree item to a new location |
protected void |
moveTreeItems(Widget parentItem,
Object[] src,
int delta)
Move existing items a given number of positions within the same node. |
protected void |
ourInternalRefresh(Widget widget,
Object element,
boolean doStruct,
boolean forceRemote,
boolean doTimings)
Refreshes the tree starting at the given widget. |
protected String |
printTreeItem(Item item)
Handy debug method to print a tree item |
protected Vector |
recursiveFindAllRemoteItemFilterReferences(Item parent,
String elementName,
ISubSystem subsystem,
Vector occurrences)
Recursively tries to find all filters which are affected by a given remote object, such that we can subsequently refresh that filter after a remote resource change. |
protected Vector |
recursiveFindAllRemoteItemReferences(Item parent,
String elementName,
Object elementObject,
ISubSystem subsystem,
Vector occurrences)
Recursively tries to find all references to a remote object. |
protected Item |
recursiveFindFirstRemoteItemReference(Item parent,
String elementName,
Object elementObject,
ISubSystem subsystem)
Recursively tries to find the first references to a remote object. |
protected Widget |
recursiveInternalFindReferencedItem(Widget parent,
Object element,
int searchLimit)
Recursively tries to find a reference the given filtercontainer Limits search depth to when we find an item that is not a connection, subsystem, filter pool, filter or filter string. |
protected Widget |
recursiveInternalFindRelativeItem(Widget parent,
Object element,
int searchLimit)
Recursively tries to find an item starting at the given item. |
void |
refreshAll()
Refresh the whole tree. |
protected boolean |
refreshRemoteObject(Object remoteObject,
Object toSelect,
boolean originatedHere)
Refresh contents of remote container. |
protected void |
refreshTreeItem(TreeItem item)
Refresh the given tree item node |
protected Item |
removeFirstItem(Item[] items,
Item[] children)
|
protected void |
renameRemoteObject(Object renameObject,
String oldElementName,
ISubSystem subsystem)
Rename a remote object. |
ISystemFilterReference |
revealAndExpand(ISubSystem parentSubSystem,
ISystemFilter filter)
Expand a given filter, given a subsystem that contains a reference to the filter's pool. |
boolean |
sameParent()
This is called to ensure all elements in a multiple-selection have the same parent in the tree viewer. |
protected void |
scanSelections(String whereFrom)
-------------------------------------------------------------------------------- For many actions we have to walk the selection list and examine each selected object to decide if a given common action is supported or not. |
protected boolean |
searchToRoot(TreeItem selectedItem,
TreeItem searchItem)
|
void |
select(Object element,
boolean expand)
Called to select an object within the tree, and optionally expand it |
void |
selectionChanged(SelectionChangedEvent event)
Handles selection changed in viewer. |
protected boolean |
selectionHasAncestryRelationship()
|
protected boolean |
selectRemoteObjects(Object src,
ISubSystem subsystem,
Item parentItem)
Select a remote object or objects given the parent remote object (can be null) and subsystem (can be null) and parent TreeItem to start the search at (can be null) |
boolean |
selectRemoteObjects(Object src,
ISubSystem subsystem,
Object parentObject)
Select a remote object or objects given the parent remote object (can be null) and subsystem (can be null) |
void |
setEnabled(boolean enabled)
Disable/Enable the viewer. |
void |
setExpandToFilterTable(Hashtable ht)
To support restoring state we need to write out to disk out current table that maps tree items to their current expand-to filter. |
void |
setInputProvider(ISystemViewInputProvider inputProvider)
Set the input provider. |
void |
setLabelAndContentProvider(SystemViewLabelAndContentProvider lcProvider)
Sets the label and content provider for the system view. |
void |
setShowActions(boolean show)
Turn off right-click actions |
boolean |
showDelete()
Required method from ISystemDeleteTarget. |
protected boolean |
showGenericShowInTableAction()
Decides whether to even show the generic "show in table" menu item. |
protected boolean |
showOpenViewActions()
Decides whether to even show the "open in new perspective" menu item. |
protected boolean |
showRefresh()
Decides whether to even show the refresh menu item. |
boolean |
showRename()
Required method from ISystemRenameTarget. |
protected void |
smartRefresh(Object element,
boolean forceRemote)
Do an intelligent refresh of the given element. |
protected void |
smartRefresh(TreeItem[] itemsToRefresh)
Do an intelligent refresh of an expanded item. |
protected void |
smartRefresh(TreeItem[] itemsToRefresh,
ArrayList expandedChildren,
boolean forceRemote)
|
protected Item[] |
sortSelection(Widget parentItem,
Item[] oldResult)
|
void |
systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
This is the method in your class that will be called when a remote resource changes. |
void |
systemResourceChanged(ISystemResourceChangeEvent event)
Called when something changes in the model |
void |
treeCollapsed(TreeExpansionEvent event)
Called after tree item collapsed. |
void |
treeExpanded(TreeExpansionEvent event)
Called after tree item expanded. |
void |
updatePropertySheet()
Called when a property is updated and we need to inform the Property Sheet viewer. |
protected void |
updateRemoteObjectProperties(Object remoteObject)
Update properties of remote object. |
protected boolean |
usingElementMap()
|
| Methods inherited from class org.eclipse.jface.viewers.TreeViewer |
|---|
addTreeListener, assertContentProviderType, buildLabel, cancelEditing, createChildren, doUpdateItem, editElement, getCellEditors, getCellModifier, getChild, getChildren, getColumnProperties, getControl, getExpanded, getItem, getItemCount, getItemCount, getItems, getLabelProvider, getParentElement, getParentItem, getRawChildren, getTree, hookControl, internalAdd, internalRefreshStruct, isCellEditorActive, isExpandable, isSameSelection, mapElement, newItem, removeAll, replace, setCellEditors, setCellModifier, setChildCount, setColumnProperties, setExpanded, setLabelProvider, setSelection, showItem |
| Methods inherited from class org.eclipse.jface.viewers.ContentViewer |
|---|
getContentProvider, getInput |
| Methods inherited from class org.eclipse.jface.viewers.Viewer |
|---|
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, setData, setSelection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider |
|---|
addSelectionChangedListener, getSelection, removeSelectionChangedListener, setSelection |
| Field Detail |
protected Shell shell
protected ISystemViewInputProvider inputProvider
protected ISystemViewInputProvider previousInputProvider
protected Object previousInput
protected IHost previousInputConnection
protected SystemNewConnectionAction newConnectionAction
protected SystemRefreshAction refreshAction
protected PropertyDialogAction propertyDialogAction
protected SystemRemotePropertiesAction remotePropertyDialogAction
protected SystemCollapseAction collapseAction
protected SystemExpandAction expandAction
protected SystemOpenExplorerPerspectiveAction openToPerspectiveAction
protected SystemShowInTableAction showInTableAction
protected SystemShowInMonitorAction showInMonitorAction
protected GoIntoAction goIntoAction
protected SystemCascadingGoToAction gotoActions
protected SystemCommonDeleteAction deleteAction
protected SystemCommonRenameAction renameAction
protected SystemCommonSelectAllAction selectAllAction
protected boolean selectionShowRefreshAction
protected boolean selectionShowOpenViewActions
protected boolean selectionShowGenericShowInTableAction
protected boolean selectionShowDeleteAction
protected boolean selectionShowRenameAction
protected boolean selectionEnableDeleteAction
protected boolean selectionEnableRenameAction
protected boolean selectionIsRemoteObject
protected boolean selectionHasAncestorRelation
protected boolean selectionFlagsUpdated
protected MenuManager menuMgr
protected boolean showActions
protected boolean hardCodedConnectionSelected
protected boolean mixedSelection
protected boolean specialMode
protected boolean menuListenerAdded
protected boolean fromSystemViewPart
protected boolean areAnyRemote
protected boolean enabledMode
protected Widget previousItem
protected int searchDepth
protected Cursor busyCursor
protected TreeItem inputTreeItem
protected static final int SEARCH_INFINITE
public boolean debug
public boolean debugRemote
public boolean debugProperties
public boolean doTimings
public SystemElapsedTimer elapsedTime
protected Hashtable expandToFiltersByObject
protected Hashtable expandToFiltersByTreePath
protected ISystemMessageLine messageLine
protected static final int LEFT_BUTTON
protected int mouseButtonPressed
protected boolean expandingTreeOnly
protected ViewerFilter[] initViewerFilters
protected List _setList
| Constructor Detail |
public SystemView(Shell shell,
Composite parent,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine)
shell - The shell hosting this tree viewer widgetparent - The composite widget into which to place this widgetinputProvider - The input object which will supply the initial root objects in the tree.
Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.msgLine - Where to display messages and tooltip text
public SystemView(Shell shell,
Composite parent,
int style,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine)
shell - The shell hosting this tree viewer widgetparent - The composite widget into which to place this widgetstyle - The style to give the tree widgetinputProvider - The input object which will supply the initial root objects in the tree.
Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.msgLine - Where to display messages and tooltip text
public SystemView(Shell shell,
Composite parent,
int style,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine,
ViewerFilter[] initViewerFilters)
shell - The shell hosting this tree viewer widgetparent - The composite widget into which to place this widgetstyle - The style to give the tree widgetinputProvider - The input object which will supply the initial root objects in the tree.
Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.msgLine - Where to display messages and tooltip textinitViewerFilters - the initial viewer filters to apply.
public SystemView(Shell shell,
Tree tree,
ISystemViewInputProvider inputProvider,
ISystemMessageLine msgLine)
shell - The shell hosting this tree viewer widgettree - The Tree widget you created.inputProvider - The input object which will supply the initial root objects in the tree.
Can be null initially, but be sure to call #setInputProvider(ISystemViewInputProvider) later.msgLine - Where to display messages and tooltip text| Method Detail |
public void setInputProvider(ISystemViewInputProvider inputProvider)
inputProvider - the input provider for this view.public SystemViewPart getSystemViewPart()
protected IWorkbenchWindow getWorkbenchWindow()
protected IWorkbenchPart getWorkbenchPart()
public void setEnabled(boolean enabled)
public void setLabelAndContentProvider(SystemViewLabelAndContentProvider lcProvider)
lcProvider - the providerprotected void init()
protected void initRefreshKey()
protected void handleDoubleClick(DoubleClickEvent event)
public void collapseSelected()
public void expandSelected()
public void displayMessage(String msg)
public void clearMessage()
public void setShowActions(boolean show)
public ISystemViewInputProvider getInputProvider()
public Menu getContextMenu()
public MenuManager getContextMenuManager()
public IAction getNewConnectionAction()
public IAction getRefreshAction()
public IAction getCollapseAction()
public IAction getExpandAction()
public PropertyDialogAction getPropertyDialogAction()
public SystemRemotePropertiesAction getRemotePropertyDialogAction()
public IAction getSelectAllAction()
public IAction getRenameAction()
public IAction getDeleteAction()
public SystemOpenExplorerPerspectiveAction getOpenToPerspectiveAction()
public SystemShowInTableAction getShowInTableAction()
public SystemShowInMonitorAction getShowInMonitorAction()
public GoIntoAction getGoIntoAction()
public SystemCascadingGoToAction getGoToActions()
public void collapseNode(Object element,
boolean forceRefresh)
forceRefresh - true if children should be deleted from memory so re-expand forces refresh.public void fillContextMenu(IMenuManager menu)
protected void addObjectActions(SystemMenuManager menu)
public void menuAboutToShow(IMenuManager menu)
fillContextMenu(IMenuManager)
menuAboutToShow in interface IMenuListenerpublic static IMenuManager createStandardGroups(IMenuManager menu)
protected void menuAdd(MenuManager menu,
IAction action)
protected boolean hasAncestorRelationSelection()
public void selectionChanged(SelectionChangedEvent event)
selectionChanged in interface ISelectionChangedListener
protected void logMyDebugMessage(String prefix,
String msg)
public Shell getShell()
getShell in interface ISystemResourceChangeListenerprotected boolean isSelected(Object element)
protected boolean isTreeItemSelected(Widget w)
protected boolean isSelected(Object[] elementArray)
protected boolean isSelected(Object element,
IStructuredSelection selection)
protected boolean isSelected(Object[] elementArray,
IStructuredSelection selection)
protected boolean isSelectedOrChildSelected(Object[] parentElements)
protected boolean searchToRoot(TreeItem selectedItem,
TreeItem searchItem)
public void treeCollapsed(TreeExpansionEvent event)
treeCollapsed in interface ITreeViewerListenerevent - the event that caused the collapse. The event data will include the
tree element being collapsed.public void treeExpanded(TreeExpansionEvent event)
treeExpanded in interface ITreeViewerListenerevent - the SWT TreeExpansionEvent that caused the expansion.protected void handleTreeCollapse(TreeEvent event)
protected void handleTreeExpand(TreeEvent event)
protected void clearSelection()
protected ISystemViewElementAdapter getAdapter(Object o)
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
public void handleDispose(DisposeEvent event)
public IHost getSelectedConnection()
protected Item[] getSelection(Control widget)
protected boolean itemsShareParent(Widget parentItem,
Item[] items)
protected Item[] sortSelection(Widget parentItem,
Item[] oldResult)
protected Item removeFirstItem(Item[] items,
Item[] children)
protected void moveTreeItem(Widget parentItem,
Item item,
Object src,
int newPosition)
protected void moveTreeItems(Widget parentItem,
Object[] src,
int delta)
protected int getTreeItemPosition(Item childItem,
Item[] children)
public ISystemFilterReference revealAndExpand(ISubSystem parentSubSystem,
ISystemFilter filter)
parentSubSystem - - the subsystem containing a reference to the filter's parent poolfilter - - the filter to find, reveal, and expand within the subsystem context
public void systemResourceChanged(ISystemResourceChangeEvent event)
systemResourceChanged in interface ISystemResourceChangeListenerISystemResourceChangeEventpublic void systemRemoteResourceChanged(ISystemRemoteChangeEvent event)
systemRemoteResourceChanged in interface ISystemRemoteChangeListenerISystemRemoteChangeEventprotected Vector getRemoteSelection()
protected String getRemoteResourceAbsoluteName(Object remoteResource)
protected ISubSystem getSubSystem(ISystemRemoteChangeEvent event,
Object remoteResource,
Object remoteParent)
protected void close()
protected boolean affectsInput(Object[] elements)
protected boolean affectsInput(Object element)
protected Object getReferencedObject(Object inputObj)
protected Object getElementParent(Object inputObj)
protected IHost getInputConnection(Object inputObj)
protected String printTreeItem(Item item)
protected void deleteRemoteObject(Object deleteObject,
ISubSystem subsystem)
protected void renameRemoteObject(Object renameObject,
String oldElementName,
ISubSystem subsystem)
protected void updateRemoteObjectProperties(Object remoteObject)
protected boolean refreshRemoteObject(Object remoteObject,
Object toSelect,
boolean originatedHere)
remoteObject - - either an actual remote object, or the absolute name of a remote objecttoSelect - - the child object to select after refreshing the given object. This will force the
object to be expanded, and then select this object which can be a remote object or absolute name of a
remote object. To simply force an expand of the remote object, without bothering to select a child,
pass an instance of SystemViewDummyObject.
protected Object getFirstRemoteObject(Vector matches)
protected void ourInternalRefresh(Widget widget,
Object element,
boolean doStruct,
boolean forceRemote,
boolean doTimings)
widget - the widgetelement - the elementdoStruct - true if structural changes are to be picked up,
and false if only label provider changes are of interestprotected boolean isSelectionRemote()
protected void doOurInternalRefresh(Widget widget,
Object element,
boolean doStruct,
boolean doTimings,
boolean firstCall)
protected Object[] getRawChildren(Widget w)
protected String getFirstSelectionName(ISelection s)
public Item expandRemoteObject(Object remoteObject,
ISubSystem subsystem,
Object parentObject)
remoteObject - - either a remote object or a remote object absolute namesubsystem - - the subsystem that owns the remote objects, to optimize searches.parentObject - - the parent that owns the remote objects, to optimize searches. Can
be an object or the absolute name of a remote object.
public boolean selectRemoteObjects(Object src,
ISubSystem subsystem,
Object parentObject)
src - - either a remote object, a remote object absolute name, or a vector of remote objects or remote object absolute namessubsystem - - the subsystem that owns the remote objects, to optimize searches.parentObject - - the parent that owns the remote objects, to optimize searches.
protected boolean selectRemoteObjects(Object src,
ISubSystem subsystem,
Item parentItem)
src - - either a remote object, a remote object absolute name, or a vector of remote objects or remote object absolute namessubsystem - - the subsystem that owns the remote objects, to optimize searches.parentItem - - the parent at which to start the search to find the remote objects. Else, starts at the roots.
public void refreshAll()
protected void smartRefresh(TreeItem[] itemsToRefresh)
protected void smartRefresh(TreeItem[] itemsToRefresh,
ArrayList expandedChildren,
boolean forceRemote)
protected void smartRefresh(Object element,
boolean forceRemote)
protected void gatherExpandedChildren(TreeItem parentItem,
TreeItem startingItem,
ArrayList listToPopulate)
parentItem - The root parent which will not be refreshed itself (only its kids) and hence will remain valid after refresh.
In a full refresh this will be null.startingItem - The starting item for this search. Usually same as parentItem, but changes via recursionlistToPopulate - An array list that will be populated with instances of our inner class ExpandedItem
protected int getItemIndex(Widget parent,
Object element)
protected void findAndUpdateFilter(ISystemResourceChangeEvent event,
int type)
Special case handling for updates to filters which affect the filter but not the filter parent: 1. Existing filter renamed (RENAME) 2. Existing filter's filter strings changed (CHANGE)
Assumption: 1. event.getGrandParent() == subsystem (one event fired per affected subsystem) 2. event.getSource() == filter or filter string (not the reference, the real filter or string) 3. event.getParent() == parent of filter or filter string. One of: a. filterPool reference or filter reference (nested) b. filterPool for non-nested filters when showing filter pools c. subsystem for non-nested filters when not showing filter pools d. filter for nested filters
Our job here: 1. Determine if we are even showing the given subsystem 2. Find the reference to the updated filter in that subsystem's subtree 3. Ask that parent to either update its name or collapse and refresh its children 4. Forget selecting something ... the original item remains selected!
protected void findAndUpdateFilterString(ISystemResourceChangeEvent event,
int type)
protected void findAndUpdateFilterParent(ISystemResourceChangeEvent event,
int type)
Special case handling for updates to filters which affect the parent of the filter, such that the parent's children must be re-generated: 1. New filter created (ADD) 2. Existing filter deleted (DELETE) 3. Existing filters reordered (MOVE)
Assumption: 1. event.getGrandParent() == subsystem (one event fired per affected subsystem) 2. event.getSource() == filter (not the reference, the real filter) 3. event.getParent() == parent of filter. One of: a. filterPool reference or filter reference (nested) b. filterPool for non-nested filters when showing filter pools c. subsystem for non-nested filters when not showing filter pools d. filter for nested filters
Our job here: 1. Determine if we are even showing the given subsystem 2. Find the parent to the given filter: filterPool or subsystem 3. Ask that parent to refresh its children (causes re-gen of filter references) 4. Select something: QUESTION: is this subsystem the origin of this action?? a. For ADD, select the newly created filter reference for the new filter ANSWER: IF PARENT OF NEW FILTER IS WITHIN THIS SUBSYSTEM, AND WAS SELECTED PREVIOUSLY b. For DELETE, select the parent of the filter? ANSWER: IF DELETED FILTER IS WITHING THIS SUBSYSTEM AND WAS SELECTED PREVIOUSLY c. For MOVE, select the moved filters ANSWER: IF MOVED FILTERS ARE WITHIN THIS SUBSYSTEM, AND WERE SELECTED PREVIOUSLY
protected void moveReferencedTreeItems(Widget parentItem,
Object[] masterSrc,
int delta)
protected Widget internalFindReferencedItem(Widget parent,
Object element,
int searchLimit)
parent - the parent item at which to start the search.element - the master element to which we want to find a tree item which references itsearchLimit - how deep to search
protected Widget recursiveInternalFindReferencedItem(Widget parent,
Object element,
int searchLimit)
parent - the parent item at which to start the search.element - the master element to which we want to find a tree item which references itsearchLimit - how deep to search
protected Widget internalFindRelativeItem(Widget parent,
Object element,
int searchLimit)
parent - the parent item at which to start the search.element - the element to match on. Matches on "==" versus equals()
protected Widget recursiveInternalFindRelativeItem(Widget parent,
Object element,
int searchLimit)
parent - the parent item at which to start the search.element - the element to match on. Matches on "==" versus equals()
protected ISystemRemoteElementAdapter getRemoteData(Item item,
Object rawData)
public Item findFirstRemoteItemReference(String remoteObjectName,
ISubSystem subsystem,
Item parentItem)
remoteObjectName - The absolute name of the remote object to find.subsystem - The subsystem of the remote object to find. Optional.parentItem - The parent item at which to start the search. Optional.
public Item findFirstRemoteItemReference(Object remoteObject,
Item parentItem)
remoteObject - - The remote object to find.parentItem - - Optionally, the parent item to start the search at
protected Vector findAllRemoteItemReferences(Object element,
Object elementObject,
Vector matches)
element - the remote object to which we want to find a tree item which references it. Can be a string or an objectelementObject - the actual remote element to find, for binary matching, optionally for cases when element is a stringmatches - the vector to populate with hits
protected Vector findAllRemoteItemReferences(String searchString,
Object elementObject,
ISubSystem subsystem,
Vector matches)
This overload takes a string and a subsystem.
searchString - the absolute name of the remote object to which we want to find a tree item which references it.elementObject - the actual remote element to find, for binary matchingsubsystem - optional subsystem to search withinmatches - the vector to populate with hits
protected Item internalFindFirstRemoteItemReference(String searchString,
Object elementObject,
ISubSystem subsystem)
This overload takes a string and a subsystem.
searchString - the absolute name of the remote object to which we want to find a tree item which references it.elementObject - the actual remote element to find, for binary matchingsubsystem - optional subsystem to search within
protected Vector recursiveFindAllRemoteItemReferences(Item parent,
String elementName,
Object elementObject,
ISubSystem subsystem,
Vector occurrences)
parent - the parent item at which to start the search.elementName - the absolute name of the remote element to findelementObject - the actual remote element to find, for binary matchingsubsystem - optional subsystem to search withinoccurrences - the vector to populate with hits
protected Item recursiveFindFirstRemoteItemReference(Item parent,
String elementName,
Object elementObject,
ISubSystem subsystem)
parent - the parent item at which to start the search.elementName - the absolute name of the remote element to findelementObject - the actual remote element to find, for binary matchingsubsystem - optional subsystem to search within
protected Vector findAllRemoteItemFilterReferences(String elementName,
ISubSystem subsystem,
Vector matches)
elementName - the absolute name of the remote object to which we want to find a filters which result in it.subsystem - The subsystem which owns the remote resource. Necessary to scope the search for impacted filters.matches - the vector to populate with hits. Can be null, in which case a new vector is created.
protected Vector recursiveFindAllRemoteItemFilterReferences(Item parent,
String elementName,
ISubSystem subsystem,
Vector occurrences)
parent - the parent item at which to start the search.elementName - the absolute name of the remote element that has been created, changed, deleted or renamed.subsystem - The subsystem which owns the remote resource. Necessary to scope the search for impacted filters.occurrences - the vector to populate with hits
protected void scanSelections(String whereFrom)
Walking this list multiple times while building the popup menu is a performance hit, so we have this common method that does it only once, setting instance variables for all of the decisions we are in interested in. --------------------------------------------------------------------------------
protected boolean showRefresh()
protected boolean showOpenViewActions()
protected boolean showGenericShowInTableAction()
protected boolean areSelectionsRemote()
public boolean showDelete()
showDelete in interface ISystemDeleteTargetpublic boolean canDelete()
canDelete in interface ISystemDeleteTargetpublic boolean doDelete(IProgressMonitor monitor)
doDelete in interface ISystemDeleteTargetpublic boolean showRename()
showRename in interface ISystemRenameTargetpublic boolean canRename()
canRename in interface ISystemRenameTargetpublic boolean doRename(String[] newNames)
doRename in interface ISystemRenameTargetprotected void logDebugMsg(String msg)
public boolean enableSelectAll(IStructuredSelection selection)
enableSelectAll in interface ISystemSelectAllTargetpublic void doSelectAll(IStructuredSelection selection)
doSelectAll in interface ISystemSelectAllTargetpublic boolean sameParent()
Designed to be as fast as possible by going directly to the SWT widgets
sameParent in interface ISystemTreeprotected boolean selectionHasAncestryRelationship()
protected boolean isAncestorOf(TreeItem container,
TreeItem[] items)
protected boolean hasSelectedAncestor(TreeItem[] items)
public Object getSelectedParent()
The getParent() method in the adapter is very unreliable... adapters can't be sure of the context which can change via filtering and view options.
getSelectedParent in interface ISystemTreepublic TreeItem getSelectedParentItem()
public Object getPreviousElement()
getPreviousElement in interface ISystemTreepublic Object getNextElement()
getNextElement in interface ISystemTreepublic Object getRootParent()
getRootParent in interface ISystemTreepublic Object[] getElementNodes(Object element)
getElementNodes in interface ISystemTreeelement - the element from which to begin
public Object[] getElementNodes(TreeItem item)
public TreeItem[] getItemNodes(TreeItem item)
public boolean isSelectedOrChildSelected(Object parentElement)
isSelectedOrChildSelected in interface ISystemTreeparentElement - the element to query
public boolean isTreeItemSelectedOrChildSelected(Widget w)
public int getChildCount(Object element)
getChildCount in interface ISystemTreeelement - the element in the tree to query
protected Widget doFindItem(Object element)
protected TreeItem getFirstSelectedTreeItem()
protected void refreshTreeItem(TreeItem item)
public void updatePropertySheet()
updatePropertySheet in interface ISystemTree
public void select(Object element,
boolean expand)
select in interface ISystemTreeelement - the element in the tree to selectexpand - true if the element is to be expandedpublic Item getViewerItem()
getViewerItem in interface ISystemTreepublic boolean areAnySelectedItemsExpanded()
areAnySelectedItemsExpanded in interface ISystemTreepublic boolean areAnySelectedItemsExpandable()
areAnySelectedItemsExpandable in interface ISystemTreeprotected void initDragAndDrop()
public void expandTo(String filterString)
protected String getItemPath(TreeItem item)
protected String getItemNodeID(TreeItem item)
public String getExpandToFilter(Object element)
public Hashtable getExpandToFilterTable()
public void setExpandToFilterTable(Hashtable ht)
protected SystemRemoteElementResourceSet getSetFor(ISubSystem subSystem,
ISystemViewElementAdapter adapter)
protected boolean usingElementMap()
public void add(Object parentElementOrTreePath,
Object[] childElements)
|
RSE Release 1.0 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||