RSE
Release 3.2

org.eclipse.rse.ui
Class SystemBaseForm

java.lang.Object
  extended by org.eclipse.rse.ui.SystemBaseForm
All Implemented Interfaces:
ISystemConnectionWizardErrorUpdater, Listener
Direct Known Subclasses:
ConnectorServicesForm, EnvironmentVariablesForm, RemoteBaseServerLauncherForm, ServicesForm, SystemChangeFilterPane

public abstract class SystemBaseForm
extends Object
implements Listener, ISystemConnectionWizardErrorUpdater

A reusable base form.

May be used to populate a dialog or a wizard page or properties page. Often we need to support multiple ways to edit the same thing, and we need to abstract out the client area. This base class puts some structure around these abstractions. Note we don't extend Composite. Rather the subclass will create and return the composite in createContents(). This offers us more flexibility in how/where this is used.

For error checking, subclasses should simply call setPageComplete whenever they do error checking (such as in response to an event). This will then call any interested listeners who have registered via addPageCompleteListener(ISystemPageCompleteListener). Error messages should be set via showErrorMessage(SystemMessage).


Field Summary
protected  boolean alreadyNotified
           
protected  Vector verifyListeners
           
 
Constructor Summary
SystemBaseForm(ISystemMessageLine msgLine)
          Deprecated. You should now use the constructor that takes a shell.
SystemBaseForm(Shell shell, ISystemMessageLine msgLine)
          Constructor.
 
Method Summary
protected  Label addFillerLine(Composite parent, int nbrColumns)
          Add a spacer line
protected  Label addGrowableFillerLine(Composite parent, int nbrColumns)
          Add a spacer line that grows in height to absorb extra space
 void addPageCompleteListener(ISystemPageCompleteListener l)
          Register an interest in knowing whenever setPageComplete(boolean) is called by subclass code.
protected  Label addSeparatorLine(Composite parent, int nbrColumns)
          Add a separator line.
 void addVerifyListener(ISystemVerifyListener l)
          Register an interest in knowing whenever the form is verified and error messages are updated.
abstract  Control createContents(Composite parent)
          CreateContents is the one method that must be overridden from the parent class.
protected  Object getInputObject()
          Return the input object as set by setInputObject(Object).
 ISystemMessageLine getMessageLine()
          Return the message line as set via setMessageLine
 Object getOutputObject()
          Return the output object as set by setOutputObject(Object).
 Shell getShell()
          Return the shell as set via setShell(Shell)
 String getTheErrorMessage()
           
 void handleEvent(Event evt)
          Default implementation to satisfy Listener interface.
 boolean isPageComplete()
          Return the current completeness value, as last set by setPageComplete(boolean).
protected  void notifyVerifyListeners()
           
 void removePageCompleteListener(ISystemPageCompleteListener l)
          De-register a page complete listener.
 void removePageCompleteListener(ISystemVerifyListener l)
          De-register a verify listener.
 void setInputObject(Object inputObject)
          Set the input object.
 void setMessageLine(ISystemMessageLine msgLine)
          Often the message line is null at the time of instantiation, so we have to call this after it is created.
protected  void setOutputObject(Object outputObject)
          Set the output object.
protected  void setPageComplete(boolean complete)
          The completeness of the page has changed.
 void setShell(Shell shell)
          Occassionally we don't know the shell at constructor time, so we need to be able to set it later
protected  void showErrorMessage(SystemMessage msg)
          Display error message or clear error message (if passed null)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verifyListeners

protected Vector verifyListeners

alreadyNotified

protected boolean alreadyNotified
Constructor Detail

SystemBaseForm

public SystemBaseForm(ISystemMessageLine msgLine)
Deprecated. You should now use the constructor that takes a shell.

Constructor.

Parameters:
msgLine - A GUI widget capable of writing error messages to.

SystemBaseForm

public SystemBaseForm(Shell shell,
                      ISystemMessageLine msgLine)
Constructor.

Parameters:
shell - The parent shell.
msgLine - A GUI widget capable of writing error messages to.
Method Detail

setMessageLine

public void setMessageLine(ISystemMessageLine msgLine)
Often the message line is null at the time of instantiation, so we have to call this after it is created.


getMessageLine

public ISystemMessageLine getMessageLine()
Return the message line as set via setMessageLine


setShell

public void setShell(Shell shell)
Occassionally we don't know the shell at constructor time, so we need to be able to set it later


getShell

public Shell getShell()
Return the shell as set via setShell(Shell)


setInputObject

public void setInputObject(Object inputObject)
Set the input object. This is usually set to the current selection, from where the dialog/page is launched. This matches similar inputObject support in the RSE classes for dialogs and wizards.
This is usually set by the using dialog/pane, and queried by this object.


getInputObject

protected Object getInputObject()
Return the input object as set by setInputObject(Object).


setOutputObject

protected void setOutputObject(Object outputObject)
Set the output object. This is usually set by this object, and is subsequently queried by the using dialog/page.


getOutputObject

public Object getOutputObject()
Return the output object as set by setOutputObject(Object).


handleEvent

public void handleEvent(Event evt)
Default implementation to satisfy Listener interface. Does nothing.

Specified by:
handleEvent in interface Listener

addPageCompleteListener

public void addPageCompleteListener(ISystemPageCompleteListener l)
Register an interest in knowing whenever setPageComplete(boolean) is called by subclass code.


removePageCompleteListener

public void removePageCompleteListener(ISystemPageCompleteListener l)
De-register a page complete listener.


setPageComplete

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

See Also:
addPageCompleteListener(ISystemPageCompleteListener)

isPageComplete

public boolean isPageComplete()
Return the current completeness value, as last set by setPageComplete(boolean).

Specified by:
isPageComplete in interface ISystemConnectionWizardErrorUpdater

createContents

public abstract Control createContents(Composite parent)
CreateContents is the one method that must be overridden from the parent class. In this method, we populate an SWT container with widgets and return the container to the caller (JFace). This is used as the contents of this page.

Parameters:
parent - The parent composite

showErrorMessage

protected void showErrorMessage(SystemMessage msg)
Display error message or clear error message (if passed null)


addSeparatorLine

protected Label addSeparatorLine(Composite parent,
                                 int nbrColumns)
Add a separator line. This is a physically visible line.


addFillerLine

protected Label addFillerLine(Composite parent,
                              int nbrColumns)
Add a spacer line


addGrowableFillerLine

protected Label addGrowableFillerLine(Composite parent,
                                      int nbrColumns)
Add a spacer line that grows in height to absorb extra space


addVerifyListener

public void addVerifyListener(ISystemVerifyListener l)
Register an interest in knowing whenever the form is verified and error messages are updated.

Specified by:
addVerifyListener in interface ISystemConnectionWizardErrorUpdater

notifyVerifyListeners

protected void notifyVerifyListeners()

removePageCompleteListener

public void removePageCompleteListener(ISystemVerifyListener l)
De-register a verify listener.


getTheErrorMessage

public String getTheErrorMessage()
Specified by:
getTheErrorMessage in interface ISystemConnectionWizardErrorUpdater

RSE
Release 3.2

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