|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.action.Action | +--org.eclipse.ui.actions.SelectionProviderAction | +--org.eclipse.ui.dialogs.PropertyDialogAction
Standard action for opening a Property Pages Dialog on the currently selected element.
This class may be instantiated; it is not intended to be subclassed.
Generally speaking, this action is useful in pop-up menus because it allows the user to browse and change properties of selected elements. When performed, the action will bring up a Property Pages Dialog containing property pages registered with the workbench for elements of the selected type.
Although the action is capable of calculating if there are any applicable pages for the current selection, this calculation is costly because it require searching the workbench registry. Where performance is critical, the action can simply be added to the pop-up menu. In the event of no applicable pages, the action will just open an appropriate message dialog.
Field Summary |
Fields inherited from interface org.eclipse.jface.action.IAction |
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, CHECKED, DESCRIPTION, ENABLED, IMAGE, TEXT, TOOL_TIP_TEXT |
Constructor Summary | |
PropertyDialogAction(Shell shell,
ISelectionProvider provider)
Creates a new action for opening a property dialog on the elements from the given selection provider. |
Method Summary | |
boolean |
isApplicableForSelection()
Returns whether this action is actually applicable to the current selection. |
boolean |
isApplicableForSelection(IStructuredSelection selection)
Returns whether this action is applicable to the current selection. |
void |
run()
The PropertyDialogAction implementation of this
IAction method performs the action by opening the Property Page
Dialog for the current selection. |
void |
selectionChanged(IStructuredSelection selection)
The PropertyDialogAction implementation of this
SelectionProviderAction method enables the action only if the
given selection contains exactly one element. |
Methods inherited from class org.eclipse.ui.actions.SelectionProviderAction |
dispose, getSelection, getSelectionProvider, getStructuredSelection, selectionChanged, selectionChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyDialogAction(Shell shell, ISelectionProvider provider)
shell
- the shell in which the dialog will openprovider
- the selection provider whose elements the property dialog
will describeMethod Detail |
public boolean isApplicableForSelection()
false
without further
calculation. If it is enabled, it will check with the workbench's property
page manager to see if there are any property pages registered for the
selected element's type.
This method is generally too expensive to use when updating the enabled state of the action on each selection change.
true
if the selection is of size 1 and there are
property pages for the selected element, and false
otherwisepublic boolean isApplicableForSelection(IStructuredSelection selection)
This method is generally too expensive to use when updating the enabled state of the action on each selection change.
true
if the selection is of size 1 and there are
property pages for the selected element, and false
otherwisepublic void run()
PropertyDialogAction
implementation of this
IAction
method performs the action by opening the Property Page
Dialog for the current selection. If no pages are found, an informative
message dialog is presented instead.
run
in interface IAction
run
in class Action
public void selectionChanged(IStructuredSelection selection)
PropertyDialogAction
implementation of this
SelectionProviderAction
method enables the action only if the
given selection contains exactly one element.
selectionChanged
in class SelectionProviderAction
selection
- the new selection
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |