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
Class SystemChangeFilterPane


java.lang.Object
  extended by 

org.eclipse.rse.ui.SystemBaseForm
      extended by 
org.eclipse.rse.ui.filters.SystemChangeFilterPane
All Implemented Interfaces:
EventListener, IMenuListener, ISystemFilterStringEditPaneListener, ISystemConnectionWizardErrorUpdater, SelectionListener, org.eclipse.swt.internal.SWTEventListener, Listener

public class SystemChangeFilterPane
extends SystemBaseForm
implements SelectionListener, ISystemFilterStringEditPaneListener, IMenuListener

Since we have decided to allow the same editing in both the Change Filter dialog and the Properties page, we have to abstract the meat of the change filter dialog into a re-usable composite. That is what this is, and it is used by both the dialog and the property page.


Field Summary
protected  boolean allowDuplicateStrings
           
protected   Button applyButton
           
protected  boolean caseSensitiveStrings
           
protected   SystemMessage duplicateFilterStringMsg
           
protected  boolean editable
           
protected   ISystemChangeFilterPaneEditPaneSupplier editPaneSupplier
           
protected   Label filterNameLabel
           
protected   Label filterPoolNameLabel
           
protected   ISystemValidator filterStringValidator
           
protected   Label fsLabel
           
protected  boolean giveEditorFocus
           
protected  boolean ignoreEvents
           
protected   ISystemFilter inputFilter
           
protected   String[] listItems
           
protected   String listPromptLabel
           
protected   String listPromptTip
           
protected   List listView
           
protected   String namePromptLabel
           
protected   String namePromptTip
           
protected   String newEntryLabel
           
protected   String poolPromptLabel
           
protected   String poolPromptTip
           
protected   ISystemFilterPoolManagerProvider provider
           
protected   ISystemFilterPoolReferenceManagerProvider refProvider
           
protected  boolean resetting
           
protected   Button revertButton
           
protected  boolean showingNew
           
protected   SystemEditPaneStateMachine sm
           
protected  boolean supportsMultipleStrings
           
protected   Button testButton
           
protected  boolean wantTestButton
           
 
Fields inherited from class org.eclipse.rse.ui. SystemBaseForm
alreadyNotified, verifyListeners
 
Constructor Summary
SystemChangeFilterPane ( Shell shell, ISystemMessageLine msgLine, ISystemChangeFilterPaneEditPaneSupplier editPaneSupplier)
          Constructor.
 
Method Summary
protected  void applyPressed ()
          User pressed Apply to save the pending changes the current filter string
 void backupChangedState ()
          Callback method.
 boolean canCopy ()
          Decide if we can do the copy or not.
 boolean canDelete ()
          Decide if we can do the delete or not.
 boolean canMoveDown ()
          Decide if we can do the move down or not.
 boolean canMoveUp ()
          Decide if we can do the move up or not.
 boolean canPaste ()
          Decide if we can do the paste or not.
protected   String checkForDuplicates ()
          This hook method is called when ok is pressed.
 boolean compareFilterStrings (boolean caseSensitive, String filterString1, String filterString2)
          Compares one filter string to another, while searching for duplicates.
  Control createContents ( Composite parent)
          Populates the content area
protected   String createFilterString ()
          Create a new filter string from the contents of the filter string edit pane
 void createStandardGroups ( IMenuManager menu)
          Creates the Systems plugin standard groups in a context menu.
 void doCopy ()
          Actually do the copy of the current filter string to the clipboard.
 void doDelete ()
          Perform the delete action
 void doMoveDown ()
          Perform the move down action
 void doMoveUp ()
          Perform the move up action
 void doPaste ()
          Actually do the copy of the current filter string to the clipboard.
 void fillContextMenu ( IMenuManager menu)
          This is method is called to populate the popup menu
 void filterStringChanged ( SystemMessage message)
          Callback method from the edit pane.
  Button getApplyButton ()
          Return the Apply button
protected   String getCurrentSelection ()
          Return currently selected filter string
  SystemMessage getDuplicateFilterStringErrorMessage ()
          Return results of setDuplicateFilterStringErrorMessage(SystemMessage)
 boolean getEditable ()
          Return whether the edit pane is editable, as set by setEditable(boolean)
protected   SystemFilterStringEditPane getFilterStringEditPane ( Shell shell)
          Return our edit pane, by referring back to our caller.
  ISystemValidator getFilterStringValidator ()
          Return the result of setFilterStringValidator(ISystemValidator).
  Control getInitialFocusControl ()
          Returns the control (the list view) to recieve initial focus control
  String getListLabel ()
          Return list label as set by setListLabel(String, String)
  String getListTip ()
          Return list tip as set by setListLabel(String, String)
  String getNamePromptLabel ()
          Return the name prompt label as set by setNamePromptLabel(String, String)
  String getNamePromptTip ()
          Return the name prompt tip as set by setNamePromptLabel(String, String)
  String getNewListItemText ()
          Return the text for the list item, as set by setNewListItemText(String), or the default if not set.
  String getParentPoolPromptLabel ()
          Return the parent filter pool prompt label, as set by setParentPoolPromptLabel(String, String)
  String getParentPoolPromptTip ()
          Return the parent filter pool prompt tip, as set by setParentPoolPromptLabel(String, String)
  Button getRevertButton ()
          Return the Revert button
 boolean getSupportsMultipleStrings ()
          Return whether the user is to be allowed to create multiple filter strings or not.
 boolean getWantTestButton ()
          Return whether a test button is wanted or not, as set by setWantTestButton(boolean)
protected  void handleNewFilterStringItemSelection ()
          Handles new filter string selection from the filter string list.
protected  boolean isNewSelected ()
          Return true if currently selected item is "New"
 void menuAboutToShow ( IMenuManager menu)
          Called when the context menu is about to open.
 boolean processCancel ()
          Call when user presses Cancel button in containing dialog.
 boolean processOK ()
          Call when user presses OK button on containing dialog or pane.
 void restoreChangedState ()
          Callback method.
protected  void revertPressed ()
          User pressed Revert to discard the pending changes the current filter string
protected  void saveFilterString ( String editedFilterString, int currSelectionIndex)
          Update the current selection with the values in the edit pane
 void setDuplicateFilterStringErrorMessage ( SystemMessage msg)
          Configuration method
Set the error message to use when the user is editing or creating a filter string, and the Apply processing detects a duplicate filter string in the list.
 void setEditable (boolean editable)
          Set if the edit pane is not to be editable
 void setFilterStringValidator ( ISystemValidator v)
          Configuration method
Call this to specify a validator for the filter string.
 void setInputObject ( Object inputObject)
          Intercept of parent so we can set the input filter, and deduce whether strings are case sensitive and if duplicates are allowed.
 void setListLabel ( String label, String tip)
          Configuration method
Set the label shown in group box around the filter string list, and the tooltip text for the list box.
 void setNamePromptLabel ( String label, String tip)
          Configuration method
Set the name prompt label and tooltip text.
 void setNewListItemText ( String label)
          Set the string to show as the first item in the list.
 void setPageComplete (boolean complete)
          The completeness of the page has changed.
 void setParentPoolPromptLabel ( String label, String tip)
          Configuration method
Set the Parent Filter Pool prompt label and tooltip text.
 void setSupportsMultipleStrings (boolean multi)
          Set if the user is to be allowed to create multiple filter strings or not.
 void setSystemFilterPoolManagerProvider ( ISystemFilterPoolManagerProvider provider)
          Configuration method
Set the contextual system filter pool manager provider.
 void setSystemFilterPoolReferenceManagerProvider ( ISystemFilterPoolReferenceManagerProvider provider)
          Configuration method
Set the contextual system filter pool reference manager provider.
 void setWantTestButton (boolean wantTestButton)
          Configuration method
Specify if you want to include a test button or not.
 boolean verify (boolean doSave)
          Perform the same validation that is done when OK is pressed.
 void widgetDefaultSelected ( SelectionEvent e)
          Handles events generated by controls on this page.
 void widgetSelected ( SelectionEvent e)
          Handles events generated by controls on this page.
 
Methods inherited from class org.eclipse.rse.ui. SystemBaseForm
addFillerLine, addGrowableFillerLine, addPageCompleteListener, addSeparatorLine, addVerifyListener, getInputObject, getMessageLine, getOutputObject, getShell, getTheErrorMessage, handleEvent, isPageComplete, notifyVerifyListeners, removePageCompleteListener, removePageCompleteListener, setMessageLine, setOutputObject, setShell, showErrorMessage
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applyButton

protected 
Button applyButton

revertButton

protected 
Button revertButton

testButton

protected 
Button testButton

sm

protected 
SystemEditPaneStateMachine sm

listView

protected 
List listView

filterNameLabel

protected 
Label filterNameLabel

filterPoolNameLabel

protected 
Label filterPoolNameLabel

fsLabel

protected 
Label fsLabel

editPaneSupplier

protected 
ISystemChangeFilterPaneEditPaneSupplier editPaneSupplier

inputFilter

protected 
ISystemFilter inputFilter

refProvider

protected 
ISystemFilterPoolReferenceManagerProvider refProvider

provider

protected 
ISystemFilterPoolManagerProvider provider

namePromptLabel

protected 
String namePromptLabel

namePromptTip

protected 
String namePromptTip

poolPromptLabel

protected 
String poolPromptLabel

poolPromptTip

protected 
String poolPromptTip

listPromptLabel

protected 
String listPromptLabel

listPromptTip

protected 
String listPromptTip

newEntryLabel

protected 
String newEntryLabel

filterStringValidator

protected 
ISystemValidator filterStringValidator

duplicateFilterStringMsg

protected 
SystemMessage duplicateFilterStringMsg

wantTestButton

protected boolean wantTestButton

editable

protected boolean editable

caseSensitiveStrings

protected boolean caseSensitiveStrings

allowDuplicateStrings

protected boolean allowDuplicateStrings

ignoreEvents

protected boolean ignoreEvents

resetting

protected boolean resetting

giveEditorFocus

protected boolean giveEditorFocus

showingNew

protected boolean showingNew

supportsMultipleStrings

protected boolean supportsMultipleStrings

listItems

protected 
String[] listItems
Constructor Detail

SystemChangeFilterPane

public SystemChangeFilterPane(
Shell shell,
                              
ISystemMessageLine msgLine,
                              
ISystemChangeFilterPaneEditPaneSupplier editPaneSupplier)
Constructor.

Method Detail

setSystemFilterPoolReferenceManagerProvider

public void setSystemFilterPoolReferenceManagerProvider(
ISystemFilterPoolReferenceManagerProvider provider)
Configuration method
Set the contextual system filter pool reference manager 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 passed into the filter and filter string wizards and dialogs in case it is needed for context.


setSystemFilterPoolManagerProvider

public void setSystemFilterPoolManagerProvider(
ISystemFilterPoolManagerProvider provider)
Configuration method
Set the contextual system filter pool manager provider. Will be non-null if the current selection is a filter pool or filter, or reference to them, or a manager provider. Generally this is called when the setSystemFilterPoolReferenceManagerProvider can't be called for some reason.

This is passed into the filter and filter string wizards and dialogs in case it is needed for context.


setParentPoolPromptLabel

public void setParentPoolPromptLabel(
String label,
                                     
String tip)
Configuration method
Set the Parent Filter Pool prompt label and tooltip text.


getParentPoolPromptLabel

public 
String getParentPoolPromptLabel()
Return the parent filter pool prompt label, as set by setParentPoolPromptLabel(String, String)


getParentPoolPromptTip

public 
String getParentPoolPromptTip()
Return the parent filter pool prompt tip, as set by setParentPoolPromptLabel(String, String)


setNamePromptLabel

public void setNamePromptLabel(
String label,
                               
String tip)
Configuration method
Set the name prompt label and tooltip text.


getNamePromptLabel

public 
String getNamePromptLabel()
Return the name prompt label as set by setNamePromptLabel(String, String)


getNamePromptTip

public 
String getNamePromptTip()
Return the name prompt tip as set by setNamePromptLabel(String, String)


setListLabel

public void setListLabel(
String label,
                         
String tip)
Configuration method
Set the label shown in group box around the filter string list, and the tooltip text for the list box.


getListLabel

public 
String getListLabel()
Return list label as set by setListLabel(String, String)


getListTip

public 
String getListTip()
Return list tip as set by setListLabel(String, String)


setNewListItemText

public void setNewListItemText(
String label)
Set the string to show as the first item in the list. The default is "New filter string"


getNewListItemText

public 
String getNewListItemText()
Return the text for the list item, as set by setNewListItemText(String), or the default if not set.


setFilterStringValidator

public void setFilterStringValidator(
ISystemValidator v)
Configuration method
Call this to specify a validator for the filter string. It will be called per keystroke. A default validator is supplied otherwise: ValidatorFilterString.

Your validator should extend ValidatorFilterString to inherited the uniqueness error checking.

Alternatively, if all you want is a unique error message for the case when duplicates are found, call setDuplicateFilterStringErrorMessage, and it will be used in the default validator.


getFilterStringValidator

public 
ISystemValidator getFilterStringValidator()
Return the result of setFilterStringValidator(ISystemValidator).


setDuplicateFilterStringErrorMessage

public void setDuplicateFilterStringErrorMessage(
SystemMessage msg)
Configuration method
Set the error message to use when the user is editing or creating a filter string, and the Apply processing detects a duplicate filter string in the list.


getDuplicateFilterStringErrorMessage

public 
SystemMessage getDuplicateFilterStringErrorMessage()
Return results of setDuplicateFilterStringErrorMessage(SystemMessage)


setWantTestButton

public void setWantTestButton(boolean wantTestButton)
Configuration method
Specify if you want to include a test button or not. Appears with "Apply" and "Reset"


getWantTestButton

public boolean getWantTestButton()
Return whether a test button is wanted or not, as set by setWantTestButton(boolean)


setEditable

public void setEditable(boolean editable)
Set if the edit pane is not to be editable


getEditable

public boolean getEditable()
Return whether the edit pane is editable, as set by setEditable(boolean)


setSupportsMultipleStrings

public void setSupportsMultipleStrings(boolean multi)
Set if the user is to be allowed to create multiple filter strings or not. Default is true


getSupportsMultipleStrings

public boolean getSupportsMultipleStrings()
Return whether the user is to be allowed to create multiple filter strings or not. Default is true


setInputObject

public void setInputObject(
Object inputObject)
Intercept of parent so we can set the input filter, and deduce whether strings are case sensitive and if duplicates are allowed.
Not typically overridden, but if you do, be sure to call super!

Overrides:
setInputObject in class SystemBaseForm

getInitialFocusControl

public 
Control getInitialFocusControl()
Returns the control (the list view) to recieve initial focus control


createContents

public 
Control createContents(
Composite parent)
Populates the content area

Specified by:
createContents in class SystemBaseForm
Parameters:
parent - The parent composite

getFilterStringEditPane

protected 
SystemFilterStringEditPane getFilterStringEditPane(
Shell shell)
Return our edit pane, by referring back to our caller. You can use this, but do not override it!


getApplyButton

public 
Button getApplyButton()
Return the Apply button


getRevertButton

public 
Button getRevertButton()
Return the Revert button


processOK

public boolean processOK()
Call when user presses OK button on containing dialog or pane. This is when we save all the changes the user made. Return true to close dialog. Return false to not close dialog.


verify

public boolean verify(boolean doSave)
Perform the same validation that is done when OK is pressed.

Parameters:
doSave - - true to actually save pending changes in filter string editor (eg, when called when actually processing OK).

processCancel

public boolean processCancel()
Call when user presses Cancel button in containing dialog. We simply blow away all their changes! Return true to close dialog. Return false to not close dialog.


widgetSelected

public void widgetSelected(
SelectionEvent e)
Handles events generated by controls on this page.

Specified by:
widgetSelected in interface SelectionListener

applyPressed

protected void applyPressed()
User pressed Apply to save the pending changes the current filter string


revertPressed

protected void revertPressed()
User pressed Revert to discard the pending changes the current filter string


widgetDefaultSelected

public void widgetDefaultSelected(
SelectionEvent e)
Handles events generated by controls on this page.

Specified by:
widgetDefaultSelected in interface SelectionListener

setPageComplete

public void setPageComplete(boolean complete)
The completeness of the page has changed. We direct it to the Apply button versus just the OK button

Overrides:
setPageComplete in class SystemBaseForm
See Also:
SystemBaseForm.addPageCompleteListener(ISystemPageCompleteListener)

isNewSelected

protected boolean isNewSelected()
Return true if currently selected item is "New"


getCurrentSelection

protected 
String getCurrentSelection()
Return currently selected filter string


createFilterString

protected 
String createFilterString()
Create a new filter string from the contents of the filter string edit pane


saveFilterString

protected void saveFilterString(
String editedFilterString,
                                int currSelectionIndex)
Update the current selection with the values in the edit pane


filterStringChanged

public void filterStringChanged(
SystemMessage message)
Callback method from the edit pane. The user has changed the filter string. It may or may not be valid. If not, the given message is non-null. If it is, and you want it, call getSystemFilterString() in the edit pane.

Specified by:
filterStringChanged in interface ISystemFilterStringEditPaneListener

backupChangedState

public void backupChangedState()
Callback method. We are about to do a verify,the side effect of which is to change the current state of the dialog, which we don't want. This tells the dialog to back up that state so it can be restored.

Specified by:
backupChangedState in interface ISystemFilterStringEditPaneListener

restoreChangedState

public void restoreChangedState()
Callback method. After backup and change events this is called to restore state

Specified by:
restoreChangedState in interface ISystemFilterStringEditPaneListener

menuAboutToShow

public void menuAboutToShow(
IMenuManager menu)
Called when the context menu is about to open. Calls fillContextMenu(IMenuManager)

Specified by:
menuAboutToShow in interface IMenuListener

fillContextMenu

public void fillContextMenu(
IMenuManager menu)
This is method is called to populate the popup menu


createStandardGroups

public void createStandardGroups(
IMenuManager menu)
Creates the Systems plugin standard groups in a context menu.


canDelete

public boolean canDelete()
Decide if we can do the delete or not. Will decide the enabled state of the delete action.


doDelete

public void doDelete()
Perform the delete action


handleNewFilterStringItemSelection

protected void handleNewFilterStringItemSelection()
Handles new filter string selection from the filter string list. Enables/disables Create button depending on whether the default filter string is valid.


canMoveUp

public boolean canMoveUp()
Decide if we can do the move up or not. Will decide the enabled state of the move up action.


doMoveUp

public void doMoveUp()
Perform the move up action


canMoveDown

public boolean canMoveDown()
Decide if we can do the move down or not. Will decide the enabled state of the move down action.


doMoveDown

public void doMoveDown()
Perform the move down action


canCopy

public boolean canCopy()
Decide if we can do the copy or not. Will decide the enabled state of the copy action.


doCopy

public void doCopy()
Actually do the copy of the current filter string to the clipboard.


canPaste

public boolean canPaste()
Decide if we can do the paste or not. Will decide the enabled state of the copy action.


doPaste

public void doPaste()
Actually do the copy of the current filter string to the clipboard. If an existing string is selected, it is pasted before it. Else. it is appended to the end of the list.


checkForDuplicates

protected 
String checkForDuplicates()
This hook method is called when ok is pressed. It checks for blatantly duplicate filter strings.

Returns:
filterstring duplicate if there ARE duplicates. NULL if there are no duplicates

compareFilterStrings

public boolean compareFilterStrings(boolean caseSensitive,
                                    
String filterString1,
                                    
String filterString2)
Compares one filter string to another, while searching for duplicates. Override if you want to do more intelligent compares. This one checks for equality. The case-sensitivity is specified by the caller.


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