From 37b2bb298d488c1c1860d4074aee4e9c5736be85 Mon Sep 17 00:00:00 2001 From: lonnen Date: Thu, 8 Jul 2010 17:53:50 +0000 Subject: [PATCH] Updated preference page. Added markers and a builder to the manifest. --- .../META-INF/MANIFEST.MF | 3 +- .../preferences/PreferenceConstants.class | Bin 0 -> 560 bytes .../preferences/PreferenceInitializer.class | Bin 0 -> 910 bytes .../ProcessingPreferencesPage.class | Bin 0 -> 1986 bytes editor/org.processing.editor/plugin.xml | 43 +++++++++++------- .../preferences/PreferenceConstants.java | 3 +- .../ProcessingPreferencesPage.java | 21 +++++++-- 7 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 editor/org.processing.editor/bin/org/processing/preferences/PreferenceConstants.class create mode 100644 editor/org.processing.editor/bin/org/processing/preferences/PreferenceInitializer.class create mode 100644 editor/org.processing.editor/bin/org/processing/preferences/ProcessingPreferencesPage.class 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 0000000000000000000000000000000000000000..84f366997b1b63e23d92765836fe9e46ad2961d3 GIT binary patch literal 560 zcmb7>OHTqZ6opTD%R?RlBCg!2i@~_nm;j;@2tycTOUh8CIL?qxG4W@)GI8M#@JAW% z5L6a!+??F6IX(CG_T%&I9l$B};|MVrp1Q9slxGXymu^ssJE4S2T7LJj%E z5y4A5n>!<}WWejgh@MHG;iUV&Ez%B>mbX;4xROD3<&RAp!QyZL8j-#$j6FmVBZ?D+ zkRVQOaEdsy!Q14dk3ycbKsRbD2BOEW*m+q+lt_cXK+B}*RUO4HDnyI|gGSXaRg12JB zZNUTZP>3_O+n5M(k)@eA<2m2C{oj9l{RUtUcO29N9wd6|pXwx}G*z)Z(u6d{Z2Jf2 z=lxh2B_s8ow1bAgQ|m=xq)t=v!$gy>v)HH;`o;grC^cG!=C>Syg-439j|J+zokM}f zvt&#z>bT&ci3Nd`K*jVrI~kFFBS#Slw1Xs+(V^7J+T~@#yj7{dUhuz_36>SGCfqQdk8Y`1%?$24MK9=$7yMMfkqVOww2Jm}0Yp4cu^W zUEqFox_^B~o%AEgk{TM#${HNmAve<^eLruPUMeeu z?yR_qH2XFtZh;lW3I}R@VkPnFu;ueEcyI20!s3Vgx67;j4J`2oc*O(WFR~@DeD3^; zku|<+ea6a1Tng^CuQtBmS{*acavrtCvDSHb+c~gPIF&#LE@yX}!2(+ht6}>mC@}ga literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..486f6bbbabbf8eb19d236657a32f18a344537842 GIT binary patch literal 1986 zcmb7FT~`}L7=8vK3F%ts+M*V%Lv0}mnB}9T73fDGP(#xi4dSUcp3Uw+rYt*gcO&w% zyh%Ow9Iw3cM|pfFo03h6{kUM*d1v0|{dk^t^3T72{smweKcq3ja7zV;Rx41B2t(=X zPjMgu;nUu#otbNWYt23sX`~odwWn}A*$RdA{J?fZ!r9u9!gIG>8L6P}9Q%$j%q4x> z(yIKZf};jSZ4O>$7~7D(jP5gx=JNXtsV(J-EJks`KpF-aa+Umk78fy@#stH{P&uNT zL86jgN?!X=`UWn+WXK+hs4Ncbwihuh=JM6|!C2R^FB`amDF%~}`UTXfcEPaJL;T-X zRfb#$lHn5rpW-S(hUY*o=ejw*J7Ru6gU=XBeMWh$+XCK?9rB#7q9%!eH%S3phP)jL zcY%jO@Ll^?yR4kNPVJh3FTfctQfg%pI)Q9OQuz#5a@FT_&+=>%QauU?YF(2yQI)=U z+CFZGV9#!N)DyF+9NXKs1F82tV~T=@q^sfnxBB8s5Sd6^%W9oKoj}-;NGLB%V~z+& zitRO_mSrFuV(K*EmqDK4LU<%1r}=Zsj+zQ#Xec5S~QViFE05Xl<$EmI`Ggi1k@4X;m*X?4Hxf*Lyo4g7ZQ3Y|P@8f!kQ6 z3W%}o<5qMUlT-3Mbs}6nL_cYT+@<;1YYKi|ojh!+w&(hD5pM`CG{}sGUNf++#W10v zgFppO=pi9KbX)EjxQ_=68QXQcZJ|!RMY)OYk#sUBF&Lg~1a@%RBVvnYBO&8ze8_9W z(pm=FR6>dOJh-M#>o^dRZlg1+k>x}~0RLT>!pU5nO3d7aj^cCYL zrf9b#Rg}IM&JkS1`jivtg6cjCrR zUcILb(*uzP@6zK}SM9)|q0wV`t>4(8@ha-U#te}2gOjW1Nm zrJvU(CMm`utxJ^CGN!QtPD8VZRa)u?)x+>D-HUs5nz29f2Tmj2cets9locPQ4sC8_aBv}DZ~H( literal 0 HcmV?d00001 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