remove external editor feature, now that command line is working

This commit is contained in:
benfry
2012-10-21 03:33:39 +00:00
parent 420f8fd446
commit c8367ba71e
3 changed files with 56 additions and 67 deletions
+27 -38
View File
@@ -65,8 +65,8 @@ public abstract class Editor extends JFrame implements RunnerListener {
// file and sketch menus for re-inserting items
private JMenu fileMenu;
private JMenuItem saveMenuItem;
private JMenuItem saveAsMenuItem;
// private JMenuItem saveMenuItem;
// private JMenuItem saveAsMenuItem;
private JMenu sketchMenu;
@@ -473,37 +473,26 @@ public abstract class Editor extends JFrame implements RunnerListener {
* with things in the Preferences window.
*/
protected void applyPreferences() {
// apply the setting for 'use external editor'
boolean external = Preferences.getBoolean("editor.external");
textarea.setEditable(!external);
saveMenuItem.setEnabled(!external);
saveAsMenuItem.setEnabled(!external);
// // apply the setting for 'use external editor'
// boolean external = Preferences.getBoolean("editor.external");
// textarea.setEditable(!external);
// saveMenuItem.setEnabled(!external);
// saveAsMenuItem.setEnabled(!external);
TextAreaPainter painter = textarea.getPainter();
if (external) {
// disable line highlight and turn off the caret when disabling
Color color = mode.getColor("editor.external.bgcolor");
painter.setBackground(color);
painter.setLineHighlightEnabled(false);
textarea.setCaretVisible(false);
// new stuff
// splitPane.setDividerLocation(toolbar.getHeight() + header.getHeight());
// splitPane.setResizeWeight(0D);
// textarea.setMinimumSize(new Dimension(textarea.getWidth(), 0));
} else {
Color color = mode.getColor("editor.bgcolor");
painter.setBackground(color);
boolean highlight = Preferences.getBoolean("editor.linehighlight");
painter.setLineHighlightEnabled(highlight);
textarea.setCaretVisible(true);
// new stuff
// splitPane.setDividerLocation(-1); // any negative value resets to preferred size
// splitPane.setResizeWeight(1D);
// textarea.setMinimumSize(null);
}
// if (external) {
// // disable line highlight and turn off the caret when disabling
// Color color = mode.getColor("editor.external.bgcolor");
// painter.setBackground(color);
// painter.setLineHighlightEnabled(false);
// textarea.setCaretVisible(false);
// } else {
Color color = mode.getColor("editor.bgcolor");
painter.setBackground(color);
boolean highlight = Preferences.getBoolean("editor.linehighlight");
painter.setLineHighlightEnabled(highlight);
textarea.setCaretVisible(true);
// }
// apply changes to the font size for the editor
painter.setFont(Preferences.getFont("editor.font"));
@@ -615,7 +604,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
handleSave(false);
}
});
saveMenuItem = item;
// saveMenuItem = item;
fileMenu.add(item);
item = Toolkit.newJMenuItemShift("Save As...", 'S');
@@ -624,7 +613,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
handleSaveAs();
}
});
saveAsMenuItem = item;
// saveAsMenuItem = item;
fileMenu.add(item);
if (exportItems != null) {
@@ -2236,11 +2225,11 @@ public abstract class Editor extends JFrame implements RunnerListener {
//current.setProgram(editor.getText());
sketch.getCurrentCode().setProgram(getText());
// if an external editor is being used, need to grab the
// latest version of the code from the file.
if (Preferences.getBoolean("editor.external")) {
sketch.reload();
}
// // if an external editor is being used, need to grab the
// // latest version of the code from the file.
// if (Preferences.getBoolean("editor.external")) {
// sketch.reload();
// }
}
+12 -12
View File
@@ -112,7 +112,7 @@ public class Preferences {
JCheckBox editorAntialiasBox;
JCheckBox exportSeparateBox;
JCheckBox deletePreviousBox;
JCheckBox externalEditorBox;
// JCheckBox externalEditorBox;
JCheckBox memoryOverrideBox;
JTextField memoryField;
JCheckBox checkUpdatesBox;
@@ -337,14 +337,14 @@ public class Preferences {
top += d.height + GUI_BETWEEN;
// [ ] Use external editor
externalEditorBox = new JCheckBox("Use external editor");
pain.add(externalEditorBox);
d = externalEditorBox.getPreferredSize();
externalEditorBox.setBounds(left, top, d.width + 10, d.height);
right = Math.max(right, left + d.width);
top += d.height + GUI_BETWEEN;
// // [ ] Use external editor
//
// externalEditorBox = new JCheckBox("Use external editor");
// pain.add(externalEditorBox);
// d = externalEditorBox.getPreferredSize();
// externalEditorBox.setBounds(left, top, d.width + 10, d.height);
// right = Math.max(right, left + d.width);
// top += d.height + GUI_BETWEEN;
// [ ] Check for updates on startup
@@ -576,7 +576,7 @@ public class Preferences {
base.setSketchbookFolder(new File(newPath));
}
setBoolean("editor.external", externalEditorBox.isSelected());
// setBoolean("editor.external", externalEditorBox.isSelected());
setBoolean("update.check", checkUpdatesBox.isSelected());
int oldDisplayIndex = getInteger("run.display");
@@ -670,8 +670,8 @@ public class Preferences {
sketchbookLocationField.
setText(get("sketchbook.path"));
externalEditorBox.
setSelected(getBoolean("editor.external"));
// externalEditorBox.
// setSelected(getBoolean("editor.external"));
checkUpdatesBox.
setSelected(getBoolean("update.check"));
+17 -17
View File
@@ -29,18 +29,12 @@ X that subclass it. not a good solution, but no good solution for
X library deps either. punting on that for now, and instead just deal
X with this specific (more esoteric) low-level case w/ a workaround
2.0 FINAL / command line
command line
X implement command line installer for Mac OS X
_ add processing-java.bat (or exe?) for Windows
_ add processing-java script for Linux
X add processing-java.exe for Windows
X add processing-java script for Linux
X file bug for android implementation
X modify comments on project site to say android, js, etc
_ kill external editor (for all its quirks) in favor of command line
_ use external editor needs to enable/disable across all windows
_ http://code.google.com/p/processing/issues/detail?id=515
C Casey says yes kill ext editor and finish command line
_ make note for docs to remove mentions of external editor
X processing.app.Commander headless still requiring X11
X problem is static calls to PApplet
X http://code.google.com/p/processing/issues/detail?id=220
@@ -49,14 +43,20 @@ X use as a way to remove the non-GUI-specifc code from PApplet
X so that the builds can run headless
X could move to java6 and better internal javac support (drop ecj)
o decided to use Java 6, so check on Javac usefulness
_ change command line to just be part of regular (separate) distros
_ there's so much platform code in there, it's not worth the extra work
_ also include update check for logging
_ command line support is currently broken
_ http://code.google.com/p/processing/issues/detail?id=142
_ some fixes can be found in the bug report
_ need to deal with setting path to sketchbook/examples
_ also deal with the script not being in the right folder
X change command line to just be part of regular (separate) distros
X there's so much platform code in there, it's not worth the extra work
X also include update check for logging
X command line support is currently broken
X http://code.google.com/p/processing/issues/detail?id=142
o some fixes can be found in the bug report
o need to deal with setting path to sketchbook/examples
o also deal with the script not being in the right folder
X lots of other fixes to deal with moving away from weird prefs split
X kill external editor (for all its quirks) in favor of command line
o use external editor needs to enable/disable across all windows
o http://code.google.com/p/processing/issues/detail?id=515
C Casey says yes kill ext editor and finish command line
X make note for docs to remove mentions of external editor
2.0 FINAL / library/tool/mode manager cleanup