project35.tabletDeployment
Class TabletTextFieldView
java.lang.Object
project35.desktopDeployment.DataFieldView
project35.desktopDeployment.EditFieldView
project35.tabletDeployment.TabletTextFieldView
- All Implemented Interfaces:
- ActionListener, EventListener, CustomisedFieldView, TextComponentSupplier, ContextHelpItem
- Direct Known Subclasses:
- TabletIDFieldView
public class TabletTextFieldView
- extends EditFieldView
- implements TextComponentSupplier, CustomisedFieldView, 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, 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
dialog
protected TabletProject35Dialog dialog
text
protected JTextComponent text
ontologyServiceManager
protected OntologyServiceManager ontologyServiceManager
ontologyServices
protected ArrayList ontologyServices
textFieldModel
protected TextFieldModel textFieldModel
markUp
protected JButton markUp
clear
protected JButton clear
useTextArea
protected boolean useTextArea
pointWithinMarkUp
protected Point pointWithinMarkUp
pluginsList
protected ArrayList pluginsList
TabletTextFieldView
public TabletTextFieldView()
initialise
public void initialise(DataFieldModel dataFieldModel,
Project35FormContext project35FormContext)
- this is an awkward construction that should never be called
but is here to satisfy methods of EditFieldView. It is only
initialiseField that will be called.
- Overrides:
initialise in class DataFieldView
- Parameters:
dataFieldModel - the model used by the view
initialiseField
public void initialiseField(Project35FormContext project35FormContext,
DataFieldModel dataFieldModel,
ArrayList additionalParameters)
- Specified by:
initialiseField in interface CustomisedFieldView
newJTextField
protected JTextField newJTextField()
getSelectedText
public String getSelectedText()
getValue
public String getValue()
- Overrides:
getValue in class EditFieldView
getTextComponent
public JTextComponent getTextComponent()
- Specified by:
getTextComponent in interface TextComponentSupplier
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
createOntologyServices
protected 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.
disableOntologyServices
public void disableOntologyServices()
keepValue
public void keepValue()
- Specified by:
keepValue in class EditFieldView
restoreValue
public void restoreValue()
- Specified by:
restoreValue in class EditFieldView
pasteClipboardText
public void pasteClipboardText()
- Specified by:
pasteClipboardText in interface TextComponentSupplier
setFieldValue
public void setFieldValue(String value)
- Specified by:
setFieldValue in interface TextComponentSupplier- Specified by:
setFieldValue in class EditFieldView
reset
public void reset()
setEditable
public void setEditable(boolean isEditable)
clearValues
public void clearValues()
- clears the value of the text field
identical to reset()
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
choosePlugin
protected void choosePlugin()
- Overrides:
choosePlugin in class EditFieldView
actionPerformed
public void actionPerformed(ActionEvent event)
- Specified by:
actionPerformed in interface 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