org.argouml.uml.ui
Class UMLPlainTextDocument
java.lang.Object
|
+--javax.swing.text.AbstractDocument
|
+--javax.swing.text.PlainDocument
|
+--org.argouml.uml.ui.UMLPlainTextDocument
- All Implemented Interfaces:
- javax.swing.text.Document, java.util.EventListener, ru.novosoft.uml.MElementListener, java.io.Serializable, TargetChangedListener
- Direct Known Subclasses:
- UMLExtensionPointLocationDocument, UMLModelElementNameDocument
- public abstract class UMLPlainTextDocument
- extends javax.swing.text.PlainDocument
- implements ru.novosoft.uml.MElementListener, TargetChangedListener
A new model for a textproperty. This model does not use reflection to reach
its goal and will perform better therefore. Furthermore, it only reacts to
events that are meant for this model which improves maintainability and
performance.
- Since:
- Oct 6, 2002
- See Also:
- Serialized Form
Inner classes inherited from class javax.swing.text.AbstractDocument |
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement |
Field Summary |
static org.apache.log4j.Category |
cat
|
Fields inherited from class javax.swing.text.PlainDocument |
lineLimitAttribute, tabSizeAttribute |
Fields inherited from class javax.swing.text.AbstractDocument |
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName |
Fields inherited from interface javax.swing.text.Document |
StreamDescriptionProperty, TitleProperty |
Constructor Summary |
UMLPlainTextDocument(java.lang.String eventName)
Constructor for UMLPlainTextDocument. |
Method Summary |
java.lang.String |
getEventName()
Returns the eventName. |
protected abstract java.lang.String |
getProperty()
|
java.lang.Object |
getTarget()
Returns the target. |
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
|
boolean |
isEditing()
Returns the editing. |
void |
listRoleItemSet(ru.novosoft.uml.MElementEvent e)
|
void |
propertySet(ru.novosoft.uml.MElementEvent e)
|
void |
recovered(ru.novosoft.uml.MElementEvent e)
|
void |
remove(int offs,
int len)
|
void |
removed(ru.novosoft.uml.MElementEvent e)
|
void |
roleAdded(ru.novosoft.uml.MElementEvent e)
|
void |
roleRemoved(ru.novosoft.uml.MElementEvent e)
|
void |
setEditing(boolean editing)
Sets the editing. |
protected void |
setEventName(java.lang.String eventName)
Sets the eventName. |
protected abstract void |
setProperty(java.lang.String text)
|
void |
setTarget(java.lang.Object target)
Sets the target. |
void |
targetChanged(java.lang.Object newTarget)
This method is called when a new target is selected, either by the
program or by the user. |
void |
targetReasserted(java.lang.Object newTarget)
This method is called when the navigation history is updated. |
Methods inherited from class javax.swing.text.PlainDocument |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate |
Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, setAsynchronousLoadPriority, setDocumentProperties, writeLock, writeUnlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cat
public static org.apache.log4j.Category cat
UMLPlainTextDocument
public UMLPlainTextDocument(java.lang.String eventName)
- Constructor for UMLPlainTextDocument. This takes a panel to set the
thirdpartyeventlistener to the given list of events to listen to.
propertySet
public void propertySet(ru.novosoft.uml.MElementEvent e)
- Specified by:
propertySet
in interface ru.novosoft.uml.MElementListener
- See Also:
MElementListener.propertySet(ru.novosoft.uml.MElementEvent)
roleAdded
public void roleAdded(ru.novosoft.uml.MElementEvent e)
- Specified by:
roleAdded
in interface ru.novosoft.uml.MElementListener
- See Also:
MElementListener.roleAdded(ru.novosoft.uml.MElementEvent)
roleRemoved
public void roleRemoved(ru.novosoft.uml.MElementEvent e)
- Specified by:
roleRemoved
in interface ru.novosoft.uml.MElementListener
- See Also:
MElementListener.roleRemoved(ru.novosoft.uml.MElementEvent)
listRoleItemSet
public void listRoleItemSet(ru.novosoft.uml.MElementEvent e)
- Specified by:
listRoleItemSet
in interface ru.novosoft.uml.MElementListener
- See Also:
MElementListener.listRoleItemSet(ru.novosoft.uml.MElementEvent)
removed
public void removed(ru.novosoft.uml.MElementEvent e)
- Specified by:
removed
in interface ru.novosoft.uml.MElementListener
- See Also:
MElementListener.removed(ru.novosoft.uml.MElementEvent)
recovered
public void recovered(ru.novosoft.uml.MElementEvent e)
- Specified by:
recovered
in interface ru.novosoft.uml.MElementListener
- See Also:
MElementListener.recovered(ru.novosoft.uml.MElementEvent)
getTarget
public final java.lang.Object getTarget()
- Returns the target.
- Returns:
- Object
setTarget
public final void setTarget(java.lang.Object target)
- Sets the target.
- Parameters:
target
- The target to set
insertString
public void insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
throws javax.swing.text.BadLocationException
- Overrides:
insertString
in class javax.swing.text.AbstractDocument
- See Also:
Document.insertString(int, java.lang.String, javax.swing.text.AttributeSet)
remove
public void remove(int offs,
int len)
throws javax.swing.text.BadLocationException
- Overrides:
remove
in class javax.swing.text.AbstractDocument
- See Also:
Document.remove(int, int)
setProperty
protected abstract void setProperty(java.lang.String text)
getProperty
protected abstract java.lang.String getProperty()
isEditing
public boolean isEditing()
- Returns the editing.
- Returns:
- boolean
setEditing
public void setEditing(boolean editing)
- Sets the editing.
- Parameters:
editing
- The editing to set
getEventName
public java.lang.String getEventName()
- Returns the eventName.
- Returns:
- String
setEventName
protected void setEventName(java.lang.String eventName)
- Sets the eventName.
- Parameters:
eventName
- The eventName to set
targetChanged
public void targetChanged(java.lang.Object newTarget)
- Description copied from interface:
TargetChangedListener
- This method is called when a new target is selected, either by the
program or by the user.
- Specified by:
targetChanged
in interface TargetChangedListener
- See Also:
TargetChangedListener.targetChanged(java.lang.Object)
targetReasserted
public void targetReasserted(java.lang.Object newTarget)
- Description copied from interface:
TargetChangedListener
- This method is called when the navigation history is updated.
- Specified by:
targetReasserted
in interface TargetChangedListener
- See Also:
TargetChangedListener.targetReasserted(java.lang.Object)