project35.desktopDeployment
Class TextFieldView
java.lang.Object
project35.desktopDeployment.DataFieldView
project35.desktopDeployment.EditFieldView
project35.desktopDeployment.TextFieldView
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener, TextComponentSupplier, ContextHelpItem
- Direct Known Subclasses:
- IDFieldView
public class TextFieldView
- extends EditFieldView
- implements TextComponentSupplier, java.awt.event.ActionListener
Renders text field views for EditFieldModel model components.
Text fields can be associated with ontology services. If a field has
at least one service, the field label will be prefixed by a "*"
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)
Methods inherited from class project35.desktopDeployment.DataFieldView |
enableContextHelp, getActivityArea, getFont, getHelpLink, getLabel, getName, hasFocus, indicateErrors, initialise, isContextHelpEnabled, isRequiredField, setActivityArea, setHelpLink, setName, setRequiredField |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
minTextComponentWidth
public static int minTextComponentWidth
text
protected javax.swing.text.JTextComponent text
ontologyServiceManager
protected OntologyServiceManager ontologyServiceManager
ontologyServices
protected java.util.ArrayList ontologyServices
textFieldModel
protected TextFieldModel textFieldModel
TextFieldView
public TextFieldView()
initialise
public void initialise(TextFieldModel textFieldModel,
Project35FormContext project35FormContext)
deregisterToolTipComponents
public void deregisterToolTipComponents()
- Description copied from class:
EditFieldView
- helps ensure that the field view removes its UI components from the the
tool tip manager
- Overrides:
deregisterToolTipComponents
in class EditFieldView
newJTextField
protected javax.swing.JTextField newJTextField()
createOntologyServices
protected java.util.ArrayList createOntologyServices(OntologyServiceConfiguration[] ontologyServiceConfigurations)
- creates ontology services given a list of ontology service descriptions.
Project35 creates ontology services on an as needed basis. The pro to this
approach is that services are not needlessly instantiated. The con is
that the speed at which a new record view is rendered may be slowed
through the creation process. This should only happen the first few
times a new record in the tree is selected. Ontology sources are cached
to prevent needless instantiation that could take up time.
reset
public void reset()
getSelectedText
public java.lang.String getSelectedText()
getValue
public java.lang.String getValue()
- Overrides:
getValue
in class EditFieldView
getTextComponent
public javax.swing.text.JTextComponent getTextComponent()
- Specified by:
getTextComponent
in interface TextComponentSupplier
setEditable
public void setEditable(boolean isEditable)
disableOntologyServices
public void disableOntologyServices()
pasteClipboardText
public void pasteClipboardText()
- Specified by:
pasteClipboardText
in interface TextComponentSupplier
setFieldValue
public void setFieldValue(java.lang.String value)
- Specified by:
setFieldValue
in interface TextComponentSupplier
- Specified by:
setFieldValue
in class EditFieldView
getPrimaryOntologyService
public OntologyService getPrimaryOntologyService()
- gets the first ontology service associated with this field.
the service is used to set the current ontology source in
the touch type ontology dialog
- Returns:
- the first ontology service associated with the field
clearValues
public void clearValues()
- clears the value of the text field
identical to reset()
keepValue
public void keepValue()
- Specified by:
keepValue
in class EditFieldView
restoreValue
public void restoreValue()
- Specified by:
restoreValue
in class EditFieldView
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
- Overrides:
actionPerformed
in class EditFieldView
isDirty
public boolean isDirty()
- Specified by:
isDirty
in class EditFieldView
- Returns:
- whether the displayed value matches the value stored in
the underlying model