@@ -217,7 +217,7 @@ static public void guardedMain(String args[]) throws Exception {
217217 }
218218
219219 // Create a location for untitled sketches
220- untitledFolder = createTempFolder ("untitled" );
220+ untitledFolder = BaseNoGui . createTempFolder ("untitled" );
221221 DeleteFilesOnShutdown .add (untitledFolder );
222222
223223 INSTANCE = new Base (args );
@@ -347,7 +347,7 @@ protected void onProgress(Progress progress) {
347347 List <String > downloadedPackageIndexFiles = installer .updateIndex ();
348348 installer .deleteUnknownFiles (downloadedPackageIndexFiles );
349349 indexer .parseIndex ();
350- indexer .syncWithFilesystem (getHardwareFolder ());
350+ indexer .syncWithFilesystem (BaseNoGui . getHardwareFolder ());
351351
352352 String [] boardToInstallParts = parser .getBoardToInstall ().split (":" );
353353
@@ -680,7 +680,7 @@ protected File createNewUntitled() throws IOException {
680680
681681 // In 0126, untitled sketches will begin in the temp folder,
682682 // and then moved to a new location because Save will default to Save As.
683- File sketchbookDir = getSketchbookFolder ();
683+ File sketchbookDir = BaseNoGui . getSketchbookFolder ();
684684 File newbieParentDir = untitledFolder ;
685685
686686 // Use a generic name like sketch_031008a, the date plus a char
@@ -805,7 +805,7 @@ public void handleOpenReplace(File file) {
805805 public void handleOpenPrompt () throws Exception {
806806 // get the frontmost window frame for placing file dialog
807807 FileDialog fd = new FileDialog (activeEditor , _ ("Open an Arduino sketch..." ), FileDialog .LOAD );
808- File lastFolder = new File (PreferencesData .get ("last.folder" , getSketchbookFolder ().getAbsolutePath ()));
808+ File lastFolder = new File (PreferencesData .get ("last.folder" , BaseNoGui . getSketchbookFolder ().getAbsolutePath ()));
809809 if (lastFolder .exists () && lastFolder .isFile ()) {
810810 lastFolder = lastFolder .getParentFile ();
811811 }
@@ -1037,7 +1037,7 @@ public void actionPerformed(ActionEvent e) {
10371037
10381038 // Add a list of all sketches and subfolders
10391039 try {
1040- boolean sketches = addSketches (menu , getSketchbookFolder (), true );
1040+ boolean sketches = addSketches (menu , BaseNoGui . getSketchbookFolder (), true );
10411041 if (sketches ) menu .addSeparator ();
10421042 } catch (IOException e ) {
10431043 e .printStackTrace ();
@@ -1058,7 +1058,7 @@ protected void rebuildSketchbookMenu(JMenu menu) {
10581058 //new Exception().printStackTrace();
10591059 try {
10601060 menu .removeAll ();
1061- addSketches (menu , getSketchbookFolder (), false );
1061+ addSketches (menu , BaseNoGui . getSketchbookFolder (), false );
10621062 //addSketches(menu, getSketchbookFolder());
10631063 } catch (IOException e ) {
10641064 e .printStackTrace ();
@@ -1111,7 +1111,7 @@ public void actionPerformed(ActionEvent e) {
11111111 importMenu .addSeparator ();
11121112
11131113 // Split between user supplied libraries and IDE libraries
1114- TargetPlatform targetPlatform = getTargetPlatform ();
1114+ TargetPlatform targetPlatform = BaseNoGui . getTargetPlatform ();
11151115
11161116 if (targetPlatform != null ) {
11171117 List <ContributedLibrary > libs = getSortedLibraries ();
@@ -1338,7 +1338,7 @@ private JRadioButtonMenuItem createBoardMenusAndCustomMenus(
13381338 @ SuppressWarnings ("serial" )
13391339 Action action = new AbstractAction (board .getName ()) {
13401340 public void actionPerformed (ActionEvent actionevent ) {
1341- selectBoard ((TargetBoard ) getValue ("b" ));
1341+ BaseNoGui . selectBoard ((TargetBoard ) getValue ("b" ));
13421342 filterVisibilityOfSubsequentBoardMenus (boardsCustomMenus , (TargetBoard ) getValue ("b" ), 1 );
13431343
13441344 onBoardOrPortChange ();
@@ -1461,15 +1461,6 @@ private static JMenuItem selectFirstEnabledMenuItem(JMenu menu) {
14611461 throw new IllegalStateException ("Menu has no enabled items" );
14621462 }
14631463
1464-
1465- private void selectBoard (TargetBoard targetBoard ) {
1466- BaseNoGui .selectBoard (targetBoard );
1467- }
1468-
1469- public static void selectSerialPort (String port ) {
1470- BaseNoGui .selectSerialPort (port );
1471- }
1472-
14731464 public void rebuildProgrammerMenu (JMenu menu ) {
14741465 menu .removeAll ();
14751466 ButtonGroup group = new ButtonGroup ();
@@ -1658,14 +1649,6 @@ static public String[] headerListFromIncludePath(File path) throws IOException {
16581649 return list ;
16591650 }
16601651
1661- protected void loadHardware (File folder ) {
1662- BaseNoGui .loadHardware (folder );
1663- }
1664-
1665-
1666- // .................................................................
1667-
1668-
16691652 /**
16701653 * Show the About box.
16711654 */
@@ -1712,153 +1695,19 @@ public void handlePrefs() {
17121695 dialog .setVisible (true );
17131696 }
17141697
1715- /**
1716- * Convenience method to get a File object for the specified filename inside
1717- * the settings folder.
1718- * For now, only used by Preferences to get the preferences.txt file.
1719- *
1720- * @param filename A file inside the settings folder.
1721- * @return filename wrapped as a File object inside the settings folder
1722- */
1723- static public File getSettingsFile (String filename ) {
1724- return BaseNoGui .getSettingsFile (filename );
1725- }
1726-
1727-
1728- static public File getBuildFolder () {
1729- return BaseNoGui .getBuildFolder ();
1730- }
1731-
1732-
1733- /**
1734- * Get the path to the platform's temporary folder, by creating
1735- * a temporary temporary file and getting its parent folder.
1736- * <br/>
1737- * Modified for revision 0094 to actually make the folder randomized
1738- * to avoid conflicts in multi-user environments. (Bug 177)
1739- */
1740- static public File createTempFolder (String name ) {
1741- return BaseNoGui .createTempFolder (name );
1742- }
1743-
1744-
17451698 // XXX: Remove this method and make librariesIndexer non-static
17461699 static public LibraryList getLibraries () {
17471700 return BaseNoGui .librariesIndexer .getInstalledLibraries ();
17481701 }
17491702
1750-
1751- static public String getExamplesPath () {
1752- return BaseNoGui .getExamplesPath ();
1753- }
1754-
1755-
1756- static public List <File > getLibrariesPath () {
1757- return BaseNoGui .getLibrariesPath ();
1758- }
1759-
1760-
1761- static public File getToolsFolder () {
1762- return BaseNoGui .getToolsFolder ();
1763- }
1764-
1765-
1766- static public String getToolsPath () {
1767- return BaseNoGui .getToolsPath ();
1768- }
1769-
1770-
1771- static public File getHardwareFolder () {
1772- return BaseNoGui .getHardwareFolder ();
1773- }
1774-
1775- //Get the core libraries
1776- static public File getCoreLibraries (String path ) {
1777- return getContentFile (path );
1778- }
1779-
1780- static public String getHardwarePath () {
1781- return BaseNoGui .getHardwarePath ();
1782- }
1783-
1784-
1785- static public String getAvrBasePath () {
1786- return BaseNoGui .getAvrBasePath ();
1787- }
1788-
1789- /**
1790- * Returns a specific TargetPackage
1791- *
1792- * @param packageName
1793- * @return
1794- */
1795- static public TargetPackage getTargetPackage (String packageName ) {
1796- return BaseNoGui .getTargetPackage (packageName );
1797- }
1798-
1799- /**
1800- * Returns the currently selected TargetPlatform.
1801- *
1802- * @return
1803- */
1804- static public TargetPlatform getTargetPlatform () {
1805- return BaseNoGui .getTargetPlatform ();
1806- }
1807-
1808- /**
1809- * Returns a specific TargetPlatform searching Package/Platform
1810- *
1811- * @param packageName
1812- * @param platformName
1813- * @return
1814- */
1815- static public TargetPlatform getTargetPlatform (String packageName ,
1816- String platformName ) {
1817- return BaseNoGui .getTargetPlatform (packageName , platformName );
1818- }
1819-
1820- static public TargetPlatform getCurrentTargetPlatformFromPackage (String pack ) {
1821- return BaseNoGui .getCurrentTargetPlatformFromPackage (pack );
1822- }
1823-
1824- static public PreferencesMap getBoardPreferences () {
1825- return BaseNoGui .getBoardPreferences ();
1826- }
1827-
18281703 public List <JMenu > getBoardsCustomMenus () {
18291704 return boardsCustomMenus ;
18301705 }
18311706
1832- static public File getPortableFolder () {
1833- return BaseNoGui .getPortableFolder ();
1834- }
1835-
1836-
1837- static public String getPortableSketchbookFolder () {
1838- return BaseNoGui .getPortableSketchbookFolder ();
1839- }
1840-
1841-
1842- static public File getSketchbookFolder () {
1843- return BaseNoGui .getSketchbookFolder ();
1844- }
1845-
1846-
1847- static public File getSketchbookLibrariesFolder () {
1848- return BaseNoGui .getSketchbookLibrariesFolder ();
1849- }
1850-
1851-
18521707 static public String getSketchbookLibrariesPath () {
1853- return getSketchbookLibrariesFolder ().getAbsolutePath ();
1708+ return BaseNoGui . getSketchbookLibrariesFolder ().getAbsolutePath ();
18541709 }
18551710
1856-
1857- static public File getSketchbookHardwareFolder () {
1858- return BaseNoGui .getSketchbookHardwareFolder ();
1859- }
1860-
1861-
18621711 public File getDefaultSketchbookFolderOrPromptForIt () {
18631712
18641713 File sketchbookFolder = BaseNoGui .getDefaultSketchbookFolder ();
@@ -2578,7 +2427,7 @@ public void handleAddLibrary() {
25782427 }
25792428
25802429 // copy folder
2581- File destinationFolder = new File (getSketchbookLibrariesFolder (), sourceFile .getName ());
2430+ File destinationFolder = new File (BaseNoGui . getSketchbookLibrariesFolder (), sourceFile .getName ());
25822431 if (!destinationFolder .mkdir ()) {
25832432 activeEditor .statusError (I18n .format (_ ("A library named {0} already exists" ), sourceFile .getName ()));
25842433 return ;
0 commit comments