Added top-level "Editors" preference page.
diff --git a/com.google.eclipse.protobuf.ui/OSGI-INF/l10n/bundle.properties b/com.google.eclipse.protobuf.ui/OSGI-INF/l10n/bundle.properties
index c481882..92ec2f9 100644
--- a/com.google.eclipse.protobuf.ui/OSGI-INF/l10n/bundle.properties
+++ b/com.google.eclipse.protobuf.ui/OSGI-INF/l10n/bundle.properties
@@ -7,6 +7,7 @@
page.name.1 = Templates
page.name.2 = Compiler
page.name.3 = Import Paths
+page.name.4 = Editor
keyword.label = Protocol Buffer
command.description = Trigger expensive validation
command.name = Validate
diff --git a/com.google.eclipse.protobuf.ui/plugin.xml b/com.google.eclipse.protobuf.ui/plugin.xml
index 923ba9f..57344bd 100644
--- a/com.google.eclipse.protobuf.ui/plugin.xml
+++ b/com.google.eclipse.protobuf.ui/plugin.xml
@@ -52,7 +52,7 @@
id="com.google.eclipse.protobuf.Protobuf" name="%page.name">
<keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" />
</page>
- <page category="com.google.eclipse.protobuf.Protobuf"
+ <page category="com.google.eclipse.protobuf.ui.preferences.pages.editor"
class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
id="com.google.eclipse.protobuf.Protobuf.coloring" name="%page.name.0">
<keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" />
@@ -67,6 +67,12 @@
id="com.google.eclipse.protobuf.ui.preferences.pages.compiler.CompilerPreferencePage" name="%page.name.2">
<keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" />
</page>
+ <page category="com.google.eclipse.protobuf.Protobuf"
+ class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.pages.editor.EditorPreferencePage"
+ id="com.google.eclipse.protobuf.ui.preferences.pages.editor"
+ name="%page.name.4">
+ <keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" />
+ </page>
</extension>
<extension point="org.eclipse.ui.keywords">
<keyword id="com.google.eclipse.protobuf.ui.keyword_Protobuf" label="%keyword.label" />
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/EditorPreferencePage.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/EditorPreferencePage.java
new file mode 100644
index 0000000..9a94b41
--- /dev/null
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/EditorPreferencePage.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.protobuf.ui.preferences.pages.editor;
+
+import static com.google.eclipse.protobuf.ui.preferences.pages.editor.Messages.header;
+import static org.eclipse.ui.dialogs.PreferencesUtil.createPreferenceDialogOn;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.*;
+
+/**
+ * General editor preferences.
+ *
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+public class EditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ @Override protected Control createContents(Composite parent) {
+ Composite contents = new Composite(parent, NONE);
+ contents.setLayout(new GridLayout(1, false));
+
+ Link link = new Link(contents, SWT.NONE);
+ GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+ gridData.widthHint= 150; // only expand further if anyone else requires it
+ link.setLayoutData(gridData);
+ link.setText(header);
+ link.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ String u = event.text;
+ createPreferenceDialogOn(getShell(), u, null, null);
+ }
+ });
+ return contents;
+ }
+
+ public void init(IWorkbench workbench) {}
+}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/Messages.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/Messages.java
new file mode 100644
index 0000000..20342ec
--- /dev/null
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/Messages.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.protobuf.ui.preferences.pages.editor;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+public class Messages extends NLS {
+
+ public static String header;
+
+ static {
+ // initialize resource bundle
+ Class<Messages> clazz = Messages.class;
+ NLS.initializeMessages(clazz.getName(), clazz);
+ }
+
+ private Messages() {}
+}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/Messages.properties b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/Messages.properties
new file mode 100644
index 0000000..0cdf619
--- /dev/null
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/pages/editor/Messages.properties
@@ -0,0 +1 @@
+header=Protocol Buffer Editor Preferences. General preferences may be set via <a href="org.eclipse.ui.preferencePages.GeneralTextEditor">Text Editors</a>.