Package org.csstudio.ui.util.composites
Class ResourceSelectionGroup
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.csstudio.ui.util.composites.ResourceSelectionGroup
- All Implemented Interfaces:
Drawable
Workbench-level composite for choosing a resource.
Code is based upon org.eclipse.ui.internal.ide.misc.ContainerSelectionGroup
in plugin
org.eclipse.ui.ide
.
-
Field Summary
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
-
Constructor Summary
ConstructorDescriptionResourceSelectionGroup
(Composite parent, Listener listener, String[] fileExtensions, boolean showNewContainerActions) Creates a new instance of the widget.ResourceSelectionGroup
(Composite parent, Listener listener, String[] fileExtensions, String message, boolean showNewContainerActions) Creates a new instance of the widget.ResourceSelectionGroup
(Composite parent, Listener listener, String[] fileExtensions, String message, boolean showClosedProjects, boolean showNewContainerActions) Creates a new instance of the widget.ResourceSelectionGroup
(Composite parent, Listener listener, String[] fileExtensions, String message, boolean showClosedProjects, boolean showNewContainerActions, int heightHint, int widthHint) Creates a new instance of the widget. -
Method Summary
Modifier and TypeMethodDescriptionvoid
containerSelectionChanged
(IResource resource) The container selection has changed in the tree view.void
createContents
(String message, String[] fileExtensions, int heightHint, int widthHint) Creates the contents of the composite.protected void
createTreeViewer
(String[] fileExtensions, int heightHint) Returns a new drill down viewer for this dialog.Returns the currently entered container name.void
itemDoubleClicked
(IResource resource) void
Gives focus to one of the widgets in the group, as determined by the group.void
setSelectedResource
(IResource resource) Selects the given resource.void
setSelectedResource
(IPath path) Selects the resource with the given path.Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
-
Constructor Details
-
ResourceSelectionGroup
public ResourceSelectionGroup(Composite parent, Listener listener, String[] fileExtensions, boolean showNewContainerActions) Creates a new instance of the widget.- Parameters:
parent
- The parent widget of the group.listener
- A listener to forward events to. Can be null if no listener is required.fileExtensions
- File extensions of files to include in the tree view. Pass an empty array ornull
to show only container resources.showNewContainerActions
- Whether to show the New Folder and New Project actions.
-
ResourceSelectionGroup
public ResourceSelectionGroup(Composite parent, Listener listener, String[] fileExtensions, String message, boolean showNewContainerActions) Creates a new instance of the widget.- Parameters:
parent
- The parent widget of the group.listener
- A listener to forward events to. Can be null if no listener is required.fileExtensions
- File extensions of files to include in the tree view. Pass an empty array ornull
to show only container resources.message
- The text to present to the user.showNewContainerActions
- Whether to show the New Folder and New Project actions.
-
ResourceSelectionGroup
public ResourceSelectionGroup(Composite parent, Listener listener, String[] fileExtensions, String message, boolean showClosedProjects, boolean showNewContainerActions) Creates a new instance of the widget.- Parameters:
parent
- The parent widget of the group.listener
- A listener to forward events to. Can be null if no listener is required.fileExtensions
- File extensions of files to include in the tree view. Pass an empty array ornull
to show only container resources.message
- The text to present to the user.showClosedProjects
- Whether or not to show closed projects.showNewContainerActions
- Whether to show the New Folder and New Project actions.
-
ResourceSelectionGroup
public ResourceSelectionGroup(Composite parent, Listener listener, String[] fileExtensions, String message, boolean showClosedProjects, boolean showNewContainerActions, int heightHint, int widthHint) Creates a new instance of the widget.- Parameters:
parent
- The parent widget of the group.listener
- A listener to forward events to. Can be null if no listener is required.fileExtensions
- File extensions of files to include in the tree view. Pass an empty array ornull
to show only container resources.message
- The text to present to the user.showClosedProjects
- Whether or not to show closed projects.showNewContainerActions
- Whether to show the New Folder and New Project actions.heightHint
- height hint for the drill down compositewidthHint
- width hint for the drill down composite
-
-
Method Details
-
containerSelectionChanged
The container selection has changed in the tree view. Update the container name field value and notify all listeners.- Parameters:
resource
- The container that changed
-
itemDoubleClicked
-
createContents
Creates the contents of the composite.- Parameters:
message
- The text to present to the user.fileExtensions
- The file extensions of files to include in the tree.heightHint
- The height of the tree widget.widthHint
- The width of the tree widget.
-
createTreeViewer
Returns a new drill down viewer for this dialog.- Parameters:
fileExtensions
- The file extensions of files to include in the tree.heightHint
- height hint for the drill down composite
-
getFullPath
Returns the currently entered container name. Null if the field is empty. Note that the container may not exist yet if the user entered a new container name in the field.- Returns:
- IPath
-
setInitialFocus
public void setInitialFocus()Gives focus to one of the widgets in the group, as determined by the group. -
setSelectedResource
Selects the given resource.- Parameters:
resource
- the resource to select.
-
setSelectedResource
Selects the resource with the given path.- Parameters:
path
- The path to a specific resource.
-