|
org.eclipse.rse.ui.filters.actions
Class SystemNewFilterAction
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.rse.ui.actions.SystemBaseAction
org.eclipse.rse.ui.actions.SystemBaseDialogAction
org.eclipse.rse.ui.actions.SystemBaseWizardAction
org.eclipse.rse.ui.filters.actions.SystemNewFilterAction
-
All Implemented Interfaces:
-
IAction,
ISelectionChangedListener,
ISystemAction,
ISystemDialogAction,
ISystemWizardAction
-
public class SystemNewFilterAction
- extends
SystemBaseWizardAction
The action acts as a base class for all "New Filter" wizards so we can
get some common functionality.
An interesting capability of this action is to defer configuration, which might be
time consuming, until the user selects to run it. That can be done by registering
a callback object that implements ISystemNewFilterActionConfigurator.
Fields inherited from interface org.eclipse.jface.action.
IAction
|
AS_CHECK_BOX,
AS_DROP_DOWN_MENU,
AS_PUSH_BUTTON,
AS_RADIO_BUTTON,
AS_UNSPECIFIED,
CHECKED,
DESCRIPTION,
ENABLED,
HANDLED,
IMAGE,
RESULT,
TEXT,
TOOL_TIP_TEXT
|
Constructor Summary
|
SystemNewFilterAction
(
Shell shell,
ISystemFilterPool parentPool)
Constructor to use when you want to just use the default action name and image. |
SystemNewFilterAction
(
Shell shell,
ISystemFilterPool parentPool,
String label,
String tooltip,
ImageDescriptor image)
Constructor for non-nested actions. |
SystemNewFilterAction
(
Shell shell,
ISystemFilterPool parentPool,
String label,
String tooltip,
ImageDescriptor image,
boolean nested)
Constructor allowing nested actions. |
Methods inherited from class org.eclipse.rse.ui.actions.
SystemBaseAction
|
allowOnMultipleSelection,
getContextMenuGroup,
getCurrentTreeView,
getFirstSelection,
getHelpContextId,
getNextSelection,
getRemoteAdapter,
getSelection,
getSelectionProvider,
getShell,
getShell,
getSystemConnection,
getViewAdapter,
getViewer,
isDummy,
isEnabled,
isSelectionSensitive,
issueTraceMessage,
selectionChanged,
setAvailableOffline,
setBusyCursor,
setContextMenuGroup,
setDisplayCursor,
setDisplayCursor,
setHelp,
setHost,
setInputs,
setSelection,
setSelectionProvider,
setSelectionSensitive,
setShell,
setTracing,
setTracing,
setViewer,
updateSelection
|
Methods inherited from class org.eclipse.jface.action.
Action
|
convertAccelerator,
convertAccelerator,
findKeyCode,
findKeyString,
findModifier,
findModifierString,
getAccelerator,
getActionDefinitionId,
getDescription,
getDisabledImageDescriptor,
getHelpListener,
getHoverImageDescriptor,
getId,
getImageDescriptor,
getMenuCreator,
getStyle,
getText,
getToolTipText,
isChecked,
isHandled,
notifyResult,
removeAcceleratorText,
removeMnemonics,
runWithEvent,
setAccelerator,
setActionDefinitionId,
setChecked,
setDescription,
setDisabledImageDescriptor,
setEnabled,
setHelpListener,
setHoverImageDescriptor,
setId,
setImageDescriptor,
setMenuCreator,
setText,
setToolTipText
|
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
Methods inherited from interface org.eclipse.rse.ui.actions.
ISystemAction
|
allowOnMultipleSelection,
getContextMenuGroup,
getHelpContextId,
getSelection,
getShell,
getViewer,
isDummy,
isSelectionSensitive,
setContextMenuGroup,
setHelp,
setInputs,
setSelection,
setSelectionSensitive,
setShell,
setViewer
|
Methods inherited from interface org.eclipse.jface.action.
IAction
|
addPropertyChangeListener,
getAccelerator,
getActionDefinitionId,
getDescription,
getDisabledImageDescriptor,
getHelpListener,
getHoverImageDescriptor,
getId,
getImageDescriptor,
getMenuCreator,
getStyle,
getText,
getToolTipText,
isChecked,
isEnabled,
isHandled,
removePropertyChangeListener,
run,
runWithEvent,
setAccelerator,
setActionDefinitionId,
setChecked,
setDescription,
setDisabledImageDescriptor,
setEnabled,
setHelpListener,
setHoverImageDescriptor,
setId,
setImageDescriptor,
setMenuCreator,
setText,
setToolTipText
|
parentPool
protected
ISystemFilterPool parentPool
poolsToSelectFrom
protected
ISystemFilterPool[] poolsToSelectFrom
poolWrapperInformation
protected
ISystemFilterPoolWrapperInformation poolWrapperInformation
nested
protected boolean nested
showFilterStrings
protected boolean showFilterStrings
showNamePrompt
protected boolean showNamePrompt
showInfoPage
protected boolean showInfoPage
fromRSE
protected boolean fromRSE
defaultFilterStrings
protected
String[] defaultFilterStrings
type
protected
String type
verbiage
protected
String verbiage
page1Description
protected
String page1Description
namePageHelp
protected
String namePageHelp
filterPoolSelectionValidator
protected
ISystemFilterPoolSelectionValidator filterPoolSelectionValidator
callbackConfigurator
protected
ISystemNewFilterActionConfigurator callbackConfigurator
callbackConfiguratorCalled
protected boolean callbackConfiguratorCalled
callbackData
protected
Object callbackData
editPane
protected
SystemFilterStringEditPane editPane
SystemNewFilterAction
public SystemNewFilterAction(
Shell shell,
ISystemFilterPool parentPool,
String label,
String tooltip,
ImageDescriptor image)
- Constructor for non-nested actions.
SystemNewFilterAction
public SystemNewFilterAction(
Shell shell,
ISystemFilterPool parentPool,
String label,
String tooltip,
ImageDescriptor image,
boolean nested)
- Constructor allowing nested actions. Changes the title.
SystemNewFilterAction
public SystemNewFilterAction(
Shell shell,
ISystemFilterPool parentPool)
- Constructor to use when you want to just use the default action name and image.
Also defaults to nested filters not allowed.
setCallBackConfigurator
public void setCallBackConfigurator(
ISystemNewFilterActionConfigurator caller,
Object data)
-
Configuration method. Do not override.
Call this to defer expensive configuration until the user runs the action
-
-
Parameters:
-
caller - - an implementor of the callback interface -
data - - any data the callback needs. It will be passed back on the callback.
setHelpContextId
public void setHelpContextId(
String id)
-
Configuration method. Do not override.
Set the help context Id (infoPop) for this action. This must be fully qualified by
plugin ID.
Same as
#setHelp(String)
-
-
See Also:
-
#getHelpContextId()
setParentFilterPool
public void setParentFilterPool(
ISystemFilterPool parentPool)
-
Configuration method. Do not override.
Set the parent filter pool that the new-filter actions need.
Typically this is set at constructor time but it can be set later if re-using the action.
-
setAllowFilterPoolSelection
public void setAllowFilterPoolSelection(
ISystemFilterPool[] poolsToSelectFrom)
-
Configuration method. Do not override.
If you want to prompt the user for the parent filter pool to create this filter in,
call this with the list of filter pools. In this case, the filter pool passed into
the constructor will be used as the initial selection.
-
setAllowFilterPoolSelection
public void setAllowFilterPoolSelection(
ISystemFilterPoolWrapperInformation poolsToSelectFrom)
-
Configuration method. Do not override.
This is an alternative to
setAllowFilterPoolSelection(ISystemFilterPool[])
If you want to prompt the user for the parent filter pool to create this filter in,
but want to not use the term "pool" say, you can use an array of euphamisms. That is,
you can pass an array of objects that map to filter pools, but have a different
display name that is shown in the dropdown.
Of course, if you want to do this, then you will likely want to offer a different
label and tooltip for the prompt, and different verbiage above the prompt. The
object this method accepts as a parameter encapsulates all that information, and
there is a default class you can use for this.
-
setType
public void setType(
String type)
-
Configuration method. Do not override.
Set the type of filter we are creating. Results in a call to setType(String) on the new filter.
Types are not used by the base filter framework but are a way for tools to create typed
filters and have unique actions per filter type.
This will also result in a call to setType(String) on the filter string edit pane, which
sets the type instance variable in case your edit pane subclass needs to know.
-
getType
public
String getType()
-
Getter method. Do not override.
Get the type of filter as set by
setType(String)
-
setShowFilterStrings
public void setShowFilterStrings(boolean show)
-
Configuration method. Do not override.
Set whether to show, or hide, the first page that prompts for a filter string. Default is true.
-
-
See Also:
-
setDefaultFilterStrings(String[])
setDefaultFilterStrings
public void setDefaultFilterStrings(
String[] defaultFilterStrings)
-
Configuration method. Do not override.
Call this if you want the new filter to have some default filter strings.
-
setShowNamePrompt
public void setShowNamePrompt(boolean show)
-
Configuration method. Do not override.
Call in order to not prompt the user for a filter name. This also implies we will not
be prompting for a parent filter pool! Default is true.
This is used when creating temporary filters that won't be saved. In this case, on
Finish a filter is not created! Instead, call getFilterStrings() to get the filter
strings created by the user ... typically there is just one unless you also called
setDefaultFilterStrings, in which case they will also be returned.
For convenience, when this is called, setShowInfoPage(false) is called for you
-
setShowInfoPage
public void setShowInfoPage(boolean show)
-
Configuration method. Do not override.
Call in order to not show the final info-only page of the wizard. Default is true.
-
-
See Also:
-
setVerbiage(String)
setVerbiage
public void setVerbiage(
String verbiage)
-
Configuration method. Do not override.
Set the verbiage to show on the final page. By default, it shows a tip about creating multiple
filter strings via the Change action. Use this method to change that default.
-
setPage1Description
public void setPage1Description(
String description)
-
Configuration method. Do not override.
Set the description to display on the first page of the wizard
-
setFromRSE
public void setFromRSE(boolean rse)
-
Configuration method. Do not override.
Set if we are creating a filter for use in the RSE or not. This affects the
tips and help.
This is set to true automatically by the subsystem factory base class in the RSE,
else it defaults to false.
-
setFilterPoolSelectionValidator
public void setFilterPoolSelectionValidator(
ISystemFilterPoolSelectionValidator validator)
-
Configuration method. Do not override.
Set the validator to call when the user selects a filter pool. Optional.
Only valid in create mode.
-
setFilterStringEditPane
public void setFilterStringEditPane(
SystemFilterStringEditPane editPane)
-
Configuration method. Do not override.
Specify an edit pane that prompts the user for the contents of a filter string.
-
setNamePageHelp
public void setNamePageHelp(
String helpId)
-
Configuration method. Do not override.
Specify the help to show for the name page (page 2)
-
configureNewFilterWizard
protected void configureNewFilterWizard(
SystemNewFilterWizard wizard)
-
Overridable configuration method.
Overridable extension. For those cases when you don't want to create your
own wizard subclass, but prefer to simply configure the default wizard.
Note, at the point this is called, all the base configuration, based on the
setters for this action, have been called. There really is nothing much that
can't be done via setters. The reason you may want to subclass versus use the
setters is defer expensive operations until the user actually selects the New Filter
action. Using the setters means this is done at time the popup menu is being
construction. Overriding this method allows you to defer the wizard configuration
until the user selects the action and the wizard is actually created.
By default, this does nothing.
-
configureNewFilter
protected void configureNewFilter(
ISystemFilter newFilter)
-
Overridable configuration method.
Configure the new filter created by the wizard. This is only called after
successful completion of the wizard
By default, this does nothing.
-
createWizard
protected
IWizard createWizard()
-
Lifecyle method. Do not override. Instead override
createNewFilterWizard(ISystemFilterPool) .
The default processing for the run method calls createDialog, which
in turn calls this method to return an instance of our wizard.
Our default implementation is to call createNewFilterWizard.
Note your own wizard must subclass
SystemNewFilterWizard
-
-
Specified by:
-
createWizard
in class
SystemBaseWizardAction
-
createNewFilterWizard
protected
SystemNewFilterWizard createNewFilterWizard(
ISystemFilterPool parentPool)
-
Overridable lifecyle method.
Create and return the actual wizard.
By default this returns an instance of
SystemNewFilterWizard .
You can avoid creating your own wizard subclass by instead overriding
configureNewFilterWizard(SystemNewFilterWizard)
-
postProcessWizard
protected void postProcessWizard(
IWizard wizard)
-
Lifecyle method. Do not override. Instead override
configureNewFilter(ISystemFilter) .
Intercept of parent method so we can allow overrides opportunity to
configure the new filter.
This simply calls configureNewFilter.
-
-
Overrides:
-
postProcessWizard
in class
SystemBaseWizardAction
-
checkObjectType
public boolean checkObjectType(
Object selectedObject)
-
Lifecyle method. No need to override.
Decide whether to enable this action based on selected object's type.
Returns false unless selected object is a filter pool or subsystem.
-
-
Overrides:
-
checkObjectType
in class
SystemBaseAction
-
getSystemFilterPoolReferenceManagerProvider
public
ISystemFilterPoolReferenceManagerProvider getSystemFilterPoolReferenceManagerProvider()
-
Output method. Do not override.
Get the contextual system filter pool reference manager provider. Will return non-null if the
current selection is a reference to a filter pool or filter, or a reference manager
provider.
-
getNewFilter
public
ISystemFilter getNewFilter()
-
Output method. Do not override.
Convenience method to return the newly created filter after running the action.
Will be null if the user cancelled. Will also be null if you called setShowNamePrompt(false),
in which case you should call getNewFilterStrings().
Be sure to call wasCancelled() first before calling this.
-
getFilterStrings
public
String[] getFilterStrings()
-
Output method. Do not override.
When prompting for an unnamed filter, no filter is created. Instead, the user is prompted
for a single filter string. This method returns that string. However, if you happened to
call setDefaultFilterStrings(...) then those are also returned, hence the need for an
array. If not, this will be an array of one, or null if the user cancelled the wizard.
Be sure to call wasCancelled() first before calling this.
-
getFilterString
public
String getFilterString()
-
Output method. Do not override.
Shortcut to getFilterStrings()[0].
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|