public class IlvSettingsManager extends IlvSettings
Query methods apply to all the settings added to the settings manager.
If a query accesses the same settings model nodes in different nodes,
nodes will be merged into one result settings node, according to the
cascading mode specified to the settings of those nodes (see IlvSettings.getCascadingMode()
).
IlvSettings.AttributeID, IlvSettings.IDAttributeMapper, IlvSettings.IDResolver
Modifier and Type | Field and Description |
---|---|
static String |
APPFRAME_LAYER
Layer for the use of Application Framework.
|
static String |
APPLICATION_DATA_LAYER
Layer to put the default application data in.
|
static String |
CLIENT_DEVICE_LAYER
Layer for inserting application data that depends on the client
device.
|
static String |
DEFAULT_NAME
Constant value for the default name of settings managers.
|
static String |
ROLE_LAYER
Layer for inserting application data that depends on the role of the user.
|
static String |
USER_LAYER
Layer where Application Framework inserts the user-customized data
when the user session ends.
|
APPLY_DIFF_MODE, EVERY_NODE_KEY, READABLE, SET_MODE, UNREADABLE, VERBOSE, WRITABLE
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
IlvSettingsManager()
Constructs a settings manager with a name set to
DEFAULT_NAME . |
IlvSettingsManager(String name)
Constructs a settings manager with the specified name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addSettings(IlvSettings settings,
String layerName)
Adds the specified settings to the specified layer.
|
void |
addSettingsListener(SettingsListener listener)
Adds a settings listener to the settings manager.
|
boolean |
areSettingsInitialized()
Determines whether the settings are initialized.
|
void |
commit()
Commits changes that occurred on the settings to the specified writable
settings.
|
boolean |
containsSettings(IlvSettings settings)
Determines whether this settings manager contains the specified
settings . |
IlvSettingsElement |
createSettingsElement(String typeName)
Creates a new settings element with the specified type name.
|
protected void |
fireInitializationEvent()
Fires an initialization event to all the settings listeners registered
with the settings manager.
|
protected void |
fireSettingsAddedEvent(IlvSettings settings)
Notifies all the settings listeners registered with the settings manager
that the specified
settings have been added to the
settings manager. |
protected void |
fireSettingsRemovedEvent(IlvSettings settings)
Notifies all the settings listeners registered with the settings manager
that the specified
settings have been removed from the
settings manager. |
void |
freezeMutationNotifications()
Freezes the notification of modification events to the settings
listeners registered with this settings manager.
|
IlvApplication |
getApplication()
Returns the application that owns this settings manager.
|
protected int |
getLayerIndex(String layerName)
Retrieves the storage index of the layer with the given name
layerName . |
String |
getLayerName(IlvSettings settings)
Returns the name of the layer that the specified settings are inserted in.
|
String[] |
getLayers()
Returns the names of the layers managed by this settings manager.
|
IlvSettings[] |
getSettings()
Returns the settings managed by this settings manager.
|
IlvSettings |
getSettings(String name)
Finds the settings with the given name.
|
IlvSettings |
getWritableSettings()
Returns the settings where settings modifications are stored.
|
boolean |
initializeSettings()
Initializes the settings.
|
boolean |
insertLayer(String layerName,
String layerRef,
boolean higherPriority)
Inserts a new settings layer.
|
boolean |
removeLayer(String layerName)
Removes the layer with the given name.
|
boolean |
removeSettings(IlvSettings settings)
Removes the specified settings.
|
boolean |
removeSettingsListener(SettingsListener listener)
Removes a settings listener from the list of listeners of the settings
manager.
|
void |
setApplication(IlvApplication application)
Sets the application that owns this settings manager.
|
void |
setWritableSettings(IlvSettings writableSettings)
Sets the settings where modifications made to settings owned by this
settings manager would be stored.
|
void |
unFreezeMutationNotifications()
Unfreezes the settings listeners.
|
addIDResolver, addSettingsElement, adoptNode, appendChild, canWrite, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createModel, createProcessingInstruction, createTextNode, ensureCorrespondingElement, ensureSettingsElement, ensureSettingsElement, getAccessRights, getAttributes, getBaseURI, getCascadingMode, getChildNodes, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getFirstChild, getID, getID, getImplementation, getInputEncoding, getLastChild, getLocalName, getModel, getMutableModel, getName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSettingsManager, getStrictErrorChecking, getTextContent, getUserData, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttributes, hasChildNodes, importNode, insertBefore, isDefaultNamespace, isEqualNode, IsEveryNodeKey, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, normalizeDocument, removeAllSettingsElements, removeChild, removeIDResolver, removeSettingsElement, renameNode, replaceChild, select, select, select, selectElement, selectElement, selectElement, selectNodes, setAccessRights, setCascadingMode, setDocumentURI, setID, setModel, setName, setNodeValue, setPrefix, setSettingsManager, setStrictErrorChecking, setTextContent, setUserData, setXmlStandalone, setXmlVersion
public static final String APPFRAME_LAYER
public static final String APPLICATION_DATA_LAYER
public static final String CLIENT_DEVICE_LAYER
public static final String ROLE_LAYER
public static final String USER_LAYER
public static final String DEFAULT_NAME
public IlvSettingsManager(String name)
name
- The name of the settings manager that allows those settings
to be retrieved from other settings if included in a top level settings manager.public IlvSettingsManager()
DEFAULT_NAME
.public boolean initializeSettings()
initializeSettings
in class IlvSettings
true
if the initialization is successful;
false
otherwise.IlvSettings.areSettingsInitialized()
public boolean areSettingsInitialized()
areSettingsInitialized
in class IlvSettings
true
if the settings are initialized; false
otherwise.IlvSettings.initializeSettings()
public void setApplication(IlvApplication application)
setApplication
in class IlvSettings
application
- The new application of this manager.getApplication()
public IlvApplication getApplication()
getApplication
in class IlvSettings
setApplication(ilog.views.appframe.IlvApplication)
public boolean addSettings(IlvSettings settings, String layerName)
settings
- The settings to add.layerName
- The name of the layer to add the settings to.true
if the given settings could be inserted
within the settings manager; false
if the layerName does not
correspond to an existing layer within the settings manager.public boolean removeSettings(IlvSettings settings)
settings
- The settings to remove.true
if the given settings could be removed;
false
if the settings were not stored in this settings manager.public boolean containsSettings(IlvSettings settings)
settings
.true
if the settings have been added to the
settings manager; false
otherwise.public IlvSettingsElement createSettingsElement(String typeName)
The settings returned by the newly created element by calling its method
IlvSettingsNode.getSettings()
must be
equal to this settings instance.
createSettingsElement
in class IlvSettings
typeName
- The name of the type of the element to instantiate.public IlvSettings getSettings(String name)
name
- The name of the settings to retrieve.public IlvSettings[] getSettings()
public void commit()
If the specified settings are equal to this settings instance, the implementation
of this method should save all the content of those settings.
Otherwise, if the writable settings are not equal to this settings instance,
the implementation of this method may do nothing, since changes that occur
on settings are automatically tracked and added to the writable settings
using the IlvSettings.addSettingsElement(ilog.views.appframe.settings.IlvSettingsElement, ilog.views.appframe.settings.IlvSettingsElement, int)
method.
commit
in class IlvSettings
IlvSettings.getModel()
public void setWritableSettings(IlvSettings writableSettings)
writableSettings
- The settings to store modifications in.public IlvSettings getWritableSettings()
public boolean insertLayer(String layerName, String layerRef, boolean higherPriority)
layerName
- The name of the layer to insert.layerRef
- The name of the layer that indicates the position
to insert the given layer. If this parameter is null
, the
newly created layer is inserted with a top priority and the parameter
higherPriority
is not taken into account.Here is the list of predefined layers, given from the highest priority to the lowest:
higherPriority
- If this parameter is true
, the new layer
will be given a higher priority than the layer of name layerRef
and
a lower priority than all the layers previously inserted with a higher
priority than the layer of name layerRef
. Otherwise,
the new layer is given a lower priority than the layer of name
layerRef
and a higher priority than all the layers previously
inserted with a lower priority than the layer of name layerRef
.true
if the method could insert a new layer or
false
if the method could not insert the new layer;
this can happen if the given parameter layerRef
does not
correspond to any of the layers already inserted in this settings
manager.public boolean removeLayer(String layerName)
layerName
- The name of the layer to remove.true
if the layer with the given name could be
found and removed; false
otherwise.public String getLayerName(IlvSettings settings)
settings
- The settings.public String[] getLayers()
protected int getLayerIndex(String layerName)
layerName
.public void addSettingsListener(SettingsListener listener)
listener
- The listener to add.public boolean removeSettingsListener(SettingsListener listener)
listener
- The listener to remove.true
if the listener could be removed from the
list of listeners or false
if the given listener could not be found in the listener
list.public void freezeMutationNotifications()
When the settings manager is frozen, events for modifications that occur on the settings manager are stored. Once the settings manager is unfrozen, stored modification events are notified to the settings listeners.
unFreezeMutationNotifications()
public void unFreezeMutationNotifications()
freezeMutationNotifications()
protected void fireSettingsAddedEvent(IlvSettings settings)
settings
have been added to the
settings manager.settings
- The settings that have been added.addSettings(ilog.views.appframe.settings.IlvSettings, java.lang.String)
protected void fireSettingsRemovedEvent(IlvSettings settings)
settings
have been removed from the
settings manager.settings
- The settings that have been removed.removeSettings(ilog.views.appframe.settings.IlvSettings)
protected void fireInitializationEvent()
initializeSettings()
method after the settings owned by the manager have been initialized.initializeSettings()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.