StructureJS
0.10.3A class based utility library for building modular and scalable web platform applications. Features opt-in classes and utilities which provide a solid foundation and toolset to build your next project.
The ObjectManager class is an abstract class that provides enabling and disabling functionality for most StructureJS classes.
isEnabled
Boolean
public
The isEnabled property is used to keep track of the enabled state of the object.
Default: false
sjsId
Int
public
The sjsId (StructureJS ID) is a unique identifier automatically assigned to most StructureJS objects upon instantiation.
Default: null
destroy
()
Void
public
The purpose of the destroy method is to make an object ready for garbage collection. This should be thought of as a one way function. Once destroy is called no further methods should be called on the object or properties accessed. It is the responsibility of those who implement this function to stop all running Timers, all running Sounds, and take any other steps necessary to make an object eligible for garbage collection.
By default the destroy method will null out all properties of the class automatically. You should call destroy on other objects before calling the super.
destroy() {
this.disable();
this._childInstance.destroy();
super.destroy();
}
disable
()
public
chainable
The disable method is responsible for disabling the object. After this method is called it will trigger the onDisabled method.
this._childInstance.disable();
enable
()
public
chainable
The enable method is responsible for enabling object. After this method is called it will trigger the onEnabled method.
this._childInstance.enable();
getQualifiedClassName
()
String
public
Returns the fully qualified class name of an object.
Returns the class name.
let someClass = new SomeClass();
someClass.getQualifiedClassName();
// SomeClass
onDisabled
()
public
chainable
This method is automatically called after the disable method is called on the object. The onDisabled method is responsible for disabling event listeners and/or children of the containing objects.
onDisabled() {
this._childInstance.removeEventListener(BaseEvent.CHANGE, this.handlerMethod, this);
this._childInstance.disable();
}
onEnabled
()
public
chainable
This method is automatically called after the enable method is called on the object. The enable method is responsible for enabling event listeners and/or children of the containing objects.
onEnabled() {
this._childInstance.addEventListener(BaseEvent.CHANGE, this.handlerMethod, this);
this._childInstance.enable();
}