jimm.datavision.gui
Class EditWinWidget

java.lang.Object
  extended by jimm.datavision.gui.FieldWidget
      extended by jimm.datavision.gui.EditWinWidget
All Implemented Interfaces:
java.awt.dnd.DropTargetListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, java.util.Observer, javax.swing.event.MouseInputListener
Direct Known Subclasses:
FormulaWidget, ParameterWidget, UserColumnWidget

public abstract class EditWinWidget
extends FieldWidget

An abstract superclass for widgets that open separate windows used to edit the widget.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  javax.swing.JDialog editor
           
 
Fields inherited from class jimm.datavision.gui.FieldWidget
action, ACTION_INACTION, ACTION_MOVE, ACTION_POPPING_UP_MENU, ACTION_STRETCH_BOTTOM, ACTION_STRETCH_LEFT, ACTION_STRETCH_RIGHT, ACTION_STRETCH_TOP, actionStartedYet, aggregatesMenuItem, alignSubmenu, componentMap, formatMenuItem, GRAB_EDGE_WIDTH, MIN_SIZE, mouseChangedSelectedState, nameItem, popup, POPUP_FONT, preMoveInfo, preStretchInfo, sectionWidget, selected, showOrHide, sizeSubmenu, swingField
 
Constructor Summary
EditWinWidget(SectionWidget sw, Field field)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Performs some action based on the action command string (the menu item text).
protected  void addCustomPopupItems()
          This hook lets subclasses customize the popup menu.
protected abstract  javax.swing.JDialog createEditor()
          Creates and returns a new frame suitable for editing this widget.
protected abstract  java.lang.String getEditorLabel()
          Returns the name edit window's label (the prompt that goes before the text edit field).
protected abstract  java.lang.String getEditorTitle()
          Returns the name edit window's title.
protected abstract  java.lang.String getWidgetName()
          Returns the name string.
 void mouseClicked(java.awt.event.MouseEvent e)
          if this is a double-click, start editing; else handle the mouse event like a normal field widget.
 void openEditor()
          Makes our text editable and starts editing.
protected  void rename()
          Opens a name editor.
abstract  void setWidgetName(java.lang.String newName)
          Set editable object's name.
protected  void updateEditor()
          Updates the editor.
 
Methods inherited from class jimm.datavision.gui.FieldWidget
actionFromPosition, align, buildPopupMenu, cursorForPosition, delete, doDelete, doDrag, doSelect, doSetVisibility, dragEnter, dragExit, dragOver, drop, dropActionChanged, enableMenuItems, finalize, findFieldWidgetOwning, getColor, getComponent, getField, getPopupNameText, getPreMoveInfo, getSectionWidget, isSelected, keyPressed, keyReleased, keyTyped, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mousePressReleaseCommon, mouseReleased, moveToSection, pickUp, putDown, resetCursor, select, setVisibilityLook, showPopupMenu, size, snapBack, startStretching, stopStretching, toggleVisibility, toString, update, usesFormat
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

editor

protected javax.swing.JDialog editor
Constructor Detail

EditWinWidget

EditWinWidget(SectionWidget sw,
              Field field)
Constructor.

Parameters:
sw - section widget in which the field's new widget will reside
field - a report field
Method Detail

addCustomPopupItems

protected void addCustomPopupItems()
Description copied from class: FieldWidget
This hook lets subclasses customize the popup menu. By default, nothing happens.

Overrides:
addCustomPopupItems in class FieldWidget

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Performs some action based on the action command string (the menu item text).

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class FieldWidget

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
if this is a double-click, start editing; else handle the mouse event like a normal field widget.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class FieldWidget
Parameters:
e - mouse event

openEditor

public void openEditor()
Makes our text editable and starts editing.


createEditor

protected abstract javax.swing.JDialog createEditor()
Creates and returns a new frame suitable for editing this widget.

Returns:
a frame (window or dialog) used to edit the widget

updateEditor

protected void updateEditor()
Updates the editor. This method supplies default do-nothing behavior.


rename

protected void rename()
Opens a name editor.


getWidgetName

protected abstract java.lang.String getWidgetName()
Returns the name string.

Returns:
the name to be edited

getEditorTitle

protected abstract java.lang.String getEditorTitle()
Returns the name edit window's title.


getEditorLabel

protected abstract java.lang.String getEditorLabel()
Returns the name edit window's label (the prompt that goes before the text edit field).


setWidgetName

public abstract void setWidgetName(java.lang.String newName)
Set editable object's name. The new name is guaranteed not to be null.

Parameters:
newName - the new name string