Package io.guise.framework.prototype
Class AbstractProxyPrototype<P extends Prototype & InfoModel>
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.model.AbstractModel
-
- io.guise.framework.prototype.AbstractProxyPrototype<P>
-
- Type Parameters:
P
- The type of prototype being proxied.
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,InfoModel
,LabelModel
,Model
,Prototype
- Direct Known Subclasses:
AbstractEnableableProxyPrototype
public class AbstractProxyPrototype<P extends Prototype & InfoModel> extends AbstractModel implements Prototype, InfoModel
Abstract prototype information that is a proxy for another prototype.- Author:
- Garret Wilson
-
-
Field Summary
-
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Fields inherited from interface io.guise.framework.model.InfoModel
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY
-
Fields inherited from interface io.guise.framework.model.LabelModel
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AbstractProxyPrototype(P proxiedPrototype)
Proxied prototype constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fireProxiedPrototypeBoundPropertyChanges(P oldProxiedPrototype, P newProxiedPrototype)
Fires appropriate property change events for the bound properties of the proxied prototype This implementation fires property change events for the following properties:LabelModel.LABEL_PROPERTY
LabelModel.LABEL_CONTENT_TYPE_PROPERTY
LabelModel.GLYPH_URI_PROPERTY
InfoModel.DESCRIPTION_PROPERTY
InfoModel.DESCRIPTION_CONTENT_TYPE_PROPERTY
InfoModel.INFO_PROPERTY
InfoModel.INFO_CONTENT_TYPE_PROPERTY
java.lang.String
getDescription()
com.globalmentor.net.ContentType
getDescriptionContentType()
java.net.URI
getGlyphURI()
java.lang.String
getInfo()
com.globalmentor.net.ContentType
getInfoContentType()
java.lang.String
getLabel()
com.globalmentor.net.ContentType
getLabelContentType()
P
getProxiedPrototype()
protected void
installListeners(P newProxiedPrototype)
Installs listeners to a proxied prototype.void
setDescription(java.lang.String newDescription)
Sets the description text, such as might appear in a flyover.void
setDescriptionContentType(com.globalmentor.net.ContentType newDescriptionContentType)
Sets the content type of the description text.void
setGlyphURI(java.net.URI newLabelIcon)
Sets the URI of the icon.void
setInfo(java.lang.String newInfo)
Sets the advisory information text, such as might appear in a tooltip.void
setInfoContentType(com.globalmentor.net.ContentType newInfoContentType)
Sets the content type of the advisory information text.void
setLabel(java.lang.String newLabelText)
Sets the text of the label.void
setLabelContentType(com.globalmentor.net.ContentType newLabelTextContentType)
Sets the content type of the label text.void
setProxiedPrototype(P newProxiedPrototype)
Changes the prototype being proxied.protected void
uninstallListeners(P oldProxiedPrototype)
Uninstalls listeners from a proxied prototype.-
Methods inherited from class io.guise.framework.model.AbstractModel
getEventListenerManager, getPlainText
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AbstractProxyPrototype
public AbstractProxyPrototype(P proxiedPrototype)
Proxied prototype constructor.- Parameters:
proxiedPrototype
- The prototype proxied by this prototype.- Throws:
java.lang.NullPointerException
- if the given proxied prototype isnull
isnull
.
-
-
Method Detail
-
getProxiedPrototype
public P getProxiedPrototype()
- Returns:
- The prototype proxied by this prototype.
-
setProxiedPrototype
public void setProxiedPrototype(P newProxiedPrototype)
Changes the prototype being proxied. Although this is not a bound property, changing its value will cause all the relevant bound properties of the proxied prototype to fire property change events.- Parameters:
newProxiedPrototype
- The new prototype to be proxied by this prototype.- See Also:
uninstallListeners(Prototype)
,installListeners(Prototype)
,fireProxiedPrototypeBoundPropertyChanges(Prototype, Prototype)
-
uninstallListeners
protected void uninstallListeners(P oldProxiedPrototype)
Uninstalls listeners from a proxied prototype.- Parameters:
oldProxiedPrototype
- The old proxied prototype.
-
installListeners
protected void installListeners(P newProxiedPrototype)
Installs listeners to a proxied prototype.- Parameters:
newProxiedPrototype
- The new proxied prototype.
-
fireProxiedPrototypeBoundPropertyChanges
protected void fireProxiedPrototypeBoundPropertyChanges(P oldProxiedPrototype, P newProxiedPrototype)
Fires appropriate property change events for the bound properties of the proxied prototype This implementation fires property change events for the following properties:- Parameters:
oldProxiedPrototype
- The old proxied prototype.newProxiedPrototype
- The new proxied prototype.- Throws:
java.lang.NullPointerException
- if the given old proxied prototype and/or new proxied prototype isnull
.
-
getGlyphURI
public java.net.URI getGlyphURI()
- Specified by:
getGlyphURI
in interfaceLabelModel
- Returns:
- The glyph URI, which may be a resource URI, or
null
if there is no glyph URI.
-
setGlyphURI
public void setGlyphURI(java.net.URI newLabelIcon)
Description copied from interface:LabelModel
Sets the URI of the icon. This is a bound property.- Specified by:
setGlyphURI
in interfaceLabelModel
- Parameters:
newLabelIcon
- The new URI of the icon, which may be a resource URI.- See Also:
LabelModel.GLYPH_URI_PROPERTY
-
getLabel
public java.lang.String getLabel()
- Specified by:
getLabel
in interfaceLabelModel
- Returns:
- The label text, which may include a resource reference, or
null
if there is no label text.
-
setLabel
public void setLabel(java.lang.String newLabelText)
Description copied from interface:LabelModel
Sets the text of the label. This is a bound property.- Specified by:
setLabel
in interfaceLabelModel
- Parameters:
newLabelText
- The new text of the label, which may include a resource reference.- See Also:
LabelModel.LABEL_PROPERTY
-
getLabelContentType
public com.globalmentor.net.ContentType getLabelContentType()
- Specified by:
getLabelContentType
in interfaceLabelModel
- Returns:
- The content type of the label text.
-
setLabelContentType
public void setLabelContentType(com.globalmentor.net.ContentType newLabelTextContentType)
Description copied from interface:LabelModel
Sets the content type of the label text. This is a bound property.- Specified by:
setLabelContentType
in interfaceLabelModel
- Parameters:
newLabelTextContentType
- The new label text content type.- See Also:
LabelModel.LABEL_CONTENT_TYPE_PROPERTY
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceInfoModel
- Returns:
- The description text, such as might appear in a flyover, or
null
if there is no description.
-
setDescription
public void setDescription(java.lang.String newDescription)
Description copied from interface:InfoModel
Sets the description text, such as might appear in a flyover. This is a bound property.- Specified by:
setDescription
in interfaceInfoModel
- Parameters:
newDescription
- The new text of the description, such as might appear in a flyover.- See Also:
InfoModel.DESCRIPTION_PROPERTY
-
getDescriptionContentType
public com.globalmentor.net.ContentType getDescriptionContentType()
- Specified by:
getDescriptionContentType
in interfaceInfoModel
- Returns:
- The content type of the description text.
-
setDescriptionContentType
public void setDescriptionContentType(com.globalmentor.net.ContentType newDescriptionContentType)
Description copied from interface:InfoModel
Sets the content type of the description text. This is a bound property.- Specified by:
setDescriptionContentType
in interfaceInfoModel
- Parameters:
newDescriptionContentType
- The new description text content type.- See Also:
InfoModel.DESCRIPTION_CONTENT_TYPE_PROPERTY
-
getInfo
public java.lang.String getInfo()
-
setInfo
public void setInfo(java.lang.String newInfo)
Description copied from interface:InfoModel
Sets the advisory information text, such as might appear in a tooltip. This is a bound property.- Specified by:
setInfo
in interfaceInfoModel
- Parameters:
newInfo
- The new text of the advisory information, such as might appear in a tooltip.- See Also:
InfoModel.INFO_PROPERTY
-
getInfoContentType
public com.globalmentor.net.ContentType getInfoContentType()
- Specified by:
getInfoContentType
in interfaceInfoModel
- Returns:
- The content type of the advisory information text.
-
setInfoContentType
public void setInfoContentType(com.globalmentor.net.ContentType newInfoContentType)
Description copied from interface:InfoModel
Sets the content type of the advisory information text. This is a bound property.- Specified by:
setInfoContentType
in interfaceInfoModel
- Parameters:
newInfoContentType
- The new advisory information text content type.- See Also:
InfoModel.INFO_CONTENT_TYPE_PROPERTY
-
-