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