infosapient.ui
Class InfoSapientRuleEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--infosapient.ui.InfoSapientRuleEditor

public class InfoSapientRuleEditor
extends javax.swing.JPanel
implements javax.swing.event.UndoableEditListener, Observer

See Also:
Serialized Form

Inner Class Summary
protected  class InfoSapientRuleEditor.ActionChangedListener
           
(package private)  class InfoSapientRuleEditor.AddAction
           
(package private)  class InfoSapientRuleEditor.CreateAction
           
(package private)  class InfoSapientRuleEditor.DeleteAction
           
(package private)  class InfoSapientRuleEditor.EditAction
           
(package private)  class InfoSapientRuleEditor.ExitAction
           
(package private)  class InfoSapientRuleEditor.RedoAction
           
(package private)  class InfoSapientRuleEditor.RuleDocListener
           
(package private)  class InfoSapientRuleEditor.RuleEditorCloser
           
(package private)  class InfoSapientRuleEditor.RuleEditorObservable
           
(package private)  class InfoSapientRuleEditor.StatusBar
          FIXME - I'm not very useful yet
(package private)  class InfoSapientRuleEditor.UndoAction
           
 
Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardBinding, javax.swing.JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
protected  javax.swing.Action[] actionsList
           
static java.lang.String actionSuffix
          Suffix applied to the key used in resource file lookups for an action.
protected  InfoSapientRuleEditor.AddAction addAction
           
static java.lang.String AddAction
           
protected  java.util.Hashtable commands
           
protected  InfoSapientController controller
           
protected  InfoSapientRuleEditor.CreateAction createAction
           
static java.lang.String CreateAction
           
protected  InfoSapientRuleEditor.DeleteAction deleteAction
           
static java.lang.String DeleteAction
           
static java.lang.String EditAction
           
protected  javax.swing.JPopupMenu editMenu
           
protected  javax.swing.text.JTextComponent editor
           
protected  InfoSapientRuleEditor.ExitAction exitAction
           
static java.lang.String ExitAction
           
protected  java.awt.FileDialog fileDialog
           
(package private) static boolean FOUND_PROPERTIES
           
protected  javax.swing.JFrame frame
           
static java.lang.String imageSuffix
          Suffix applied to the key used in resource file lookups for an image.
static java.lang.String labelSuffix
          Suffix applied to the key used in resource file lookups for a label.
protected  javax.swing.JMenuBar menubar
           
protected  java.util.Hashtable menuItems
           
static java.lang.String NEW_RULE
          Rule template string
protected  javax.swing.JPopupMenu pMenu
           
protected  InfoSapientRuleEditor.RedoAction redoAction
           
protected  InfoSapientRuleEditor.RuleEditorObservable reo
           
protected static java.util.ResourceBundle resources
           
protected  CompileSPRule ruleCompiler
           
protected  javax.swing.JPopupMenu ruleMenu
           
protected  javax.swing.JComponent status
           
protected  FzyKnowledgebase theKB
           
protected  FzyRule theRule
           
static java.lang.String tipSuffix
          Suffix applied to the key used in resource file lookups for tooltip text.
protected  javax.swing.JToolBar toolbar
           
protected  InfoSapientRuleEditor.UndoAction undoAction
          Actions defined by InfoSapientRuleEditor
protected  javax.swing.undo.UndoManager undoMgr
          UndoManager that we add edits to.
 
Fields inherited from class javax.swing.JPanel
defaultLayout, uiClassID
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, alignmentX, alignmentY, ANCESTOR_USING_BUFFER, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, flags, HAS_FOCUS, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, paintingChild, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, uiClassID, UNDEFINED_CONDITION, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
InfoSapientRuleEditor(InfoSapientController theControl)
           
InfoSapientRuleEditor(InfoSapientController theControl, FzyRule aRule)
           
 
Method Summary
(package private) static void ()
           
protected  java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem b)
           
protected  javax.swing.text.JTextComponent createEditor()
          Create an editor to represent the given document.
protected  javax.swing.JMenu createMenu(java.lang.String key)
          Create a menu for the app.
protected  javax.swing.JMenuBar createMenubar()
          Create the menubar for the app.
protected  javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
          This is the hook through which all menu items are created.
protected  java.awt.Component createStatusbar()
          Create a status bar
protected  java.awt.Component createTool(java.lang.String key)
          Hook through which every toolbar item is created.
protected  java.awt.Component createToolbar()
          Create the toolbar.
protected  javax.swing.JButton createToolbarButton(java.lang.String key)
          Create a button to go inside of the toolbar.
protected  javax.swing.Action getAction(java.lang.String cmd)
           
 javax.swing.Action[] getActions()
          Fetch the list of actions supported by this editor.
protected  InfoSapientController getController()
           
protected  javax.swing.text.JTextComponent getEditor()
          Fetch the editor contained in this panel
protected  java.awt.Frame getFrame()
          Find the hosting frame, for the file-chooser dialog.
protected  javax.swing.JMenuBar getMenubar()
           
protected  javax.swing.JMenuItem getMenuItem(java.lang.String cmd)
          Fetch the menu item that was created for the given command.
protected  java.net.URL getResource(java.lang.String key)
           
protected  java.lang.String getResourceString(java.lang.String nm)
           
 FzyRule getRule()
           
protected  java.awt.Container getToolbar()
           
 void handleFSEvent(FSEvent anEvent)
           
protected  void initialize()
           
 void setRule(FzyRule aRule)
           
 void setRuleText(java.lang.String rText)
           
 void setVisible(boolean f)
           
protected  java.lang.String[] tokenize(java.lang.String input)
          Take the given string and chop it up into a series of strings on whitespace boundries.
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
          Messaged when the Document has created an edit, the edit is added to undo, an instance of UndoManager.
 void update(Observable observ, java.lang.Object obj)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI, writeObject
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, adjustPaintFlags, alwaysOnTop, bindingForKeyStroke, checkIfChildObscuredBySibling, computeVisibleRect, computeVisibleRect, contains, createToolTip, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperties, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getFlag, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, keyboardBindings, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paintWithBuffer, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, readObject, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFlag, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printOneComponent, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setCursor, setFocusOwner, setLayout, transferFocus, updateCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocale, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

resources

protected static java.util.ResourceBundle resources

FOUND_PROPERTIES

static boolean FOUND_PROPERTIES

reo

protected InfoSapientRuleEditor.RuleEditorObservable reo

theKB

protected FzyKnowledgebase theKB

theRule

protected FzyRule theRule

ruleCompiler

protected CompileSPRule ruleCompiler

controller

protected InfoSapientController controller

frame

protected javax.swing.JFrame frame

editor

protected javax.swing.text.JTextComponent editor

pMenu

protected javax.swing.JPopupMenu pMenu

editMenu

protected javax.swing.JPopupMenu editMenu

ruleMenu

protected javax.swing.JPopupMenu ruleMenu

imageSuffix

public static final java.lang.String imageSuffix
Suffix applied to the key used in resource file lookups for an image.

labelSuffix

public static final java.lang.String labelSuffix
Suffix applied to the key used in resource file lookups for a label.

actionSuffix

public static final java.lang.String actionSuffix
Suffix applied to the key used in resource file lookups for an action.

tipSuffix

public static final java.lang.String tipSuffix
Suffix applied to the key used in resource file lookups for tooltip text.

EditAction

public static final java.lang.String EditAction

CreateAction

public static final java.lang.String CreateAction

DeleteAction

public static final java.lang.String DeleteAction

AddAction

public static final java.lang.String AddAction

ExitAction

public static final java.lang.String ExitAction

NEW_RULE

public static final java.lang.String NEW_RULE
Rule template string

commands

protected java.util.Hashtable commands

menuItems

protected java.util.Hashtable menuItems

menubar

protected javax.swing.JMenuBar menubar

toolbar

protected javax.swing.JToolBar toolbar

status

protected javax.swing.JComponent status

fileDialog

protected java.awt.FileDialog fileDialog

undoMgr

protected javax.swing.undo.UndoManager undoMgr
UndoManager that we add edits to.

undoAction

protected InfoSapientRuleEditor.UndoAction undoAction
Actions defined by InfoSapientRuleEditor

redoAction

protected InfoSapientRuleEditor.RedoAction redoAction

createAction

protected InfoSapientRuleEditor.CreateAction createAction

addAction

protected InfoSapientRuleEditor.AddAction addAction

deleteAction

protected InfoSapientRuleEditor.DeleteAction deleteAction

exitAction

protected InfoSapientRuleEditor.ExitAction exitAction

actionsList

protected javax.swing.Action[] actionsList
Constructor Detail

InfoSapientRuleEditor

public InfoSapientRuleEditor(InfoSapientController theControl)

InfoSapientRuleEditor

public InfoSapientRuleEditor(InfoSapientController theControl,
                             FzyRule aRule)
Method Detail

static void ()

createActionChangeListener

protected java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem b)

createEditor

protected javax.swing.text.JTextComponent createEditor()
Create an editor to represent the given document.

createMenu

protected javax.swing.JMenu createMenu(java.lang.String key)
Create a menu for the app. By default this pulls the definition of the menu from the associated resource file.

createMenubar

protected javax.swing.JMenuBar createMenubar()
Create the menubar for the app. By default this pulls the definition of the menu from the associated resource file.

createMenuItem

protected javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().
Parameters:
String - -- the menu item name being created
See Also:
getMenuItem(java.lang.String)

createStatusbar

protected java.awt.Component createStatusbar()
Create a status bar

createTool

protected java.awt.Component createTool(java.lang.String key)
Hook through which every toolbar item is created.

createToolbar

protected java.awt.Component createToolbar()
Create the toolbar. By default this reads the resource file for the definition of the toolbar.

createToolbarButton

protected javax.swing.JButton createToolbarButton(java.lang.String key)
Create a button to go inside of the toolbar. By default this will load an image resource. The image filename is relative to the classpath (including the '.' directory if its a part of the classpath), and may either be in a JAR file or a separate file.
Parameters:
key - The key in the resource file to serve as the basis of lookups.

getAction

protected javax.swing.Action getAction(java.lang.String cmd)

getActions

public javax.swing.Action[] getActions()
Fetch the list of actions supported by this editor. It is implemented to return the list of actions supported by the embedded JTextComponent augmented with the actions defined locally.

getController

protected InfoSapientController getController()

getEditor

protected javax.swing.text.JTextComponent getEditor()
Fetch the editor contained in this panel

getFrame

protected java.awt.Frame getFrame()
Find the hosting frame, for the file-chooser dialog.

getMenubar

protected javax.swing.JMenuBar getMenubar()

getMenuItem

protected javax.swing.JMenuItem getMenuItem(java.lang.String cmd)
Fetch the menu item that was created for the given command.
Parameters:
cmd - Name of the action.

getResource

protected java.net.URL getResource(java.lang.String key)

getResourceString

protected java.lang.String getResourceString(java.lang.String nm)

getRule

public FzyRule getRule()

getToolbar

protected java.awt.Container getToolbar()

handleFSEvent

public void handleFSEvent(FSEvent anEvent)

initialize

protected void initialize()

setRule

public void setRule(FzyRule aRule)

setRuleText

public void setRuleText(java.lang.String rText)

setVisible

public void setVisible(boolean f)
Overrides:
setVisible in class javax.swing.JComponent

tokenize

protected java.lang.String[] tokenize(java.lang.String input)
Take the given string and chop it up into a series of strings on whitespace boundries. This is useful for trying to get an array of strings out of the resource file.

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
Messaged when the Document has created an edit, the edit is added to undo, an instance of UndoManager.
Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener

update

public void update(Observable observ,
                   java.lang.Object obj)
Specified by:
update in interface Observer

License to use this program is provided under the TERMS OF THE COMMON PUBLIC LICENSE 0.5. ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved