|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
dsto.dfc.swing.forms.AbstractFormEditorComponent
dsto.dfc.swing.text.TermCustomizer
public class TermCustomizer
An editable rich text view of a Term
. Shows the heirachy of
CompositeTerm's and the text customizer for each term.
Term.getCustomizerFormat()
,
Serialized FormNested Class Summary | |
---|---|
protected class |
TermCustomizer.Document
The document used for the text display. |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static String |
ADD_IMAGE_URL
|
protected static String |
DELETE_IMAGE_URL
|
protected TermCustomizer.Document |
document
|
protected HashMap |
parentMap
|
protected Term |
rootTerm
|
protected ArrayList |
terms
|
protected List |
termTemplates
|
Fields inherited from class dsto.dfc.swing.forms.AbstractFormEditorComponent |
---|
description |
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 | |
---|---|
TermCustomizer()
|
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener l)
|
protected void |
addTerm(int termRow)
Add a term at a given row in the term list. |
void |
commitEdits()
Default implementation does nothing. |
protected void |
customizeTerm(String link)
Customize a term property represented by a given link from its customizerFormat. |
protected Term |
customizeTermVisually(Term term,
String property)
Customize a property of a term using its customizer UI. |
protected void |
fireStateChanged()
|
Object |
getEditorValue()
Get the current value from the form editor. |
CompositeTerm |
getParent(Term child)
|
Dimension |
getPreferredScrollableViewportSize()
|
Term |
getRootTerm()
Get the root term that is being edited. |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
|
List |
getTermTemplates()
|
JTextPane |
getTextPane()
|
boolean |
isDirectEdit()
True if the editor directly edits the value passed in with setValue (). |
protected void |
linkActivated(String link)
Called when a hyperlink in the text pane is activated and delegates to customize/remove/addTerm (). |
protected void |
linkEntered(String link)
Called when a hyperlink in the text pane is entered and shows tooltip. |
protected void |
linkExited(String link)
Called when a hyperlink in the text pane is exited and clears tooltip. |
void |
removeChangeListener(ChangeListener l)
|
protected void |
removeTerm(int termRow)
Remove the term at a given row in the term list. |
protected void |
replaceTerm(Term term,
Term newTerm,
int termRow)
Replace one term with another at the same location. |
protected Term |
selectTemplateTerm()
Show a list of template terms and allow the user to select one. |
void |
setEditorValue(Object value)
Sets the value to be displayed/edited by the form editor. |
void |
setRootTerm(Term newValue)
Set the term that is to be edited. |
void |
setTermTemplates(List newValue)
Set the list of template terms that is presented to the user when the add term button is clicked. |
protected void |
textifyTerm(ArrayList buffer,
Term term,
int level)
Turn a term tree into its textual customizer form. |
protected void |
updateText()
Rebuild the text view of the term tree. |
Methods inherited from class dsto.dfc.swing.forms.AbstractFormEditorComponent |
---|
addFormEditorListener, fireEditComitted, fireEditCommitRequested, fireEditCommitted, getEditorComponent, getEditorDescription, getPreferredValueType, removeFormEditorListener, setEditorDescription, setObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.beans.Customizer |
---|
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
protected static final String DELETE_IMAGE_URL
protected static final String ADD_IMAGE_URL
protected Term rootTerm
protected TermCustomizer.Document document
protected ArrayList terms
protected HashMap parentMap
protected List termTemplates
Constructor Detail |
---|
public TermCustomizer()
Method Detail |
---|
public CompositeTerm getParent(Term child)
public List getTermTemplates()
public void setTermTemplates(List newValue)
public JTextPane getTextPane()
public void setRootTerm(Term newValue)
public Term getRootTerm()
public Object getEditorValue() throws IllegalFormatException
FormEditor
getEditorValue
in interface FormEditor
getEditorValue
in class AbstractFormEditorComponent
IllegalFormatException
public void setEditorValue(Object value) throws IllegalFormatException
FormEditor
setEditorValue
in interface FormEditor
setEditorValue
in class AbstractFormEditorComponent
value
- The value to display.
IllegalFormatException
- if the value was not in the
correct format for display by this editor. The source specified
by the exception should be this FormEditor instance or a child.public boolean isDirectEdit()
FormEditor
isDirectEdit
in interface FormEditor
isDirectEdit
in class AbstractFormEditorComponent
public void commitEdits()
AbstractFormEditorComponent
commitEdits
in interface FormEditor
commitEdits
in class AbstractFormEditorComponent
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
protected void linkEntered(String link)
protected void linkExited(String link)
protected void linkActivated(String link)
protected void removeTerm(int termRow)
termRow
- The absolute row of the term in the tree of terms.protected void addTerm(int termRow)
termRow
- The absolute row of the term in the tree of terms.protected void replaceTerm(Term term, Term newTerm, int termRow) throws IllegalArgumentException
term
- The old term.newTerm
- The new term.termRow
- The absolute row in the tree that term is at.
IllegalArgumentException
- if attempt is made to replace root
term.protected void customizeTerm(String link)
protected Term customizeTermVisually(Term term, String property)
term
- The term.property
- The property to be edited.
protected Term selectTemplateTerm()
protected void updateText()
protected void textifyTerm(ArrayList buffer, Term term, int level) throws BadLocationException
buffer
- The buffer to add the generated ElementSpec's to.term
- The root of the term tree to textify.level
- The child nesting level (should be 0 for root).
BadLocationException
public void removeChangeListener(ChangeListener l)
public void addChangeListener(ChangeListener l)
protected void fireStateChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |