Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.widgets
Class SystemSelectConnectionForm

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.SystemBaseForm
      extended bycom.ibm.etools.systems.core.ui.widgets.SystemSelectConnectionForm
All Implemented Interfaces:
ISystemConnectionWizardErrorUpdator

public class SystemSelectConnectionForm
extends SystemBaseForm

A reusable form for prompting for a connection. Unlike SystemConnectionCombo, this form uses a list box to show the available connections.

This form may be used to populate a dialog or a wizard page.

To configure the functionality, call these methods:

To configure the text on the dialog, call these methods:

After running, call these methods to get the output:


Field Summary
protected  boolean allowNew
           
protected  int autoExpandDepth
           
protected  boolean contentsCreated
           
static String copyright
           
protected  SystemConnection defaultConn
           
protected  boolean initDone
           
protected  Vector listeners
           
protected  boolean multipleSelectionMode
           
protected  Text nameEntryValue
           
protected  Composite outerParent
           
protected  SystemConnection outputConnection
           
protected  SystemConnection[] outputConnections
           
protected  Object previousSelection
           
protected static int PROMPT_WIDTH
           
protected  SystemPropertySheetForm ps
           
protected  Composite ps_composite
           
protected  boolean showPropertySheet
           
protected  Label spacer1
           
protected  Label spacer2
           
protected  String[] systemTypes
           
protected  SystemViewForm tree
           
protected  String verbage
           
protected  Label verbageLabel
           
 
Fields inherited from class com.ibm.etools.systems.core.ui.SystemBaseForm
alreadyNotified, verifyListeners
 
Constructor Summary
SystemSelectConnectionForm(Shell shell, ISystemMessageLine msgLine)
          Constructor
 
Method Summary
 void addSelectionChangedListener(ISelectionChangedListener l)
          Add a listener to selection change events in the list
 Control createContents(Composite parent)
          In this method, we populate the given SWT container with widgets and return the container to the caller.
 void dispose()
           
protected  Object getFirstSelection(ISelection selection)
          Return first item currently selected.
 Control getInitialFocusControl()
          Return control to recieve initial focus
 boolean getMultipleSelectionMode()
          Return the multiple selection mode current setting
 SystemConnection getSelectedConnection()
          Return selected connection
 SystemConnection[] getSelectedConnections()
          Return all selected connections.
protected  Object[] getSelections(ISelection selection)
          Return all items currently selected.
 void removeSelectionChangedListener(ISelectionChangedListener l)
          Remove a listener for selection change events in the list
 void selectionChanged(SelectionChangedEvent e)
          User selected something in the tree.
 void setDefaultConnection(SystemConnection conn)
          Set the connection to default the selection to
 void setMessage(String message)
          Set the message shown as the text at the top of the form.
 void setMultipleSelectionMode(boolean multiple)
          Set multiple selection mode.
protected  void setNameText(String text)
           
 void setShowNewConnectionPrompt(boolean show)
          Set to true if we are to allow users to create a new connection.
 void setShowPropertySheet(boolean show)
          Show the property sheet on the right hand side, to show the properties of the selected connection.
 void setSystemType(String systemType)
          Restrict to one system type
 void setSystemTypes(String[] systemTypes)
          Restrict to certain system types
 boolean toggleShowPropertySheet(Shell shell, Control contents)
          Show or hide the property sheet.
 boolean verify()
          Completes processing of the wizard page or dialog.
 
Methods inherited from class com.ibm.etools.systems.core.ui.SystemBaseForm
addFillerLine, addGrowableFillerLine, addPageCompleteListener, addSeparatorLine, addVerifyListener, getInputObject, getMessageLine, getOutputObject, getShell, getTheErrorMessage, handleEvent, isPageComplete, notifyVerifyListeners, removePageCompleteListener, removePageCompleteListener, setInputObject, setMessageLine, setOutputObject, setPageComplete, setShell, showErrorMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

PROMPT_WIDTH

protected static final int PROMPT_WIDTH
See Also:
Constant Field Values

verbageLabel

protected Label verbageLabel

spacer1

protected Label spacer1

spacer2

protected Label spacer2

nameEntryValue

protected Text nameEntryValue

tree

protected SystemViewForm tree

ps

protected SystemPropertySheetForm ps

outerParent

protected Composite outerParent

ps_composite

protected Composite ps_composite

verbage

protected String verbage

systemTypes

protected String[] systemTypes

defaultConn

protected SystemConnection defaultConn

allowNew

protected boolean allowNew

multipleSelectionMode

protected boolean multipleSelectionMode

showPropertySheet

protected boolean showPropertySheet

listeners

protected Vector listeners

outputConnections

protected SystemConnection[] outputConnections

outputConnection

protected SystemConnection outputConnection

initDone

protected boolean initDone

contentsCreated

protected boolean contentsCreated

autoExpandDepth

protected int autoExpandDepth

previousSelection

protected Object previousSelection
Constructor Detail

SystemSelectConnectionForm

public SystemSelectConnectionForm(Shell shell,
                                  ISystemMessageLine msgLine)
Constructor

Parameters:
shell - The shell hosting this form
msgLine - A GUI widget capable of writing error messages to.
See Also:
setShowNewConnectionPrompt(boolean), setSystemTypes(String[])
Method Detail

setDefaultConnection

public void setDefaultConnection(SystemConnection conn)
Set the connection to default the selection to


setShowNewConnectionPrompt

public void setShowNewConnectionPrompt(boolean show)
Set to true if we are to allow users to create a new connection. Default is true.


setSystemTypes

public void setSystemTypes(String[] systemTypes)
Restrict to certain system types

Parameters:
systemTypes - the system types to restrict what connections are shown and what types of connections the user can create
See Also:
ISystemTypes

setSystemType

public void setSystemType(String systemType)
Restrict to one system type

Parameters:
systemType - the system type to restrict what connections are shown and what types of connections the user can create
See Also:
ISystemTypes

setMessage

public void setMessage(String message)
Set the message shown as the text at the top of the form. Default is "Select a connection"


setShowPropertySheet

public void setShowPropertySheet(boolean show)
Show the property sheet on the right hand side, to show the properties of the selected connection.

Default is false


setMultipleSelectionMode

public void setMultipleSelectionMode(boolean multiple)
Set multiple selection mode. Default is single selection mode

If you turn on multiple selection mode, you must use the getSelectedConnections() method to retrieve the list of selected connections.

See Also:
getSelectedConnections()

addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener l)
Add a listener to selection change events in the list


removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener l)
Remove a listener for selection change events in the list


getSelectedConnections

public SystemConnection[] getSelectedConnections()
Return all selected connections.

See Also:
setMultipleSelectionMode(boolean)

getSelectedConnection

public SystemConnection getSelectedConnection()
Return selected connection


getMultipleSelectionMode

public boolean getMultipleSelectionMode()
Return the multiple selection mode current setting


getInitialFocusControl

public Control getInitialFocusControl()
Return control to recieve initial focus


toggleShowPropertySheet

public boolean toggleShowPropertySheet(Shell shell,
                                       Control contents)
Show or hide the property sheet. This is called after the contents are created when the user toggles the Details button.

Parameters:
shell - Use getShell() in your dialog or wizard page
contents - Use getContents() in your dialog or wizard page
Returns:
new state -> true if showing, false if hiding

dispose

public void dispose()

createContents

public Control createContents(Composite parent)
In this method, we populate the given SWT container with widgets and return the container to the caller.

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

verify

public boolean verify()
Completes processing of the wizard page or dialog. If this method returns true, the wizard/dialog will close; otherwise, it will stay active.

Returns:
true if no errors

setNameText

protected void setNameText(String text)

selectionChanged

public void selectionChanged(SelectionChangedEvent e)
User selected something in the tree.


getFirstSelection

protected Object getFirstSelection(ISelection selection)
Return first item currently selected.


getSelections

protected Object[] getSelections(ISelection selection)
Return all items currently selected.


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.