public class IlpDefaultAttributeGroup extends Object implements IlpMutableAttributeGroup
Constructor and Description |
---|
IlpDefaultAttributeGroup()
Default constructor
|
IlpDefaultAttributeGroup(IlpAttribute[] attributes)
Convenience constructor.
|
IlpDefaultAttributeGroup(String name)
Creates a default attribute group with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(IlpAttribute a)
Adds a new attribute to the model.
|
void |
addAttributeGroupListener(AttributeGroupListener l)
Adds a listener to model changes.
|
void |
endChangingAttributeGroup()
Indicates that the model has been changed and
that the events may now be sent to the interested
listeners.
|
void |
fireEvent(AttributeGroupEvent ev)
Notifies events to listeners.
|
IlpAttribute |
getAttribute(String name)
Returns the attribute that corresponds to the
given name, independently of whether it is visible or not.
|
Collection<IlpAttribute> |
getAttributes()
Returns the collection of attributes present in this model.
|
Collection<IlpAttribute> |
getDeclaredAttributes()
Returns the collection of attributes declared in this model.
|
String |
getName()
Returns the Attribute Group name.
|
boolean |
hasAttribute(IlpAttribute attr)
Returns whether the given attribute is part of the model, independently
of whether the attribute is visible or not.
|
boolean |
isAttributeVisible(IlpAttribute attr)
Checks whether the given attribute is visible or not.
|
void |
removeAttribute(IlpAttribute a)
Removes the given attribute from the model.
|
void |
removeAttributeGroupListener(AttributeGroupListener l)
Removes the model listener.
|
void |
setAttributeVisible(IlpAttribute attr,
boolean visible)
Sets whether the given attribute should be visible
to users of the model.
|
void |
startChangingAttributeGroup()
Indicates that the model will be changed and
events will be fired only when the method
endChangingAttributeGroup is called. |
public IlpDefaultAttributeGroup()
public IlpDefaultAttributeGroup(IlpAttribute[] attributes)
public IlpDefaultAttributeGroup(String name)
public String getName()
getName
in interface IlpAttributeGroup
public Collection<IlpAttribute> getAttributes()
Only visible attributes are returned.
The attributes returned by this method are present according to the insertion order. If an attribute is made invisible and then visible again, its position is the same as if it had been removed and inserted in the group.
getAttributes
in interface IlpAttributeGroup
IlpAttribute
instances.public Collection<IlpAttribute> getDeclaredAttributes()
Only visible attributes are returned.
The attributes returned by this method are present according to the insertion order. If an attribute is made invisible and then visible again, its position is the same as if it had been removed and inserted in the group.
getDeclaredAttributes
in interface IlpAttributeGroup
IlpAttribute
instances.getAttributes()
public IlpAttribute getAttribute(String name)
getAttribute
in interface IlpAttributeGroup
name
- The name of the class instance attribute to be retrieved.null
if there is no matching attribute.IllegalArgumentException
- if the name is invalid.public boolean hasAttribute(IlpAttribute attr)
hasAttribute
in interface IlpAttributeGroup
public void addAttribute(IlpAttribute a)
ATTRIBUTE_ADDED
event to the
listeners.addAttribute
in interface IlpMutableAttributeGroup
IlpAttribute.setAttributeGroup(ilog.cpl.model.IlpAttributeGroup)
public void removeAttribute(IlpAttribute a)
ATTRIBUTE_REMOVED
event to
the listeners.removeAttribute
in interface IlpMutableAttributeGroup
IlpAttribute.setAttributeGroup(ilog.cpl.model.IlpAttributeGroup)
public void addAttributeGroupListener(AttributeGroupListener l)
addAttributeGroupListener
in interface IlpAttributeGroup
public void removeAttributeGroupListener(AttributeGroupListener l)
removeAttributeGroupListener
in interface IlpAttributeGroup
public void fireEvent(AttributeGroupEvent ev)
fireEvent
in interface IlpAttributeGroup
public void startChangingAttributeGroup()
endChangingAttributeGroup
is called.endChangingAttributeGroup()
public void endChangingAttributeGroup()
startChangingAttributeGroup()
public void setAttributeVisible(IlpAttribute attr, boolean visible)
Attributes that are not visible will not be included in
the list returned by getAttributes
, but they will be
accessible through the other APIs.
Used to hide certain attributes from the reference model.
This method fires ATTRIBUTE_ADDED
or ATTRIBUTE_REMOVED
events according to the given visibility status.
IllegalArgumentException
- if the given attribute is not
part of the model.public boolean isAttributeVisible(IlpAttribute attr)
true
if the attribute is contained in the model and visible.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.