public interface Model<C extends Component<C>> extends Referenceable
Modifier and Type | Interface and Description |
---|---|
static class |
Model.State
State of the model.
|
Modifier and Type | Field and Description |
---|---|
static String |
STATE_PROPERTY |
Modifier and Type | Method and Description |
---|---|
void |
addChildComponent(Component target,
Component child,
int index)
Adds child component at specified index.
|
void |
addComponentListener(ComponentListener cl)
Removes component event listener.
|
void |
addPropertyChangeListener(PropertyChangeListener pcl)
Adds fine-grained property change listener for events on model components.
|
void |
addUndoableEditListener(UndoableEditListener uel)
Adds undoable edit listener.
|
void |
addUndoableRefactorListener(UndoableEditListener uel)
Adds undoable refactoring edit listener.
|
void |
endTransaction()
This method stops the transaction and causes all events to be fired.
|
ModelSource |
getModelSource() |
Model.State |
getState() |
boolean |
inSync()
Returns true if sync is being performed.
|
boolean |
isIntransaction()
Be very careful while using this method.
|
void |
removeChildComponent(Component child)
Removes specified component from model.
|
void |
removeComponentListener(ComponentListener cl)
Adds coarse-grained change listener for events on model components.
|
void |
removePropertyChangeListener(PropertyChangeListener pcl)
Remove property change listener.
|
void |
removeUndoableEditListener(UndoableEditListener uel)
Removes undoable edit listener.
|
void |
removeUndoableRefactorListener(UndoableEditListener uel)
Removes undoable refactoring edit listener.
|
boolean |
startTransaction()
This method will block until a transaction can be started.
|
void |
sync()
Makes the current memory model consistent with the underlying
representation, typically a swing document.
|
static final String STATE_PROPERTY
void removeComponentListener(ComponentListener cl)
void addComponentListener(ComponentListener cl)
void addPropertyChangeListener(PropertyChangeListener pcl)
void removePropertyChangeListener(PropertyChangeListener pcl)
void removeUndoableEditListener(UndoableEditListener uel)
void addUndoableEditListener(UndoableEditListener uel)
void removeUndoableRefactorListener(UndoableEditListener uel)
void addUndoableRefactorListener(UndoableEditListener uel)
void sync() throws IOException
IOException
boolean inSync()
Model.State getState()
boolean isIntransaction()
@CheckReturnValue boolean startTransaction()
Model.endTransaction()
has been invoked. A transaction must be
be acquired during a mutation, reading can be performed without
a transaction. Only a single transaction at a time is supported. Mutations
which occur based on events will not be reflected until the transaction
has completed.void endTransaction()
void addChildComponent(Component target, Component child, int index)
target
- the parent component.child
- the child component to be added.index
- position among same type of child components, or -1 if not relevant.void removeChildComponent(Component child)
ModelSource getModelSource()