project35.desktopDeployment
Class DateFieldView

java.lang.Object
  extended by project35.desktopDeployment.DataFieldView
      extended by project35.desktopDeployment.EditFieldView
          extended by project35.desktopDeployment.DateFieldView
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, ContextHelpItem

public class DateFieldView
extends EditFieldView

Visualises a date field. Project35 allows the user to choose which format to use for interpretting and representing date values. However, it always stores a canonical date value in the underlying model.


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Field Summary
 
Fields inherited from class project35.desktopDeployment.EditFieldView
edit, editFieldModel, ontologyContext, plugins, pluginsList, schemaConceptPropertyManager
 
Fields inherited from class project35.desktopDeployment.DataFieldView
activityArea, collator, dataFieldModel, font, label, name, project35FormContext, project35UIFactory
 
Constructor Summary
DateFieldView()
           
 
Method Summary
 void changeFont(java.awt.Font font)
           
 java.lang.String getCanonicalValue()
           
 java.lang.String getSelectedText()
           
 java.lang.String getValue()
           
 void initialise(EditFieldModel editFieldModel, Project35FormContext project35FormContext)
           
 boolean isDirty()
          determines whether the saved and current values are the same In this case, the current value must first be converted to a canonical value so it can be compared with the canonical date stored in the model
 void keepValue()
          commits the date value to the underlying model component.
 void refreshLabel()
          used to update the date field label in cases where the user has changed the format of the date
 void restoreValue()
          restores the text value with the current value in the model
 void setFieldValue(java.lang.String value)
          commits the field value to the underlying model
 void setName(java.lang.String name)
          overrides the setName method of DataFieldView.
 void setValue(java.lang.String value)
           
 
Methods inherited from class project35.desktopDeployment.EditFieldView
actionPerformed, choosePlugin, deregisterToolTipComponents, editFieldWithEditingComponent, getEditFieldEditingComponent, getModel, getValueSupplier, setUnits, setValueSupplier
 
Methods inherited from class project35.desktopDeployment.DataFieldView
enableContextHelp, getActivityArea, getFont, getHelpLink, getLabel, getName, hasFocus, indicateErrors, initialise, isContextHelpEnabled, isRequiredField, setActivityArea, setHelpLink, setRequiredField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFieldView

public DateFieldView()
Method Detail

initialise

public void initialise(EditFieldModel editFieldModel,
                       Project35FormContext project35FormContext)
Overrides:
initialise in class EditFieldView

setFieldValue

public void setFieldValue(java.lang.String value)
commits the field value to the underlying model

Specified by:
setFieldValue in class EditFieldView

getSelectedText

public java.lang.String getSelectedText()

refreshLabel

public void refreshLabel()
used to update the date field label in cases where the user has changed the format of the date


getCanonicalValue

public java.lang.String getCanonicalValue()
Returns:
the canonical value of the date value

setValue

public void setValue(java.lang.String value)

isDirty

public boolean isDirty()
determines whether the saved and current values are the same In this case, the current value must first be converted to a canonical value so it can be compared with the canonical date stored in the model

Specified by:
isDirty in class EditFieldView
Returns:
whether there is a difference between the displayed value and the value saved value contained in the underlying model component.

setName

public void setName(java.lang.String name)
overrides the setName method of DataFieldView. This method needs to consider both the name and the string that describes the current date format pattern accepted by the field

Overrides:
setName in class DataFieldView
Parameters:
name - the name of the field

restoreValue

public void restoreValue()
restores the text value with the current value in the model

Specified by:
restoreValue in class EditFieldView

getValue

public java.lang.String getValue()
Overrides:
getValue in class EditFieldView

keepValue

public void keepValue()
commits the date value to the underlying model component. Assumes the date is valid. It has to do a conversion between the value as it appears in the current date format and the canonical value that is actually going to be stored in a data file

Specified by:
keepValue in class EditFieldView

changeFont

public void changeFont(java.awt.Font font)
Overrides:
changeFont in class EditFieldView