Ontimize 5.2072EN

com.ontimize.gui.field
Class MemoDataField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.ontimize.gui.field.DataField
                      extended bycom.ontimize.gui.field.MemoDataField
All Implemented Interfaces:
AccessForm, javax.accessibility.Accessible, ApplicationPreferencesListener, DataComponent, java.util.EventListener, FormComponent, Freeable, HasHelpIdComponent, HasPreferenceComponent, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, OpenDialog, SecureElement, java.io.Serializable, ValueChangeDataComponent
Direct Known Subclasses:
HTMLDataField, RTFDataField, XMLDataField

public class MemoDataField
extends DataField
implements OpenDialog, Freeable

This class implements a memo data field. This field could be used like a text box in a description for a user or a product.

Author:
Imatia Innovation
See Also:
Serialized Form

Nested Class Summary
protected  class MemoDataField.InnerDocumentListener
          This class implements a inner listener for document.
 
Nested classes inherited from class com.ontimize.gui.field.DataField
DataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButton
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean activationScrollTip
          The condition of scroll tip activation.
static java.lang.String DE
          The key for "OF" text.
protected  FindDialog dQuery
          A reference for a find dialog.
protected  boolean expandVertical
          The reference to vertical expansion.
protected  MemoDataField.InnerDocumentListener innerListener
          The reference to inner listener.
protected  int maximumTextLength
          The maximum text length.
protected  java.awt.Frame parentFrame
          The reference for parent frame.
static java.lang.String queryKey
          The key for search.
protected  int rows
          The memo data field rows.
protected  javax.swing.JScrollPane scroll
          A reference for a scroll.
protected  TipScroll scrollTip
          A reference for a scroll tip.
protected  javax.swing.JMenuItem searchMenu
          A reference for a search menu.
static java.lang.String selectAllKey
          The key for select all.
protected  javax.swing.JMenuItem selectAllMenu
          A reference for a all selection menu.
protected  boolean sqlTypeText
          The condition about the SQL type: False -> VARCHAR ; True -> LONGVARCHAR.
static boolean tabTransferFocus
           
protected  java.lang.String translateDE
          The reference to translate the "OF" text.
protected  javax.swing.undo.UndoManager undoManager
           
protected  boolean uppercase
          The reference for upper case condition.
static java.lang.String WHITE_SPACE
          The key for a white space.
 
Fields inherited from class com.ontimize.gui.field.DataField
advancedQueryMode, ALIGN, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, alignment, ASTERISK_REQUIRED_STYLE, ATTR, attribute, backgroundColor, BGCOLOR, bold, BOLD, BORDER, BORDER_REQUIRED_STYLE, borderText, BOTTOM, CENTER, CLIPBOARD_COPY, CLIPBOARD_COPY_es_ES, CLIPBOARD_CUT, CLIPBOARD_CUT_es_ES, CLIPBOARD_PASTE, CLIPBOARD_PASTE_es_ES, conditions, dataField, DEFAULT_BORDER, DEFAULT_BOTTOM_MARGIN, DEFAULT_FIELD_LEFT_MARGIN, DEFAULT_FIELD_RIGHT_MARGIN, DEFAULT_LABEL_LEFT_MARGIN, DEFAULT_LABEL_RIGHT_MARGIN, DEFAULT_PARENT_MARGIN, DEFAULT_PARENT_MARGIN_FOR_SCROLL, DEFAULT_TOP_MARGIN, defaultAsteriskColor, DEFAULTBORDER, defaultDisableBackgroundColor, defaultFieldButtonHigh, defaultPreferenceTextNotRetrievedFromPreferences, DEFINE_HELP_FIELD_PREFERENCE, dim, DIM, disabledbgcolor, DISABLEDBGCOLOR, empty, enabled, ENABLED, FIELD_HELP_TIP, fieldlistenerFocus, fieldSize, fireValueEvents, FOCUS_BACKGROUNDCOLOR, FONT, fontColor, FONTCOLOR, fontSize, FONTSIZE, height, HEIGHT, incrementalFont, initPreferenceHelpText, isEnabled, LABELALIGN, labelComponent, LABELFONT, LABELFONTCOLOR, labelPosition, LABELPOSITION, LABELSIZE, labelText, LABELVISIBLE, LEFT, locale, LOWERED, menuCopy, menuCut, menuDefineHelpPreference, menuHelpPreferences, menuPaste, modifiable, NO_STR, NONE, noRequiredBorder, OPAQUE, originalSize, OUTBORDER, panel, parentForm, permissionActivate, permissionVisible, popupMenu, RAISED, redimensionPanel, redimensJTextField, required, REQUIRED, requiredBorder, REQUIREDBORDER, requiredFieldBackgroundColor, resources, restricted, RIGHT, show, showLabel, SIZE, TEXT_STR, TEXTALIGN, textAlignment, textHelpPreference, TIP, tipKey, TOP, validData, VALIGN, Valignment, valueListener, valueSave, VISIBLE, VISUALIZE_HELP_FIELD_PREFERENCE, weightDataFieldH, weightPanelH, width, WIDTH, x, X, y, Y, YES_STR
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.ontimize.gui.field.DataComponent
COMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2
 
Fields inherited from interface com.ontimize.gui.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface com.ontimize.gui.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
MemoDataField(java.util.Hashtable params)
          The class constructor.
 
Method Summary
protected  void createDataField()
          Creates the field and overrides the JComponent.processKeyEvent(KeyEvent) method for managing focus.
protected  void createPopupMenu()
          Creates a pop-up menu.
 void deleteData()
          The method to delete data for component.
protected  void enableInnerListener(boolean enable)
          This method allows to enable/disable the ValueEvent events notifier.
 void free()
          Makes the object to release the resources.
 java.lang.Object getConstraints(java.awt.LayoutManager parentLayout)
          Gets the constraints needed to adapt the field to the container from init
protected  int getRowNumber()
          Gets the row number.
 int getSQLDataType()
          Returns the sql data type according to java.sql.Types
 java.lang.String getText()
          Gets text.
 java.util.Vector getTextsToTranslate()
          Returns all the texts in the element suitable for being translated.
 java.lang.Object getValue()
          Gets the value of a component.
protected  void hideScrollTip()
          Hides the scroll tip.
 void init(java.util.Hashtable params)
          Initializes parameters.
protected  void installInnerListener()
          Adds a inner listener for document.
protected  void installScrollListener()
          Installs the scroll listener.
 boolean isEmpty()
          Checks the data existence in component.
protected  void registerUndoableListener()
           
protected  void registerUndoRedoActions()
           
 void setComponentLocale(java.util.Locale l)
           
 void setMaxLength(int l)
          Sets the max length of field.
 void setParentFrame(java.awt.Frame parentFrame)
          This method is called from Form for each component that implements this interface.
 void setResourceBundle(java.util.ResourceBundle res)
          Sets the language resource bundle.
 void setValue(java.lang.Object value)
          Sets the value for component.
protected  void showPopupMenu(java.awt.Component source, int x, int y)
          Shows the pop-up menu.
protected  void showScrollTip(javax.swing.JScrollBar scrollBar, int x, int y, int row)
          Shows the scroll tip.
protected  void updateBackgroundColor()
          Updates the background color.
 
Methods inherited from class com.ontimize.gui.field.DataField
addFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, defineHelpField, finalize, fireValueChanged, getAttribute, getBorder, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelComponentText, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isModifiable, isModified, isRequired, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setDisabledbgcolor, setEnabled, setFont, setFontColor, setFontSize, setLabelFontColor, setModifiable, setParentForm, setRequired, setRequiredFieldBackground, setVisible, updateBackgroundColor, updateFont, updateTip, updateUI, validateComponentPositions
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rows

protected int rows
The memo data field rows. By default, 2.


sqlTypeText

protected boolean sqlTypeText
The condition about the SQL type: False -> VARCHAR ; True -> LONGVARCHAR. By default, false.


searchMenu

protected javax.swing.JMenuItem searchMenu
A reference for a search menu. By default, null.


selectAllMenu

protected javax.swing.JMenuItem selectAllMenu
A reference for a all selection menu.


queryKey

public static java.lang.String queryKey
The key for search.


selectAllKey

public static java.lang.String selectAllKey
The key for select all.


parentFrame

protected java.awt.Frame parentFrame
The reference for parent frame. By default, null.


dQuery

protected FindDialog dQuery
A reference for a find dialog. By default, null.

See Also:
FindDialog

scrollTip

protected TipScroll scrollTip
A reference for a scroll tip. By default, null.

See Also:
TipScroll

activationScrollTip

protected boolean activationScrollTip
The condition of scroll tip activation. By default, true.


scroll

protected javax.swing.JScrollPane scroll
A reference for a scroll. By default, null.


DE

public static final java.lang.String DE
The key for "OF" text.

See Also:
Constant Field Values

WHITE_SPACE

public static final java.lang.String WHITE_SPACE
The key for a white space.

See Also:
Constant Field Values

translateDE

protected java.lang.String translateDE
The reference to translate the "OF" text. By default, "OF".


maximumTextLength

protected int maximumTextLength
The maximum text length. By default, -1.


uppercase

protected boolean uppercase
The reference for upper case condition. By default, false.


expandVertical

protected boolean expandVertical
The reference to vertical expansion. By default, false.


undoManager

protected javax.swing.undo.UndoManager undoManager

tabTransferFocus

public static boolean tabTransferFocus

innerListener

protected MemoDataField.InnerDocumentListener innerListener
The reference to inner listener. By default, null.

Constructor Detail

MemoDataField

public MemoDataField(java.util.Hashtable params)
The class constructor. Calls to super constructor, initializes parameters and installs listeners.

Parameters:
params - the component parameters
Method Detail

registerUndoableListener

protected void registerUndoableListener()

registerUndoRedoActions

protected void registerUndoRedoActions()

getText

public java.lang.String getText()
Description copied from class: DataField
Gets text.

Overrides:
getText in class DataField
Returns:
the text in this implementation returns null.

createDataField

protected void createDataField()
Creates the field and overrides the JComponent.processKeyEvent(KeyEvent) method for managing focus.


installScrollListener

protected void installScrollListener()
Installs the scroll listener.


showScrollTip

protected void showScrollTip(javax.swing.JScrollBar scrollBar,
                             int x,
                             int y,
                             int row)
Shows the scroll tip.

Parameters:
scrollBar - the reference to scroll bar.
x - the x position
y - the y position
row - the row number

getRowNumber

protected int getRowNumber()
Gets the row number.

Returns:
the row number

hideScrollTip

protected void hideScrollTip()
Hides the scroll tip.


init

public void init(java.util.Hashtable params)
Initializes parameters.

Specified by:
init in interface FormComponent
Overrides:
init in class DataField
Parameters:
params - the hashtable with parameters

attribute values default required meaning
sqltexttype yes/no no no no -> Varchar ; yes -> LongVarchar.
uppercase yes/no no no The uppercase condition.
rows no The number of rows.
maxlength no The maxlength for component.
expand yes/no no The vertical expansion.

getSQLDataType

public int getSQLDataType()
Description copied from interface: DataComponent
Returns the sql data type according to java.sql.Types

Specified by:
getSQLDataType in interface DataComponent
Returns:
the Integer type

getValue

public java.lang.Object getValue()
Description copied from interface: DataComponent
Gets the value of a component.

Specified by:
getValue in interface DataComponent
Returns:
the object with value.

isEmpty

public boolean isEmpty()
Description copied from interface: DataComponent
Checks the data existence in component.

Specified by:
isEmpty in interface DataComponent
Returns:
true when component is empty

setValue

public void setValue(java.lang.Object value)
Description copied from interface: DataComponent
Sets the value for component.

Specified by:
setValue in interface DataComponent
Parameters:
value - the object with value to set

deleteData

public void deleteData()
Description copied from interface: DataComponent
The method to delete data for component.

Specified by:
deleteData in interface DataComponent

installInnerListener

protected void installInnerListener()
Adds a inner listener for document.


enableInnerListener

protected void enableInnerListener(boolean enable)
This method allows to enable/disable the ValueEvent events notifier. So, inner events will be not triggered when inner listener is disabled. It is advisable disabling the listener only when content is inserted by program.

Parameters:
enable - the condition to enable/disable the inner listener.

setParentFrame

public void setParentFrame(java.awt.Frame parentFrame)
Description copied from interface: OpenDialog
This method is called from Form for each component that implements this interface. It fixes the parent frame for element. This frame is needed to open the modal dialog.

Specified by:
setParentFrame in interface OpenDialog
Parameters:
parentFrame - the frame

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Description copied from interface: Internationalization
Sets the language resource bundle. When the application changes the configured language, for all the objects that implement this interface this method must be called with the new file.
The method must translate all the elements that have texts in the GUI

Specified by:
setResourceBundle in interface Internationalization
Overrides:
setResourceBundle in class DataField

setComponentLocale

public void setComponentLocale(java.util.Locale l)
Specified by:
setComponentLocale in interface Internationalization
Overrides:
setComponentLocale in class DataField

getTextsToTranslate

public java.util.Vector getTextsToTranslate()
Description copied from interface: Internationalization
Returns all the texts in the element suitable for being translated.

Specified by:
getTextsToTranslate in interface Internationalization
Overrides:
getTextsToTranslate in class DataField

createPopupMenu

protected void createPopupMenu()
Description copied from class: DataField
Creates a pop-up menu.

Overrides:
createPopupMenu in class DataField

showPopupMenu

protected void showPopupMenu(java.awt.Component source,
                             int x,
                             int y)
Description copied from class: DataField
Shows the pop-up menu.

Overrides:
showPopupMenu in class DataField
Parameters:
source - the component
x - the x coordinate
y - the y coordinate

setMaxLength

public void setMaxLength(int l)
Sets the max length of field.

Parameters:
l - the length

getConstraints

public java.lang.Object getConstraints(java.awt.LayoutManager parentLayout)
Description copied from class: DataField
Gets the constraints needed to adapt the field to the container from init

Specified by:
getConstraints in interface FormComponent
Overrides:
getConstraints in class DataField
Parameters:
parentLayout - the parent layout

free

public void free()
          throws java.lang.Exception
Description copied from interface: Freeable
Makes the object to release the resources.

Specified by:
free in interface Freeable
Throws:
java.lang.Exception

updateBackgroundColor

protected void updateBackgroundColor()
Description copied from class: DataField
Updates the background color.

Overrides:
updateBackgroundColor in class DataField

Ontimize