@@ -217,7 +217,7 @@ static public void guardedMain(String args[]) throws Exception {
217
217
}
218
218
219
219
// Create a location for untitled sketches
220
- untitledFolder = createTempFolder ("untitled" );
220
+ untitledFolder = BaseNoGui . createTempFolder ("untitled" );
221
221
DeleteFilesOnShutdown .add (untitledFolder );
222
222
223
223
INSTANCE = new Base (args );
@@ -347,7 +347,7 @@ protected void onProgress(Progress progress) {
347
347
List <String > downloadedPackageIndexFiles = installer .updateIndex ();
348
348
installer .deleteUnknownFiles (downloadedPackageIndexFiles );
349
349
indexer .parseIndex ();
350
- indexer .syncWithFilesystem (getHardwareFolder ());
350
+ indexer .syncWithFilesystem (BaseNoGui . getHardwareFolder ());
351
351
352
352
String [] boardToInstallParts = parser .getBoardToInstall ().split (":" );
353
353
@@ -680,7 +680,7 @@ protected File createNewUntitled() throws IOException {
680
680
681
681
// In 0126, untitled sketches will begin in the temp folder,
682
682
// and then moved to a new location because Save will default to Save As.
683
- File sketchbookDir = getSketchbookFolder ();
683
+ File sketchbookDir = BaseNoGui . getSketchbookFolder ();
684
684
File newbieParentDir = untitledFolder ;
685
685
686
686
// Use a generic name like sketch_031008a, the date plus a char
@@ -805,7 +805,7 @@ public void handleOpenReplace(File file) {
805
805
public void handleOpenPrompt () throws Exception {
806
806
// get the frontmost window frame for placing file dialog
807
807
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 ()));
809
809
if (lastFolder .exists () && lastFolder .isFile ()) {
810
810
lastFolder = lastFolder .getParentFile ();
811
811
}
@@ -1037,7 +1037,7 @@ public void actionPerformed(ActionEvent e) {
1037
1037
1038
1038
// Add a list of all sketches and subfolders
1039
1039
try {
1040
- boolean sketches = addSketches (menu , getSketchbookFolder (), true );
1040
+ boolean sketches = addSketches (menu , BaseNoGui . getSketchbookFolder (), true );
1041
1041
if (sketches ) menu .addSeparator ();
1042
1042
} catch (IOException e ) {
1043
1043
e .printStackTrace ();
@@ -1058,7 +1058,7 @@ protected void rebuildSketchbookMenu(JMenu menu) {
1058
1058
//new Exception().printStackTrace();
1059
1059
try {
1060
1060
menu .removeAll ();
1061
- addSketches (menu , getSketchbookFolder (), false );
1061
+ addSketches (menu , BaseNoGui . getSketchbookFolder (), false );
1062
1062
//addSketches(menu, getSketchbookFolder());
1063
1063
} catch (IOException e ) {
1064
1064
e .printStackTrace ();
@@ -1111,7 +1111,7 @@ public void actionPerformed(ActionEvent e) {
1111
1111
importMenu .addSeparator ();
1112
1112
1113
1113
// Split between user supplied libraries and IDE libraries
1114
- TargetPlatform targetPlatform = getTargetPlatform ();
1114
+ TargetPlatform targetPlatform = BaseNoGui . getTargetPlatform ();
1115
1115
1116
1116
if (targetPlatform != null ) {
1117
1117
List <ContributedLibrary > libs = getSortedLibraries ();
@@ -1338,7 +1338,7 @@ private JRadioButtonMenuItem createBoardMenusAndCustomMenus(
1338
1338
@ SuppressWarnings ("serial" )
1339
1339
Action action = new AbstractAction (board .getName ()) {
1340
1340
public void actionPerformed (ActionEvent actionevent ) {
1341
- selectBoard ((TargetBoard ) getValue ("b" ));
1341
+ BaseNoGui . selectBoard ((TargetBoard ) getValue ("b" ));
1342
1342
filterVisibilityOfSubsequentBoardMenus (boardsCustomMenus , (TargetBoard ) getValue ("b" ), 1 );
1343
1343
1344
1344
onBoardOrPortChange ();
@@ -1461,15 +1461,6 @@ private static JMenuItem selectFirstEnabledMenuItem(JMenu menu) {
1461
1461
throw new IllegalStateException ("Menu has no enabled items" );
1462
1462
}
1463
1463
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
-
1473
1464
public void rebuildProgrammerMenu (JMenu menu ) {
1474
1465
menu .removeAll ();
1475
1466
ButtonGroup group = new ButtonGroup ();
@@ -1658,14 +1649,6 @@ static public String[] headerListFromIncludePath(File path) throws IOException {
1658
1649
return list ;
1659
1650
}
1660
1651
1661
- protected void loadHardware (File folder ) {
1662
- BaseNoGui .loadHardware (folder );
1663
- }
1664
-
1665
-
1666
- // .................................................................
1667
-
1668
-
1669
1652
/**
1670
1653
* Show the About box.
1671
1654
*/
@@ -1712,153 +1695,19 @@ public void handlePrefs() {
1712
1695
dialog .setVisible (true );
1713
1696
}
1714
1697
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
-
1745
1698
// XXX: Remove this method and make librariesIndexer non-static
1746
1699
static public LibraryList getLibraries () {
1747
1700
return BaseNoGui .librariesIndexer .getInstalledLibraries ();
1748
1701
}
1749
1702
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
-
1828
1703
public List <JMenu > getBoardsCustomMenus () {
1829
1704
return boardsCustomMenus ;
1830
1705
}
1831
1706
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
-
1852
1707
static public String getSketchbookLibrariesPath () {
1853
- return getSketchbookLibrariesFolder ().getAbsolutePath ();
1708
+ return BaseNoGui . getSketchbookLibrariesFolder ().getAbsolutePath ();
1854
1709
}
1855
1710
1856
-
1857
- static public File getSketchbookHardwareFolder () {
1858
- return BaseNoGui .getSketchbookHardwareFolder ();
1859
- }
1860
-
1861
-
1862
1711
public File getDefaultSketchbookFolderOrPromptForIt () {
1863
1712
1864
1713
File sketchbookFolder = BaseNoGui .getDefaultSketchbookFolder ();
@@ -2578,7 +2427,7 @@ public void handleAddLibrary() {
2578
2427
}
2579
2428
2580
2429
// copy folder
2581
- File destinationFolder = new File (getSketchbookLibrariesFolder (), sourceFile .getName ());
2430
+ File destinationFolder = new File (BaseNoGui . getSketchbookLibrariesFolder (), sourceFile .getName ());
2582
2431
if (!destinationFolder .mkdir ()) {
2583
2432
activeEditor .statusError (I18n .format (_ ("A library named {0} already exists" ), sourceFile .getName ()));
2584
2433
return ;
0 commit comments