Ontimize 5.2072EN

com.ontimize.gui.field
Class HtmlHelpField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.ontimize.gui.field.AbstractFormComponent
                  extended bycom.ontimize.gui.field.IdentifiedAbstractFormComponent
                      extended bycom.ontimize.gui.field.HtmlHelpField
All Implemented Interfaces:
AccessForm, java.util.EventListener, FormComponent, javax.swing.event.HyperlinkListener, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, SecureElement, java.io.Serializable

public class HtmlHelpField
extends IdentifiedAbstractFormComponent
implements javax.swing.event.HyperlinkListener

HTML component with hyperlinks to invoke some different actions in the form elements.


Shown text is the component template parameter value. This value can be one of the following three possibilities: The hyperlinks in the html text are actions to execute in the form elements.
This actions can be configured using the element attribute and the method name.
For example:
 <html>
    <body>
      <a href="ETableEntityName.openInsertDetailForm()"><img src="com/ontimize/gui/images/detail.png">Show the insertion form from table ETableEntityName</a>
      <a href="EPacketsItems.openDetailForm(getSelectedRow())">Open the detail form with the selected data</a>
      <a href="query.doClick()">Do click in the form query button</a> 		
    </body>
 </html>
 

See parameters: init(Hashtable)

Author:
Imatia Innovation SL
See Also:
Serialized Form

Nested Class Summary
protected static class HtmlHelpField.ParameterInfo
           
 
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  java.util.Hashtable currentData
           
protected  java.lang.String currentSeparator
           
protected  java.lang.String currentTemplate
           
protected  boolean horizontalScroll
           
protected  CustomEditorPane htmlViewer
           
protected  java.lang.String originalTemplate
          Variables useful to show the same template with different values in it
protected  boolean scrollable
           
protected  boolean verticalScroll
           
 
Fields inherited from class com.ontimize.gui.field.IdentifiedAbstractFormComponent
attribute, enabledPermission, parentForm, restricted, visiblePermission
 
Fields inherited from class com.ontimize.gui.field.AbstractFormComponent
defaultBottomMargin, defaultLeftMargin, defaultRightMargin, defaultTopMargin
 
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.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HtmlHelpField(java.util.Hashtable p)
           
 
Method Summary
 void clean()
           
protected  void doAction(java.lang.Object ob, java.lang.String action)
           
 java.lang.Object getConstraints(java.awt.LayoutManager parentLayout)
          Description method to return the constraints component to place correctly in parent container.
 java.lang.String getCurrentTemplate()
           
 java.util.List getDataFieldNames(java.lang.String template, java.lang.String separator)
           
protected  java.lang.reflect.Method getMethod(java.lang.Object ob, java.lang.String methodName, HtmlHelpField.ParameterInfo[] parameters)
           
protected  java.lang.reflect.Method getNonPublicMethod(java.lang.Class c, java.lang.String methodName, java.lang.Class[] paramsClasss)
           
protected  HtmlHelpField.ParameterInfo getParameterInfo(java.lang.Object ob, java.lang.String param)
           
protected  java.lang.String[] getParameters(java.lang.String paramString)
           
 java.awt.Dimension getPreferredSize()
           
protected  java.lang.String getTemplateText(java.lang.String templatePath)
           
 java.util.Vector getTextsToTranslate()
          Returns all the texts in the element suitable for being translated.
protected  java.lang.String getTranslateTemplate(java.util.ResourceBundle resourceBundle)
           
 javax.swing.JEditorPane getViewer()
           
 void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt)
           
 void init(java.util.Hashtable parameters)
          Initialize the component with the following parameters:
 void setData(java.util.Hashtable data, java.lang.String separator)
           
 void setPaint(java.awt.Paint paint)
           
 void setResourceBundle(java.util.ResourceBundle resourceBundle)
          Sets the language resource bundle.
 void setText(java.lang.String text_path)
           
 void showHtml(java.lang.String templatePath, java.util.Hashtable dictionary)
           
 
Methods inherited from class com.ontimize.gui.field.IdentifiedAbstractFormComponent
checkEnabledPermission, checkVisiblePermission, getAttribute, getParentForm, initPermissions, isRestricted, setParentForm
 
Methods inherited from class com.ontimize.gui.field.AbstractFormComponent
setComponentLocale
 
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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
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, addFocusListener, 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, isEnabled, 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, removeFocusListener, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ontimize.gui.field.FormComponent
isEnabled, setEnabled, setVisible
 

Field Detail

htmlViewer

protected CustomEditorPane htmlViewer

horizontalScroll

protected boolean horizontalScroll

verticalScroll

protected boolean verticalScroll

scrollable

protected boolean scrollable

originalTemplate

protected java.lang.String originalTemplate
Variables useful to show the same template with different values in it


currentTemplate

protected java.lang.String currentTemplate

currentData

protected java.util.Hashtable currentData

currentSeparator

protected java.lang.String currentSeparator
Constructor Detail

HtmlHelpField

public HtmlHelpField(java.util.Hashtable p)
              throws java.lang.Exception
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()

init

public void init(java.util.Hashtable parameters)
Initialize the component with the following parameters:

Specified by:
init in interface FormComponent
Overrides:
init in class IdentifiedAbstractFormComponent
Parameters:
parameters - the Hashtable with parameters

attribute values default required meaning
attr yes Attribute for field.
template yes Complete path to html template.
scroll no Specifies whether the component must use an scroll or not.
scrollh no Adjust the component to use horizontal scroll.
scrollv no Adjust the component to use vertical scroll.
paint no Fixes specified paint for viewer.
maxwidth no Maximum width for component.
opaque yes no The opacity condition for component. By default, it is opaque.

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle resourceBundle)
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 AbstractFormComponent

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 AbstractFormComponent

getTranslateTemplate

protected java.lang.String getTranslateTemplate(java.util.ResourceBundle resourceBundle)

setText

public void setText(java.lang.String text_path)

getCurrentTemplate

public java.lang.String getCurrentTemplate()

getTemplateText

protected java.lang.String getTemplateText(java.lang.String templatePath)

getDataFieldNames

public java.util.List getDataFieldNames(java.lang.String template,
                                        java.lang.String separator)

showHtml

public void showHtml(java.lang.String templatePath,
                     java.util.Hashtable dictionary)

getConstraints

public java.lang.Object getConstraints(java.awt.LayoutManager parentLayout)
Description copied from interface: FormComponent
Description method to return the constraints component to place correctly in parent container.

Specified by:
getConstraints in interface FormComponent
Overrides:
getConstraints in class AbstractFormComponent

setData

public void setData(java.util.Hashtable data,
                    java.lang.String separator)

clean

public void clean()

hyperlinkUpdate

public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt)
Specified by:
hyperlinkUpdate in interface javax.swing.event.HyperlinkListener

doAction

protected void doAction(java.lang.Object ob,
                        java.lang.String action)
                 throws java.lang.Exception
Throws:
java.lang.Exception

setPaint

public void setPaint(java.awt.Paint paint)

getViewer

public javax.swing.JEditorPane getViewer()

getParameterInfo

protected HtmlHelpField.ParameterInfo getParameterInfo(java.lang.Object ob,
                                                       java.lang.String param)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getMethod

protected java.lang.reflect.Method getMethod(java.lang.Object ob,
                                             java.lang.String methodName,
                                             HtmlHelpField.ParameterInfo[] parameters)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getNonPublicMethod

protected java.lang.reflect.Method getNonPublicMethod(java.lang.Class c,
                                                      java.lang.String methodName,
                                                      java.lang.Class[] paramsClasss)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getParameters

protected java.lang.String[] getParameters(java.lang.String paramString)

Ontimize