public class WorkspaceController
extends java.lang.Object
| Constructor and Description |
|---|
WorkspaceController()
Constructs a WorkspaceController instance that manages the
interaction with the codeblocks.Workspace
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<SearchableContainer> |
getAllSearchableContainers()
Returns an unmodifiable Iterable of SearchableContainers
|
org.w3c.dom.Node |
getSaveNode()
Returns a DOM node for the entire workspace.
|
org.w3c.dom.Node |
getSaveNode(boolean validate)
Returns a DOM node for the entire workspace.
|
java.lang.String |
getSaveString()
Returns the save string for the entire workspace.
|
javax.swing.JComponent |
getSearchBar()
Returns a SearchBar instance capable of searching for blocks
within the BlockCanvas and block drawers
|
Workspace |
getWorkspace() |
javax.swing.JComponent |
getWorkspacePanel()
Returns the JComponent of the entire workspace.
|
void |
loadBlockLanguage(org.w3c.dom.Element root)
Loads all the block genuses, properties, and link rules of
a language specified in the pre-defined language def file.
|
void |
loadFreshWorkspace()
Loads a fresh workspace based on the default specifications in the language
definition file.
|
void |
loadProject(java.lang.String projectContents,
java.lang.String langDefContents)
Loads the programming project specified in the projectContents String,
which is associated with the language definition file contained in the
specified langDefContents.
|
void |
loadProjectFromElement(org.w3c.dom.Element elementToLoad)
Loads the programming project from the specified element.
|
void |
loadProjectFromPath(java.lang.String path)
Loads the programming project from the specified file path.
|
static void |
main(java.lang.String[] args) |
void |
resetLanguage()
Resets the current language within the active
Workspace.
|
void |
resetWorkspace()
Resets the entire workspace.
|
void |
setLangDefDtd(java.io.InputStream is) |
void |
setLangDefFilePath(java.lang.String filePath)
Sets the file path for the language definition file, if the
language definition file is located in
|
void |
setLangDefStream(java.io.InputStream in)
Sets language definition file from the given input stream
|
void |
setLangResourceBundle(java.util.ResourceBundle bundle) |
void |
setSelectedFile(java.io.File selectedFile) |
void |
setStyleList(java.util.List<java.lang.String[]> list) |
public WorkspaceController()
public Workspace getWorkspace()
public void setLangDefDtd(java.io.InputStream is)
public void setLangResourceBundle(java.util.ResourceBundle bundle)
public void setStyleList(java.util.List<java.lang.String[]> list)
public void setLangDefFilePath(java.lang.String filePath)
public void setLangDefStream(java.io.InputStream in)
in - input stream to readpublic void loadBlockLanguage(org.w3c.dom.Element root)
root - Loads the language specified in the Element rootpublic void resetLanguage()
public java.lang.String getSaveString()
public org.w3c.dom.Node getSaveNode()
public org.w3c.dom.Node getSaveNode(boolean validate)
validate - If true, perform a validation of the output
against the code blocks schemapublic void loadFreshWorkspace()
public void loadProjectFromPath(java.lang.String path)
throws java.io.IOException
path - String file path of the programming project to loadjava.io.IOExceptionpublic void loadProjectFromElement(org.w3c.dom.Element elementToLoad)
element - element of the programming project to loadpublic void loadProject(java.lang.String projectContents,
java.lang.String langDefContents)
projectContents - langDefContents - String XML that defines the language of
projectContentspublic void resetWorkspace()
public javax.swing.JComponent getWorkspacePanel()
public void setSelectedFile(java.io.File selectedFile)
public javax.swing.JComponent getSearchBar()
public java.lang.Iterable<SearchableContainer> getAllSearchableContainers()
public static void main(java.lang.String[] args)