project35.desktopDeployment
Class DataFieldView

java.lang.Object
  extended by project35.desktopDeployment.DataFieldView
All Implemented Interfaces:
ContextHelpItem
Direct Known Subclasses:
EditFieldView, ListFieldView

public abstract class DataFieldView
extends java.lang.Object
implements ContextHelpItem

Describes basic aspects of a field view including context sensitive help and whether field should indicate a required or optional model component. this class complements project35.model.DataFieldModel


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
protected  javax.swing.JComponent activityArea
           
protected  java.text.Collator collator
           
protected  DataFieldModel dataFieldModel
           
protected  java.awt.Font font
           
protected  javax.swing.JLabel label
           
protected  java.lang.String name
           
protected  Project35FormContext project35FormContext
           
protected  Project35UIFactory project35UIFactory
           
 
Constructor Summary
DataFieldView()
           
 
Method Summary
 void changeFont(java.awt.Font font)
           
 void deregisterToolTipComponents()
           
 void enableContextHelp(boolean enableContextHelp)
          turns context help sensitivity on or off
 java.awt.Component getActivityArea()
           
 java.awt.Font getFont()
           
 java.net.URL getHelpLink()
           
 javax.swing.JLabel getLabel()
           
 java.lang.String getName()
           
 boolean hasFocus()
           
 void indicateErrors(boolean indicateErrors)
           
 void initialise(DataFieldModel dataFieldModel, Project35FormContext project35FormContext)
          sets the model used by the view.
 boolean isContextHelpEnabled()
           
 boolean isRequiredField()
           
protected  void setActivityArea(javax.swing.JComponent activityArea)
          sets the activity area of the field.
 void setHelpLink(java.net.URL helpLink)
          sets the context help for this field
 void setName(java.lang.String name)
          sets the name of the field.
 void setRequiredField(boolean isRequiredField)
          sets whether the field is required or optional.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

protected javax.swing.JLabel label

font

protected java.awt.Font font

name

protected java.lang.String name

activityArea

protected javax.swing.JComponent activityArea

dataFieldModel

protected DataFieldModel dataFieldModel

project35FormContext

protected Project35FormContext project35FormContext

project35UIFactory

protected Project35UIFactory project35UIFactory

collator

protected java.text.Collator collator
Constructor Detail

DataFieldView

public DataFieldView()
Method Detail

initialise

public void initialise(DataFieldModel dataFieldModel,
                       Project35FormContext project35FormContext)
sets the model used by the view. Called by subclasses to take care of things like setting context sensitive help links and to indicate whether field is required or optional.

Parameters:
dataFieldModel - the model used by the view

getLabel

public javax.swing.JLabel getLabel()

getActivityArea

public java.awt.Component getActivityArea()

getName

public java.lang.String getName()

getHelpLink

public java.net.URL getHelpLink()
Specified by:
getHelpLink in interface ContextHelpItem
Returns:
the URL for the HTML help page associated with the item

hasFocus

public boolean hasFocus()

isRequiredField

public boolean isRequiredField()

getFont

public java.awt.Font getFont()

isContextHelpEnabled

public boolean isContextHelpEnabled()
Specified by:
isContextHelpEnabled in interface ContextHelpItem
Returns:
whether context help mode is currently activated for item

indicateErrors

public void indicateErrors(boolean indicateErrors)

deregisterToolTipComponents

public void deregisterToolTipComponents()

setRequiredField

public void setRequiredField(boolean isRequiredField)
sets whether the field is required or optional. in the views required fields have bold print labels. Labels for optional fields appear in plain text

Parameters:
isRequiredField - true if the field is required; false if the field is optional

setActivityArea

protected void setActivityArea(javax.swing.JComponent activityArea)
sets the activity area of the field. This can be many things such as a text field, a JList, a panel of radio buttons or a combination box

Parameters:
activityArea - the part of the field that receives data entry.

setHelpLink

public void setHelpLink(java.net.URL helpLink)
sets the context help for this field

Specified by:
setHelpLink in interface ContextHelpItem
Parameters:
helpLink - the URL that provides information about a model field

setName

public void setName(java.lang.String name)
sets the name of the field.

Parameters:
name - the name of the field

enableContextHelp

public void enableContextHelp(boolean enableContextHelp)
turns context help sensitivity on or off

Specified by:
enableContextHelp in interface ContextHelpItem
Parameters:
enableContextHelp - true if context help is on; otherwise false

changeFont

public void changeFont(java.awt.Font font)