org.beanfabrics.model
Class IconPM

java.lang.Object
  extended by org.beanfabrics.AbstractBean
      extended by org.beanfabrics.ValidatableBean
          extended by org.beanfabrics.model.AbstractPM
              extended by org.beanfabrics.model.AbstractValuePM
                  extended by org.beanfabrics.model.IconPM
All Implemented Interfaces:
Bean, ContextOwner, HasComparable, IIconPM, IValuePM, PresentationModel, Supportable, Validatable

public class IconPM
extends AbstractValuePM
implements IIconPM

The IconPM is a PresentationModel that contains a Swing Icon.

Please Note: this class will be moved to the org.beanfabrics.swing.model package soon.


Nested Class Summary
 class IconPM.IconComparable
          The IconPM.IconComparable delegates the comparison to the Icon or, if the Icon is an ImageIcon to the icon's Image property.
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractValuePM
AbstractValuePM.MandatoryValidationRule
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractPM
AbstractPM.PropertiesValidationRule
 
Field Summary
 
Fields inherited from class org.beanfabrics.model.AbstractValuePM
KEY_MESSAGE_MANDATORY
 
Fields inherited from class org.beanfabrics.model.AbstractPM
KEY_MESSAGE_ONE_OR_MORE_INVALID
 
Constructor Summary
IconPM()
           
 
Method Summary
 java.lang.Comparable<?> getComparable()
          Returns the comparable substitute.
 javax.swing.Icon getIcon()
          Returns the Icon value of this PM.
 boolean isEmpty()
          Returns whether the value of this PM is interpreted as an empty value.
 void setIcon(javax.swing.Icon newIcon)
          Sets the Icon value of this PM.
 void setIconUrl(java.net.URL url)
          Sets the URL to the resource containing an Image that should be used as Icon value of this PM.
 
Methods inherited from class org.beanfabrics.model.AbstractValuePM
getDescription, getTitle, isEditable, isMandatory, revalidate, setDescription, setEditable, setMandatory, setTitle
 
Methods inherited from class org.beanfabrics.model.AbstractPM
getContext, getSupportMap, revalidateProperties
 
Methods inherited from class org.beanfabrics.ValidatableBean
getValidationState, getValidator, isValid, setValidationState
 
Methods inherited from class org.beanfabrics.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.beanfabrics.model.IValuePM
getDescription, getTitle, isEditable, isMandatory, setDescription, setEditable, setMandatory, setTitle
 
Methods inherited from interface org.beanfabrics.Bean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.beanfabrics.validation.Validatable
getValidationState, getValidator, isValid, revalidate
 
Methods inherited from interface org.beanfabrics.support.Supportable
getSupportMap
 
Methods inherited from interface org.beanfabrics.context.ContextOwner
getContext
 

Constructor Detail

IconPM

public IconPM()
Method Detail

setIcon

public void setIcon(javax.swing.Icon newIcon)
Sets the Icon value of this PM.

Parameters:
newIcon -

getIcon

public javax.swing.Icon getIcon()
Returns the Icon value of this PM.

Specified by:
getIcon in interface IIconPM
Returns:
the Icon value of this PM

setIconUrl

public void setIconUrl(java.net.URL url)
Sets the URL to the resource containing an Image that should be used as Icon value of this PM.

Parameters:
url - the URL to the Image resource
See Also:
setIcon(Icon)

isEmpty

public boolean isEmpty()
Returns whether the value of this PM is interpreted as an empty value.

Specified by:
isEmpty in interface IValuePM
Returns:
true if this PM contains an empty value

getComparable

public java.lang.Comparable<?> getComparable()
Returns the comparable substitute. This substitute can be used for comparison of this object with another.

Override this method to control how instances of this class are sorted by a Sorter.

Specified by:
getComparable in interface HasComparable
Overrides:
getComparable in class AbstractPM
Returns:
the comparable substitute