mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Editor: removed duplicated classes DefaultRunHandler, and DefaultPresentHandler in favour of generic BuildHandler
This commit is contained in:
parent
fd4a5a82b3
commit
b16ee6c7b2
@ -1426,8 +1426,8 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
|
|
||||||
|
|
||||||
public void resetHandlers() {
|
public void resetHandlers() {
|
||||||
runHandler = new DefaultRunHandler();
|
runHandler = new BuildHandler();
|
||||||
presentHandler = new DefaultPresentHandler();
|
presentHandler = new BuildHandler(true);
|
||||||
stopHandler = new DefaultStopHandler();
|
stopHandler = new DefaultStopHandler();
|
||||||
exportHandler = new DefaultExportHandler();
|
exportHandler = new DefaultExportHandler();
|
||||||
exportAppHandler = new DefaultExportAppHandler();
|
exportAppHandler = new DefaultExportAppHandler();
|
||||||
@ -1917,33 +1917,23 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
new Thread(verbose ? presentHandler : runHandler).start();
|
new Thread(verbose ? presentHandler : runHandler).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DAM: in Arduino, this is compile
|
class BuildHandler implements Runnable {
|
||||||
class DefaultRunHandler implements Runnable {
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
sketch.prepare();
|
|
||||||
sketch.build(false);
|
|
||||||
statusNotice(_("Done compiling."));
|
|
||||||
} catch (PreferencesMapException e) {
|
|
||||||
statusError(I18n.format(
|
|
||||||
_("Error while compiling: missing '{0}' configuration parameter"),
|
|
||||||
e.getMessage()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
status.unprogress();
|
|
||||||
statusError(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
status.unprogress();
|
private final boolean verbose;
|
||||||
toolbar.deactivate(EditorToolbar.RUN);
|
|
||||||
|
public BuildHandler() {
|
||||||
|
this(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// DAM: in Arduino, this is compile (with verbose output)
|
public BuildHandler(boolean verbose) {
|
||||||
class DefaultPresentHandler implements Runnable {
|
this.verbose = verbose;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
sketch.prepare();
|
sketch.prepare();
|
||||||
sketch.build(true);
|
sketch.build(verbose);
|
||||||
statusNotice(_("Done compiling."));
|
statusNotice(_("Done compiling."));
|
||||||
} catch (PreferencesMapException e) {
|
} catch (PreferencesMapException e) {
|
||||||
statusError(I18n.format(
|
statusError(I18n.format(
|
||||||
@ -1961,11 +1951,8 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
|
|
||||||
class DefaultStopHandler implements Runnable {
|
class DefaultStopHandler implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
// TODO
|
||||||
// DAM: we should try to kill the compilation or upload process here.
|
// DAM: we should try to kill the compilation or upload process here.
|
||||||
} catch (Exception e) {
|
|
||||||
statusError(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user