public class IlpExtendedAttributeGroup extends IlpDefaultAttributeGroup implements AttributeGroupListener, ilog.cpl.model.internal.IlpAttributeGroupHierarchy
Constructor and Description |
---|
IlpExtendedAttributeGroup()
Default constructor.
|
IlpExtendedAttributeGroup(IlpAttributeGroup defaultModel)
Creates a new group with the given attribute group as a default group.
|
IlpExtendedAttributeGroup(String name)
Creates a new attribute group with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeGroup(IlpAttributeGroup model)
Adds the given model to be used by this one.
|
void |
attributeAdded(AttributeGroupEvent ev)
Is called when an attribute is added
to an
IlpAttributeGroup . |
void |
attributeChanged(AttributeGroupEvent ev)
Is called when an attribute is changed
in an
IlpAttributeGroup . |
void |
attributeRemoved(AttributeGroupEvent ev)
Is called when an attribute is removed
from an
IlpAttributeGroup . |
IlpAttribute |
getAttribute(String name)
Returns a class instance attribute.
|
Collection<IlpAttributeGroup> |
getAttributeGroups()
Returns the list of all attribute groups being used by this one.
|
Collection<IlpAttribute> |
getAttributes()
Returns the collection of visible attributes present in this model.
|
Collection<IlpAttribute> |
getDeclaredAttributes()
Returns the collection of attributes declared in this model.
|
IlpAttributeGroup |
getDefaultAttributeGroup()
Returns the default attribute group.
|
String |
getGroupName()
Returns the name of this group, otherwise returns null;
|
String |
getName()
Returns the Attribute Group name, if one exist.
|
boolean |
hasAttribute(IlpAttribute attr)
Indicates whether the given attribute is part of the model.
|
boolean |
hasAttributeGroup(IlpAttributeGroup model)
Indicates whether this extended attribute model is using another model.
|
boolean |
isAttributeVisible(IlpAttribute attr)
Checks whether the given attribute is visible or not.
|
void |
modelStructureChanged(AttributeGroupEvent ev)
Is called when the attribute model has
undergone several modifications.
|
void |
removeAttributeGroup(IlpAttributeGroup model)
Removes the given model from the list of models.
|
void |
setAttributeVisible(IlpAttribute attr,
boolean visible)
Sets whether the given attribute should be visible
to users of the model.
|
void |
setDefaultAttributeGroup(IlpAttributeGroup group)
Sets the default attribute group.
|
addAttribute, addAttributeGroupListener, endChangingAttributeGroup, fireEvent, removeAttribute, removeAttributeGroupListener, startChangingAttributeGroup
public IlpExtendedAttributeGroup()
public IlpExtendedAttributeGroup(IlpAttributeGroup defaultModel)
public IlpExtendedAttributeGroup(String name)
public Collection<IlpAttribute> getAttributes()
This implementation returns a collection where the attributes are in the following order:
When an attribute is made invisible and then visible again, its position in the collection will be the same as if the attribute had been removed and inserted in the group.
getAttributes
in interface IlpAttributeGroup
getAttributes
in class IlpDefaultAttributeGroup
IlpAttribute
instances.public Collection<IlpAttribute> getDeclaredAttributes()
The attributes are returned in the insertion order. When an attribute is made invisible and then visible again, its position in the list will be the same as if the attribute had been removed and added to the group.
getDeclaredAttributes
in interface IlpAttributeGroup
getDeclaredAttributes
in class IlpDefaultAttributeGroup
IlpAttribute
instances.IlpDefaultAttributeGroup.getAttributes()
public IlpAttribute getAttribute(String name)
getAttribute
in interface IlpAttributeGroup
getAttribute
in class IlpDefaultAttributeGroup
name
- The name of the class instance attribute to be retrieved.null
if there is no matching attribute.public boolean hasAttribute(IlpAttribute attr)
hasAttribute
in interface IlpAttributeGroup
hasAttribute
in class IlpDefaultAttributeGroup
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.
setAttributeVisible
in class IlpDefaultAttributeGroup
IllegalArgumentException
- if the given attribute is not
part of the model.public boolean isAttributeVisible(IlpAttribute attr)
isAttributeVisible
in class IlpDefaultAttributeGroup
true
if the attribute is contained in the model and visible.public String getName()
getName
in interface IlpAttributeGroup
getName
in class IlpDefaultAttributeGroup
public String getGroupName()
getGroupName
in interface ilog.cpl.model.internal.IlpAttributeGroupHierarchy
public void attributeAdded(AttributeGroupEvent ev)
IlpAttributeGroup
.attributeAdded
in interface AttributeGroupListener
public void attributeRemoved(AttributeGroupEvent ev)
IlpAttributeGroup
.attributeRemoved
in interface AttributeGroupListener
public void attributeChanged(AttributeGroupEvent ev)
IlpAttributeGroup
.attributeChanged
in interface AttributeGroupListener
public void modelStructureChanged(AttributeGroupEvent ev)
modelStructureChanged
in interface AttributeGroupListener
public boolean hasAttributeGroup(IlpAttributeGroup model)
model
- The model that may be used by this extended attribute model.true
if the model is used by this extended attribute model.public void addAttributeGroup(IlpAttributeGroup model)
This method fires a MODEL_STRUCTURE_CHANGE
event
to the listeners.
public void removeAttributeGroup(IlpAttributeGroup model)
This method fires a MODEL_STRUCTURE_CHANGE
event
to the listeners.
public IlpAttributeGroup getDefaultAttributeGroup()
The default attribute group is the first one used by this extended attribute group, which can be set or passed at construction time.
getDefaultAttributeGroup
in interface ilog.cpl.model.internal.IlpAttributeGroupHierarchy
public void setDefaultAttributeGroup(IlpAttributeGroup group) throws IllegalArgumentException
The default attribute group must be contained in this attribute group
otherwise, an IllegalArgumentException
is thrown.
IllegalArgumentException
- when the given attribute group is unknown.public Collection<IlpAttributeGroup> getAttributeGroups()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.