public class RemoteConnectionWidget
extends Composite
Modifier and Type | Class and Description |
---|---|
protected class |
RemoteConnectionWidget.WidgetListener
Listener for widget selected events.
|
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_FORCE_PROVIDER_SELECTION
Force the use of a remote provider dialog, regardless of the PRE_REMOTE_SERVICES_ID preference setting.
|
static int |
FLAG_NO_LOCAL_SELECTION
Do not provide a selection for local services.
|
Constructor and Description |
---|
RemoteConnectionWidget(Composite parent,
int style,
String title,
int flags,
IRunnableContext context)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the user changes the receiver's selection, by
sending it one of the messages defined in the
SelectionListener interface. |
Button |
getButton()
Get the new button from the widget
|
IRemoteConnection |
getConnection()
Get the connection that is currently selected in the widget, or null if there is no selected connection.
|
protected IRemoteConnectionManager |
getRemoteConnectionManager(IRemoteServices services) |
protected IRemoteServices |
getRemoteServices(String id) |
protected void |
handleConnectionSelected()
Handle the section of a new connection.
|
protected void |
handleNewRemoteConnectionSelected()
Handle creation of a new connection by pressing the 'New...' button.
|
protected void |
handleRemoteServiceSelected(IRemoteConnection conn)
Handle selection of a new remote services provider from the remote services combo.
|
protected void |
initializeRemoteServicesCombo(String id)
Initialize the contents of the remote services combo.
|
boolean |
isEnabled() |
void |
removeSelectionListener(SelectionListener listener)
Remove a listener that will be notified when one of the widget's controls are selected
|
void |
setConnection(IRemoteConnection connection)
Set the connection that should be selected in the widget.
|
void |
setConnection(String id,
String name)
Set the connection that should be selected in the widget.
|
void |
setEnabled(boolean enabled) |
void |
setHints(String[] attrHints,
String[] attrHintValues)
Set hints to use when creating a new connection.
|
public static int FLAG_FORCE_PROVIDER_SELECTION
public static int FLAG_NO_LOCAL_SELECTION
public RemoteConnectionWidget(Composite parent, int style, String title, int flags, IRunnableContext context)
parent
- parent compositestyle
- style or SWT.NONEtitle
- if a title is supplied then the widget will be placed in a group. Can be null.flags
- a combination of flags that modify the behavior of the widget.context
- runnable context, or nullpublic void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the user changes the service provider or connection.
listener
- the listener which should be notifiedpublic Button getButton()
public IRemoteConnection getConnection()
protected IRemoteConnectionManager getRemoteConnectionManager(IRemoteServices services)
protected IRemoteServices getRemoteServices(String id)
protected void handleConnectionSelected()
protected void handleNewRemoteConnectionSelected()
protected void handleRemoteServiceSelected(IRemoteConnection conn)
conn
- connection to select as current. If conn is null, select the first item in the list.notify
- if true, notify handlers that the connection has changed. This should only happen if the user changes the
connection.protected void initializeRemoteServicesCombo(String id)
public boolean isEnabled()
public void removeSelectionListener(SelectionListener listener)
listener
- listener to removepublic void setConnection(IRemoteConnection connection)
connection
- connection to selectpublic void setConnection(String id, String name)
id
- remote services idname
- connection namepublic void setEnabled(boolean enabled)
Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.