diff --git a/editor/org.processing.editor/META-INF/MANIFEST.MF b/editor/org.processing.editor/META-INF/MANIFEST.MF index 2ff8a25fd..cb8bd6bd6 100644 --- a/editor/org.processing.editor/META-INF/MANIFEST.MF +++ b/editor/org.processing.editor/META-INF/MANIFEST.MF @@ -7,7 +7,8 @@ Bundle-Activator: org.processing.editor.ProcessingEditorPlugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.jface.text, - org.eclipse.ui.editors + org.eclipse.ui.editors, + org.eclipse.core.resources Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: org.eclipse.ui.views.contentoutline Bundle-ActivationPolicy: lazy diff --git a/editor/org.processing.editor/bin/org/processing/preferences/PreferenceConstants.class b/editor/org.processing.editor/bin/org/processing/preferences/PreferenceConstants.class new file mode 100644 index 000000000..84f366997 Binary files /dev/null and b/editor/org.processing.editor/bin/org/processing/preferences/PreferenceConstants.class differ diff --git a/editor/org.processing.editor/bin/org/processing/preferences/PreferenceInitializer.class b/editor/org.processing.editor/bin/org/processing/preferences/PreferenceInitializer.class new file mode 100644 index 000000000..774125c25 Binary files /dev/null and b/editor/org.processing.editor/bin/org/processing/preferences/PreferenceInitializer.class differ diff --git a/editor/org.processing.editor/bin/org/processing/preferences/ProcessingPreferencesPage.class b/editor/org.processing.editor/bin/org/processing/preferences/ProcessingPreferencesPage.class new file mode 100644 index 000000000..486f6bbba Binary files /dev/null and b/editor/org.processing.editor/bin/org/processing/preferences/ProcessingPreferencesPage.class differ diff --git a/editor/org.processing.editor/plugin.xml b/editor/org.processing.editor/plugin.xml index 7e1d1eb9f..b03cb6b9c 100644 --- a/editor/org.processing.editor/plugin.xml +++ b/editor/org.processing.editor/plugin.xml @@ -1,8 +1,7 @@ - + - + name="Processing Document Setup Participant"> - + - + name="Processing Buttons"> @@ -45,18 +41,33 @@ - + - - + + + + + + + + + + + + + diff --git a/editor/org.processing.editor/src/org/processing/preferences/PreferenceConstants.java b/editor/org.processing.editor/src/org/processing/preferences/PreferenceConstants.java index 61bf7668b..be9b58470 100644 --- a/editor/org.processing.editor/src/org/processing/preferences/PreferenceConstants.java +++ b/editor/org.processing.editor/src/org/processing/preferences/PreferenceConstants.java @@ -6,7 +6,8 @@ package org.processing.preferences; public class PreferenceConstants { // Editor Preferences - public static final String PROCESSING_SKETCH = "sketch_path"; // path preference + public static final String PROCESSING_SKETCHBOOK = "sketch_path"; // path preference + public static final String PROCESSING_LIBRARIES = "library_path"; // path preference public static final String PROCESSING_AUTO_INDENT = "eclipse.editor.auto.indent"; // // PROCESSING_PREFERENCES prefix indicates membership in the processing.app preferences class diff --git a/editor/org.processing.editor/src/org/processing/preferences/ProcessingPreferencesPage.java b/editor/org.processing.editor/src/org/processing/preferences/ProcessingPreferencesPage.java index 3c9231438..8ad2ade58 100644 --- a/editor/org.processing.editor/src/org/processing/preferences/ProcessingPreferencesPage.java +++ b/editor/org.processing.editor/src/org/processing/preferences/ProcessingPreferencesPage.java @@ -19,6 +19,12 @@ import org.processing.editor.ProcessingEditorPlugin; * but things could be setup such that these are read * from a file, and we could use a customized version of * a standard Processing preferences file to store this. + * + * Added some validation and warning messages as examples. + * If we really want to implement ones of any complexity + * there should be an addition of propertyChange() and checkState() + * methods. + * See: http://sites.google.com/site/eclipseplugindevelopment/9-preference-pages */ public class ProcessingPreferencesPage @@ -38,8 +44,17 @@ public class ProcessingPreferencesPage * restore itself. */ public void createFieldEditors() { - addField(new DirectoryFieldEditor(PreferenceConstants.PROCESSING_SKETCH, - "Sketchbook Directory:", getFieldEditorParent())); + // Sketchbook Directory Item setup + DirectoryFieldEditor nextField = new DirectoryFieldEditor(PreferenceConstants.PROCESSING_SKETCHBOOK, "Sketchbook Directory:", getFieldEditorParent()); + nextField.setEmptyStringAllowed(false); + nextField.setErrorMessage("The Sketchbook Directory shouldn't be empty!"); + addField(nextField); + // Library Path item setup + nextField = new DirectoryFieldEditor(PreferenceConstants.PROCESSING_LIBRARIES, "Processing Library Path:", getFieldEditorParent()); + nextField.setEmptyStringAllowed(false); + nextField.setErrorMessage("A library path is required to use libraries!"); + addField(nextField); + // Checkbox example setup! addField( new BooleanFieldEditor( PreferenceConstants.PROCESSING_AUTO_INDENT, @@ -51,5 +66,5 @@ public class ProcessingPreferencesPage * Initializes the preference page. Nothing to do here, but it has to be subclassed. */ public void init(IWorkbench workbench) {} - + } \ No newline at end of file