Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.ui.filters.actions
Class SystemNewFilterAction


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 

org.eclipse.jface.action.AbstractAction
          extended by 

org.eclipse.jface.action.Action
              extended by 

org.eclipse.rse.ui.actions.SystemBaseAction
                  extended by 

org.eclipse.rse.ui.actions.SystemBaseDialogAction
                      extended by 

org.eclipse.rse.ui.actions.SystemBaseWizardAction
                          extended by 
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.


Field Summary
protected   ISystemNewFilterActionConfigurator callbackConfigurator
           
protected  boolean callbackConfiguratorCalled
           
protected   Object callbackData
           
protected   String[] defaultFilterStrings
           
protected   SystemFilterStringEditPane editPane
           
protected   ISystemFilterPoolSelectionValidator filterPoolSelectionValidator
           
protected  boolean fromRSE
           
protected   String namePageHelp
           
protected  boolean nested
           
protected   String page1Description
           
protected   ISystemFilterPool parentPool
           
protected   ISystemFilterPool[] poolsToSelectFrom
           
protected   ISystemFilterPoolWrapperInformation poolWrapperInformation
           
protected  boolean showFilterStrings
           
protected  boolean showInfoPage
           
protected  boolean showNamePrompt
           
protected   String type
           
protected   String verbiage
           
 
Fields inherited from class org.eclipse.rse.ui.actions. SystemBaseDialogAction
cancelled, dlgHelpId, needsProgressMonitor, needsProgressMonitorSet, processAll, value
 
Fields inherited from class org.eclipse.rse.ui.actions. SystemBaseAction
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
 
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.
 
Method Summary
 boolean checkObjectType ( Object selectedObject)
          Lifecyle method.
protected  void configureNewFilter ( ISystemFilter newFilter)
           Overridable configuration method.
protected  void configureNewFilterWizard ( SystemNewFilterWizard wizard)
           Overridable configuration method.
protected   SystemNewFilterWizard createNewFilterWizard ( ISystemFilterPool parentPool)
           Overridable lifecyle method.
protected   IWizard createWizard ()
          Lifecyle method.
  String getFilterString ()
          Output method.
  String[] getFilterStrings ()
          Output method.
  ISystemFilter getNewFilter ()
          Output method.
  ISystemFilterPoolReferenceManagerProvider getSystemFilterPoolReferenceManagerProvider ()
          Output method.
  String getType ()
          Getter method.
protected  void postProcessWizard ( IWizard wizard)
          Lifecyle method.
 void setAllowFilterPoolSelection ( ISystemFilterPool[] poolsToSelectFrom)
          Configuration method.
 void setAllowFilterPoolSelection ( ISystemFilterPoolWrapperInformation poolsToSelectFrom)
          Configuration method.
 void setCallBackConfigurator ( ISystemNewFilterActionConfigurator caller, Object data)
          Configuration method.
 void setDefaultFilterStrings ( String[] defaultFilterStrings)
          Configuration method.
 void setFilterPoolSelectionValidator ( ISystemFilterPoolSelectionValidator validator)
          Configuration method.
 void setFilterStringEditPane ( SystemFilterStringEditPane editPane)
          Configuration method.
 void setFromRSE (boolean rse)
          Configuration method.
 void setHelpContextId ( String id)
          Configuration method.
 void setNamePageHelp ( String helpId)
          Configuration method.
 void setPage1Description ( String description)
          Configuration method.
 void setParentFilterPool ( ISystemFilterPool parentPool)
          Configuration method.
 void setShowFilterStrings (boolean show)
          Configuration method.
 void setShowInfoPage (boolean show)
          Configuration method.
 void setShowNamePrompt (boolean show)
          Configuration method.
 void setType ( String type)
          Configuration method.
 void setVerbiage ( String verbiage)
          Configuration method.
 
Methods inherited from class org.eclipse.rse.ui.actions. SystemBaseWizardAction
createDialog, doCreateWizardDialog, getDialogValue, getWizardPageTitle, setMinimumPageSize, setWizardImage, setWizardPageTitle, setWizardTitle, wasCancelled
 
Methods inherited from class org.eclipse.rse.ui.actions. SystemBaseDialogAction
getDialogHelpContextId, getNeedsProgressMonitor, getProcessAllSelections, getValue, run, setDialogHelp, setNeedsProgressMonitor, setProcessAllSelections, setValue, wasNeedsProgressMonitorSet
 
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 org.eclipse.jface.action. AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common. EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
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. ISystemDialogAction
getValue, setProcessAllSelections, setValue
 
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
 
Methods inherited from interface org.eclipse.jface.viewers. ISelectionChangedListener
selectionChanged
 

Field Detail

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
Constructor Detail

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.

Method Detail

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].


RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire