java.lang.Objectorg.nlogo.workspace.ExtensionManager
public class ExtensionManager
Constructor Summary | |
---|---|
ExtensionManager(AbstractWorkspace workspace)
|
Method Summary | |
---|---|
void |
addConfigurable(Configurable c)
|
boolean |
anyExtensionsLoaded()
Returns true if any extensions have been imported in the current model, false otherwise. |
void |
cleanUp()
Instructs any extensions which haven't been re-imported during the current compile to shut down. |
String |
dumpExtensionPrimitives()
Returns a String describing all the loaded extensions. |
String |
dumpExtensions()
Returns a String describing all the loaded extensions. |
String |
getAddendum()
|
String |
getExternalFileSource(String filename)
|
void |
importExtension(String extName,
org.nlogo.compiler.ErrorSource errors)
Loads the extension contained in the jar at jarPath. |
void |
initializeHubNet()
Intializes the HubNetManager, this method should be called if the extension intends to use HubNet. |
String[] |
listExtensions()
|
ExtensionObject |
readExtensionObject(String extName,
String typeName,
String value)
|
Object |
readFromString(String source)
|
Primitive |
replaceIdentifier(String name)
Returns the identifier "name" by its imported implementation, if any. |
void |
reset()
Instructs any loaded extensions to unload. |
String |
resolvePath(String path)
|
String |
resolvePathAsURL(String path)
|
Object |
retrieveObject()
Returns the stored object. |
void |
storeObject(Object obj)
Stores an object for the extension that can be retrieved in runOnce if the extension is loaded again. |
AbstractWorkspace |
workspace()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensionManager(AbstractWorkspace workspace)
Method Detail |
---|
public AbstractWorkspace workspace()
public boolean anyExtensionsLoaded()
org.nlogo.compiler.ExtensionManager
public String getAddendum()
public String getExternalFileSource(String filename) throws IOException
IOException
public void storeObject(Object obj)
ExtensionManager
storeObject
in interface ExtensionManager
obj
- the object to be storedpublic Object retrieveObject()
ExtensionManager
retrieveObject
in interface ExtensionManager
public void importExtension(String extName, org.nlogo.compiler.ErrorSource errors) throws CompilerException
org.nlogo.compiler.ExtensionManager
extName
- the path to the extension jar. May be relative to the
current model directory.errors
- the ErrorSource to use when a CompilerException needs
to be thrown.
CompilerException
public void addConfigurable(Configurable c)
public void initializeHubNet()
ExtensionManager
initializeHubNet
in interface ExtensionManager
public String resolvePath(String path)
public String resolvePathAsURL(String path)
public Object readFromString(String source)
readFromString
in interface ExtensionManager
public ExtensionObject readExtensionObject(String extName, String typeName, String value)
readExtensionObject
in interface ExtensionManager
public Primitive replaceIdentifier(String name)
org.nlogo.compiler.ExtensionManager
public String[] listExtensions()
public String dumpExtensions()
public String dumpExtensionPrimitives()
public void reset()
org.nlogo.compiler.ExtensionManager
public void cleanUp()
org.nlogo.compiler.ExtensionManager