Skip to content

Commit cda60dd

Browse files
committed
PDE X prefs work
1 parent c59bbbe commit cda60dd

File tree

5 files changed

+32
-20
lines changed

5 files changed

+32
-20
lines changed

app/.classpath

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<attribute name="ignore_optional_problems" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry kind="src" path="test/src"/>
109
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
1110
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
1211
<classpathentry kind="lib" path="lib/antlr.jar" sourcepath="lib/antlr-src.zip"/>

app/src/processing/app/Preferences.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,11 @@ protected void applyFrame() {
825825
setBoolean("platform.auto_file_type_associations", //$NON-NLS-1$
826826
autoAssociateBox.isSelected());
827827
}
828-
828+
829+
setBoolean("pdex.errorCheckEnabled", errorCheckerBox.isSelected());
830+
setBoolean("pdex.warningsEnabled", warningsCheckerBox.isSelected());
831+
setBoolean("pdex.ccEnabled", codeCompletionBox.isSelected());
832+
829833
for (Editor editor : base.getEditors()) {
830834
editor.applyPreferences();
831835
}

pdex/src/processing/mode/experimental/DebugEditor.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,8 @@ synchronized public boolean updateTable(final TableModel tableModel) {
16091609
* at the bottom of the PDE
16101610
*/
16111611
public void updateErrorToggle(){
1612-
btnShowErrors.updateMarker(errorCheckerService.hasErrors(),
1613-
errorBar.errorColor);
1612+
btnShowErrors.updateMarker(ExperimentalMode.errorCheckEnabled
1613+
&& errorCheckerService.hasErrors(), errorBar.errorColor);
16141614
}
16151615

16161616
/**
@@ -1649,4 +1649,14 @@ private void checkForJavaTabs() {
16491649
}
16501650
}
16511651
}
1652+
1653+
protected void applyPreferences() {
1654+
super.applyPreferences();
1655+
if (dmode != null) {
1656+
dmode.loadPreferences();
1657+
log("Applying prefs");
1658+
// trigger it once to refresh UI
1659+
errorCheckerService.runManualErrorCheck();
1660+
}
1661+
}
16521662
}

pdex/src/processing/mode/experimental/ErrorCheckerService.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -476,19 +476,18 @@ protected boolean checkCode() {
476476
}
477477

478478
astGenerator.buildAST(cu);
479-
if(ExperimentalMode.errorCheckEnabled){
480-
calcPDEOffsetsForProbList();
481-
updateErrorTable();
482-
editor.updateErrorBar(problemsList);
483-
updateEditorStatus();
484-
editor.getTextArea().repaint();
485-
updatePaintedThingys();
486-
editor.updateErrorToggle();
487-
}
488-
else
489-
{
490-
log("Error Check disabled, so not updating UI.");
479+
if(!ExperimentalMode.errorCheckEnabled){
480+
problemsList.clear();
481+
log("Error Check disabled, so not updating UI.");
491482
}
483+
calcPDEOffsetsForProbList();
484+
updateErrorTable();
485+
editor.updateErrorBar(problemsList);
486+
updateEditorStatus();
487+
editor.getTextArea().repaint();
488+
updatePaintedThingys();
489+
editor.updateErrorToggle();
490+
492491
int x = textModified.get();
493492
//log("TM " + x);
494493
if (x >= 2) {

pdex/src/processing/mode/experimental/XQConsoleToggle.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ public void paintComponent(Graphics g) {
9494
g.drawString(buttonName, getWidth() / 2 + 2 // + 2 is a offset
9595
- getFontMetrics(getFont()).stringWidth(buttonName) / 2,
9696
this.getHeight() - 6);
97-
if(drawMarker){
98-
g.setColor(markerColor);
99-
g.fillRect(4, 0, 2, this.getHeight());
100-
}
97+
if (drawMarker) {
98+
g.setColor(markerColor);
99+
g.fillRect(4, 0, 2, this.getHeight());
100+
}
101101
}
102102

103103
boolean drawMarker = false;

0 commit comments

Comments
 (0)