RSE
Release 1.0

org.eclipse.rse.ui
Class SystemProfileForm

java.lang.Object
  extended byorg.eclipse.rse.ui.SystemProfileForm
All Implemented Interfaces:
Listener

public class SystemProfileForm
extends Object
implements Listener

A reusable form for prompting for profile information, in new or update mode.

May be used to populate a dialog or a wizard page.


Field Summary
protected  Object caller
           
protected  boolean callerInstanceOfSystemPromptDialog
           
protected  boolean callerInstanceOfWizardPage
           
protected  ISystemMessageLine msgLine
           
protected  ISystemValidator nameValidator
           
protected  ISystemProfile profile
           
protected  Label profileLabel
           
protected  Text profileName
           
protected static int profileNameLength
           
protected  Control verbage
           
 
Constructor Summary
SystemProfileForm(ISystemMessageLine msgLine, Object caller, ISystemProfile profile, boolean showVerbage)
          Constructor.
 
Method Summary
 Control createContents(Composite parent)
          CreateContents is the one method that must be overridden from the parent class.
 Control getInitialFocusControl()
          Return control to recieve initial focus
 String getProfileName()
          Return user-entered profile Name.
 void handleEvent(Event evt)
          Default implementation to satisfy Listener interface.
 boolean isPageComplete()
          This method can be called by the dialog or wizard page host, to decide whether to enable or disable the next, final or ok buttons.
 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.
 void setNameValidators(ISystemValidator v)
          Call this to specify a validator for the profile name.
 void setPageComplete()
          Inform caller of page-complete status of this form
 void setProfileName(String name)
          Call to initialize the profile name in create mode.
protected  SystemMessage validateNameInput()
          This hook method is called whenever the text changes in the input field.
 boolean verify()
          Verifies all input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profileLabel

protected Label profileLabel

verbage

protected Control verbage

profileName

protected Text profileName

msgLine

protected ISystemMessageLine msgLine

nameValidator

protected ISystemValidator nameValidator

caller

protected Object caller

callerInstanceOfWizardPage

protected boolean callerInstanceOfWizardPage

callerInstanceOfSystemPromptDialog

protected boolean callerInstanceOfSystemPromptDialog

profileNameLength

protected static final int profileNameLength
See Also:
Constant Field Values

profile

protected ISystemProfile profile
Constructor Detail

SystemProfileForm

public SystemProfileForm(ISystemMessageLine msgLine,
                         Object caller,
                         ISystemProfile profile,
                         boolean showVerbage)
Constructor.

Parameters:
msgLine - A GUI widget capable of writing error messages to.
caller - The wizardpage or dialog hosting this form.
profile - The existing profile being updated, or null for New action.
showVerbage - Specify true to show first-time-user verbage.
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.


setNameValidators

public void setNameValidators(ISystemValidator v)
Call this to specify a validator for the profile name. It will be called per keystroke. If not specified, a default is used.


setProfileName

public void setProfileName(String name)
Call to initialize the profile name in create mode. Must be called after createContents


createContents

public 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

getInitialFocusControl

public Control getInitialFocusControl()
Return control to recieve initial focus


handleEvent

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

Specified by:
handleEvent in interface Listener

verify

public boolean verify()
Verifies all input.

Returns:
true if there are no errors in the user input

getProfileName

public String getProfileName()
Return user-entered profile Name. Call this after finish ends successfully.


validateNameInput

protected SystemMessage validateNameInput()
This hook method is called whenever the text changes in the input field. The default implementation delegates the request to an ISystemValidator object. If the ISystemValidator reports an error the error message is displayed in the Dialog's message line.

See Also:
setNameValidators(ISystemValidator)

isPageComplete

public boolean isPageComplete()
This method can be called by the dialog or wizard page host, to decide whether to enable or disable the next, final or ok buttons. It returns true if the minimal information is available and is correct.


setPageComplete

public void setPageComplete()
Inform caller of page-complete status of this form


RSE
Release 1.0

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