站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ResettableContext (Registry) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.registry/1 1.8

org.netbeans.spi.registry
Interface ResettableContext

All Superinterfaces:
BasicContext

public interface ResettableContext
extends BasicContext

BasicContext extension supporting default values. If the implementation of backend storage has concept of default values it should implement also this context extension which allows examination of whether the bound object has some default value, whether current value is modified or the original one and also allows to revert the modified value to the default one.

If the binding name is null then the context is examined. The context should be considered as modified if following condition is true for it or for any of its subcontexts: some binding in the context is modified or list of subcontext is different from default one. Reverting context means that all modified bindings in the context (including the subcontexts) are reverted and all nondefault subcontexts are destroyed.


Method Summary
 boolean hasDefault(String bindingName)
          Exist a default value?
 boolean isModified(String bindingName)
          Check whether the value is modified.
 void revert(String bindingName)
          Revert modification.
 
Methods inherited from interface org.netbeans.spi.registry.BasicContext
addContextListener, bindObject, createSubcontext, destroySubcontext, getAttribute, getAttributeNames, getBindingNames, getContextName, getParentContext, getRootContext, getSubcontext, getSubcontextNames, lookupObject, removeContextListener, setAttribute
 

Method Detail

hasDefault

boolean hasDefault(String bindingName)
Exist a default value?

Parameters:
bindingName - the binding name or null for the context
Returns:
true if there is a default

isModified

boolean isModified(String bindingName)
Check whether the value is modified. For existing binding for which there is no default value (that is hasDefault(java.lang.String) is false) returns this method always true.

Parameters:
bindingName - the binding name or null for the context
Returns:
true if default value is modified; always returns true if default value does not exist

revert

void revert(String bindingName)
            throws ContextException
Revert modification. Will do something only if value is modified (ie. isModified(java.lang.String) returns true). If there is no default value (ie. hasDefault(java.lang.String) returns false) the revert operation is identical to unbinding of object or destroying of context content.

Parameters:
bindingName - the binding name or null for the context
Throws:
ContextException - can throw exception if there were problems during removal of modified values

org.netbeans.modules.registry/1 1.8

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.