Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
public class: StyleContext.NamedStyle [javadoc | source]
java.lang.Object
   javax.swing.text.StyleContext$NamedStyle

All Implemented Interfaces:
    Style, Serializable

A collection of attributes, typically used to represent character and paragraph styles. This is an implementation of MutableAttributeSet that can be observed if desired. These styles will take advantage of immutability while the sets are small enough, and may be substantially more efficient than something like SimpleAttributeSet.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .
Field Summary
protected  EventListenerList listenerList    The change listeners for the model. 
protected transient  ChangeEvent changeEvent    Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this". 
Constructor:
 public NamedStyle() 
 public NamedStyle(Style parent) 
    Creates a new named style.
    Parameters:
    parent - the parent style, null if none
    since: 1.4 -
 public NamedStyle(String name,
    Style parent) 
    Creates a new named style.
    Parameters:
    name - the style name, null for unnamed
    parent - the parent style, null if none
    since: 1.4 -
Method from javax.swing.text.StyleContext$NamedStyle Summary:
addAttribute,   addAttributes,   addChangeListener,   containsAttribute,   containsAttributes,   copyAttributes,   fireStateChanged,   getAttribute,   getAttributeCount,   getAttributeNames,   getChangeListeners,   getListeners,   getName,   getResolveParent,   isDefined,   isEqual,   removeAttribute,   removeAttributes,   removeAttributes,   removeChangeListener,   setName,   setResolveParent,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.StyleContext$NamedStyle Detail:
 public  void addAttribute(Object name,
    Object value) 
    Adds an attribute.
 public  void addAttributes(AttributeSet attr) 
    Adds a set of attributes to the element.
 public  void addChangeListener(ChangeListener l) 
    Adds a change listener.
 public boolean containsAttribute(Object name,
    Object value) 
    Checks whether a given attribute name/value is defined.
 public boolean containsAttributes(AttributeSet attrs) 
    Checks whether the element contains all the attributes.
 public AttributeSet copyAttributes() 
    Copies a set of attributes.
 protected  void fireStateChanged() 
    Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
 public Object getAttribute(Object attrName) 
    Gets the value of an attribute.
 public int getAttributeCount() 
    Gets the number of attributes that are defined.
 public Enumeration<?> getAttributeNames() 
    Gets the names of all attributes.
 public ChangeListener[] getChangeListeners() 
    Returns an array of all the ChangeListeners added to this NamedStyle with addChangeListener().
 public T[] getListeners(Class<T> listenerType) 
    Return an array of all the listeners of the given type that were added to this model.
 public String getName() 
    Fetches the name of the style. A style is not required to be named, so null is returned if there is no name associated with the style.
 public AttributeSet getResolveParent() 
    Gets attributes from the parent. If not overriden, the resolving parent defaults to the parent element.
 public boolean isDefined(Object attrName) 
    Checks whether a given attribute is defined.
 public boolean isEqual(AttributeSet attr) 
    Checks whether two attribute sets are equal.
 public  void removeAttribute(Object name) 
    Removes an attribute from the set.
 public  void removeAttributes(Enumeration<?> names) 
    Removes a set of attributes for the element.
 public  void removeAttributes(AttributeSet attrs) 
    Removes a set of attributes for the element.
 public  void removeChangeListener(ChangeListener l) 
    Removes a change listener.
 public  void setName(String name) 
    Changes the name of the style. Does nothing with a null name.
 public  void setResolveParent(AttributeSet parent) 
    Sets the resolving parent.
 public String toString() 
    Converts the style to a string.