|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cs.ai.kreator.control.ProjectController
public class ProjectController
This controller manages projects. Handles opening and closing of projects. Manages the current project: Adding or removing files, command history, ...
Field Summary | |
---|---|
static java.lang.String |
CMD_ADDFILES
|
static java.lang.String |
CMD_CLOSEPROJECT
|
static java.lang.String |
CMD_NEWPROJECT
|
static java.lang.String |
CMD_OPENGETTINGSTARTED
|
static java.lang.String |
CMD_OPENPROJECT
|
static java.lang.String |
GETTING_STARTED_PROJECT
|
static org.apache.log4j.Logger |
LOG
|
Constructor Summary | |
---|---|
ProjectController()
Initializes the ProjectController: Sets the working directory to the user's home and the current project to null. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addDataFile(DataFile file)
Adds a DataFile to the current project. |
void |
addDataFiles()
Asks the user for a list files, which will then be added to the current project. |
boolean |
canAddFileToProject(DataFile file)
Returns false in the following situations: - there is no current project - the file is already in the project Then returns true if the file is in the project's directory |
boolean |
closeProject()
Closes the current project. |
Project |
getCurrentProject()
|
Project |
getProject(java.io.File file)
Creates a Project from a File . |
java.io.File |
getProjectPath()
|
java.util.List<java.lang.String> |
getQueryHistory()
|
void |
init()
|
void |
openGettingStartedProject()
Opens the getting started project. |
void |
openProject()
Shows the user a "Open project..." |
void |
openProject(java.io.File file)
Provided for convenience. |
void |
openProject(Project project)
Opens a Project in the GUI. |
boolean |
projectContains(DataFile file)
|
void |
removeDataFile(DataFile file)
Removes a DataFile from the current project. |
void |
removeDataFileFromTree()
Removes the currently selected file in the project container from the current project. |
void |
setQueryHistory(java.util.List<java.lang.String> history)
Sets the query history. |
boolean |
shutDown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger LOG
public static final java.lang.String CMD_OPENPROJECT
public static final java.lang.String CMD_CLOSEPROJECT
public static final java.lang.String CMD_ADDFILES
public static final java.lang.String CMD_NEWPROJECT
public static final java.lang.String CMD_OPENGETTINGSTARTED
public static final java.lang.String GETTING_STARTED_PROJECT
Constructor Detail |
---|
public ProjectController()
Method Detail |
---|
public void init()
public boolean shutDown()
public Project getCurrentProject()
public Project getProject(java.io.File file) throws ProjectParsingException
Project
from a File
.
file
-
ProjectParsingException
public void openProject(Project project)
Project
in the GUI.
Handles saving of the working directory, last project and command history.
project
- public void openProject(java.io.File file)
getProject(File)
and openProject(Project)
.
file
- public void openProject()
public void openGettingStartedProject()
public boolean closeProject()
closeProjectConfirmed()
public void addDataFile(DataFile file)
canAddFileToProject(DataFile)
for details.
file
- public void addDataFiles()
public void removeDataFile(DataFile file)
file
- public void removeDataFileFromTree()
public boolean projectContains(DataFile file)
file
-
public boolean canAddFileToProject(DataFile file)
file
- public java.util.List<java.lang.String> getQueryHistory()
public void setQueryHistory(java.util.List<java.lang.String> history) throws java.io.IOException
the
- query history
java.io.IOException
public java.io.File getProjectPath()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |