|
 |
|
|
org.eclipse.rse.ui.filters.dialogs
Class SystemNewFilterWizard
java.lang.Object
org.eclipse.jface.wizard.Wizard
org.eclipse.rse.ui.wizards.AbstractSystemWizard
org.eclipse.rse.ui.filters.dialogs.SystemNewFilterWizard
-
All Implemented Interfaces:
-
IWizard,
ISystemPromptDialog,
ISystemWizard,
INewWizard,
IWorkbenchWizard
-
public class SystemNewFilterWizard
- extends
AbstractSystemWizard
Base Wizard for users to define a new system filter.
While subsystem providers are free to offer their own wizards, this
abstracts out much of it and makes it easy to simply override and
supply a couple classes to offer a totally unique presentation to the
user.
Some guiding design rules for this wizard:
- Users are confused about filter strings versus filters. So, we don't
support the creation of multiple filter strings at the time the filter
is created, only after via the change action. The wizard basically
prompts for the creation of a single new filter string.
- Users are confused about "naming" a filter, so the name is not asked
for until the second page, and it is possible for subclasses to
default that name to something intelligent based on the contents of
the first page, such that users can press Finish and not think about
the name.
While this class can be subclassed, you should find all attributes can be
configured via setters.
Fields inherited from class org.eclipse.rse.ui.wizards.
AbstractSystemWizard
|
cancelled,
finishPressed,
helpId,
input,
minPageHeight,
minPageWidth,
output,
owningDialog,
pageTitle,
selection,
viewer
|
Method Summary
|
void
|
addPages
()
Override of parent to do nothing |
boolean
|
areStringsCaseSensitive
()
Override if necessary. |
protected
SystemNewFilterWizardInfoPage
|
createInfoPage
()
Extendable point for child classes. |
protected
SystemNewFilterWizardMainPage
|
createMainPage
()
Extendable point for child classes. |
protected
SystemNewFilterWizardNamePage
|
createNamePage
()
By default, this page uses the wizard page title as set in
setWizardPageTitle(...) or the constructor. |
ISystemFilter
|
createNewFilter
(
Shell shell,
ISystemFilterContainer filterParent,
String aliasName,
Vector filterStringsVector,
String type)
Extendable point for child classes. |
void
|
createPageControls
(
Composite c)
Creates the wizard pages. |
String
|
getDefaultFilterName
()
For page 2 of the New Filter wizard, if it is possible to
deduce a reasonable default name from the user input here,
then return it here. |
protected
ISystemFilterContainer
|
getFilterContainer
()
Return parent filter container to contain this filter |
protected
ISystemValidator
|
getFilterNameValidator
(
ISystemFilterContainer container)
Extendable point for child classes. |
static
ISystemValidator
|
getFilterNameValidator
(
ISystemFilterContainer container,
ISystemFilter filter)
Reusable method to return a name validator for renaming a filter. |
protected
Object
|
getParent
()
Return the parent into which we are creating a filter. |
ISystemFilter
|
getSystemFilter
()
Return the filter created upon successful finish |
String
|
getType
()
Get the type of filter as set by
setType(String)
|
protected boolean
|
isFromRSE
()
Return true if this filter is an RSE filter or not |
boolean
|
performFinish
()
Completes processing of the wizard. |
void
|
setAllowFilterPoolSelection
(
ISystemFilterPool[] poolsToSelectFrom)
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. |
void
|
setAllowFilterPoolSelection
(
ISystemFilterPoolWrapperInformation poolsToSelectFrom)
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. |
void
|
setDefaultFilterStrings
(
String[] defaultFilterStrings)
Call this if you want the filter to auto-include some default filter strings. |
void
|
setFilterContainer
(
ISystemFilterContainer container)
Set parent filter container to contain this filter |
void
|
setFilterContainer
(
ISystemFilterContainerReference containerRef)
Set parent filter container to contain this filter |
void
|
setFilterPoolSelectionValidator
(
ISystemFilterPoolSelectionValidator validator)
Set the validator to call when the user selects a filter pool. |
void
|
setFilterStringEditPane
(
SystemFilterStringEditPane editPane)
Specify an edit pane that prompts the user for the contents of a filter string. |
void
|
setFromRSE
(boolean rse)
Set if we are creating a filter for use in the RSE or not. |
void
|
setNamePageHelp
(
String helpId)
Specify the help to show for the name page (page 2) |
void
|
setPage1Description
(
String description)
Set the description to display on the first page of the wizard |
void
|
setShowFilterStrings
(boolean show)
Call in order to not have the first page, but instead the name-prompt page. |
void
|
setShowInfoPage
(boolean show)
Call in order to not show the final info-only page of the wizard. |
void
|
setShowNamePrompt
(boolean show)
Call in order to not prompt the user for a filter name. |
void
|
setSystemFilterPoolReferenceManagerProvider
(
ISystemFilterPoolReferenceManagerProvider provider)
Set the contextual system filter pool reference manager provider. |
void
|
setType
(
String type)
Set the type of filter we are creating. |
void
|
setVerbiage
(
String verbiage)
Set the verbiage to show on the final page. |
void
|
setWizardPageTitle
(
String pageTitle)
Set the wizard page title. |
Methods inherited from class org.eclipse.rse.ui.wizards.
AbstractSystemWizard
|
addPage,
getCurrentTreeView,
getHelpContextId,
getInputObject,
getMinimumPageHeight,
getMinimumPageWidth,
getOutputObject,
getSystemWizardDialog,
getViewer,
getWizardPageTitle,
init,
performCancel,
publicConvertHeightInCharsToPixels,
publicConvertWidthInCharsToPixels,
setHelp,
setInputObject,
setMinimumPageSize,
setOutputObject,
setPageError,
setSystemWizardDialog,
setViewer,
setWasCancelled,
setWizardImage,
setWizardTitle,
updateSize,
wasCancelled
|
Methods inherited from class org.eclipse.jface.wizard.
Wizard
|
canFinish,
dispose,
getContainer,
getDefaultPageImage,
getDialogSettings,
getNextPage,
getPage,
getPageCount,
getPages,
getPreviousPage,
getShell,
getStartingPage,
getTitleBarColor,
getWindowTitle,
isHelpAvailable,
needsPreviousAndNextButtons,
needsProgressMonitor,
setContainer,
setDefaultPageImageDescriptor,
setDialogSettings,
setForcePreviousAndNextButtons,
setHelpAvailable,
setNeedsProgressMonitor,
setTitleBarColor,
setWindowTitle
|
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.wizard.
IWizard
|
canFinish,
dispose,
getContainer,
getDefaultPageImage,
getDialogSettings,
getNextPage,
getPage,
getPageCount,
getPages,
getPreviousPage,
getStartingPage,
getTitleBarColor,
getWindowTitle,
isHelpAvailable,
needsPreviousAndNextButtons,
needsProgressMonitor,
setContainer
|
mainPage
protected
SystemNewFilterWizardMainPage mainPage
infoPage
protected
SystemNewFilterWizardInfoPage infoPage
filterContainer
protected
ISystemFilterContainer filterContainer
parentPool
protected
ISystemFilterPool parentPool
poolsToSelectFrom
protected
ISystemFilterPool[] poolsToSelectFrom
type
protected
String type
defaultFilterStrings
protected
String[] defaultFilterStrings
showFilterStrings
protected boolean showFilterStrings
showNamePrompt
protected boolean showNamePrompt
showInfoPage
protected boolean showInfoPage
fromRSE
protected boolean fromRSE
page1DescriptionSet
protected boolean page1DescriptionSet
newFilter
protected
ISystemFilter newFilter
editPane
protected
SystemFilterStringEditPane editPane
provider
protected
ISystemFilterPoolReferenceManagerProvider provider
poolWrapperInformation
protected
ISystemFilterPoolWrapperInformation poolWrapperInformation
filterPoolSelectionValidator
protected
ISystemFilterPoolSelectionValidator filterPoolSelectionValidator
configurator
protected
ISystemNewFilterWizardConfigurator configurator
SystemNewFilterWizard
public SystemNewFilterWizard(
String title,
ImageDescriptor wizardImage,
ISystemFilterPool parentPool)
- Constructor when you want to supply your own title and image
-
Parameters:
-
title - - title to show for this wizard. This is used as the page title! The title is always "New"! -
wizardImage - - title bar image for this wizard -
parentPool - - the filter pool we are to create this filter in.
SystemNewFilterWizard
public SystemNewFilterWizard(
ISystemFilterPool parentPool)
- Constructor when you want to use the default page title and image, or want to
supply it via setWizardTitle and setWizardImage.
-
Parameters:
-
parentPool - - the filter pool we are to create this filter in.
SystemNewFilterWizard
public SystemNewFilterWizard(
ISystemNewFilterWizardConfigurator data,
ImageDescriptor wizardImage,
ISystemFilterPool parentPool)
- Constructor when you want to supply all your own configuration data
-
Parameters:
-
data - - configuration data -
wizardImage - - title bar image for this wizard -
parentPool - - the filter pool we are to create this filter in.
setAllowFilterPoolSelection
public void setAllowFilterPoolSelection(
ISystemFilterPool[] poolsToSelectFrom)
- 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)
- 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)
- Set the type of filter we are creating. Results in a call to setType 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.
-
getType
public
String getType()
- Get the type of filter as set by
setType(String)
-
setShowFilterStrings
public void setShowFilterStrings(boolean show)
- Call in order to not have the first page, but instead the name-prompt page. Default is true.
-
-
See Also:
-
setDefaultFilterStrings(String[])
setShowNamePrompt
public void setShowNamePrompt(boolean show)
- 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
-
setNamePageHelp
public void setNamePageHelp(
String helpId)
- Specify the help to show for the name page (page 2)
-
setShowInfoPage
public void setShowInfoPage(boolean show)
- Call in order to not show the final info-only page of the wizard. Default is true.
-
setDefaultFilterStrings
public void setDefaultFilterStrings(
String[] defaultFilterStrings)
- Call this if you want the filter to auto-include some default filter strings.
-
setFromRSE
public void setFromRSE(boolean rse)
- 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)
- Set the validator to call when the user selects a filter pool. Optional.
Only valid in create mode.
-
setSystemFilterPoolReferenceManagerProvider
public void setSystemFilterPoolReferenceManagerProvider(
ISystemFilterPoolReferenceManagerProvider provider)
- Set the contextual system filter pool reference manager provider. Eg, in the RSE, this
will be the selected subsystem if the New Filter action is launched from there, or if
launched from a filter pool reference under there.
Will be non-null if the current selection is a reference to a filter pool or filter,
or a reference manager provider.
This is passed into the filter and filter string wizards and dialogs in case it is needed
for context.
-
setVerbiage
public void setVerbiage(
String verbiage)
- 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.
-
setWizardPageTitle
public void setWizardPageTitle(
String pageTitle)
- Set the wizard page title. Using this makes it possible to avoid subclassing.
The page title goes below the wizard title, and can be unique per page. However,
typically the wizard page title is the same for all pages... eg "Filter".
This is not used by default, but can be queried via getPageTitle() when constructing
pages.
-
-
Specified by:
-
setWizardPageTitle
in interface
ISystemWizard
-
Overrides:
-
setWizardPageTitle
in class
AbstractSystemWizard
-
setPage1Description
public void setPage1Description(
String description)
- Set the description to display on the first page of the wizard
-
setFilterStringEditPane
public void setFilterStringEditPane(
SystemFilterStringEditPane editPane)
- Specify an edit pane that prompts the user for the contents of a filter string.
-
createMainPage
protected
SystemNewFilterWizardMainPage createMainPage()
- Extendable point for child classes. You don't need to override typically though... rather
you can simply supply your own filter string edit pane.
By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor.
-
-
Returns:
- the primary page prompting for a single filter string.
createNamePage
protected
SystemNewFilterWizardNamePage createNamePage()
- By default, this page uses the wizard page title as set in
setWizardPageTitle(...) or the constructor.
-
-
Returns:
- the wizard page prompting for the filter name and parent filter
pool
-
Since:
- 3.0 moved SystemNewFilterWizardNamePage from internal to API
createInfoPage
protected
SystemNewFilterWizardInfoPage createInfoPage()
- Extendable point for child classes. You don't need to override typically though.
By default, this page uses the wizard page title as set in setWizardPageTitle(...) or the constructor.
-
-
Returns:
- the final wizard page with additional readonly information
addPages
public void addPages()
- Override of parent to do nothing
-
-
Specified by:
-
addPages
in interface
IWizard
-
Specified by:
-
addPages
in class
AbstractSystemWizard
-
createPageControls
public void createPageControls(
Composite c)
- Creates the wizard pages.
This method is an override from the parent Wizard class.
-
-
Specified by:
-
createPageControls
in interface
IWizard
-
Overrides:
-
createPageControls
in class
Wizard
-
getFilterNameValidator
protected
ISystemValidator getFilterNameValidator(
ISystemFilterContainer container)
- Extendable point for child classes.
Override to change the validator used for the filter name given the master object.
By default, uses FilterNameValidator.
-
getFilterNameValidator
public static
ISystemValidator getFilterNameValidator(
ISystemFilterContainer container,
ISystemFilter filter)
- Reusable method to return a name validator for renaming a filter.
-
-
Parameters:
-
container - the current filter object on updates. Can be null for new names. Used
to remove from the existing name list the current filter's name. -
filter - the filter whose name should be removed from the validation list. May be null if the list from the container
should be used intact.
-
Returns:
- a name validator
areStringsCaseSensitive
public boolean areStringsCaseSensitive()
- Override if necessary.
Returns true if filter strings are case-sensitive in this filter.
By default, returns the value in the selected filter container. If this is null, returns false.
-
performFinish
public boolean performFinish()
- Completes processing of the wizard. If this
method returns true, the wizard will close;
otherwise, it will stay active.
This method is an override from the parent Wizard class.
-
-
Specified by:
-
performFinish
in interface
IWizard
-
Specified by:
-
performFinish
in class
AbstractSystemWizard
-
-
Returns:
- whether the wizard finished successfully
getParent
protected
Object getParent()
- Return the parent into which we are creating a filter. If filterContainer has been set,
returns that, else returns getInputObject() which is set by the calling action.
-
getFilterContainer
protected
ISystemFilterContainer getFilterContainer()
- Return parent filter container to contain this filter
-
setFilterContainer
public void setFilterContainer(
ISystemFilterContainer container)
- Set parent filter container to contain this filter
-
setFilterContainer
public void setFilterContainer(
ISystemFilterContainerReference containerRef)
- Set parent filter container to contain this filter
-
createNewFilter
public
ISystemFilter createNewFilter(
Shell shell,
ISystemFilterContainer filterParent,
String aliasName,
Vector filterStringsVector,
String type)
throws
Exception
- Extendable point for child classes.
Override to create unique SystemFilter object.
By default calls createSystemFilter in subsystem factory.
-
-
Parameters:
-
shell - the shell that hosts this wizard. -
filterParent - the parent of this filter - usually a filter pool -
aliasName - the name of the filter itself -
filterStringsVector - a Vector of string that contain the specification of this filter -
type - the type of the filter used when interpreting the filter, usually supplied by a subsystem
-
Returns:
- the ISystemFilter that was created
-
Throws:
-
Exception
- if an error occurs
isFromRSE
protected boolean isFromRSE()
- Return true if this filter is an RSE filter or not
-
getDefaultFilterName
public
String getDefaultFilterName()
- For page 2 of the New Filter wizard, if it is possible to
deduce a reasonable default name from the user input here,
then return it here. Else, just return null.
By default this calls getDefaultFilterName on the edit pane.
-
getSystemFilter
public
ISystemFilter getSystemFilter()
- Return the filter created upon successful finish
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|