PTP
Release 5.0

org.eclipse.ptp.services.ui.widgets
Class ServiceConfigurationSelectionWidget

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.ptp.services.ui.widgets.ServiceConfigurationSelectionWidget
All Implemented Interfaces:
org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.swt.graphics.Drawable

public class ServiceConfigurationSelectionWidget
extends org.eclipse.swt.widgets.Composite
implements org.eclipse.jface.viewers.ISelectionProvider

Standard widget for selecting a service configuration. Displays a table view of service configurations so that the user can easily see what services and providers are available in the configuration. Provides "Add...", "Remove", and "Rename" buttons to allow the creation, removal and renaming of service configurations. These buttons can be enabled/disabled by using the buttons constructor parameter. The excluded constructor parameter can be used to supply a list of configurations to be exclude from the list. The whole control can be enabled/disabled using the setEnabled method.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
ServiceConfigurationSelectionWidget(org.eclipse.swt.widgets.Composite parent, int style)
           
ServiceConfigurationSelectionWidget(org.eclipse.swt.widgets.Composite parent, int style, java.util.Set<IServiceConfiguration> excluded, java.util.Set<IService> services, boolean enableButtons)
           
 
Method Summary
 void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
           
 IServiceConfiguration[] getCheckedServiceConfigurations()
          Gets the elements that have been checked in the viewer
 boolean getEnabled()
           
 IServiceConfiguration getSelectedConfiguration()
          Return the service configuration selected by the user
 org.eclipse.jface.viewers.ISelection getSelection()
           
 void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
           
 void setAllChecked(boolean state)
          Sets all elements in the viewer to the given checked state.
 void setConfigurations(IServiceConfiguration[] configurations)
          Set the service configurations to display in the viewer.
 void setEnabled(boolean enabled)
           
 void setSelection(org.eclipse.jface.viewers.ISelection selection)
           
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isTouchEnabled, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEventsEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceConfigurationSelectionWidget

public ServiceConfigurationSelectionWidget(org.eclipse.swt.widgets.Composite parent,
                                           int style)

ServiceConfigurationSelectionWidget

public ServiceConfigurationSelectionWidget(org.eclipse.swt.widgets.Composite parent,
                                           int style,
                                           java.util.Set<IServiceConfiguration> excluded,
                                           java.util.Set<IService> services,
                                           boolean enableButtons)
Method Detail

addSelectionChangedListener

public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
Specified by:
addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider

getCheckedServiceConfigurations

public IServiceConfiguration[] getCheckedServiceConfigurations()
Gets the elements that have been checked in the viewer

Returns:
array containing the elements that are checked

getEnabled

public boolean getEnabled()
Overrides:
getEnabled in class org.eclipse.swt.widgets.Control

getSelectedConfiguration

public IServiceConfiguration getSelectedConfiguration()
Return the service configuration selected by the user

Returns:
Selected service configuration

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
Specified by:
getSelection in interface org.eclipse.jface.viewers.ISelectionProvider

removeSelectionChangedListener

public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
Specified by:
removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider

setAllChecked

public void setAllChecked(boolean state)
Sets all elements in the viewer to the given checked state.

Parameters:
state -

setConfigurations

public void setConfigurations(IServiceConfiguration[] configurations)
Set the service configurations to display in the viewer. Passing null will display all known configurations (default).

Parameters:
configurations - configurations to display, or null to display all

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class org.eclipse.swt.widgets.Control

setSelection

public void setSelection(org.eclipse.jface.viewers.ISelection selection)
Specified by:
setSelection in interface org.eclipse.jface.viewers.ISelectionProvider

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.