|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.quartzware.Project
Project class Contains all the information about the currently open Project. It holds all of the Resource Bundles and the current preferences for the project.
Inner Class Summary | |
class |
Project.Config
This class encapsulates the project options |
Constructor Summary | |
Project()
Default constructor PRE: none POST: class is created |
|
Project(java.io.File projectFile)
Loads a Project using a project file. |
|
Project(Project.Config cfg,
java.util.Vector bundles)
Creates a project using the given Config (preferences) and the given Vector of Resource Bundles. |
Method Summary | |
void |
addBundle(ResBundle rb)
Adds the given Resource Bundle to the current Project |
void |
addKey(java.lang.String key)
Adds a new key to the root. |
void |
addTreeModelListener(javax.swing.event.TreeModelListener lis)
|
void |
deleteKey(java.lang.String key)
Deletes the Entries in all of the Resource Bundles that match the given key |
void |
fireUpdate()
|
java.util.Vector |
getAllBundles()
Gets all of the Resoruce Bundles |
ResBundle |
getBundle(java.lang.String suffix)
Gets the bundle that matches the suffix |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
|
int |
getChildCount(java.lang.Object parent)
|
Project.Config |
getConfig()
Returns a Config containing all of the options for the current Project. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
java.io.File |
getProjectFile()
Returns a File which contains the path to the Project File. |
java.lang.Object |
getRoot()
|
ResBundle |
getRootBundle()
Gets the Root Resource Bundle |
boolean |
isChild(java.lang.String parSfx,
java.lang.String chldSfx)
|
boolean |
isLeaf(java.lang.Object node)
|
static Project |
load(java.io.File file)
Loads all bundles listed in the project file at the given path. |
static ResBundle |
loadBundle(java.io.File loc)
Loads the specified ResBundle. |
void |
loadProjectFile(java.io.File projFile)
Load in a project file PRE: none POST: a new project is created |
void |
removeBundle(ResBundle rb)
Removes the given Resource Bundle from the current Project |
void |
removeBundleAndChildren(java.lang.String sfx)
Removes the Resource Bundle that matches the given suffix and all of its children from the current Project. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener lis)
|
void |
save(boolean saveAs)
Saves all of the currently dirty Resource Bundles. |
static void |
saveBundle(ResBundle bund)
Saves the specified ResBundle. |
void |
saveProjectFile()
Save out the project file PRE: none POST: the project file is saved. |
void |
setProjectFile(java.io.File projFile)
Changes the File used to write out. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Project()
public Project(Project.Config cfg, java.util.Vector bundles)
cfg
- Current preferencesbundles
- a vector with Resource Bundles including a root
PRE: cfg and bundles are not null
POST: class is createdpublic Project(java.io.File projectFile)
f
- Project file selected from Open dialog box
PRE: projectFile points to a file that can be used as a project file
POST: the class is createdMethod Detail |
public void addTreeModelListener(javax.swing.event.TreeModelListener lis)
addTreeModelListener
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
public boolean isChild(java.lang.String parSfx, java.lang.String chldSfx)
public void removeTreeModelListener(javax.swing.event.TreeModelListener lis)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
public ResBundle getRootBundle()
public void deleteKey(java.lang.String key)
key
- The Key to be deleted
PRE: key is not null
POST: no Entry containing the given key will be in the project.public java.io.File getProjectFile()
public void setProjectFile(java.io.File projFile)
projectFile
- The new ProjectFilepublic void addBundle(ResBundle rb)
rb
- The resource bundle to be added
PRE: rb is not null
POST: the resource bundle is added to the projectpublic void removeBundle(ResBundle rb)
rb
- The resource bundle to be removed
PRE: rb is not null
POST: the resource bundle is removed if it existspublic void removeBundleAndChildren(java.lang.String sfx)
rb
- The resource bundle to be removed
PRE: none
POST: the resource bundles are removedpublic void save(boolean saveAs)
saveAs
- Save As Flag (described above)
PRE: none
POST: the project is saved.public static void saveBundle(ResBundle bund)
bundle
- bundle to write out.
PRE: none
POST: the project is saved.public void saveProjectFile()
public void loadProjectFile(java.io.File projFile)
public static Project load(java.io.File file)
file
- Where the project file is.
PRE: none
POST: the project is loaded.public static ResBundle loadBundle(java.io.File loc)
File
- the file to read in from.
PRE: none
POST: nonepublic ResBundle getBundle(java.lang.String suffix)
public java.util.Vector getAllBundles()
public void addKey(java.lang.String key)
key
- the name of the key to be added
PRE: key is not null
POST: key is added to root bundlepublic void fireUpdate()
public Project.Config getConfig()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |