org.openoffice.ide.eclipse.core.gui.rows
Class DialogRow

java.lang.Object
  extended by org.openoffice.ide.eclipse.core.gui.rows.LabeledRow
      extended by org.openoffice.ide.eclipse.core.gui.rows.DialogRow
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.ModifyListener, org.eclipse.swt.internal.SWTEventListener

public class DialogRow
extends LabeledRow
implements org.eclipse.swt.events.ModifyListener

Row class with a text and a configurable button to open a dialog.

Author:
cedricbosdo

Field Summary
 
Fields inherited from class org.openoffice.ide.eclipse.core.gui.rows.LabeledRow
LAYOUT_COLUMNS, mBrowse, mField, mLabel, mListener, mProperty
 
Constructor Summary
DialogRow(org.eclipse.swt.widgets.Composite pParent, java.lang.String pProperty, java.lang.String pLabel)
          Simple constructor for the Dialog row creation.
DialogRow(org.eclipse.swt.widgets.Composite pParent, java.lang.String pProperty, java.lang.String pLabel, java.lang.String pBtnLabel)
          Constructor for the Dialog row creation allowing to change the button text.
 
Method Summary
 java.lang.String doOpenDialog()
          Open the dialog when clicking on the right button.
 java.lang.String getValue()
          Get or calculate the value of this property.
 void modifyText(org.eclipse.swt.events.ModifyEvent pEvent)
          
 void setValue(java.lang.String pValue)
          Set a new value to the row.
 
Methods inherited from class org.openoffice.ide.eclipse.core.gui.rows.LabeledRow
createContent, fillRow, fireFieldChangedEvent, getLabel, getProperty, removeFieldChangedlistener, setEnabled, setFieldChangedListener, setLabel, setTooltip, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogRow

public DialogRow(org.eclipse.swt.widgets.Composite pParent,
                 java.lang.String pProperty,
                 java.lang.String pLabel)
Simple constructor for the Dialog row creation. The button text will be set to Browse.

Parameters:
pParent - the composite in which to create the row
pProperty - the property to recognize an event from this row
pLabel - the label on the left of the row

DialogRow

public DialogRow(org.eclipse.swt.widgets.Composite pParent,
                 java.lang.String pProperty,
                 java.lang.String pLabel,
                 java.lang.String pBtnLabel)
Constructor for the Dialog row creation allowing to change the button text.

Parameters:
pParent - the composite in which to create the row
pProperty - the property to recognize an event from this row
pLabel - the label on the left of the row
pBtnLabel - the label of the button opening the dialog
Method Detail

doOpenDialog

public java.lang.String doOpenDialog()
Open the dialog when clicking on the right button. Subclasses, may implement this method. Default returns an empty string.

Returns:
the new value for the row

getValue

public java.lang.String getValue()
Get or calculate the value of this property.

Specified by:
getValue in class LabeledRow
Returns:
the property value

modifyText

public void modifyText(org.eclipse.swt.events.ModifyEvent pEvent)

Specified by:
modifyText in interface org.eclipse.swt.events.ModifyListener

setValue

public void setValue(java.lang.String pValue)
Set a new value to the row.

Parameters:
pValue - the new value