Updated preference page. Added markers and a builder to the manifest.

This commit is contained in:
lonnen
2010-07-08 17:53:50 +00:00
parent 92d4fecb4f
commit 37b2bb298d
7 changed files with 49 additions and 21 deletions
@@ -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
+27 -16
View File
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<extension point="org.eclipse.ui.editors">
<editor
class="org.processing.editor.ProcessingEditor"
default="true"
@@ -12,26 +11,23 @@
name="Processing Sketch Editor">
</editor>
</extension>
<extension
<extension point="org.eclipse.core.filebuffers.documentSetup"
id="ProcessingDocumentSetupParticipant"
name="Processing Document Setup Participant"
point="org.eclipse.core.filebuffers.documentSetup">
name="Processing Document Setup Participant">
<participant
class="org.processing.editor.ProcessingDocumentSetupParticipant"
extensions="pde">
</participant>
</extension>
<extension
point="org.eclipse.core.filebuffers.annotationModelCreation">
<extension point="org.eclipse.core.filebuffers.annotationModelCreation">
<factory
extensions="*"
class="org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory">
</factory>
</extension>
<extension
<extension point="org.eclipse.ui.editorActions"
id="Processing.EditorSpecificActions"
name="Processing Buttons"
point="org.eclipse.ui.editorActions">
name="Processing Buttons">
<editorContribution
id="org.processing.actions.ToolbarButtons"
targetID="org.processing.editor.ProcessingEditor">
@@ -45,18 +41,33 @@
</action>
</editorContribution>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<extension point="org.eclipse.ui.preferencePages">
<page
class="org.processing.preferences.ProcessingPreferencesPage"
id="org.processing.preferences.ProcessingPreferencesPage"
name="Processing">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.processing.preferences.PreferenceInitializer">
<extension point="org.eclipse.core.runtime.preferences">
<initializer class="org.processing.preferences.PreferenceInitializer">
</initializer>
</extension>
<extension
id="auditmarker"
name="Processing Audit Marker"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker"/>
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="true"/>
</extension>
<extension
id=""
point="org.eclipse.core.resources.builders">
<builder
hasNature="true">
<run
class="org.processing.builder.ProcessingSketchAuditor">
</run>
</builder>
</extension>
</plugin>
@@ -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
@@ -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) {}
}