| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -880,8 +880,7 @@ | |||
| 880 | 880 | </replace> | |
| 881 | 881 | </target> | |
| 882 | 882 | ||
| 883 | - <!-- Standardize all newline character sequences. Subversion takes care of this | ||
| 884 | - automatically, but sometimes files crop up with the wrong sequence.--> | ||
| 883 | + <!-- Standardize all newline character sequences.--> | ||
| 885 | 884 | <target name="fix-newlines" description="Standardize newline character sequences in all text files"> | |
| 886 | 885 | <!-- If we're in Windows, use \r\n --> | |
| 887 | 886 | <condition property="newline-code" value="crlf"> | |
@@ -1151,7 +1150,6 @@ | |||
| 1151 | 1150 | value="${ant.project.name}${tag-append}-${DSTAMP}-${TSTAMP}"/> | |
| 1152 | 1151 | </target> | |
| 1153 | 1152 | ||
| 1154 | - | ||
| 1155 | 1153 | <!-- Sets "already-generated" if "generate-file" is more recent than "generate-sourcefile"; | |
| 1156 | 1154 | otherwise, the out-of-date target file is deleted (if it exists). Note that, since | |
| 1157 | 1155 | properties can only be set once, this should happen underneath an "antcall". --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1812,24 +1812,22 @@ public void reloadProject(File file, HashMap<OpenDefinitionsDocument, DocumentIn | |||
| 1812 | 1812 | setProjectChanged(projChanged); | |
| 1813 | 1813 | } | |
| 1814 | 1814 | ||
| 1815 | - /** Parses the given project file and loads it into the document navigator | ||
| 1816 | - * and resets interactions pane. Assumes preceding project, if any, has | ||
| 1817 | - * already been closed. | ||
| 1818 | - * | ||
| 1819 | - * @param projectFile The project file to parse | ||
| 1820 | - * @throws IOException if an IO operation fails | ||
| 1821 | - * @throws MalformedProjectFileException if one of the project files was malformed | ||
| 1822 | - */ | ||
| 1815 | + /** Parses the given project file and loads it into the document navigator and resets interactions pane. Assumes | ||
| 1816 | + * that any existing project has been closed. | ||
| 1817 | + * @param projectFile The project file to parse | ||
| 1818 | + * @throws IOException if an IO operation fails | ||
| 1819 | + * @throws MalformedProjectFileException if one of the project files was malformed | ||
| 1820 | + */ | ||
| 1823 | 1821 | public void openProject(File projectFile) throws IOException, MalformedProjectFileException { | |
| 1824 | - _loadProject(ProjectFileParserFacade.ONLY.parse(projectFile)); | ||
| 1822 | + _loadProject(ProjectFileParserFacade.ONLY.parse(projectFile)); // resets interactions if successful | ||
| 1825 | 1823 | } | |
| 1826 | 1824 | ||
| 1827 | 1825 | /** Loads the specified project into the document navigator and opens all of | |
| 1828 | - * the files (if not already open). | ||
| 1829 | - * Assumes that any prior project has been closed. Only runs in event thread. | ||
| 1830 | - * @param ir The project file to load | ||
| 1831 | - * @throws IOException if an IO operation fails | ||
| 1832 | - */ | ||
| 1826 | + * the files (if not already open). | ||
| 1827 | + * Assumes that any prior project has been closed. Only runs in event thread. | ||
| 1828 | + * @param ir The project file to load | ||
| 1829 | + * @throws IOException if an IO operation fails | ||
| 1830 | + */ | ||
| 1833 | 1831 | private void _loadProject(final ProjectFileIR ir) throws IOException { | |
| 1834 | 1832 | ||
| 1835 | 1833 | assert EventQueue.isDispatchThread(); | |
@@ -2011,16 +2009,16 @@ public boolean accept(OpenDefinitionsDocument d) { | |||
| 2011 | 2009 | public void autoRefreshProject() { openNewFilesInProject(); } | |
| 2012 | 2010 | ||
| 2013 | 2011 | /** Performs any needed operations on the model after project files have been | |
| 2014 | - * closed. This method is not responsible for closing any files; both the | ||
| 2015 | - * files in the project and the project file have already been closed (by | ||
| 2016 | - * MainFrame._closeProject()). Resets interations unless suppressReset is | ||
| 2017 | - * true, which only happens when DrJava is quitting. | ||
| 2018 | - * | ||
| 2019 | - * @param suppressReset false if we want to reset the interactions pane; true otherwise | ||
| 2020 | - */ | ||
| 2012 | + * closed. This method is not responsible for closing any files; both the | ||
| 2013 | + * files in the project and the project file have already been closed (by | ||
| 2014 | + * MainFrame._closeProject()). Resets interations unless suppressReset is | ||
| 2015 | + * true, which only happens when DrJava is quitting. | ||
| 2016 | + * | ||
| 2017 | + * @param suppressReset false if we want to reset the interactions pane; true otherwise | ||
| 2018 | + */ | ||
| 2021 | 2019 | public void closeProject(boolean suppressReset) { | |
| 2022 | - setDocumentNavigator(new AWTContainerNavigatorFactory<OpenDefinitionsDocument>(). | ||
| 2023 | - makeListNavigator(getDocumentNavigator())); | ||
| 2020 | + IDocumentNavigator<OpenDefinitionsDocument> nav = getDocumentNavigator(); | ||
| 2021 | + setDocumentNavigator(new AWTContainerNavigatorFactory<OpenDefinitionsDocument>().makeListNavigator(nav)); | ||
| 2024 | 2022 | setFileGroupingState(makeFlatFileGroupingState()); | |
| 2025 | 2023 | ||
| 2026 | 2024 | // remove previous listeners | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,7 @@ | |||
| 52 | 52 | */ | |
| 53 | 53 | public final class GlobalModelJUnitTest extends GlobalModelTestCase { | |
| 54 | 54 | ||
| 55 | - private static Log _log = new Log("GlobalModelTest.txt", true); | ||
| 55 | + private static Log _log = new Log("GlobalModelTest.txt", false); | ||
| 56 | 56 | ||
| 57 | 57 | /** Whether or not to print debugging output. */ | |
| 58 | 58 | static final boolean printMessages = true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,7 @@ | |||
| 75 | 75 | */ | |
| 76 | 76 | public abstract class GlobalModelTestCase extends MultiThreadedTestCase { | |
| 77 | 77 | ||
| 78 | - public static final Log _log = new Log("GlobalModelTest.txt", true); | ||
| 78 | + public static final Log _log = new Log("GlobalModelTest.txt", false); | ||
| 79 | 79 | ||
| 80 | 80 | protected volatile DefaultGlobalModel _model; | |
| 81 | 81 | protected volatile InteractionsController _interactionsController; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,7 @@ | |||
| 80 | 80 | */ | |
| 81 | 81 | public class JUnitTestManager { | |
| 82 | 82 | ||
| 83 | - protected static final Log _log = new Log("JUnitTestManager.txt", true); | ||
| 83 | + protected static final Log _log = new Log("JUnitTestManager.txt", false); | ||
| 84 | 84 | ||
| 85 | 85 | /** The interface to the master JVM via RMI. */ | |
| 86 | 86 | private final JUnitModelCallback _jmc; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ | |||
| 48 | 48 | */ | |
| 49 | 49 | public class JUnitTestRunner extends BaseTestRunner { | |
| 50 | 50 | ||
| 51 | - protected static final Log _log = new Log("JUnitTestManager.txt", true); | ||
| 51 | + protected static final Log _log = new Log("JUnitTestManager.txt", false); | ||
| 52 | 52 | ||
| 53 | 53 | /** Receives updates on the test suite's progress. */ | |
| 54 | 54 | private JUnitModelCallback _jmc; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4854,29 +4854,28 @@ private void _resetNavigatorPane() { | |||
| 4854 | 4854 | _updateBackgroundColor(); | |
| 4855 | 4855 | } | |
| 4856 | 4856 | ||
| 4857 | - /** Asks the user to select the project file to open and starts the process of opening the project. */ | ||
| 4858 | - private void _openProject() { openProject(_openProjectSelector); } | ||
| 4857 | + /** Closes existing project if one exists, asks the user to select the project file to open, and opens it. */ | ||
| 4858 | + private void _openProject() { | ||
| 4859 | + if (_model.isProjectActive()) closeProject(); // does not reset interactions | ||
| 4860 | + openProject(_openProjectSelector); // resets interactions if successful | ||
| 4861 | + } | ||
| 4859 | 4862 | ||
| 4860 | - public void openProject(FileOpenSelector projectSelector) { | ||
| 4861 | - | ||
| 4862 | - try { | ||
| 4863 | + /** Assumes any existing project has already been closed. */ | ||
| 4864 | + public void openProject(final FileOpenSelector projectSelector) { | ||
| 4865 | + try { | ||
| 4863 | 4866 | final File[] files = projectSelector.getFiles(); | |
| 4864 | 4867 | if (files.length < 1) | |
| 4865 | 4868 | throw new IllegalStateException("Open project file selection not canceled but no project file was selected."); | |
| 4866 | 4869 | final File file = files[0]; | |
| 4867 | - | ||
| 4868 | - updateStatusField("Opening project " + file); | ||
| 4869 | - | ||
| 4870 | - try { | ||
| 4871 | - hourglassOn(); | ||
| 4872 | - // make sure there are no open projects | ||
| 4873 | - if (! _model.isProjectActive() || (_model.isProjectActive() && _closeProject())) _openProjectHelper(file); | ||
| 4874 | - } | ||
| 4875 | - catch(Exception e) { e.printStackTrace(System.out); } | ||
| 4876 | - finally { hourglassOff(); } | ||
| 4870 | + if (file != null && file != FileOps.NULL_FILE) | ||
| 4871 | + Utilities.invokeLater(new Runnable() { | ||
| 4872 | + public void run() { | ||
| 4873 | + updateStatusField("Opening project " + file); | ||
| 4874 | + _openProjectHelper(file); | ||
| 4875 | + } | ||
| 4876 | + }); | ||
| 4877 | 4877 | } | |
| 4878 | - catch(OperationCanceledException oce) { /* do nothing, we just won't open anything */ } | ||
| 4879 | - | ||
| 4878 | + catch(OperationCanceledException oce) { return; /* do nothing if getFiles() fails; we just don't open anything */ } | ||
| 4880 | 4879 | } | |
| 4881 | 4880 | ||
| 4882 | 4881 | /** Oversees the opening of the project by delegating to the model to parse and initialize the project | |
| Back | FazBrowse Home | New Git URL |
0 commit comments