org.ow2.clif.scenario.isac.egui.plugins.gui
Class ParameterWidget

java.lang.Object
  extended by org.ow2.clif.scenario.isac.egui.plugins.gui.ParameterWidget
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

public class ParameterWidget
extends java.lang.Object
implements org.eclipse.swt.events.SelectionListener

Implementation of the object which included widgets to edit parameters

Author:
JC Meillaud, A Peyrard, Bruno Dillenseger, Florian Francheteau

Constructor Summary
ParameterWidget(int style, java.lang.String name, java.lang.String labelValue, java.util.Map<java.lang.String,java.lang.Object> params, org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.ModifyListener listener)
          Constructor, build a new WidgetParam
 
Method Summary
 boolean addEmptyEntryForTable(java.lang.Object source)
          This method adds an entry on the table widget
 boolean addEmptyFieldForNField(java.lang.Object source)
          Add a new field to the current nfield
 void addListeners()
          This method add a listener to the current widget
 void dispose()
          dispose the element used
 org.eclipse.swt.widgets.Composite getComposite()
          Get the widget to add new widget on it, used for group widget
 java.lang.String getName()
          Attribute name getter
 int getStyle()
           
 java.lang.String getValue()
          Method which permit to get the parameter value
 boolean modifyText(java.lang.Object source)
          modify the text of a table entry
 boolean removeLastEntryForTable(java.lang.Object source)
          This method removes the last entry of the table widget
 boolean removeLastFieldForNField(java.lang.Object source)
          Remove the last field of the nfield
 void removeListeners()
          This method remove the listener of the current widget
 void setComboValues(java.util.Vector values)
          Set the values of a combo
 void setValue(java.lang.String value)
          Set the widget value
 java.lang.String toString()
           
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent arg0)
          Do nothing
 void widgetSelected(org.eclipse.swt.events.SelectionEvent arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterWidget

public ParameterWidget(int style,
                       java.lang.String name,
                       java.lang.String labelValue,
                       java.util.Map<java.lang.String,java.lang.Object> params,
                       org.eclipse.swt.widgets.Composite parent,
                       org.eclipse.swt.events.ModifyListener listener)
Constructor, build a new WidgetParam

Parameters:
style - The style of the widget for editing this param
name - The name of the parameter
labelValue - The value of the label for this widget, if it is not defined use the name of the param
params - The parameter to build the widget
parent - The parent composite to add the new widget
listener - The modify listener to set on the parameter widget
Method Detail

getValue

public java.lang.String getValue()
Method which permit to get the parameter value

Returns:
String value

setValue

public void setValue(java.lang.String value)
Set the widget value

Parameters:
value - The value to set

setComboValues

public void setComboValues(java.util.Vector values)
Set the values of a combo

Parameters:
values - The values to be set

addEmptyFieldForNField

public boolean addEmptyFieldForNField(java.lang.Object source)
Add a new field to the current nfield

Parameters:
source - The source of the event
Returns:
true if a new field has been added, false otherwise (i.e. when the event source is not the add new field button)

addEmptyEntryForTable

public boolean addEmptyEntryForTable(java.lang.Object source)
This method adds an entry on the table widget

Parameters:
source - The source of the event
Returns:
true if the source is our add button, else false

removeLastEntryForTable

public boolean removeLastEntryForTable(java.lang.Object source)
This method removes the last entry of the table widget

Parameters:
source - The source of the event
Returns:
true if the source is our remove button, else false

removeLastFieldForNField

public boolean removeLastFieldForNField(java.lang.Object source)
Remove the last field of the nfield

Parameters:
source - The source of the event
Returns:
true if the last field has been removed, false otherwise (i.e. when the event source is not the remove field button)

removeListeners

public void removeListeners()
This method remove the listener of the current widget


addListeners

public void addListeners()
This method add a listener to the current widget


getComposite

public org.eclipse.swt.widgets.Composite getComposite()
Get the widget to add new widget on it, used for group widget

Returns:
Composite

dispose

public void dispose()
dispose the element used


getName

public java.lang.String getName()
Attribute name getter

Returns:
The name of the parameter

getStyle

public int getStyle()
Returns:
the widget style identifier

modifyText

public boolean modifyText(java.lang.Object source)
modify the text of a table entry

Parameters:
source -
Returns:
boolean

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent arg0)
Do nothing

Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener
See Also:
SelectionListener.widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent arg0)
Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener
See Also:
SelectionListener.widgetSelected(org.eclipse.swt.events.SelectionEvent)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object