|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel issrg.utils.gui.xml.XMLEditor
public abstract class XMLEditor
An Abstract class, that handles core XML editing functions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
boolean |
canRedo
Flag that is used to notify if there is any event on the redo Stack |
boolean |
canUndo
Flag that is used to notify if there is any event on the undo Stack |
org.w3c.dom.Document |
DOM
org.w3c.dom.Document where the elements are stored |
java.util.Stack |
done
Stack that keeps a list of items that can be undone |
PolicyValidator |
policyValidator
|
java.util.Stack |
undone
Stack that keeps a list of items that can be redone |
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 | |
---|---|
XMLEditor()
Creates a new instance of XMLEditor |
Method Summary | |
---|---|
void |
addItem(org.w3c.dom.Element childNode,
org.w3c.dom.Element parentNode)
Adds the child element to a parent element in XML. |
void |
addItem(org.w3c.dom.Element childNode,
org.w3c.dom.Element parentNode,
int childIndex)
Adds the child element to a parent element in XML, at a specified position. |
void |
addXMLChangeListener(XMLChangeListener listener)
Method to add a listener to any XML Change |
void |
createDOM(byte[] bytesDOM)
Method to open a Document given an XML byte array input. |
void |
createDOM(java.io.InputStream bais)
Method to open a Document given an XML String input. |
void |
createDOM(java.lang.String xml)
Method to open a Document given an XML String input. |
void |
deleteItem(org.w3c.dom.Element childNode,
org.w3c.dom.Element parentNode)
Deletes a child element from the parent element. |
protected void |
doEvent(XMLChangeEvent ev)
This method adds to the done stack that something has just been done and calls processEvent with the received XMLChangeEvent |
java.lang.String |
GenerateXML()
Calls the previous overloaded method GenerateXML(OutputStream), converts the stream into a string, and returns it. |
void |
GenerateXML(java.io.OutputStream baos)
Generates the XML file, with Serializing. |
org.w3c.dom.Document |
getDocument()
Returns the Document that this XMLEditor holds. |
org.w3c.dom.Element |
getElement(java.lang.String name)
Gets the first element with the specified name in the document. |
void |
newDoneStack()
Initializes the done Stack. |
void |
newUnDoneStack()
Initializes the undone Stack. |
XMLChangeEvent |
not(XMLChangeEvent ev)
Obtains the converse of an XMLChangeEvent. |
void |
notifyChanges(XMLChangeEvent ev)
Method that fires XMLChanged notifications to a list of registered listeners. |
void |
processEvent(XMLChangeEvent ev)
It will then call notifyChanges, to notify any registered listeners with the changes. |
void |
redo()
Method that redoes the first XMLChangeEvent that is on the undone Stack. |
void |
removeXMLChangeListener(XMLChangeListener listener)
Method to remove a listener to any XML Change |
void |
replaceNode(org.w3c.dom.Element parent,
org.w3c.dom.Element oldChild,
org.w3c.dom.Element newChild)
|
void |
setAttributeValue(org.w3c.dom.Element childNode,
java.lang.String[] attribs,
java.lang.String[] values)
Constructs the XMLChangeEvent to Modify the Element's Attributes with the list of their respective values. |
void |
undo()
Method that undoes the last performed action stored on the done stack. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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 |
Field Detail |
---|
public boolean canUndo
public boolean canRedo
public java.util.Stack done
public java.util.Stack undone
public org.w3c.dom.Document DOM
public PolicyValidator policyValidator
Constructor Detail |
---|
public XMLEditor()
Method Detail |
---|
public void addXMLChangeListener(XMLChangeListener listener)
listener
- the component that listens to XML Changes to be added to
the listener list.public void removeXMLChangeListener(XMLChangeListener listener)
listener
- the component to be removed from the listener listpublic org.w3c.dom.Document getDocument()
public void setAttributeValue(org.w3c.dom.Element childNode, java.lang.String[] attribs, java.lang.String[] values)
childNode
- The Element to modifyattribs
- A String Array of attributes to modifyvalues
- The corresponding values of the attributes to setpublic void replaceNode(org.w3c.dom.Element parent, org.w3c.dom.Element oldChild, org.w3c.dom.Element newChild)
public void undo()
public void redo()
public void notifyChanges(XMLChangeEvent ev)
public void newDoneStack()
public void newUnDoneStack()
public void processEvent(XMLChangeEvent ev)
It will then call notifyChanges, to notify any registered listeners with the changes.
public XMLChangeEvent not(XMLChangeEvent ev)
ev
- the event needed to convert.
public void addItem(org.w3c.dom.Element childNode, org.w3c.dom.Element parentNode)
childNode
- The child element to addparentNode
- The parent element to add topublic void addItem(org.w3c.dom.Element childNode, org.w3c.dom.Element parentNode, int childIndex)
childNode
- The child element to addparentNode
- The parent element to add tochildIndex
- The child's position in the parent's set of child nodespublic void deleteItem(org.w3c.dom.Element childNode, org.w3c.dom.Element parentNode)
childNode
- The child element to deleteparentNode
- The parent element to delete fromprotected void doEvent(XMLChangeEvent ev)
ev
- The XMLChangeEvent that specifies was is being done.public void GenerateXML(java.io.OutputStream baos)
baos
- An output stream (file) to write to.public java.lang.String GenerateXML()
public void createDOM(java.lang.String xml)
xml
- This String should contain the XML policy to openpublic void createDOM(byte[] bytesDOM)
bytesDOM
- A byte Array that should contain the XML policy to openpublic void createDOM(java.io.InputStream bais)
bais
- An InputStream containing the XML to openpublic org.w3c.dom.Element getElement(java.lang.String name)
name
- the name of the element to get
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |