Oracle Forms 9i Samples and Demos


oracle.forms.demos
Class KeyFilter

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--oracle.ewt.lwAWT.LWComponent
                    |
                    +--oracle.ewt.EwtComponent
                          |
                          +--oracle.ewt.lwAWT.lwText.LWTextComponent
                                |
                                +--oracle.ewt.lwAWT.lwText.LWCommonText
                                      |
                                      +--oracle.ewt.lwAWT.lwText.LWTextField
                                            |
                                            +--oracle.forms.ui.VTextField
                                                  |
                                                  +--oracle.forms.demos.KeyFilter
All Implemented Interfaces:
javax.accessibility.Accessible, oracle.ewt.dnd.Autoscroll, oracle.ewt.lwAWT.DoubleBufferer, oracle.ewt.help.HelpCapable, java.awt.image.ImageObserver, oracle.ewt.lwAWT.ImmediatePainter, oracle.forms.ui.IView, oracle.ewt.lwAWT.KeyProcessor, java.awt.MenuContainer, oracle.ewt.scrolling.Scrollable, java.io.Serializable, oracle.ewt.lwAWT.VirtualComponent

public class KeyFilter
extends oracle.forms.ui.VTextField

KeyFilter Pluggable Java Component for Oracle Forms Services 9i

This class is a Pluggable Java Component for Oracle Forms, that implements a method for only allowing defined keystrokes to be entered into a field. The class also provides some additional information for the Forms programmer in the form of information about what the last keypress delivered to the field was and the Shift state at the time. The class implements the following Custom properties for the programmer to use: The Properties KEY_CODE, KEY_CHARACTER and KEY_MODIFIER are read only.
For more PJC Demos and White Papers see Forms on OTN

Version:
9.0 19/10/2001
Author:
Duncan Mills
See Also:
Serialized Form

Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static oracle.forms.properties.ID CUSTOMFILTER
          The property registered to return or set the custom filter on the field.
static oracle.forms.properties.ID FILTERTYPE
          The property registered to return or set the current filter on the field.
static oracle.forms.properties.ID KEYCHAR
          The property registered to return the character of the last key pressed, or a control key enclosed in braces.
static oracle.forms.properties.ID KEYCODE
          The property registered to return the ASCII code of the last key-press.
static oracle.forms.properties.ID KEYMODIFIER
          The property registered to return the modifier in force when the last key was pressed.
 
Fields inherited from class oracle.ewt.lwAWT.lwText.LWTextField
ALIGNMENT_CENTER, ALIGNMENT_DEFAULT, ALIGNMENT_LEFT, ALIGNMENT_RIGHT
 
Fields inherited from class oracle.ewt.lwAWT.LWComponent
DEFAULT_BORDERPAINTER, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_PAINTER, MNEMONIC_CHAR_NONE, MNEMONIC_INDEX_NONE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface oracle.forms.ui.IView
DEFAULT_COLOR
 
Fields inherited from interface oracle.ewt.scrolling.Scrollable
SCROLL_LINEDOWN, SCROLL_LINEUP, SCROLL_PAGEDOWN, SCROLL_PAGEUP, SCROLL_POSITION
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
KeyFilter()
          Constructor for the KeyFilter PJC
 
Method Summary
 java.lang.Object getProperty(oracle.forms.properties.ID pid)
          Implementation of IView interface.
 void log(java.lang.String msg)
          Utility function to print out a debug message to the Java Console.
 boolean setProperty(oracle.forms.properties.ID pid, java.lang.Object value)
          Implementation of IView interface.
 
Methods inherited from class oracle.forms.ui.VTextField
add, addListener, copy, cut, destroy, getDefaultName, init, isTextSecure, remove, removeAll, removeListener, repaint, setTextSecure
 
Methods inherited from class oracle.ewt.lwAWT.lwText.LWTextField
addActionListener, createAccessibleContext, getDisplayStringFilter, getMinimumSize, getPreferredSize, getText, getUIClassID, layoutCanvas, paintCanvasInterior, paramString, processActionEvent, processEventImpl, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeActionListener, removeNotify, setDisplayStringFilter, updateLocale, updateReadingDirection
 
Methods inherited from class oracle.ewt.lwAWT.lwText.LWCommonText
attachHAdjustable, detachAdjustable, getColumns, getHAdjustable, getMaximumChars, getRepaintFlags, getValueStringFilter, isHScrollable, isOKToPaste, setColumns, setMaximumChars, setValueStringFilter
 
Methods inherited from class oracle.ewt.lwAWT.lwText.LWTextComponent
addNotify, addSelectionListener, addTextListener, append, clear, enableInputMethods, getBorderBackground, getBorderForeground, getCaretPosition, getDefaultBorder, getDefaultBorderPainter, getPaintData, getSelectedText, getSelectionEnd, getSelectionStart, getTextLength, insert, isEditable, isFocusable, isFocusTraversable, paste, processTextEvent, removeSelectionListener, removeTextListener, replaceRange, requestFocus, select, select, selectAll, setCaretPosition, setCaretPosition, setEditable, setEnabled, setFocusable, setFont, setSelectionEnd, setSelectionStart, setText
 
Methods inherited from class oracle.ewt.EwtComponent
attachVAdjustable, autoscroll, clipCanvasToParents, convertCanvasToOuter, convertOuterToCanvas, getAutoscrollInsets, getBorder, getBorderPainter, getCanvasBounds, getCanvasFill, getCanvasGraphics, getCanvasHeight, getCanvasOrigin, getCanvasOriginX, getCanvasOriginY, getCanvasSize, getCanvasWidth, getDocumentSize, getHMaximum, getHOffsetOfValue, getHValueOfOffset, getProxyConfigurer, getScrollInsets, getVAdjustable, getVMaximum, getVOffsetOfValue, getVValueOfOffset, handleHScroll, handleVScroll, invalidateCanvas, isInteriorTransparent, isVScrollable, layout, makeCanvasGraphics, paint, paintImmediateCanvas, paintImmediateCanvas, paintInterior, printPage, repaintCanvas, repaintCanvas, reshape, setBorder, setBorderPainter, setCanvasFill, setCanvasOrigin, setCanvasSize, setHScrollInsets, setVScrollInsets, storeCanvasOrigin, validate
 
Methods inherited from class oracle.ewt.lwAWT.LWComponent
accessAccessibleContext, addAnyEventListener, addImpl, addPostKeyListener, addPreKeyListener, clipToParents, contains, convertInnerToOuterSize, convertInteriorToOuter, convertOuterToInterior, disable, doLayout, enable, eventMatchesMnemonic, eventMatchesMnemonic, freezeRepaints, getAccessibleContext, getActualAlignment, getActualReadingDirection, getAlignment, getBackground, getBaseClassName, getBorderContext, getBorderInsets, getClientProperty, getColorScheme, getDefaultHelpProvider, getDoubleBuffer, getEWTDropTarget, getFill, getFocusedComponent, getFont, getForeground, getGraphics, getHelpBook, getHelpProvider, getHelpTopic, getInnerBounds, getInnerHeight, getInnerOrigin, getInnerSize, getInnerWidth, getInsets, getInteriorAlignmentX, getInteriorAlignmentY, getInvalidateFlags, getLookAndFeel, getMnemonicChar, getMnemonicIndex, getMnemonicString, getName, getPageBounds, getPaintContext, getPaintState, getPrintPaintContext, getReadingDirection, getToolTipValue, getUI, getUIDefaults, hasFocus, hasGlobalFocus, hasMnemonicModifier, hasWindowFocus, hide, imageUpdate, insets, interiorContains, invalidate, invalidateAndRepaintIfNecessary, isActive, isBorderTransparent, isChildClipped, isClippedBySibling, isLocaleDefaulted, isPaintPropagationRequired, isReadingDirectionDefaulted, isTransparent, paintAll, paintImmediate, paintImmediate, paintImmediateInterior, paintImmediateInterior, paintImmediateUnclipped, paintOverChildren, pointInInterior, pointIsInChild, postProcessKey, print, printAll, processEvent, putClientProperty, redispatchEvent, remove, removeAnyEventListener, removeClientProperty, removePostKeyListener, removePreKeyListener, repaint, repaintInterior, repaintInterior, setAlignment, setBackground, setColorScheme, setDefaultHelpProvider, setEWTDropTarget, setFill, setForeground, setHelpBook, setHelpProvider, setHelpTopic, setLocale, setLookAndFeel, setMnemonicChar, setMnemonicIndex, setReadingDirection, setToolTipValue, setToolTipValue, setUI, setVisible, shiftFrozenDamage, showHelp, unfreezeRepaints, update, updateAlignment, updateUI, updateUI, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getListeners, getMaximumSize, isAncestorOf, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, removeContainerListener, setLayout, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, firePropertyChange, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, inside, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.forms.ui.IView
contains, paint
 
Methods inherited from interface oracle.ewt.lwAWT.VirtualComponent
getBounds, getSize
 

Field Detail

KEYCODE

public static final oracle.forms.properties.ID KEYCODE
The property registered to return the ASCII code of the last key-press. Used with GET_CUSTOM_PROPERTY() from the Form

KEYCHAR

public static final oracle.forms.properties.ID KEYCHAR
The property registered to return the character of the last key pressed, or a control key enclosed in braces. For instance F1 will set this property to {F1} Used with GET_CUSTOM_PROPERTY() from the Form

KEYMODIFIER

public static final oracle.forms.properties.ID KEYMODIFIER
The property registered to return the modifier in force when the last key was pressed. will return SHIFT, CTRL or ALT or a combination thereof Used with GET_CUSTOM_PROPERTY() from the Form

FILTERTYPE

public static final oracle.forms.properties.ID FILTERTYPE
The property registered to return or set the current filter on the field. Used with SET and GET_CUSTOM_PROPERTY() from the Form

CUSTOMFILTER

public static final oracle.forms.properties.ID CUSTOMFILTER
The property registered to return or set the custom filter on the field. Used with SET and GET_CUSTOM_PROPERTY() from the Form
Constructor Detail

KeyFilter

public KeyFilter()
Constructor for the KeyFilter PJC
Method Detail

getProperty

public java.lang.Object getProperty(oracle.forms.properties.ID pid)
Implementation of IView interface. This code in the PJC is called when PL/SQL in Forms issues a GET_CUSTOM_PROPERTY call The value returned from this method is returned to PL/SQL
Overrides:
getProperty in class oracle.forms.ui.VTextField
Parameters:
pid - property ID
Returns:
value of the property
See Also:
IView

setProperty

public boolean setProperty(oracle.forms.properties.ID pid,
                           java.lang.Object value)
Implementation of IView interface. This code in the PJC is called when PL/SQL in Forms issues a SET_CUSTOM_PROPERTY call
Overrides:
setProperty in class oracle.forms.ui.VTextField
Parameters:
pid - property to be set
value - new value of the property
Returns:
true (if the property could be set), false otherwise
See Also:
IView

log

public void log(java.lang.String msg)
Utility function to print out a debug message to the Java Console.
Parameters:
msg - string to display, this will be prefixed with the classname of the PJC

Oracle Forms 9i Samples and Demos