public abstract class AbstractWorkingSetPage
extends org.eclipse.jface.wizard.WizardPage
implements org.eclipse.ui.dialogs.IWorkingSetPage
IWorkingSetPage
. A tree viewer on the
left is used to show the workspace content, a table viewer on the right
is used to show the working set content. Buttons to move content from right
to left and vice versa are available between the two viewers. A text field
allows to set/change the working set name.Modifier and Type | Field and Description |
---|---|
protected static org.eclipse.core.runtime.IAdaptable[] |
NO_ELEMENTS
A zero-length array of the runtime type
IAdaptable[] . |
Constructor and Description |
---|
AbstractWorkingSetPage(java.lang.String pageName,
java.lang.String title,
org.eclipse.jface.resource.ImageDescriptor titleImage)
Creates a new wizard page with the given name, title, and image.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.core.runtime.IAdaptable[] |
adaptElements(org.eclipse.core.runtime.IAdaptable[] objects)
Transforms the supplied elements into elements that are suitable for
containment in the working set configured by this page.
|
protected abstract void |
configureTable(org.eclipse.jface.viewers.TableViewer table)
Configures the table viewer on the right side of this page.
|
protected abstract void |
configureTree(org.eclipse.jface.viewers.TreeViewer tree)
Configures the tree viewer on the left side of this page.
|
void |
createControl(org.eclipse.swt.widgets.Composite parent) |
void |
finish() |
protected static org.eclipse.core.runtime.IAdaptable[] |
getAdaptables(java.lang.Object[] elements)
Given an array, selects the
IAdaptable elements. |
protected org.eclipse.core.runtime.IAdaptable[] |
getFinalWorkingSetElements(org.eclipse.ui.IWorkingSet workingSet,
org.eclipse.core.runtime.IAdaptable[] elements)
Returns the elements that are to be set into the working set
configured by this page.
|
protected org.eclipse.jface.viewers.IStructuredSelection |
getInitialSelection()
Returns the selection used as a basis for the initial state of this page.
|
protected org.eclipse.core.runtime.IAdaptable[] |
getInitialWorkingSetElements(org.eclipse.ui.IWorkingSet workingSet)
Returns the elements that are to be shown in the table viewer initially.
|
protected abstract java.lang.String |
getPageId()
Returns the page id as specified in the extension point
org.eclipse.ui.workingSets . |
org.eclipse.ui.IWorkingSet |
getSelection() |
protected void |
initializeTreeSelection(org.eclipse.jface.viewers.TreeViewer tree)
Computes and sets the initial selection for the tree viewer.
|
void |
setInitialSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
Sets the selection used as a basis for the initial state of this page.
|
void |
setSelection(org.eclipse.ui.IWorkingSet workingSet) |
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected static final org.eclipse.core.runtime.IAdaptable[] NO_ELEMENTS
IAdaptable[]
.public AbstractWorkingSetPage(java.lang.String pageName, java.lang.String title, org.eclipse.jface.resource.ImageDescriptor titleImage)
pageName
- the name of the page (not null
)title
- the title for this wizard page,
or null
if nonetitleImage
- the image descriptor for the title of this wizard page,
or null
if nonepublic void setInitialSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
selection
- may be null
or emptypublic void createControl(org.eclipse.swt.widgets.Composite parent)
createControl
in interface org.eclipse.jface.dialogs.IDialogPage
public void finish()
finish
in interface org.eclipse.ui.dialogs.IWorkingSetPage
public org.eclipse.ui.IWorkingSet getSelection()
getSelection
in interface org.eclipse.ui.dialogs.IWorkingSetPage
public void setSelection(org.eclipse.ui.IWorkingSet workingSet)
setSelection
in interface org.eclipse.ui.dialogs.IWorkingSetPage
protected abstract java.lang.String getPageId()
org.eclipse.ui.workingSets
.protected abstract void configureTree(org.eclipse.jface.viewers.TreeViewer tree)
Implementors must set:
They may also set:
Note that the initial selection is set in initializeTreeSelection(TreeViewer)
, which is called
right after this method.
tree
- the tree viewer to configure (never null
)protected abstract void configureTable(org.eclipse.jface.viewers.TableViewer table)
Implementors must set:
They may also set:
They must not set:
table
- the table viewer to configure (never null
)protected final org.eclipse.jface.viewers.IStructuredSelection getInitialSelection()
null
or empty)protected void initializeTreeSelection(org.eclipse.jface.viewers.TreeViewer tree)
If the working set that will be configured by this page exists,
this implementation adapts the elements from getInitialSelection()
using adaptElements(IAdaptable[])
and sets the result as the
current selection for the tree viewer.
tree
- the tree viewer (never null
)protected org.eclipse.core.runtime.IAdaptable[] adaptElements(org.eclipse.core.runtime.IAdaptable[] objects)
This implementation creates a temporary working set, sets its id to getPageId()
, and delegates to IWorkingSet.adaptElements(IAdaptable[])
.
objects
- the objects to transform (never null
)null
)protected static org.eclipse.core.runtime.IAdaptable[] getAdaptables(java.lang.Object[] elements)
IAdaptable
elements.elements
- not null
IAdaptable
elements
selected from the given array (never null
)protected org.eclipse.core.runtime.IAdaptable[] getInitialWorkingSetElements(org.eclipse.ui.IWorkingSet workingSet)
null
if it does not yet exist.
This implementation returns the elements contained in the working set or,
if the working set does not yet exist, the elements adapted from getInitialSelection()
using adaptElements(IAdaptable[])
.
workingSet
- the working set to configure,
or null
if it does not yet existnull
)protected org.eclipse.core.runtime.IAdaptable[] getFinalWorkingSetElements(org.eclipse.ui.IWorkingSet workingSet, org.eclipse.core.runtime.IAdaptable[] elements)
This implementation returns the given elements unchanged.
workingSet
- the working set to configure,
or null
if it does not yet existelements
- the elements explicitly selected by the user
(never null
)null
)Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0