org.eclipse.xtext.ui.editor.tasks.dialogfields
Class SelectionButtonDialogField

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.tasks.dialogfields.DialogField
      extended by org.eclipse.xtext.ui.editor.tasks.dialogfields.SelectionButtonDialogField

public class SelectionButtonDialogField
extends DialogField

Dialog Field containing a single button such as a radio or checkbox button.


Field Summary
 
Fields inherited from class org.eclipse.xtext.ui.editor.tasks.dialogfields.DialogField
fLabelText
 
Constructor Summary
SelectionButtonDialogField(int buttonStyle)
          Creates a selection button.
 
Method Summary
 void attachDialogField(DialogField dialogField)
          Attaches a field to the selection state of the selection button.
 void attachDialogFields(DialogField[] dialogFields)
          Attaches fields to the selection state of the selection button.
 org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int nColumns)
          Creates all controls of the dialog field and fills it to a composite.
 int getNumberOfControls()
          Returns the number of columns of the dialog field.
 org.eclipse.swt.widgets.Button getSelectionButton(org.eclipse.swt.widgets.Composite group)
          Returns the selection button widget.
 boolean isAttached(DialogField editor)
          Returns true is teh gived field is attached to the selection button.
 boolean isSelected()
          Returns the selection state of the button.
 void refresh()
          Brings the UI in sync with the model.
 void setLabelText(java.lang.String labeltext)
          Sets the label of the dialog field.
 void setSelection(boolean selected)
          Sets the selection state of the button.
protected  void updateEnableState()
          Called when the enable state changed.
 
Methods inherited from class org.eclipse.xtext.ui.editor.tasks.dialogfields.DialogField
assertCompositeNotNull, assertEnoughColumns, createEmptySpace, createEmptySpace, dialogFieldChanged, getLabelControl, gridDataForLabel, isEnabled, isOkToUse, postSetFocusOnDialogField, setDialogFieldListener, setEnabled, setFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionButtonDialogField

public SelectionButtonDialogField(int buttonStyle)
Creates a selection button. Allowed button styles: SWT.RADIO, SWT.CHECK, SWT.TOGGLE, SWT.PUSH

Method Detail

attachDialogField

public void attachDialogField(DialogField dialogField)
Attaches a field to the selection state of the selection button. The attached field will be disabled if the selection button is not selected.


attachDialogFields

public void attachDialogFields(DialogField[] dialogFields)
Attaches fields to the selection state of the selection button. The attached fields will be disabled if the selection button is not selected.


isAttached

public boolean isAttached(DialogField editor)
Returns true is teh gived field is attached to the selection button.


doFillIntoGrid

public org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
                                                        int nColumns)
Description copied from class: DialogField
Creates all controls of the dialog field and fills it to a composite. The composite is assumed to have MGridLayout as layout. The dialog field will adjust its controls' spans to the number of columns given. To be reimplemented by dialog field implementors.

Overrides:
doFillIntoGrid in class DialogField

getNumberOfControls

public int getNumberOfControls()
Description copied from class: DialogField
Returns the number of columns of the dialog field. To be reimplemented by dialog field implementors.

Overrides:
getNumberOfControls in class DialogField

getSelectionButton

public org.eclipse.swt.widgets.Button getSelectionButton(org.eclipse.swt.widgets.Composite group)
Returns the selection button widget. When called the first time, the widget will be created.

Parameters:
group - The parent composite when called the first time, or null after.

setLabelText

public void setLabelText(java.lang.String labeltext)
Description copied from class: DialogField
Sets the label of the dialog field.

Overrides:
setLabelText in class DialogField

isSelected

public boolean isSelected()
Returns the selection state of the button.


setSelection

public void setSelection(boolean selected)
Sets the selection state of the button.


updateEnableState

protected void updateEnableState()
Description copied from class: DialogField
Called when the enable state changed. To be extended by dialog field implementors.

Overrides:
updateEnableState in class DialogField

refresh

public void refresh()
Description copied from class: DialogField
Brings the UI in sync with the model. Only needed when model was changed in different thread whil UI was lready created.

Overrides:
refresh in class DialogField