GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cleaning up pdex prefs and underbrush · D-I-R-M/processing4@a6091f3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • build/shared/lib
    • defaults.txt
  • java/src/processing/mode/java
    • JavaMode.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎build/shared/lib/defaults.txt‎

Copy file name to clipboardExpand all lines: build/shared/lib/defaults.txt
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,20 @@ proxy.socks.port=
328328
proxy.system=true
329329

330330
# PDE X
331-
pdex.autoSave.autoSaveByDefault=true
332-
pdex.autoSave.autoSaveEnabled=false
333-
pdex.autoSave.promptDisplay=true
334-
pdex.autoSaveInterval=5
335-
pdex.dbgOutput=false
336-
pdex.errorCheckEnabled=true
337-
pdex.warningsEnabled=true
338-
pdex.writeErrorLogs=false
331+
pdex.errorCheckEnabled = true
332+
pdex.warningsEnabled = true
333+
pdex.writeErrorLogs = false
334+
335+
pdex.autoSave.autoSaveEnabled = false
336+
pdex.autoSaveInterval = 5
337+
pdex.autoSave.promptDisplay = true
338+
pdex.autoSave.autoSaveByDefault = true
339339

340-
# Set to false to disable ctrl/cmd-click jump to definition
341-
pdex.inspectMode.hotkey=true
342340
# Enable auto-completion when hitting ctrl-space
343341
pdex.completion = false
344342
# Trigger happy version of completion that fires more often
345343
pdex.completion.trigger = false
346344
# Suggest libraries to import when a class is undefined/unavailable
347345
pdex.suggest.imports = true
346+
# Set to false to disable ctrl/cmd-click jump to definition
347+
pdex.inspectMode.hotkey=true
Collapse file

‎java/src/processing/mode/java/JavaMode.java‎

Copy file name to clipboardExpand all lines: java/src/processing/mode/java/JavaMode.java
+30-50Lines changed: 30 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,35 @@ public String getSearchPath() {
206206
// Merged from ExperimentalMode
207207

208208

209-
static public volatile boolean errorCheckEnabled = true;
210-
static public volatile boolean warningsEnabled = true;
211-
static public volatile boolean codeCompletionsEnabled = true;
212-
static public volatile boolean errorLogsEnabled = false;
213-
static public volatile boolean autoSaveEnabled = true;
214-
static public volatile boolean autoSavePromptEnabled = true;
215-
static public volatile boolean defaultAutoSaveEnabled = true;
216-
static public volatile boolean ccTriggerEnabled = false;
217-
static public volatile boolean importSuggestEnabled = true;
218-
static public volatile boolean inspectModeHotkeyEnabled = true;
209+
static volatile boolean errorCheckEnabled = true;
210+
static volatile boolean warningsEnabled = true;
211+
static volatile boolean errorLogsEnabled = false;
212+
213+
static volatile boolean autoSaveEnabled = true;
214+
static volatile boolean autoSavePromptEnabled = true;
215+
static volatile boolean defaultAutoSaveEnabled = true;
216+
217+
static volatile boolean codeCompletionsEnabled = true;
218+
static volatile boolean ccTriggerEnabled = false;
219+
static volatile boolean importSuggestEnabled = true;
220+
static volatile boolean inspectModeHotkeyEnabled = true;
219221

220222
static public int autoSaveInterval = 3; //in minutes
221223

222224
static public final String prefErrorCheck = "pdex.errorCheckEnabled";
223225
static public final String prefWarnings = "pdex.warningsEnabled";
224226
static public final String prefErrorLogs = "pdex.writeErrorLogs";
225-
static public final String prefAutoSaveInterval = "pdex.autoSaveInterval";
227+
226228
static public final String prefAutoSave = "pdex.autoSave.autoSaveEnabled";
229+
static public final String prefAutoSaveInterval = "pdex.autoSaveInterval";
227230
static public final String prefAutoSavePrompt = "pdex.autoSave.promptDisplay";
228231
static public final String prefDefaultAutoSave = "pdex.autoSave.autoSaveByDefault";
229-
static public final String suggestionsFileName = "suggestions.txt";
230232

231233
static public final String COMPLETION_PREF = "pdex.completion";
232234
static public final String COMPLETION_TRIGGER_PREF = "pdex.completion.trigger";
233235
static public final String SUGGEST_IMPORTS_PREF = "pdex.suggest.imports";
234236
static public final String INSPECT_MODE_HOTKEY_PREF = "pdex.inspectMode.hotkey";
235237

236-
237238
/**
238239
* Stores the white list/black list of allowed/blacklisted imports.
239240
* These are defined in suggestions.txt in java mode folder.
@@ -243,48 +244,54 @@ public String getSearchPath() {
243244

244245
static boolean checkSuggestion(String mapName, String impName) {
245246
return suggestionsMap.containsKey(mapName) &&
246-
JavaMode.suggestionsMap.get(mapName).contains(impName);
247+
suggestionsMap.get(mapName).contains(impName);
247248
}
248249

249250

250251
public void loadPreferences() {
251252
Messages.log("Load PDEX prefs");
252-
ensurePrefsExist();
253+
253254
errorCheckEnabled = Preferences.getBoolean(prefErrorCheck);
254255
warningsEnabled = Preferences.getBoolean(prefWarnings);
255-
codeCompletionsEnabled = Preferences.getBoolean(COMPLETION_PREF);
256256
errorLogsEnabled = Preferences.getBoolean(prefErrorLogs);
257-
autoSaveInterval = Preferences.getInteger(prefAutoSaveInterval);
257+
258258
autoSaveEnabled = Preferences.getBoolean(prefAutoSave);
259+
autoSaveInterval = Preferences.getInteger(prefAutoSaveInterval);
259260
autoSavePromptEnabled = Preferences.getBoolean(prefAutoSavePrompt);
260261
defaultAutoSaveEnabled = Preferences.getBoolean(prefDefaultAutoSave);
262+
263+
codeCompletionsEnabled = Preferences.getBoolean(COMPLETION_PREF);
261264
ccTriggerEnabled = Preferences.getBoolean(COMPLETION_TRIGGER_PREF);
262265
importSuggestEnabled = Preferences.getBoolean(SUGGEST_IMPORTS_PREF);
263266
inspectModeHotkeyEnabled = Preferences.getBoolean(INSPECT_MODE_HOTKEY_PREF);
267+
264268
loadSuggestionsMap();
265269
}
266270

267271

268272
public void savePreferences() {
269273
Messages.log("Saving PDEX prefs");
274+
270275
Preferences.setBoolean(prefErrorCheck, errorCheckEnabled);
271276
Preferences.setBoolean(prefWarnings, warningsEnabled);
272-
Preferences.setBoolean(COMPLETION_PREF, codeCompletionsEnabled);
273277
Preferences.setBoolean(prefErrorLogs, errorLogsEnabled);
274-
Preferences.setInteger(prefAutoSaveInterval, autoSaveInterval);
278+
275279
Preferences.setBoolean(prefAutoSave, autoSaveEnabled);
280+
Preferences.setInteger(prefAutoSaveInterval, autoSaveInterval);
276281
Preferences.setBoolean(prefAutoSavePrompt, autoSavePromptEnabled);
277282
Preferences.setBoolean(prefDefaultAutoSave, defaultAutoSaveEnabled);
283+
284+
Preferences.setBoolean(COMPLETION_PREF, codeCompletionsEnabled);
278285
Preferences.setBoolean(COMPLETION_TRIGGER_PREF, ccTriggerEnabled);
279286
Preferences.setBoolean(SUGGEST_IMPORTS_PREF, importSuggestEnabled);
280287
Preferences.setBoolean(INSPECT_MODE_HOTKEY_PREF, inspectModeHotkeyEnabled);
281288
}
282289

283290

284291
private void loadSuggestionsMap() {
285-
File suggestionsListFile = new File(getFolder(), suggestionsFileName);
286-
if (suggestionsListFile.exists()) {
287-
String[] lines = PApplet.loadStrings(suggestionsListFile);
292+
File suggestionsFile = new File(getFolder(), "suggestions.txt");
293+
if (suggestionsFile.exists()) {
294+
String[] lines = PApplet.loadStrings(suggestionsFile);
288295
if (lines != null) {
289296
for (String line : lines) {
290297
if (!line.trim().startsWith("#")) {
@@ -307,34 +314,7 @@ private void loadSuggestionsMap() {
307314
}
308315
}
309316
} else {
310-
Messages.loge("Suggestions file not found at " + suggestionsListFile);
317+
Messages.loge("Suggestions file not found at " + suggestionsFile);
311318
}
312319
}
313-
314-
315-
public void ensurePrefsExist() {
316-
//TODO: Need to do a better job of managing prefs. Think lists.
317-
if (Preferences.get(prefErrorCheck) == null)
318-
Preferences.setBoolean(prefErrorCheck, errorCheckEnabled);
319-
if (Preferences.get(prefWarnings) == null)
320-
Preferences.setBoolean(prefWarnings, warningsEnabled);
321-
if (Preferences.get(COMPLETION_PREF) == null)
322-
Preferences.setBoolean(COMPLETION_PREF, codeCompletionsEnabled);
323-
if (Preferences.get(prefErrorLogs) == null)
324-
Preferences.setBoolean(prefErrorLogs, errorLogsEnabled);
325-
if (Preferences.get(prefAutoSaveInterval) == null)
326-
Preferences.setInteger(prefAutoSaveInterval, autoSaveInterval);
327-
if (Preferences.get(prefAutoSave) == null)
328-
Preferences.setBoolean(prefAutoSave, autoSaveEnabled);
329-
if (Preferences.get(prefAutoSavePrompt) == null)
330-
Preferences.setBoolean(prefAutoSavePrompt, autoSavePromptEnabled);
331-
if (Preferences.get(prefDefaultAutoSave) == null)
332-
Preferences.setBoolean(prefDefaultAutoSave, defaultAutoSaveEnabled);
333-
if (Preferences.get(COMPLETION_TRIGGER_PREF) == null)
334-
Preferences.setBoolean(COMPLETION_TRIGGER_PREF, ccTriggerEnabled);
335-
if (Preferences.get(SUGGEST_IMPORTS_PREF) == null)
336-
Preferences.setBoolean(SUGGEST_IMPORTS_PREF, importSuggestEnabled);
337-
if (Preferences.get(INSPECT_MODE_HOTKEY_PREF) == null)
338-
Preferences.setBoolean(INSPECT_MODE_HOTKEY_PREF, inspectModeHotkeyEnabled);
339-
}
340320
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.