ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.rules
Class AbleRuleSetEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ibm.able.rules.AbleRuleSetEditor
All Implemented Interfaces:
AbleCustomizer, javax.accessibility.Accessible, java.beans.Customizer, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public class AbleRuleSetEditor
extends javax.swing.JPanel
implements AbleCustomizer, java.awt.event.MouseListener

This class contains the Able Ruleset Editor panel.

This object can be run from the command line, in which case the main() method will create an new, empty AbleRuleSet that can be saved as a serialized bean. When called as a regular bean customizer, the setObject() method must be called specifying the AbleRuleSet object that is to be customized. Being a "customizer", this object implements the "Customizer" interface, but note that no property change events are fired from this object. However, the AbleRuleSet object being customized may itself fire such events.

See Also:
Serialized Form

Inner Class Summary
 class AbleRuleSetEditor.XAppCloser
          To shutdown when run as an application.
 
Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
protected  java.io.File myCurrentDir
           
protected  javax.swing.JFileChooser myFileDialog
           
protected  int myFileOption
           
protected  javax.swing.event.UndoableEditListener myUndoHandler
          Listener for the edits on the current document.
protected  javax.swing.undo.UndoManager myUndoManager
          UndoManager to which we add edits.
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbleRuleSetEditor()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener theListener)
          Add a property change listener to this object.
protected  void debugTrace(java.lang.String theMessage)
          Log a trace message.
protected  void exitCustomizer(int buttonOptions)
          Gracefully exit the customizer.
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, and for setting the title.
protected  java.awt.Window getWindow_()
          This method is used by those routines that display dialog boxes so that the box can be displayed relative to our parent component.
protected  boolean isRegularFrame()
          We use this to determine whether we are in some sort of Dialog window or a regular (J)Frame.
static void main(java.lang.String[] theArgs)
          Called thru the command line or from AbleRuleSetEditorLauncher main() method.
 void mouseClicked(java.awt.event.MouseEvent theEvent)
          Handle a popup menu request
 void mouseEntered(java.awt.event.MouseEvent theEvent)
           
 void mouseExited(java.awt.event.MouseEvent theEvent)
           
 void mousePressed(java.awt.event.MouseEvent theEvent)
           
 void mouseReleased(java.awt.event.MouseEvent theEvent)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener theListener)
          Remove a property change listener from this object.
protected  void saveEditorFramePreferences()
          Save the location and size of the rule editor frame.
protected  void saveExceptionFramePreferences()
          Save the location and size of the exception frame.
protected  void saveFramePreferences()
          Save the locations and sizes of each frame in the preferences file.
protected  void saveHelpFramePreferences()
          Save the location and size of the help frame.
protected  void saveOutputFramePreferences()
          Save the location and size of the output frame.
protected  void saveSetViewerFramePreferences()
          Save the location and size of the set viewer frame.
protected  void saveXmlFramePreferences()
          Save the location and size of the XML frame.
 void setEnteredThruMain()
           
 void setObject(java.lang.Object theRuleSet)
          Save a reference to the object that is being customized.
 void updateObject()
          This is an "OK" from a JDialog box thrown up by the AbleCustomizerDialog class.
protected  void xferFileNames()
          Transfer the current "source", "serial", and "xml" file names to the object being customized.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, 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, wait, wait, wait
 

Field Detail

myFileDialog

protected javax.swing.JFileChooser myFileDialog

myFileOption

protected int myFileOption

myCurrentDir

protected java.io.File myCurrentDir

myUndoHandler

protected javax.swing.event.UndoableEditListener myUndoHandler
Listener for the edits on the current document.

myUndoManager

protected javax.swing.undo.UndoManager myUndoManager
UndoManager to which we add edits.
Constructor Detail

AbleRuleSetEditor

public AbleRuleSetEditor()
Method Detail

setEnteredThruMain

public void setEnteredThruMain()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener theListener)
Add a property change listener to this object.
Specified by:
addPropertyChangeListener in interface java.beans.Customizer
Overrides:
addPropertyChangeListener in class javax.swing.JComponent
Parameters:
theListener - the property change listener to be added to this object.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener theListener)
Remove a property change listener from this object.
Specified by:
removePropertyChangeListener in interface java.beans.Customizer
Overrides:
removePropertyChangeListener in class javax.swing.JComponent
Parameters:
theListener - the property change listener to be removed from this object.


setObject

public void setObject(java.lang.Object theRuleSet)
Save a reference to the object that is being customized.
Specified by:
setObject in interface java.beans.Customizer
Parameters:
theRuleSet - The AbleRuleSet object that is to be changed.


updateObject

public void updateObject()
                  throws AbleException
This is an "OK" from a JDialog box thrown up by the AbleCustomizerDialog class.
Specified by:
updateObject in interface AbleCustomizer

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent theEvent)
Handle a popup menu request
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent theEvent)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent theEvent)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent theEvent)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent theEvent)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

debugTrace

protected void debugTrace(java.lang.String theMessage)
Log a trace message.
Parameters:
theMessage - A String containing text to be traced.


getEditor

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

xferFileNames

protected void xferFileNames()
Transfer the current "source", "serial", and "xml" file names to the object being customized.

getFrame

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

getWindow_

protected java.awt.Window getWindow_()
This method is used by those routines that display dialog boxes so that the box can be displayed relative to our parent component.

isRegularFrame

protected boolean isRegularFrame()
We use this to determine whether we are in some sort of Dialog window or a regular (J)Frame.

If we are in a dialog box, we don't honor any exit requests from the user.

Otherwise, we assume that we've been put in a frame that can be disposed of, and we will indeed dispose of ourselves when the user presses exit! We will also save parent frame location and size.


exitCustomizer

protected void exitCustomizer(int buttonOptions)
Gracefully exit the customizer.

If we are in a regular frame, we check to see whether the ruleset needs to be saved, we save all our frame sizes and locations, and then we dispose of our frame.

If we are in some sort of dialog box, we simply disable our exit action, and let the dialog handle the "OK" & "Cancel" options itself.

Lastly, if this class was entered thru the main() method, presumably from the command line, we do a System.exit(0).

Parameters:
buttonOptions - JOptionPane.YES_NO_CANCEL_OPTION or JOptionPane.YES_NO_OPTION

saveFramePreferences

protected void saveFramePreferences()
Save the locations and sizes of each frame in the preferences file.

saveEditorFramePreferences

protected void saveEditorFramePreferences()
Save the location and size of the rule editor frame.

saveExceptionFramePreferences

protected void saveExceptionFramePreferences()
Save the location and size of the exception frame.

saveHelpFramePreferences

protected void saveHelpFramePreferences()
Save the location and size of the help frame.

saveOutputFramePreferences

protected void saveOutputFramePreferences()
Save the location and size of the output frame.

saveSetViewerFramePreferences

protected void saveSetViewerFramePreferences()
Save the location and size of the set viewer frame.

saveXmlFramePreferences

protected void saveXmlFramePreferences()
Save the location and size of the XML frame.

main

public static void main(java.lang.String[] theArgs)
Called thru the command line or from AbleRuleSetEditorLauncher main() method. When launched from main(), the ruleset editor will kill the JVM when it exits!
Parameters:
theArgs - the first element must be "arl" which specifies that "Able Rule Language" edit mode wanted. This is the only mode supported.


ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003