adams.gui.goe
Class CronScheduleEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by adams.gui.goe.AbstractPropertyEditorSupport
          extended by adams.gui.goe.CronScheduleEditor
All Implemented Interfaces:
CustomStringRepresentationHandler, InlineEditorSupport, PropertyEditor

public class CronScheduleEditor
extends AbstractPropertyEditorSupport
implements CustomStringRepresentationHandler, InlineEditorSupport

A PropertyEditor for CronSchedule objects.

Version:
$Revision: 5016 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
CronSchedule

Field Summary
protected  ParameterPanel m_PanelParts
          for the parts of the expression.
protected  JTextField m_TextDayOfMonth
          the text field for the day-of-month.
protected  JTextField m_TextDayOfWeek
          the text field for the day-of-week.
protected  JTextField m_TextHours
          the text field for the hours.
protected  JTextField m_TextMinutes
          the text field for the minutes.
protected  JTextField m_TextMonth
          the text field for the month.
protected  JTextField m_TextSeconds
          the text field for the seconds.
protected  JTextField m_TextYear
          the text field for the year.
static String URL_EXPRESSION
          the URL for the CronExpression class.
 
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, m_ChosenOption, m_CustomEditor, m_WindowAdapter
 
Constructor Summary
CronScheduleEditor()
           
 
Method Summary
protected  JComponent createCustomEditor()
          Gets the custom editor component.
 Object fromCustomStringRepresentation(String str)
          Returns an object created from the custom string representation.
protected  String getCurrentExpression()
          Returns the current expression in the GUI.
 String getInlineValue()
          Returns the current value.
 String getJavaInitializationString()
          Returns a representation of the current property value as java source.
protected  void initForDisplay()
          Initializes the display of the value.
 boolean isInlineEditingAvailable()
          Checks whether inline editing is available.
 boolean isInlineValueValid(String value)
          Checks whether the value id valid.
 void paintValue(Graphics gfx, Rectangle box)
          Paints a representation of the current Object.
 void setInlineValue(String value)
          Sets the value to use.
 String toCustomStringRepresentation(Object obj)
          Returns a custom string representation of the object.
static String toString(AbstractOption option, Object object)
          Returns the Compound as string.
static Object valueOf(AbstractOption option, String str)
          Returns a Compound generated from the string.
 
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createWindowAdapter, getChosenOption, getCustomEditor, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_EXPRESSION

public static final String URL_EXPRESSION
the URL for the CronExpression class.

See Also:
Constant Field Values

m_PanelParts

protected ParameterPanel m_PanelParts
for the parts of the expression.


m_TextSeconds

protected JTextField m_TextSeconds
the text field for the seconds.


m_TextMinutes

protected JTextField m_TextMinutes
the text field for the minutes.


m_TextHours

protected JTextField m_TextHours
the text field for the hours.


m_TextDayOfMonth

protected JTextField m_TextDayOfMonth
the text field for the day-of-month.


m_TextMonth

protected JTextField m_TextMonth
the text field for the month.


m_TextDayOfWeek

protected JTextField m_TextDayOfWeek
the text field for the day-of-week.


m_TextYear

protected JTextField m_TextYear
the text field for the year.

Constructor Detail

CronScheduleEditor

public CronScheduleEditor()
Method Detail

toString

public static String toString(AbstractOption option,
                              Object object)
Returns the Compound as string.

Parameters:
option - the current option
object - the Compound object to convert
Returns:
the generated string

valueOf

public static Object valueOf(AbstractOption option,
                             String str)
Returns a Compound generated from the string.

Parameters:
option - the current option
str - the string to convert to a Compound
Returns:
the generated Compound

toCustomStringRepresentation

public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.

Specified by:
toCustomStringRepresentation in interface CustomStringRepresentationHandler
Parameters:
obj - the object to turn into a string
Returns:
the string representation

fromCustomStringRepresentation

public Object fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.

Specified by:
fromCustomStringRepresentation in interface CustomStringRepresentationHandler
Parameters:
str - the string to turn into an object
Returns:
the object

getJavaInitializationString

public String getJavaInitializationString()
Returns a representation of the current property value as java source.

Specified by:
getJavaInitializationString in interface PropertyEditor
Overrides:
getJavaInitializationString in class PropertyEditorSupport
Returns:
a value of type 'String'

paintValue

public void paintValue(Graphics gfx,
                       Rectangle box)
Paints a representation of the current Object.

Specified by:
paintValue in interface PropertyEditor
Overrides:
paintValue in class PropertyEditorSupport
Parameters:
gfx - the graphics context to use
box - the area we are allowed to paint into

getCurrentExpression

protected String getCurrentExpression()
Returns the current expression in the GUI.

Returns:
the expression

createCustomEditor

protected JComponent createCustomEditor()
Gets the custom editor component.

Specified by:
createCustomEditor in class AbstractPropertyEditorSupport
Returns:
the editor

isInlineEditingAvailable

public boolean isInlineEditingAvailable()
Checks whether inline editing is available.

Specified by:
isInlineEditingAvailable in interface InlineEditorSupport
Returns:
true if editing available

setInlineValue

public void setInlineValue(String value)
Sets the value to use.

Specified by:
setInlineValue in interface InlineEditorSupport
Parameters:
value - the value to use

getInlineValue

public String getInlineValue()
Returns the current value.

Specified by:
getInlineValue in interface InlineEditorSupport
Returns:
the current value

isInlineValueValid

public boolean isInlineValueValid(String value)
Checks whether the value id valid.

Specified by:
isInlineValueValid in interface InlineEditorSupport
Parameters:
value - the value to check
Returns:
true if valid

initForDisplay

protected void initForDisplay()
Initializes the display of the value.

Overrides:
initForDisplay in class AbstractPropertyEditorSupport


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.