public abstract class AbstractUnit extends java.lang.Object implements ScriptingUnit, Unit
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.beans.PropertyChangeListener> |
changeListener |
protected java.lang.String |
createdBy |
protected java.lang.String |
description |
protected java.lang.String |
id |
protected static Logger |
LOGGER |
protected DefaultScriptingManager |
manager |
protected java.lang.String |
name |
protected ScriptingFolder |
parent |
protected boolean |
saved |
protected java.lang.String |
typename |
protected java.lang.String |
version |
Constructor and Description |
---|
AbstractUnit(ScriptingFolder parent,
java.lang.String typename,
ScriptingManager manager,
java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
protected void |
console_println(java.lang.String s) |
void |
create(ScriptingFolder folder,
java.lang.String id) |
boolean |
equals(java.lang.Object obj) |
void |
firePropertyChange(java.beans.PropertyChangeEvent event) |
void |
firePropertyChangeListener(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue) |
java.lang.String |
getCreatedBy()
Returns information about the ScriptingUnit's creator
|
java.lang.String |
getDescription()
Returns the ScriptingUnit's description
|
java.io.File |
getFile()
Gets a File with the ScriptUnit path name.
|
java.io.File |
getFileResource(java.lang.String extension) |
java.lang.String |
getId()
Returns the ScriptingUnit's ID
|
protected boolean |
getInfBoolean(Ini prefs,
java.lang.String section,
java.lang.String option,
boolean defaultValue) |
protected int |
getInfInt(Ini prefs,
java.lang.String section,
java.lang.String option,
int defaultValue) |
protected java.lang.String |
getInfString(Ini prefs,
java.lang.String section,
java.lang.String option,
java.lang.Object defaultValue) |
protected java.lang.Object |
getInfValue(Ini prefs,
java.lang.String section,
java.lang.String option,
java.lang.Object defaultValue) |
ScriptingManager |
getManager() |
java.lang.String |
getName()
Returns the ScriptingUnit's name
|
ScriptingFolder |
getParent()
Returns the ScriptingUnit's parent
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties() |
java.lang.String |
getProperty(java.lang.String name) |
java.lang.String |
getTypeName() |
java.net.URL |
getURL() |
java.lang.String |
getUserPath() |
java.lang.String |
getVersion()
Returns the ScriptingUnit's version
|
int |
hashCode() |
boolean |
isASystemUnit() |
boolean |
isSaved()
Indicates if the ScriptBaseScript is modified from last saved version.
|
abstract void |
load(ScriptingFolder folder,
java.lang.String id) |
protected void |
loadInf(Ini prefs) |
void |
reload() |
protected void |
save(Ini prefs) |
void |
setCreatedBy(java.lang.String createdBy)
Sets a new information about the ScriptingUnit's creator.
|
void |
setDescription(java.lang.String description)
Sets a new description to the ScriptingUnit.
|
void |
setId(java.lang.String id) |
void |
setName(java.lang.String name)
Sets a new name to the ScriptingUnit.
|
protected void |
setParent(ScriptingFolder parent) |
void |
setProperty(java.lang.String name,
java.lang.String value) |
void |
setSaved(boolean saved)
Sets the unit current status with the saved version.
|
void |
setVersion(java.lang.String version)
Sets a new version value to the ScriptingUnit.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFiles, getIconNames, move, remove, rename
protected static final Logger LOGGER
protected DefaultScriptingManager manager
protected java.lang.String id
protected java.lang.String name
protected java.lang.String description
protected java.lang.String createdBy
protected java.lang.String version
protected ScriptingFolder parent
protected java.lang.String typename
protected java.util.Set<java.beans.PropertyChangeListener> changeListener
protected boolean saved
public AbstractUnit(ScriptingFolder parent, java.lang.String typename, ScriptingManager manager, java.lang.String id)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface ScriptingUnit
public void firePropertyChange(java.beans.PropertyChangeEvent event)
public void firePropertyChangeListener(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
public java.lang.String getTypeName()
getTypeName
in interface ScriptingUnit
public abstract void load(ScriptingFolder folder, java.lang.String id)
public void reload()
reload
in interface ScriptingUnit
public java.lang.String toString()
toString
in class java.lang.Object
protected void setParent(ScriptingFolder parent)
public ScriptingManager getManager()
public java.io.File getFileResource(java.lang.String extension)
getFileResource
in interface ScriptingUnit
public java.lang.String getDescription()
ScriptingUnit
getDescription
in interface ScriptingUnit
public java.lang.String getCreatedBy()
ScriptingUnit
getCreatedBy
in interface ScriptingUnit
public java.lang.String getVersion()
ScriptingUnit
getVersion
in interface ScriptingUnit
public java.lang.String getId()
ScriptingUnit
getId
in interface ScriptingUnit
public java.lang.String getName()
ScriptingUnit
getName
in interface ScriptingUnit
public void setDescription(java.lang.String description)
ScriptingUnit
setDescription
in interface ScriptingUnit
description
- String that contains the new description.public void setCreatedBy(java.lang.String createdBy)
ScriptingUnit
setCreatedBy
in interface ScriptingUnit
createdBy
- String that contains the new creator's information.public void setVersion(java.lang.String version)
ScriptingUnit
setVersion
in interface ScriptingUnit
version
- String that contains the new version.public void setName(java.lang.String name)
ScriptingUnit
setName
in interface ScriptingUnit
name
- String that contains the new name.public ScriptingFolder getParent()
ScriptingUnit
getParent
in interface ScriptingUnit
ScriptingFolder
where is contained the ScriptingUnitpublic java.lang.String getUserPath()
getUserPath
in interface ScriptingUnit
protected void save(Ini prefs)
protected void loadInf(Ini prefs)
protected java.lang.Object getInfValue(Ini prefs, java.lang.String section, java.lang.String option, java.lang.Object defaultValue)
protected java.lang.String getInfString(Ini prefs, java.lang.String section, java.lang.String option, java.lang.Object defaultValue)
protected int getInfInt(Ini prefs, java.lang.String section, java.lang.String option, int defaultValue)
protected boolean getInfBoolean(Ini prefs, java.lang.String section, java.lang.String option, boolean defaultValue)
protected void console_println(java.lang.String s)
public void create(ScriptingFolder folder, java.lang.String id)
public java.io.File getFile()
ScriptingUnit
getFile
in interface ScriptingUnit
public java.net.URL getURL()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isSaved()
ScriptingUnit
isSaved
in interface ScriptingUnit
public void setSaved(boolean saved)
ScriptingUnit
setSaved
in interface ScriptingUnit
saved
- Indicate if the unit is up-to-date or not.public void setProperty(java.lang.String name, java.lang.String value)
setProperty
in interface ScriptingUnit
public java.lang.String getProperty(java.lang.String name)
getProperty
in interface ScriptingUnit
public java.util.Map<java.lang.String,java.lang.String> getProperties()
getProperties
in interface ScriptingUnit
public boolean isASystemUnit()
isASystemUnit
in interface ScriptingUnit