com.ibm.commons.swt.data.editors.support
Class DialogButton

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Button
              extended by com.ibm.commons.swt.data.editors.support.DialogButton
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, org.eclipse.swt.widgets.Listener

public class DialogButton
extends org.eclipse.swt.widgets.Button
implements org.eclipse.swt.widgets.Listener

A custom implementation of the standard SWT button control. The button either calls for a dialog or a script dialog to be invoked.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
DialogButton(CompositeEditor parent, java.lang.String text, boolean script, java.lang.String id)
          Constructs a new instance of the class given the parent Composite, the text to be set on the button, a boolean to determine whether this button is to launch a custom dialog or a script dialog, and an id property that can be used to programatically identify the control.
 
Method Summary
protected  void checkSubclass()
           
 java.lang.String getId()
          Returns the id that can be used to programmatically identify this control.
 void handleEvent(org.eclipse.swt.widgets.Event e)
           
protected  void onClick()
           
 void setId(java.lang.String id)
          Sets an id that can be used to programmatically identify this control.
 
Methods inherited from class org.eclipse.swt.widgets.Button
addSelectionListener, computeSize, getAlignment, getGrayed, getImage, getSelection, getText, removeSelectionListener, setAlignment, setGrayed, setImage, setSelection, setText
 
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, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, 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, setEnabled, setFocus, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEnabled, 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

DialogButton

public DialogButton(CompositeEditor parent,
                    java.lang.String text,
                    boolean script,
                    java.lang.String id)
Constructs a new instance of the class given the parent Composite, the text to be set on the button, a boolean to determine whether this button is to launch a custom dialog or a script dialog, and an id property that can be used to programatically identify the control.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. Style bits are also inherited from superclasses.

Parameters:
parent - a Composite control which will be the parent of the new instance (CANNOT be null).
text - the text that is to appear on the button
boolean - determines whether to use a custom dialog or the script dialog
id - a String which can be used to programatically identify the control
Method Detail

checkSubclass

protected void checkSubclass()
Overrides:
checkSubclass in class org.eclipse.swt.widgets.Widget

handleEvent

public void handleEvent(org.eclipse.swt.widgets.Event e)
Specified by:
handleEvent in interface org.eclipse.swt.widgets.Listener

onClick

protected void onClick()

getId

public java.lang.String getId()
Returns the id that can be used to programmatically identify this control.

Returns:
the id

setId

public void setId(java.lang.String id)
Sets an id that can be used to programmatically identify this control.

Parameters:
id - the id to set