Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.widgets
Class IBMiConnectionCombo

java.lang.Object
  extended by SystemHostCombo
      extended by com.ibm.etools.iseries.rse.ui.widgets.IBMiConnectionCombo

public class IBMiConnectionCombo
extends SystemHostCombo

This re-usable widget is for selecting an iSeries connection from the master list of connections. The list is subsettable by one or more system types. There is also the option of including a "New" button to the right of the connection dropdown, for the purpose of creating a new connection.

Without the New button, the composite is layed as follows:


   Connection: ______________________v  
 

With the New button, the composite is layed as follows:


   Connection: ______________v  New...
 


Field Summary
static String copyright
           
 
Constructor Summary
IBMiConnectionCombo(Composite parent)
          Constructor when you don't care about the style or default connection, and do want to show the New button.
IBMiConnectionCombo(Composite parent, IBMiConnection defaultConnection, boolean showNewButton)
          Constructor when you don't care about the style.
IBMiConnectionCombo(Composite parent, int style, IBMiConnection defaultConnection, boolean showNewButton, boolean showLabel)
          Constructor when you want to set the style
IBMiConnectionCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton)
          Constructor when you want to set the style
IBMiConnectionCombo(Composite parent, int style, IRSESystemType systemType, IBMiConnection defaultConnection, boolean showNewButton)
          Constructor when you want to set the style
IBMiConnectionCombo(Composite parent, IRSESystemType systemType, IHost defaultConnection, boolean showNewButton)
          Constructor when you don't care about the style.
 
Method Summary
 IBMiConnection getISeriesConnection()
          Return the selected connection as an ISeriesConnection object.
protected  SystemNewConnectionAction getNewConnectionAction(Shell shell, ISelectionProvider selectionProvider)
          Overridable method.
 void lineUpWith(IBMiConnectionCombo otherWidget)
          If a composite widget like this is used more than once on the same page, it is nice to line up the columns.
 void lineUpWith(QSYSBasePrompt otherWidget)
          If a composite widget like this is used more than once on the same page, it is nice to line up the columns.
 void select(IBMiConnection connection)
          Select an iSeries connection from the dropdown
 
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
Constructor Detail

IBMiConnectionCombo

public IBMiConnectionCombo(Composite parent,
                           int style,
                           IHost defaultConnection,
                           boolean showNewButton)
Constructor when you want to set the style

Parameters:
parent - Parent composite
style - SWT style flags for overall composite widget. Typically just pass SWT.NULL
defaultConnection - the system host to preselect. Pass null to preselect first connection.
showNewButton - true if a New... button is to be included in this composite

IBMiConnectionCombo

public IBMiConnectionCombo(Composite parent,
                           IRSESystemType systemType,
                           IHost defaultConnection,
                           boolean showNewButton)
Constructor when you don't care about the style. Defaults to SWT.NULL

Parameters:
parent - Parent composite
defaultConnection - the system host to preselect. Pass null to preselect first connection.
showNewButton - true if a New... button is to be included in this composite

IBMiConnectionCombo

public IBMiConnectionCombo(Composite parent,
                           int style,
                           IRSESystemType systemType,
                           IBMiConnection defaultConnection,
                           boolean showNewButton)
Constructor when you want to set the style

Parameters:
parent - Parent composite
style - SWT style flags for overall composite widget. Typically just pass SWT.NULL
systemType - the system type to restrict the connection list to. Can be null or * for all.
defaultConnection - the AS/400 connection to preselect. Pass null to preselect first connection.
showNewButton - true if a New... button is to be included in this composite

IBMiConnectionCombo

public IBMiConnectionCombo(Composite parent,
                           int style,
                           IBMiConnection defaultConnection,
                           boolean showNewButton,
                           boolean showLabel)
Constructor when you want to set the style

Parameters:
parent - Parent composite
style - SWT style flags for overall composite widget. Typically just pass SWT.NULL
defaultConnection - the AS/400 connection to preselect. Pass null to preselect first connection.
showNewButton - true if a New... button is to be included in this composite
showLabel - true if a 'Connection' label is to be included in this composite

IBMiConnectionCombo

public IBMiConnectionCombo(Composite parent,
                           IBMiConnection defaultConnection,
                           boolean showNewButton)
Constructor when you don't care about the style. Defaults to SWT.NULL

Parameters:
parent - Parent composite
defaultConnection - the AS/400 connection to preselect. Pass null to preselect first connection.
showNewButton - true if a New... button is to be included in this composite

IBMiConnectionCombo

public IBMiConnectionCombo(Composite parent)
Constructor when you don't care about the style or default connection, and do want to show the New button. This is the most common case.

Parameters:
parent - Parent composite
Method Detail

getISeriesConnection

public IBMiConnection getISeriesConnection()
Return the selected connection as an ISeriesConnection object. This is an alternative to the inherited method getSystemConnection()which returns a SystemConnection object. The class ISeriesConnection wraps SystemConnection and adds iSeries-specific functionality for convenience.

This returns null if there is no connection currently selected.


select

public void select(IBMiConnection connection)
Select an iSeries connection from the dropdown


getNewConnectionAction

protected SystemNewConnectionAction getNewConnectionAction(Shell shell,
                                                           ISelectionProvider selectionProvider)
Overridable method. Returns action to be called when New... pressed. In our case, we restrict the system type to iSeries


lineUpWith

public void lineUpWith(QSYSBasePrompt otherWidget)
If a composite widget like this is used more than once on the same page, it is nice to line up the columns. This method will do that, given the first composite widget. The trick to this though is that we need to know the size of other composite, which is not known until after the controls are all layed out. So only call this after all controls have been added to your dialog/wizard content area.


lineUpWith

public void lineUpWith(IBMiConnectionCombo otherWidget)
If a composite widget like this is used more than once on the same page, it is nice to line up the columns. This method will do that, given the first composite widget. The trick to this though is that we need to know the size of other composite, which is not known until after the controls are all layed out. So only call this after all controls have been added to your dialog/wizard content area.


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 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.