net.quartzware
Class Project

java.lang.Object
  |
  +--net.quartzware.Project

public class Project
extends java.lang.Object


Inner Class Summary
 class Project.Config
          This class encapsulates the project options
 
Field Summary
private  java.util.Vector bundles
           
private  java.util.Vector looseFiles
           
private  java.io.File projectFile
           
 
Constructor Summary
Project()
          Constructor that creates a new project from scratch
Project(java.io.File f)
          Constructor that loads a Project based off of a project file
Project(Project.Config cfg, java.util.Vector bundles)
          Constructor that creates a project using a given configuration (prefferences) and a given Vector of Resource Bundles.
 
Method Summary
 void addKey(java.lang.String key)
          Adds a new key to the root.
 ResBundle createBundle(java.lang.String suffix)
          Creates a new Resource Bundle and adds it to the Project
 void deleteKey(java.lang.String key)
          Deletes all of the Entries in all of the Resource Bundles that match the given key
 java.util.Vector getAllBundles()
          Gets all of the Resoruce Bundles
 java.io.File getProjectFile()
          Gets the project file upon which this Project is based
 ResBundle getRoot()
          Gets the Root Resource Bundle
 ResBundle importBundle(java.io.File file, java.lang.String suffix)
          Adds a currently existing bundle to the current Project
 ResBundle openLooseFile(java.io.File file)
          Opens a Loose file into the editor, but does not actually add it to the Project.
 void removeBundle(ResBundle rb)
          Removes the given Resource Bundle from the current Project
 void save(boolean saveAs)
          Saves all of the currently dirty Resource Bundles.
 void setProjectFile(java.io.File projectFile)
          Sets a new project file based off of the Save As...
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

bundles

private java.util.Vector bundles

projectFile

private java.io.File projectFile

looseFiles

private java.util.Vector looseFiles
Constructor Detail

Project

public Project()
Constructor that creates a new project from scratch

Project

public Project(Project.Config cfg,
               java.util.Vector bundles)
Constructor that creates a project using a given configuration (prefferences) and a given Vector of Resource Bundles. Will be used mostly for creating a new project based off of Resource Bundles not made in RBEdit
Parameters:
cfg - Current preferences
bundles - a vector with Resource Bundles including a root

Project

public Project(java.io.File f)
Constructor that loads a Project based off of a project file
Parameters:
f - Project file selected from Open dialog box
Method Detail

getRoot

public ResBundle getRoot()
Gets the Root Resource Bundle
Returns:
the Root

deleteKey

public void deleteKey(java.lang.String key)
Deletes all of the Entries in all of the Resource Bundles that match the given key
Parameters:
key - The Key to be deleted

getProjectFile

public java.io.File getProjectFile()
Gets the project file upon which this Project is based
Returns:
the Project File

setProjectFile

public void setProjectFile(java.io.File projectFile)
Sets a new project file based off of the Save As... dialog
Parameters:
projectFile - The new Project File

openLooseFile

public ResBundle openLooseFile(java.io.File file)
Opens a Loose file into the editor, but does not actually add it to the Project. Instead it addes it to a Vector of Loose Files
Parameters:
file - The Loose File to be opened
Returns:
The Resource Bundle for the Loose File

importBundle

public ResBundle importBundle(java.io.File file,
                              java.lang.String suffix)
Adds a currently existing bundle to the current Project
Parameters:
file - The file containing the Resource Bundle to be added
suffix - the suffix to be appended to the new Resource Bundle file name (the language_LOCALE_varient)
Returns:
the Resource Bundle just loaded

createBundle

public ResBundle createBundle(java.lang.String suffix)
Creates a new Resource Bundle and adds it to the Project
Parameters:
suffix - the suffix to be appended to the new Resource Bundle file name (the language_LOCALE_varient)
Returns:
the newly created Resource Bundle

removeBundle

public void removeBundle(ResBundle rb)
Removes the given Resource Bundle from the current Project
Parameters:
rb - The resource bundle to be removed

save

public void save(boolean saveAs)
Saves all of the currently dirty Resource Bundles. Does not write any files that have not been changed. If the saveAs flag is true, it will first bring up a Save As.. dialog box to prompt the user for a new name
Parameters:
saveAs - Save As Flag (described above)

getAllBundles

public java.util.Vector getAllBundles()
Gets all of the Resoruce Bundles
Returns:
all of the Resource Bundles in a Vectorj

addKey

public void addKey(java.lang.String key)
Adds a new key to the root. The Children will then be able to overide this new key
Parameters:
key - the name of the key to be added