|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.ui.filters.SystemFilterStringEditPane
public class SystemFilterStringEditPane
This class prompts the user to create or edit the contents of a single filter string. This edit pane is used in many places, so creating a decent looking subclass is important:
Field Summary | |
---|---|
protected boolean |
changeFilterMode
|
protected int |
currentSelectionIndex
|
protected Button |
dlgTestButton
|
protected boolean |
editable
|
protected SystemMessage |
errorMessage
|
protected boolean |
ignoreChanges
|
protected String |
inputFilterString
|
protected Label |
labelString
|
protected Vector |
listeners
|
protected boolean |
newMode
|
protected ISystemFilterPoolManagerProvider |
provider
|
protected ISystemFilterPoolReferenceManagerProvider |
refProvider
|
protected Shell |
shell
|
protected boolean |
skipEventFiring
|
protected Text |
textString
|
protected String |
type
|
Constructor Summary | |
---|---|
SystemFilterStringEditPane(Shell shell)
Constructor for SystemFilterStringEditPane. |
Method Summary | |
---|---|
void |
addChangeListener(ISystemFilterStringEditPaneListener l)
Configuration method, called from Change Filter dialog and New Filter wizard. |
protected void |
addFillerLine(Composite parent,
int nbrColumns)
Helper method. |
protected void |
addGrowableFillerLine(Composite parent,
int nbrColumns)
Helper method. |
protected void |
addSeparatorLine(Composite parent,
int nbrColumns)
Helper method. |
boolean |
areErrorsPending()
Lifecycle method. |
protected boolean |
areFieldsComplete()
Overridable lifecycle method. |
boolean |
canSaveImplicitly()
Returns whether filter string can be saved implicitly. |
void |
clearErrorsPending()
Lifecycle method. |
void |
configureHeadingLabel(Label label)
Overridable configuration method, called from Change Filter dialog and New Filter wizard. |
Control |
createContents(Composite parent)
Overridable lifecycle method. |
protected void |
doInitializeFields()
Overridable lifecycle method. |
protected void |
enable(Control control,
boolean enabled)
Set the enabled state of a particular control. |
protected void |
fireBackupChangeEvent()
Tell interested callers to backup changes-pending state, as we are about to fire a change event, after which we will want to restore state. |
protected void |
fireChangeEvent(SystemMessage error)
Private method. |
protected void |
fireRestoreChangeEvent()
Private method. |
int |
getCurrentSelectionIndex()
Getter method. |
String |
getDefaultFilterName()
Overridable getter method. |
boolean |
getEditable()
|
String |
getFilterString()
Overridable getter method. |
protected String |
getFilterStringPromptLabel()
|
protected String |
getFilterStringPromptTooltip()
|
Control |
getInitialFocusControl()
Overridable lifecycle method. |
protected String |
getInputFilterString()
Helper method. |
protected Shell |
getShell()
Helper method. |
ISystemFilterPoolManagerProvider |
getSystemFilterPoolManagerProvider()
Getter method, for the use of subclasses. |
ISystemFilterPoolReferenceManagerProvider |
getSystemFilterPoolReferenceManagerProvider()
Getter method, for the use of subclasses. |
boolean |
isComplete()
Lifecycle method. |
void |
processTest(Shell shell)
Overridable method, if subclass supports a Test button. |
void |
removeChangeListener(ISystemFilterStringEditPaneListener l)
Configuration method, called from Change Filter dialog and New Filter wizard. |
protected void |
resetFields()
Overridable lifecycle method. |
void |
setChangeFilterMode(boolean changeMode)
Configuration method, called from Change Filter dialog. |
void |
setEditable(boolean editable)
Sets whether or not the edit pane is not to be editable. |
void |
setFilterString(String filterString,
int selectionIndex)
Configuration method, called from Change Filter dialog and New Filter wizard. |
protected void |
setIgnoreChanges(boolean ignoreChanges)
Lifecyle method. |
void |
setInputFilterString(String filterString)
Configuration method, called from Change Filter dialog and New Filter wizard. |
void |
setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
Configuration method, called from Change Filter dialog and New Filter wizard. |
void |
setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
Configuration method, called from Change Filter dialog and New Filter wizard. |
void |
setTestButton(Button button)
Configuration method, called from Change Filter dialog and New Filter wizard. |
void |
setType(String type)
Helper method you do not need to ever override. |
protected SystemMessage |
validateStringInput()
Overridable lifecycle method. |
SystemMessage |
verify()
Overridable lifecycle method. |
void |
widgetDefaultSelected(SelectionEvent event)
Overridable lifecycle method. |
void |
widgetSelected(SelectionEvent event)
Overridable lifecycle method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Shell shell
protected String inputFilterString
protected Vector listeners
protected ISystemFilterPoolReferenceManagerProvider refProvider
protected ISystemFilterPoolManagerProvider provider
protected String type
protected boolean newMode
protected boolean changeFilterMode
protected boolean ignoreChanges
protected boolean editable
protected Label labelString
protected Text textString
protected Button dlgTestButton
protected SystemMessage errorMessage
protected boolean skipEventFiring
protected int currentSelectionIndex
Constructor Detail |
---|
public SystemFilterStringEditPane(Shell shell)
shell
- - the shell of the wizard or dialog host thisMethod Detail |
---|
protected Shell getShell()
protected String getInputFilterString()
protected void addSeparatorLine(Composite parent, int nbrColumns)
protected void addFillerLine(Composite parent, int nbrColumns)
protected void addGrowableFillerLine(Composite parent, int nbrColumns)
public void setFilterString(String filterString, int selectionIndex)
filterString
- - the filter string to edit or null if new modeselectionIndex
- - the index of the currently selected filter string. Only used for getCurrentSelectionIndex().public void setInputFilterString(String filterString)
protected void setIgnoreChanges(boolean ignoreChanges)
public void addChangeListener(ISystemFilterStringEditPaneListener l)
public void removeChangeListener(ISystemFilterStringEditPaneListener l)
public void setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider provider)
Will be non-null if the current selection is a reference to a filter pool or filter, or a reference manager provider.
This is not used by default but made available for subclasses.
setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider)
public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider provider)
Will be non-null if the current selection is a reference to a filter pool or filter, or a filter pool or filter, or a manager provider itself.
This is not used by default but made available for subclasses.
setSystemFilterPoolReferenceManagerProvider(ISystemFilterPoolReferenceManagerProvider)
public ISystemFilterPoolReferenceManagerProvider getSystemFilterPoolReferenceManagerProvider()
This is not used by default but made available for subclasses.
public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider()
This is not used by default but made available for subclasses.
public void setType(String type)
This simply sets the type instance variable, so that subclassing code may access it if it needs to know what type of filter is being created. This method is called by the setType method in the SystemNewFilterWizard wizard.
public void setChangeFilterMode(boolean changeMode)
public void setTestButton(Button button)
public void processTest(Shell shell)
public void setEditable(boolean editable)
Subclasses should call super to ensure that the "editable" flag is set properly. Controls which are not instantiated in this call will be ignored.
editable
- true if the controls in this pane are to be editable.
Usually set to true, but if the filter is not modifiable it will be
set to false.protected void enable(Control control, boolean enabled)
control
- the control of which to set the stateenabled
- the enabled statepublic boolean getEditable()
public String getFilterString()
This is the functional opposite of doInitializeFields, which tears apart the input string in update mode, to populate the GUIs. This method creates the filter string from the information in the GUI.
public int getCurrentSelectionIndex()
public String getDefaultFilterName()
public void configureHeadingLabel(Label label)
This method gives subclasses the opportunity to specify unique values for this label. In addition to setting the text, the tooltip text should also be set.
Defaults are supplied.
public Control createContents(Composite parent)
parent
- - the composite that will be the parent of the returned client area composite
SystemWidgetHelpers
public Control getInitialFocusControl()
protected String getFilterStringPromptLabel()
protected String getFilterStringPromptTooltip()
protected void doInitializeFields()
protected void resetFields()
public boolean isComplete()
areFieldsComplete()
.
This is called by the wizard page when first shown, to decide if the default information is complete enough to enable finish. It doesn't do validation, that will be done when finish is pressed.
protected boolean areFieldsComplete()
This is called by the isComplete, to decide if the default information is complete enough to enable finish. It doesn't do validation, that will be done when finish is pressed.
public boolean areErrorsPending()
public void clearErrorsPending()
protected void fireChangeEvent(SystemMessage error)
Because this is used to enable/disable the Next and Finish buttons it is important to call it when asked to do verification, even if nothing has changed.
It is more efficient, however, to defer the event firing during a full verification until after the last widget has been verified. To enable this, set the protected variable "skipEventFiring" to true at the top of your verify event, then to "false" at the end. Then do fireChangeEvent(errorMessage);
protected void fireBackupChangeEvent()
protected void fireRestoreChangeEvent()
protected SystemMessage validateStringInput()
public SystemMessage verify()
Default implementation calls validateStringInput()
.
public void widgetSelected(SelectionEvent event)
widgetSelected
in interface SelectionListener
public void widgetDefaultSelected(SelectionEvent event)
widgetDefaultSelected
in interface SelectionListener
public boolean canSaveImplicitly()
false
,
and the user has pending changes when he clicks on another entry in the filter string list, we will
not ask user to save pending changes.
By default, returns true
true
to query user to save pending changes, false
otherwise.
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |