org.nakedobjects.plugins.dnd.viewer.view.field
Class AbstractField

java.lang.Object
  extended by org.nakedobjects.plugins.dnd.viewer.view.simple.AbstractView
      extended by org.nakedobjects.plugins.dnd.viewer.view.field.AbstractField
All Implemented Interfaces:
java.lang.Cloneable, View
Direct Known Subclasses:
CheckboxField, ImageField, TextParseableFieldAbstract

public abstract class AbstractField
extends AbstractView


Field Summary
protected static int TEXT_WIDTH
           
 
Fields inherited from interface org.nakedobjects.plugins.dnd.View
HPADDING, VPADDING
 
Constructor Summary
protected AbstractField(Content content, ViewSpecification design, ViewAxis axis)
           
 
Method Summary
 boolean canFocus()
          Determines whether this view accepts keyboard focus.
protected  boolean cantClear()
           
protected  void clear()
           
 void contentMenuOptions(UserActionSet options)
          Called when the popup menu is being populated for this view.
protected  void copyToClipboard()
           
 void drag(InternalDrag drag)
          Indicates the drag started within this view's bounds is continuing.
 void dragCancel(InternalDrag drag)
          Default implementation - does nothing
 View dragFrom(Location location)
          Indicates the start of a drag within this view's bounds.
 void dragTo(InternalDrag drag)
          Indicates the drag started within this view's bounds has been finished (although the location may now be outside of its bounds).
 void draw(Canvas canvas)
          Called by the frame, or the parent view, when this view must redraw itself.
 void entered()
          Called as the mouse crosses the bounds, and ends up inside, of this view.
 void exited()
          Called as the mouse crosses the bounds, and ends up outside, of this view.
 int getBaseline()
           
 boolean getIdentified()
           
 Padding getPadding()
           
 View getRoot()
           
 boolean hasFocus()
           
 boolean indicatesForView(Location mouseLocation)
           
protected  void initiateSave(boolean moveToNextField)
           
 boolean isEmpty()
           
 void keyPressed(KeyboardAction key)
          Called when the user presses any key on the keyboard while this view has the focus.
 void keyReleased(int keyCode, int modifiers)
          Called when the user releases any key on the keyboard while this view has the focus.
 void keyTyped(char keyCode)
          Called when the user presses a non-control key (i.e.
protected  void pasteFromClipboard()
           
protected  boolean provideClearCopyPaste()
           
protected abstract  void save()
           
 java.lang.String toString()
           
 ViewAreaType viewAreaType(Location mouseLocation)
          Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.
 
Methods inherited from class org.nakedobjects.plugins.dnd.viewer.view.simple.AbstractView
addView, assignId, canChangeValue, contains, containsFocus, debug, debugStructure, dispose, drag, dragIn, dragOut, dragStart, drop, drop, editComplete, firstClick, focusLost, focusReceived, getAbsoluteLocation, getBounds, getContent, getFeedbackManager, getFocusManager, getId, getLocation, getMaximumSize, getParent, getRequiredSize, getSize, getSpecification, getState, getSubviews, getView, getViewAxis, getViewManager, getWorkspace, identify, invalidateContent, invalidateLayout, layout, limitBoundsWithin, limitBoundsWithin, markDamaged, markDamaged, mouseDown, mouseMoved, mouseUp, objectActionResult, pickupContent, pickupView, print, refresh, removeView, replaceOptions, replaceView, secondClick, setBounds, setContent, setFocusManager, setLocation, setMaximumSize, setParent, setSize, setSpecification, setView, setViewAxis, subviewFor, thirdClick, update, updateView, viewMenuOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT_WIDTH

protected static final int TEXT_WIDTH
See Also:
Constant Field Values
Constructor Detail

AbstractField

protected AbstractField(Content content,
                        ViewSpecification design,
                        ViewAxis axis)
Method Detail

canFocus

public boolean canFocus()
Description copied from interface: View
Determines whether this view accepts keyboard focus. If so focusLost and focusReceived will be called.

Specified by:
canFocus in interface View
Overrides:
canFocus in class AbstractView

provideClearCopyPaste

protected boolean provideClearCopyPaste()

cantClear

protected boolean cantClear()

clear

protected void clear()

copyToClipboard

protected void copyToClipboard()

pasteFromClipboard

protected void pasteFromClipboard()

drag

public void drag(InternalDrag drag)
Indicates the drag started within this view's bounds is continuing. By default does nothing.

Specified by:
drag in interface View
Overrides:
drag in class AbstractView

dragCancel

public void dragCancel(InternalDrag drag)
Default implementation - does nothing

Specified by:
dragCancel in interface View
Overrides:
dragCancel in class AbstractView

dragFrom

public View dragFrom(Location location)
Indicates the start of a drag within this view's bounds. By default does nothing.

Specified by:
dragFrom in interface View
Overrides:
dragFrom in class AbstractView

dragTo

public void dragTo(InternalDrag drag)
Indicates the drag started within this view's bounds has been finished (although the location may now be outside of its bounds). By default does nothing.

Specified by:
dragTo in interface View
Overrides:
dragTo in class AbstractView

draw

public void draw(Canvas canvas)
Description copied from interface: View
Called by the frame, or the parent view, when this view must redraw itself.

Specified by:
draw in interface View
Overrides:
draw in class AbstractView

entered

public void entered()
Description copied from interface: View
Called as the mouse crosses the bounds, and ends up inside, of this view. Is also called as the mouse returns into this view from a contained view.

Specified by:
entered in interface View
Overrides:
entered in class AbstractView

exited

public void exited()
Description copied from interface: View
Called as the mouse crosses the bounds, and ends up outside, of this view.

Specified by:
exited in interface View
Overrides:
exited in class AbstractView

getIdentified

public boolean getIdentified()

getPadding

public Padding getPadding()
Specified by:
getPadding in interface View
Overrides:
getPadding in class AbstractView

getRoot

public View getRoot()

hasFocus

public boolean hasFocus()
Specified by:
hasFocus in interface View
Overrides:
hasFocus in class AbstractView

isEmpty

public boolean isEmpty()

indicatesForView

public boolean indicatesForView(Location mouseLocation)

keyPressed

public void keyPressed(KeyboardAction key)
Called when the user presses any key on the keyboard while this view has the focus.

Specified by:
keyPressed in interface View
Overrides:
keyPressed in class AbstractView
Parameters:
key - TODO

keyReleased

public void keyReleased(int keyCode,
                        int modifiers)
Called when the user releases any key on the keyboard while this view has the focus.

Specified by:
keyReleased in interface View
Overrides:
keyReleased in class AbstractView

keyTyped

public void keyTyped(char keyCode)
Called when the user presses a non-control key (i.e. data entry keys and not shift, up-arrow etc). Such a key press will result in a prior call to keyPressed and a subsequent call to keyReleased.

Specified by:
keyTyped in interface View
Overrides:
keyTyped in class AbstractView

contentMenuOptions

public void contentMenuOptions(UserActionSet options)
Description copied from interface: View
Called when the popup menu is being populated for this view. Any content options that need to appear on the menu should be added to the menuOptions object.

Specified by:
contentMenuOptions in interface View
Overrides:
contentMenuOptions in class AbstractView

initiateSave

protected final void initiateSave(boolean moveToNextField)

save

protected abstract void save()

toString

public java.lang.String toString()
Overrides:
toString in class AbstractView

viewAreaType

public ViewAreaType viewAreaType(Location mouseLocation)
Description copied from interface: View
Determines if the user is invoking an action relating to this view, rather than to whatever this view represents.

Specified by:
viewAreaType in interface View
Overrides:
viewAreaType in class AbstractView
Returns:
true if the user is targeting the view itself, false if the user is targeting what is being represented

getBaseline

public int getBaseline()
Specified by:
getBaseline in interface View
Overrides:
getBaseline in class AbstractView


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.