Skip to content

Commit

Permalink
Connected up the "Close Project" Action and completed the closeProjec…
Browse files Browse the repository at this point in the history
…t() method a bit more.
  • Loading branch information
raceimaztion committed May 12, 2011
1 parent da94954 commit fdb425f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 0 additions & 2 deletions create/simulator/window/CreateProject.java
Expand Up @@ -6,8 +6,6 @@
import create.simulator.utils.*;

import org.fife.ui.rsyntaxtextarea.*;
import org.fife.ui.rsyntaxtextarea.FileLocation;


/**
* Contains all the information about a project required to build it, as well as starting a simulator/etc.
Expand Down
10 changes: 9 additions & 1 deletion create/simulator/window/EditorWindow.java
Expand Up @@ -111,7 +111,7 @@ public EditorWindow(CreateProject project)
private void setup()
{
window = new JFrame("Create Simulator: Editor");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
window.setMinimumSize(new Dimension(300, 450));
window.addWindowListener(this);

Expand Down Expand Up @@ -259,6 +259,10 @@ protected void closeProject()
editorProjectName.setText("");
editorProjectName.setVisible(false);

editorPanes.removeAllElements();
editorScrollers.removeAllElements();
editorTabs.removeAll();

updateProjectList();
windowLayout.show(mainContainer, CHOOSER_PANEL);
}
Expand Down Expand Up @@ -322,10 +326,14 @@ public void actionPerformed(ActionEvent e)
else if (command.equals(COMMAND_LOAD_PROJECT))
{
// Project -> Load project...
// TODO: See if this is permanent enough:
EditorWindow newWindow = new EditorWindow();
newWindow.show();
}
else if (command.equals(COMMAND_CLOSE_PROJECT))
{
// Project -> Close project
closeProject();
}
else if (command.equals(COMMAND_PROJECT_PROPERTIES))
{
Expand Down

0 comments on commit fdb425f

Please sign in to comment.