public class RemoteConnectionWidget
extends org.eclipse.swt.widgets.Composite
Modifier and Type | Class and Description |
---|---|
protected class |
RemoteConnectionWidget.WidgetListener
Listener for widget selected events.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CONNECTION_NAME |
static int |
FLAG_FORCE_CONNECTION_TYPE_SELECTION
Force the use of the connection type combo, regardless of the PREF_CONNECTION_TYPE preference setting.
|
static int |
FLAG_NO_LOCAL_SELECTION
Do not provide a selection for local services.
|
Constructor and Description |
---|
RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String title,
int flags)
Constructor
|
RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String title,
int flags,
org.eclipse.jface.operation.IRunnableContext context)
Constructor
|
RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String title,
int flags,
org.eclipse.jface.operation.IRunnableContext context,
java.util.List<IRemoteConnectionType> connectionTypes)
Constructor
|
RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String title,
int flags,
java.util.List<IRemoteConnectionType> connectionTypes)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(org.eclipse.swt.events.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. |
void |
filterConnections(java.lang.Class<? extends IRemoteConnection.Service>... services)
Limit the connection types that will be used when displaying valid connections.
|
org.eclipse.swt.widgets.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 void |
handleConnectionSelected()
Handle the section of a new connection.
|
protected void |
handleConnectionTypeSelected(IRemoteConnection conn)
Handle selection of a new connection type from the connection type combo.
|
protected void |
handleNewRemoteConnectionSelected()
Handle creation of a new connection by pressing the 'New...' button.
|
protected void |
initializeConnectionTypeCombo()
Initialize the contents of the connection type combo.
|
boolean |
isEnabled() |
void |
removeSelectionListener(org.eclipse.swt.events.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(java.lang.String id,
java.lang.String name)
Set the connection that should be selected in the widget.
|
void |
setEnabled(boolean enabled) |
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public static final java.lang.String DEFAULT_CONNECTION_NAME
public static int FLAG_FORCE_CONNECTION_TYPE_SELECTION
public static int FLAG_NO_LOCAL_SELECTION
public RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String title, int flags)
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.public RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String title, int flags, org.eclipse.jface.operation.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 nullconnnectionTypes
- list of connection types to select frompublic RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String title, int flags, java.util.List<IRemoteConnectionType> connectionTypes)
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.connnectionTypes
- list of connection types to select frompublic RemoteConnectionWidget(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String title, int flags, org.eclipse.jface.operation.IRunnableContext context, java.util.List<IRemoteConnectionType> connectionTypes)
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 nullconnnectionTypes
- list of connection types to select frompublic void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the user changes the service provider or connection.
listener
- the listener which should be notified@SafeVarargs public final void filterConnections(java.lang.Class<? extends IRemoteConnection.Service>... services)
services
- list of services IRemoteConnection.Service
public org.eclipse.swt.widgets.Button getButton()
public IRemoteConnection getConnection()
protected void handleConnectionSelected()
org.eclipse.core.runtime.CoreException
protected void handleNewRemoteConnectionSelected()
org.eclipse.core.runtime.CoreException
protected void handleConnectionTypeSelected(IRemoteConnection conn)
conn
- connection to select as current. If conn is null, select the first item in the list.org.eclipse.core.runtime.CoreException
protected void initializeConnectionTypeCombo()
public boolean isEnabled()
isEnabled
in class org.eclipse.swt.widgets.Control
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
listener
- listener to removepublic void setConnection(IRemoteConnection connection)
connection
- connection to selectorg.eclipse.core.runtime.CoreException
public void setConnection(java.lang.String id, java.lang.String name)
id
- connection type idname
- connection nameorg.eclipse.core.runtime.CoreException
public void setEnabled(boolean enabled)
setEnabled
in class org.eclipse.swt.widgets.Control