|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectComposite
com.ibm.etools.systems.core.ui.widgets.SystemConnectionCombo
This re-usable widget is for selecting a 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...
There are numerous ways to subset the connection list:
ISubSystemFactoryCategories
.
Field Summary | |
---|---|
protected Combo |
connectionCombo
|
protected Label |
connectionLabel
|
static String |
copyright
|
protected boolean |
listeningForConnectionEvents
|
protected Button |
newButton
|
protected boolean |
showLabel
|
protected boolean |
showNewButton
|
protected boolean |
showQualifiedNames
|
Fields inherited from interface com.ibm.etools.systems.core.ui.widgets.ISystemCombo |
---|
Copyright |
Constructor Summary | |
---|---|
SystemConnectionCombo(Composite parent,
int style,
String[] systemTypes,
SystemConnection defaultConnection,
boolean showNewButton)
Constructor for SystemConnectionCombo when there is an array of system types to restrict the connection list to. |
|
SystemConnectionCombo(Composite parent,
int style,
String systemType,
SystemConnection defaultConnection,
boolean showNewButton)
Constructor for SystemConnectionCombo when there is only a single system type to restrict the connection list to. |
|
SystemConnectionCombo(Composite parent,
int style,
SubSystemFactory ssFactory,
SystemConnection defaultConnection,
boolean showNewButton)
Constructor for SystemConnectionCombo when there is a subsystem factory to restrict the list to. |
|
SystemConnectionCombo(Composite parent,
int style,
SystemConnection defaultConnection,
boolean showNewButton,
String ssFactoryCategory)
Constructor for SystemConnectionCombo when there is a subsystem factory category to restrict the list to. |
|
SystemConnectionCombo(Composite parent,
int style,
SystemConnection defaultConnection,
boolean showNewButton,
String ssFactoryCategory,
boolean showLabel)
Constructor for SystemConnectionCombo when there is a subsystem factory category to restrict the list to. |
|
SystemConnectionCombo(Composite parent,
int style,
SystemConnection defaultConnection,
String ssFactoryId,
boolean showNewButton)
Constructor for SystemConnectionCombo when there is a subsystem factory id to restrict the list to. |
Method Summary | |
---|---|
void |
addModifyListener(ModifyListener listener)
Register a listener interested in entry field modify events |
void |
addNewButtonSelectionListener(SelectionListener listener)
Register a listener interested in when the new button is selected |
protected void |
addOurButtonSelectionListener()
|
protected void |
addOurConnectionSelectionListener()
|
void |
addSelectionChangedListener(ISelectionChangedListener listener)
Register a listener interested in an item is selected in the combo box |
void |
addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in the combo box |
void |
clearSelection()
Deselect |
void |
clearTextSelection()
Clear the entered/selected contents of the combo box. |
static Combo |
createCombo(Composite parent,
boolean readonly)
Creates a new combobox instance and sets the default layout data. |
protected Combo |
createConnectionCombo(Composite parent)
Creates a new readonly connection combobox instance and sets the default layout data, with tooltip text. |
protected static Button |
createPushButton(Composite group,
ResourceBundle bundle,
String key)
|
protected static Button |
createPushButton(Composite group,
String label)
|
Combo |
getCombo()
Return the combo box widget |
SystemConnection[] |
getConnections()
|
int |
getGridColumns()
Return the number of grid data columns within this composite. |
String[] |
getItems()
Get the items in the combo field |
Button |
getNewButton()
Return the New... button widget |
protected SystemNewConnectionAction |
getNewConnectionAction(Shell shell,
ISelectionProvider selectionProvider)
Overridable method. |
Label |
getPromptLabel()
Get the prompt Label widget |
ISelection |
getSelection()
|
int |
getSelectionIndex()
Get the index number of the currently selected item. |
SystemConnection |
getSystemConnection()
Get the user selected SystemConnection object. |
String |
getText()
Return the text in the connection combo entry field. |
protected void |
init(Composite parent,
boolean showNewButton)
|
protected void |
init(Composite parent,
boolean showNewButton,
boolean showLabel)
|
void |
listenToConnectionEvents(boolean start)
Have the SystemConnectionCombo listen to add/delete/rename events on connections and automatically update it's list of connections |
protected void |
populateConnectionCombo(Combo combo,
String[] systemTypes,
SystemConnection defaultConnection)
Populates a readonly connection combobox instance with system connections for the given array of system types. |
protected boolean |
populateConnectionCombo(Combo combo,
String ssFactoryId,
SystemConnection defaultConnection)
Populates a readonly connection combobox instance with system connections which have subsystems owned by a subsystem factory of the given subsystem factory id. |
protected boolean |
populateConnectionCombo(Combo combo,
String systemType,
SystemConnection defaultConnection,
boolean preSelectIfNoMatch)
Populates a readonly connection combobox instance with system connections for the given system type. |
protected boolean |
populateConnectionCombo(Combo combo,
String systemType,
SystemConnection defaultConnection,
boolean preSelectIfNoMatch,
boolean appendToCombo)
Populates a readonly connection combobox instance with system connections for the given system type. |
protected boolean |
populateConnectionCombo(Combo combo,
SubSystemFactory ssFactory,
SystemConnection defaultConnection)
Populates a readonly connection combobox instance with system connections which have subsystems owned by the given subsystem factory. |
protected boolean |
populateConnectionCombo(Combo combo,
SystemConnection defaultConnection,
String ssFactoryCategory)
Populates a readonly connection combobox instance with system connections which have subsystems owned by a subsystem factory of the given subsystem factory category. |
protected Composite |
prepareComposite(int numColumns)
Prepares this composite control and sets the default layout data. |
void |
refreshConnections()
Refresh the list of connections |
void |
removeModifyListener(ModifyListener listener)
Remove a previously set entry field listener. |
void |
removeNewButtonSelectionListener(SelectionListener listener)
Remove a previously set new button selection listener. |
void |
removeSelectionChangedListener(ISelectionChangedListener listener)
Remove a previously set combo box selection listener. |
void |
removeSelectionListener(SelectionListener listener)
Remove a previously set combo box selection listener. |
void |
select(int selIdx)
Select the combo dropdown list entry at the given index. |
void |
select(SystemConnection connection)
Select a connection from the dropdown |
void |
setAutoUpperCase(boolean enable)
Set auto-uppercase. |
protected void |
setBusyCursor(boolean setBusy)
Helper method. |
void |
setButtonToolTipText(String tip)
Same as setNewButtonToolTipText(String) |
void |
setButtonWidthHint(int widthHint)
Set button width hint |
void |
setConnections(SystemConnection[] input)
|
protected void |
setConnectionToolTipText()
|
void |
setEnabled(boolean enabled)
Disable/Enable all the child controls. |
boolean |
setFocus()
Set the focus to the directory combo field |
void |
setItems(String[] items)
Set the items in the combo field |
void |
setLabel(String label)
Set the label to use for the prompt. |
void |
setNewButtonFocus()
Set the focus to the new button |
void |
setNewButtonToolTipText(String tip)
Set the tooltip text for the new button |
void |
setSelection(ISelection selection)
|
void |
setSelectionIndex(int selIdx)
Same as select(int) |
void |
setToolTipText(String tip)
Set the tooltip text for the directory combo field |
void |
setWidthHint(int widthHint)
Set the width hint for this whole composite Default is 180. |
protected static String |
sub(String msg,
String subOld,
String subNew)
Do string variable substitution. |
void |
systemResourceChanged(ISystemResourceChangeEvent event)
This is the method in your class that will be called when a system resource changes. |
void |
widgetDisposed(DisposeEvent e)
We are going away. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.etools.systems.model.ISystemResourceChangeListener |
---|
getShell |
Field Detail |
public static final String copyright
protected Label connectionLabel
protected Combo connectionCombo
protected Button newButton
protected boolean showNewButton
protected boolean showLabel
protected boolean showQualifiedNames
protected boolean listeningForConnectionEvents
Constructor Detail |
public SystemConnectionCombo(Composite parent, int style, String systemType, SystemConnection defaultConnection, boolean showNewButton)
parent
- Parent compositestyle
- SWT style flags for overall composite widget. Typically just pass SWT.NULLsystemType
- the system type to restrict the connection list to. Can be null or * for all.defaultConnection
- the system connection to preselect. Pass null to preselect first connection.showNewButton
- true if a New... button is to be included in this compositepublic SystemConnectionCombo(Composite parent, int style, String[] systemTypes, SystemConnection defaultConnection, boolean showNewButton)
parent
- Parent compositestyle
- SWT style flags for overall composite widget. Typically just pass SWT.NULLsystemTypes
- the system type array to restrict the connection list to.defaultConnection
- the system connection to preselect. Pass null to preselect first connection.showNewButton
- true if a New... button is to be included in this compositepublic SystemConnectionCombo(Composite parent, int style, SubSystemFactory ssFactory, SystemConnection defaultConnection, boolean showNewButton)
parent
- Parent compositestyle
- SWT style flags for overall composite widget. Typically just pass SWT.NULLdefaultConnection
- the system connection to preselect. Pass null to preselect first connection.showNewButton
- true if a New... button is to be included in this compositepublic SystemConnectionCombo(Composite parent, int style, SystemConnection defaultConnection, String ssFactoryId, boolean showNewButton)
parent
- Parent compositestyle
- SWT style flags for overall composite widget. Typically just pass SWT.NULLdefaultConnection
- the system connection to preselect. Pass null to preselect first connection.showNewButton
- true if a New... button is to be included in this compositepublic SystemConnectionCombo(Composite parent, int style, SystemConnection defaultConnection, boolean showNewButton, String ssFactoryCategory)
parent
- Parent compositestyle
- SWT style flags for overall composite widget. Typically just pass SWT.NULLdefaultConnection
- the system connection to preselect. Pass null to preselect first connection.showNewButton
- true if a New... button is to be included in this compositepublic SystemConnectionCombo(Composite parent, int style, SystemConnection defaultConnection, boolean showNewButton, String ssFactoryCategory, boolean showLabel)
parent
- Parent compositestyle
- SWT style flags for overall composite widget. Typically just pass SWT.NULLdefaultConnection
- the system connection to preselect. Pass null to preselect first connection.showNewButton
- true if a New... button is to be included in this compositeMethod Detail |
public void setAutoUpperCase(boolean enable)
This method is part of ISystemCombo, so we must support it, but it does not apply this combo widget since the contents are read-only. Hence, it does nothing!
setAutoUpperCase
in interface ISystemCombo
protected void init(Composite parent, boolean showNewButton)
protected void init(Composite parent, boolean showNewButton, boolean showLabel)
protected SystemNewConnectionAction getNewConnectionAction(Shell shell, ISelectionProvider selectionProvider)
public SystemConnection getSystemConnection()
public Combo getCombo()
getCombo
in interface ISystemCombo
public void setWidthHint(int widthHint)
setWidthHint
in interface ISystemCombo
public void setButtonWidthHint(int widthHint)
public int getGridColumns()
public Button getNewButton()
public Label getPromptLabel()
public void setItems(String[] items)
public String[] getItems()
public String getText()
getText
in interface ISystemCombo
public void setEnabled(boolean enabled)
setEnabled
in interface ISystemCombo
public void setToolTipText(String tip)
setToolTipText
in interface ISystemCombo
public void setNewButtonToolTipText(String tip)
public void setButtonToolTipText(String tip)
setNewButtonToolTipText(String)
setButtonToolTipText
in interface ISystemCombo
public void setLabel(String label)
public boolean setFocus()
setFocus
in interface ISystemCombo
public void setNewButtonFocus()
public void select(int selIdx)
select
in interface ISystemCombo
public void setSelectionIndex(int selIdx)
select(int)
setSelectionIndex
in interface ISystemCombo
public void select(SystemConnection connection)
public void clearSelection()
clearSelection
in interface ISystemCombo
public void clearTextSelection()
clearTextSelection
in interface ISystemCombo
public int getSelectionIndex()
getSelectionIndex
in interface ISystemCombo
public void addSelectionListener(SelectionListener listener)
addSelectionListener
in interface ISystemCombo
removeSelectionListener(SelectionListener)
public void removeSelectionListener(SelectionListener listener)
removeSelectionListener
in interface ISystemCombo
addSelectionListener(SelectionListener)
public void addNewButtonSelectionListener(SelectionListener listener)
removeNewButtonSelectionListener(SelectionListener)
public void removeNewButtonSelectionListener(SelectionListener listener)
addNewButtonSelectionListener(SelectionListener)
public void addModifyListener(ModifyListener listener)
removeModifyListener(ModifyListener)
public void removeModifyListener(ModifyListener listener)
addModifyListener(ModifyListener)
protected Composite prepareComposite(int numColumns)
protected Combo createConnectionCombo(Composite parent)
This fills the combination with the names of all the active connections of the given system type.
parent
- composite to put the button into.public static Combo createCombo(Composite parent, boolean readonly)
Does NOT set the widthHint as that causes problems. Instead the combo will consume what space is available within this composite.
parent
- composite to put the button into.protected boolean populateConnectionCombo(Combo combo, String systemType, SystemConnection defaultConnection, boolean preSelectIfNoMatch)
This fills the combination with the names of all the active connections of the given system type.
systemType
- the system type to restrict the connection list to. Pass null or * for all system typesdefaultConnection
- the default system connection to preselect.preSelectIfNoMatch
- true if we should preselect the first item if the given connection is not found
protected boolean populateConnectionCombo(Combo combo, String systemType, SystemConnection defaultConnection, boolean preSelectIfNoMatch, boolean appendToCombo)
This fills the combination with the names of all the active connections of the given system type.
systemType
- the system type to restrict the connection list to. Pass null or * for all system typesdefaultConnection
- the default system connection to preselect.preSelectIfNoMatch
- true if we should preselect the first item if the given connection is not foundappendToCombo
- indicates whether or not to append to combo with population or replace
protected void populateConnectionCombo(Combo combo, String[] systemTypes, SystemConnection defaultConnection)
systemTypes
- the system types to restrict the connection list to. Pass null or * for all system typesdefaultConnection
- the default system connection to preselect.protected boolean populateConnectionCombo(Combo combo, SubSystemFactory ssFactory, SystemConnection defaultConnection)
defaultConnection
- the default system connection to preselect.
protected boolean populateConnectionCombo(Combo combo, String ssFactoryId, SystemConnection defaultConnection)
defaultConnection
- the default system connection to preselect.
protected boolean populateConnectionCombo(Combo combo, SystemConnection defaultConnection, String ssFactoryCategory)
defaultConnection
- the default system connection to preselect.
protected static String sub(String msg, String subOld, String subNew)
public void refreshConnections()
public void systemResourceChanged(ISystemResourceChangeEvent event)
systemResourceChanged
in interface ISystemResourceChangeListener
ISystemResourceChangeEvent
public void listenToConnectionEvents(boolean start)
public void widgetDisposed(DisposeEvent e)
protected void addOurButtonSelectionListener()
protected void addOurConnectionSelectionListener()
protected void setConnectionToolTipText()
protected static Button createPushButton(Composite group, String label)
protected static Button createPushButton(Composite group, ResourceBundle bundle, String key)
public void addSelectionChangedListener(ISelectionChangedListener listener)
removeSelectionChangedListener(ISelectionChangedListener)
public void removeSelectionChangedListener(ISelectionChangedListener listener)
addSelectionChangedListener(ISelectionChangedListener)
public ISelection getSelection()
public void setSelection(ISelection selection)
public SystemConnection[] getConnections()
public void setConnections(SystemConnection[] input)
protected void setBusyCursor(boolean setBusy)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |