public abstract class AbstractGriffonModel extends AbstractGriffonMvcArtifact implements GriffonModel
Modifier and Type | Field and Description |
---|---|
protected PropertyChangeSupport |
pcs |
protected VetoableChangeSupport |
vcs |
application
Constructor and Description |
---|
AbstractGriffonModel() |
AbstractGriffonModel(GriffonApplication application)
Deprecated.
Griffon prefers field injection over constructor injector for artifacts as of 2.1.0
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the given PropertyChangeListener to the listener list.
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Removes the given PropertyChangeListener from the listener list.
|
void |
addVetoableChangeListener(String propertyName,
VetoableChangeListener listener)
Add a VetoableChangeListener for a specific property.
|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Add a VetoableListener to the listener list.
|
protected void |
firePropertyChange(PropertyChangeEvent event) |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue) |
protected void |
fireVetoableChange(PropertyChangeEvent event) |
protected void |
fireVetoableChange(String propertyName,
Object oldValue,
Object newValue) |
protected String |
getArtifactType() |
PropertyChangeListener[] |
getPropertyChangeListeners()
Returns an array of all the listeners that were added with addPropertyChangeListener().
|
PropertyChangeListener[] |
getPropertyChangeListeners(String propertyName)
Returns an array of all the listeners which have been associated
with the named property.
|
VetoableChangeListener[] |
getVetoableChangeListeners()
Returns the list of VetoableChangeListeners.
|
VetoableChangeListener[] |
getVetoableChangeListeners(String propertyName)
Returns an array of all the listeners which have been associated
with the named property.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the given PropertyChangeListener from the listener list.
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Removes the given PropertyChangeListener from the listener list.
|
void |
removeVetoableChangeListener(String propertyName,
VetoableChangeListener listener)
Remove a VetoableChangeListener for a specific property.
|
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Remove a VetoableChangeListener from the listener list.
|
createMVC, createMVC, createMVC, createMVC, createMVC, createMVC, createMVCGroup, createMVCGroup, createMVCGroup, createMVCGroup, createMVCGroup, createMVCGroup, getMvcGroup, mvcGroupDestroy, mvcGroupInit, setMvcGroup, withMVC, withMVC, withMVC, withMVC, withMVC, withMVC, withMVCGroup, withMVCGroup, withMVCGroup, withMVCGroup, withMVCGroup, withMVCGroup
classloader, destroyMVCGroup, getApplication, getGriffonClass, getLog, getResourceAsStream, getResourceAsURL, getResources, isUIThread, runFuture, runFuture, runInsideUIAsync, runInsideUISync, runOutsideUI
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMvcGroup, mvcGroupDestroy, mvcGroupInit
getApplication, getGriffonClass, getLog
isUIThread, runFuture, runFuture, runInsideUIAsync, runInsideUISync, runOutsideUI
createMVC, createMVC, createMVC, createMVC, createMVC, createMVC, createMVCGroup, createMVCGroup, createMVCGroup, createMVCGroup, createMVCGroup, createMVCGroup, destroyMVCGroup, withMVC, withMVC, withMVC, withMVC, withMVC, withMVC, withMVCGroup, withMVCGroup, withMVCGroup, withMVCGroup, withMVCGroup, withMVCGroup
classloader, getResourceAsStream, getResourceAsURL, getResources
protected final PropertyChangeSupport pcs
protected final VetoableChangeSupport vcs
public AbstractGriffonModel()
@Inject @Deprecated public AbstractGriffonModel(@Nonnull GriffonApplication application)
application
- the GriffonApplication that holds this artifact.@Nonnull protected String getArtifactType()
getArtifactType
in class AbstractGriffonArtifact
public void addVetoableChangeListener(@Nullable VetoableChangeListener listener)
Vetoable
listener
is null, no exception is thrown and no action
is taken.addVetoableChangeListener
in interface Vetoable
listener
- The VetoableChangeListener to be addedpublic void addVetoableChangeListener(@Nullable String propertyName, @Nullable VetoableChangeListener listener)
Vetoable
propertyName
or listener
is null, no
exception is thrown and no action is taken.addVetoableChangeListener
in interface Vetoable
propertyName
- The name of the property to listen on.listener
- The VetoableChangeListener to be addedpublic void removeVetoableChangeListener(@Nullable VetoableChangeListener listener)
Vetoable
listener
was added more than once to the same event
source, it will be notified one less time after being removed.
If listener
is null, or was never added, no exception is
thrown and no action is taken.removeVetoableChangeListener
in interface Vetoable
listener
- The VetoableChangeListener to be removedpublic void removeVetoableChangeListener(@Nullable String propertyName, @Nullable VetoableChangeListener listener)
Vetoable
listener
was added more than once to the same event
source for the specified property, it will be notified one less time
after being removed.
If propertyName
is null, no exception is thrown and no
action is taken.
If listener
is null, or was never added for the specified
property, no exception is thrown and no action is taken.removeVetoableChangeListener
in interface Vetoable
propertyName
- The name of the property that was listened on.listener
- The VetoableChangeListener to be removed@Nonnull public VetoableChangeListener[] getVetoableChangeListeners()
Vetoable
getVetoableChangeListeners
in interface Vetoable
@Nonnull public VetoableChangeListener[] getVetoableChangeListeners(@Nullable String propertyName)
Vetoable
getVetoableChangeListeners
in interface Vetoable
propertyName
- The name of the property being listened toVetoableChangeListeners
associated with
the named property. If no such listeners have been added,
or if propertyName
is null, an empty array is
returned.public void addPropertyChangeListener(@Nullable PropertyChangeListener listener)
Observable
The listener is registered for all bound properties of this class.
addPropertyChangeListener
in interface Observable
listener
- the PropertyChangeListener to be addedObservable.removePropertyChangeListener(PropertyChangeListener)
public void addPropertyChangeListener(@Nullable String propertyName, @Nullable PropertyChangeListener listener)
Observable
The listener is registered an specific property of this class.
addPropertyChangeListener
in interface Observable
propertyName
- The name of the property to listen on.listener
- the PropertyChangeListener to be addedObservable.removePropertyChangeListener(String, PropertyChangeListener)
public void removePropertyChangeListener(@Nullable PropertyChangeListener listener)
Observable
This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.
removePropertyChangeListener
in interface Observable
listener
- the PropertyChangeListener to be removedObservable.addPropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(@Nullable String propertyName, @Nullable PropertyChangeListener listener)
Observable
This method should be used to remove PropertyChangeListeners that were registered for an specific property of this class.
removePropertyChangeListener
in interface Observable
propertyName
- The name of the property that was listened on.listener
- the PropertyChangeListener to be removedObservable.addPropertyChangeListener(String, PropertyChangeListener)
@Nonnull public PropertyChangeListener[] getPropertyChangeListeners()
Observable
getPropertyChangeListeners
in interface Observable
PropertyChangeListeners
added or an empty array if no
listeners have been added.@Nonnull public PropertyChangeListener[] getPropertyChangeListeners(@Nullable String propertyName)
Observable
getPropertyChangeListeners
in interface Observable
propertyName
- The name of the property being listened toPropertyChangeListeners
associated with
the named property. If no such listeners have been added,
or if propertyName
is null, an empty array is
returned.protected void firePropertyChange(@Nonnull PropertyChangeEvent event)
protected void firePropertyChange(@Nonnull String propertyName, @Nullable Object oldValue, @Nullable Object newValue)
protected void fireVetoableChange(@Nonnull PropertyChangeEvent event) throws PropertyVetoException
PropertyVetoException
protected void fireVetoableChange(@Nonnull String propertyName, @Nullable Object oldValue, @Nullable Object newValue) throws PropertyVetoException
PropertyVetoException