Fixed: [ Issue 70 ] Validation doesn't start until editing https://code.google.com/p/protobuf-dt/issues/detail?id=70 Working on preference page for validation options.
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 dbc0008..c481882 100644 --- a/com.google.eclipse.protobuf.ui/OSGI-INF/l10n/bundle.properties +++ b/com.google.eclipse.protobuf.ui/OSGI-INF/l10n/bundle.properties
@@ -6,7 +6,7 @@ page.name.0 = Syntax Coloring page.name.1 = Templates page.name.2 = Compiler -page.name.3 = Paths +page.name.3 = Import Paths 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 da63f1b..7f6628a 100644 --- a/com.google.eclipse.protobuf.ui/plugin.xml +++ b/com.google.eclipse.protobuf.ui/plugin.xml
@@ -48,7 +48,7 @@ </extension> <extension point="org.eclipse.ui.preferencePages"> <page - class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.RootPreferencePage" + class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.general.GeneralSettingsPreferencePage" id="com.google.eclipse.protobuf.Protobuf" name="%page.name"> <keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" /> </page> @@ -161,7 +161,7 @@ </extension> <extension point="org.eclipse.ui.propertyPages"> <page - class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.RootPreferencePage" + class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.general.GeneralSettingsPreferencePage" id="com.google.eclipse.protobuf.Protobuf" name="%page.name" selectionFilter="single"> </page>
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/RootPreferencePage.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/RootPreferencePage.java deleted file mode 100644 index af1538a..0000000 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/RootPreferencePage.java +++ /dev/null
@@ -1,44 +0,0 @@ -/* - * 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; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.*; - -/** - * @author alruiz@google.com (Alex Ruiz) - */ -public class RootPreferencePage extends PreferenceAndPropertyPage { - - private static final String PREFERENCE_PAGE_ID = RootPreferencePage.class.getName(); - - /** {@inheritDoc} */ - @Override protected Control createContents(Composite parent) { - // generated by WindowBuilder - Composite contents = super.contentsComposite(parent); - Label label = new Label(contents, SWT.NONE); - label.setText("General Settings."); - return contents; - } - - /** {@inheritDoc} */ - @Override protected void onProjectSettingsActivation(boolean active) {} - - /** {@inheritDoc} */ - @Override protected String preferencePageId() { - return PREFERENCE_PAGE_ID; - } - - /** {@inheritDoc} */ - @Override protected void savePreferences(IPreferenceStore store) {} - - /** {@inheritDoc} */ - @Override protected void performDefaults(IPreferenceStore store) {} -}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/general/GeneralSettingsPreferencePage.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/general/GeneralSettingsPreferencePage.java new file mode 100644 index 0000000..e95946e --- /dev/null +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/general/GeneralSettingsPreferencePage.java
@@ -0,0 +1,58 @@ +/* + * 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.general; + +import com.google.eclipse.protobuf.ui.preferences.PreferenceAndPropertyPage; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.*; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; + +/** + * @author alruiz@google.com (Alex Ruiz) + */ +public class GeneralSettingsPreferencePage extends PreferenceAndPropertyPage { + public GeneralSettingsPreferencePage() { + } + + private static final String PREFERENCE_PAGE_ID = GeneralSettingsPreferencePage.class.getName(); + + /** {@inheritDoc} */ + @Override protected Control createContents(Composite parent) { + // generated by WindowBuilder + Composite contents = super.contentsComposite(parent); + GridLayout gridLayout = (GridLayout) contents.getLayout(); + gridLayout.numColumns = 2; + + Group grpValidation = new Group(contents, SWT.NONE); + grpValidation.setLayout(new GridLayout(1, false)); + grpValidation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); + grpValidation.setText("Content Validation"); + + Button btnValidateOnActivation = new Button(grpValidation, SWT.CHECK); + btnValidateOnActivation.setText("Validate files when activated"); + return contents; + } + + /** {@inheritDoc} */ + @Override protected void onProjectSettingsActivation(boolean active) {} + + /** {@inheritDoc} */ + @Override protected String preferencePageId() { + return PREFERENCE_PAGE_ID; + } + + /** {@inheritDoc} */ + @Override protected void savePreferences(IPreferenceStore store) {} + + /** {@inheritDoc} */ + @Override protected void performDefaults(IPreferenceStore store) {} +}