Author: akazakov
Date: 2009-12-21 16:17:38 -0500 (Mon, 21 Dec 2009)
New Revision: 19504
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidatorConfigurationBlock.java
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2009-12-21 18:10:08
UTC (rev 19503)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2009-12-21 21:17:38
UTC (rev 19504)
@@ -16,14 +16,17 @@
org.eclipse.wst.common.frameworks,
org.jboss.tools.jst.web.kb,
org.jboss.tools.common.el.core,
- org.eclipse.jface.text
+ org.eclipse.jface.text,
+ org.eclipse.equinox.preferences
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: JBoss by Red Hat
Export-Package: org.jboss.tools.cdi.core,
+ org.jboss.tools.cdi.core.preferences,
org.jboss.tools.cdi.internal.core.el,
org.jboss.tools.cdi.internal.core.impl,
org.jboss.tools.cdi.internal.core.impl.definition,
org.jboss.tools.cdi.internal.core.project.facet,
org.jboss.tools.cdi.internal.core.scanner,
- org.jboss.tools.cdi.internal.core.scanner.lib
+ org.jboss.tools.cdi.internal.core.scanner.lib,
+ org.jboss.tools.cdi.internal.core.validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-12-21 18:10:08 UTC (rev
19503)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2009-12-21 21:17:38 UTC (rev
19504)
@@ -91,4 +91,8 @@
resolver-class="org.jboss.tools.cdi.internal.core.el.CdiElResolver"/>
</el-resolver>
</extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer
class="org.jboss.tools.cdi.core.preferences.CDIPreferenceInitializer"/>
+ </extension>
</plugin>
\ No newline at end of file
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences defaultPreferences = ((IScopeContext) new
DefaultScope()).getNode(CDICorePlugin.PLUGIN_ID);
+ for (String name : CDIPreferences.SEVERITY_OPTION_NAMES) {
+ defaultPreferences.put(name, SeverityPreferences.ERROR);
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.preferences;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIPreferences extends SeverityPreferences {
+
+ public static final Set<String> SEVERITY_OPTION_NAMES = new
HashSet<String>();
+
+ private static CDIPreferences INSTANCE = new CDIPreferences();
+
+ // Test group
+
+ // Test
+ public static final String TEST = INSTANCE.createSeverityOption("testKey");
//$NON-NLS-1$
+
+ /**
+ * @return the only instance of CDIPreferences
+ */
+ public static CDIPreferences getInstance() {
+ return INSTANCE;
+ }
+
+ private CDIPreferences() {
+ }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.common.preferences.SeverityPreferences#createSeverityOption(java.lang.String)
+ */
+ @Override
+ protected String createSeverityOption(String shortName) {
+ String name = getPluginId() + ".validator.problem." + shortName;
//$NON-NLS-1$
+ SEVERITY_OPTION_NAMES.add(name);
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.preferences.SeverityPreferences#getPluginId()
+ */
+ @Override
+ protected String getPluginId() {
+ return CDICorePlugin.PLUGIN_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.preferences.SeverityPreferences#getSeverityOptionNames()
+ */
+ @Override
+ protected Set<String> getSeverityOptionNames() {
+ return SEVERITY_OPTION_NAMES;
+ }
+
+ public static boolean shouldValidateCore(IProject project) {
+ return true;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.internal.core.validation;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIValidationMessages {
+
+ private static final String BUNDLE_NAME =
"org.jboss.tools.cdi.internal.core.validation.messages"; //$NON-NLS-1$
+
+ public static String testKey;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, CDIValidationMessages.class);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1 @@
+testKey=Test Key
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2009-12-21 18:10:08 UTC
(rev 19503)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2009-12-21 21:17:38 UTC
(rev 19504)
@@ -3,5 +3,8 @@
ConfigureMenu_AddCDISupport=Add CDI support...
ConfigureMenu_RemoveCDISupport=Remove CDI support...
+PreferencePage_Validator=Validator
+PreferencePage_CDI=CDI
+
Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = Context and Dependency Injection UI
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2009-12-21 18:10:08 UTC (rev
19503)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2009-12-21 21:17:38 UTC (rev
19504)
@@ -16,6 +16,21 @@
</page>
</extension>
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.jboss.tools.common.model.ui.cdi"
+ class="org.jboss.tools.cdi.ui.preferences.CDIValidatorPreferencePage"
+ id="org.jboss.tools.cdi.ui.preferences.CDIValidatorPreferencePage"
+ name="%PreferencePage_Validator">
+ </page>
+ <page
+ category="org.jboss.tools.common.model.ui"
+ class="org.jboss.tools.cdi.ui.preferences.CDIPreferencePage"
+ id="org.jboss.tools.common.model.ui.cdi"
+ name="%PreferencePage_CDI">
+ </page>
+ </extension>
+
<extension
point="org.eclipse.ui.popupMenus">
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIConfigurationBlock extends SeverityConfigurationBlock {
+
+ private static final String SETTINGS_SECTION_NAME =
"CDIValidatorConfigurationBlock";
+
+ private static SectionDescription SECTION_TEST = new SectionDescription(
+ CDIPreferencesMessages.CDIValidatorConfigurationBlock_section_test,
+ new String[][]{
+ {CDIPreferences.TEST,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_test_label}
+ },
+ CDICorePlugin.PLUGIN_ID
+ );
+
+ private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ SECTION_TEST
+ };
+
+ private static Key[] getKeys() {
+ ArrayList<Key> keys = new ArrayList<Key>();
+ for (int i = 0; i < ALL_SECTIONS.length; i++) {
+ for (int j = 0; j < ALL_SECTIONS[i].options.length; j++) {
+ keys.add(ALL_SECTIONS[i].options[j].key);
+ }
+ }
+ return keys.toArray(new Key[0]);
+ }
+
+ public CDIConfigurationBlock(IStatusChangeListener context,
+ IProject project, IWorkbenchPreferenceContainer container) {
+ super(context, project, getKeys(), container);
+ }
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return ALL_SECTIONS;
+ }
+
+ @Override
+ protected String getCommonDescription() {
+ return CDIPreferencesMessages.CDIValidatorConfigurationBlock_common_description;
+ }
+
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return
CDICorePlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
{
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite root = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout(1, false);
+ root.setLayout(gl);
+
+ return root;
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -21,6 +21,19 @@
public static String CDI_SETTINGS_PREFERENCE_PAGE_CDI_SUPPORT;
+ // Validator Preference page
+ public static String CDIValidatorConfigurationBlock_common_description;
+
+ public static String CDIValidatorConfigurationBlock_needsbuild_title;
+ public static String CDIValidatorConfigurationBlock_needsfullbuild_message;
+ public static String CDIValidatorConfigurationBlock_needsprojectbuild_message;
+
+ // Section Test
+ public static String CDIValidatorConfigurationBlock_section_test;
+ public static String CDIValidatorConfigurationBlock_pb_test_label;
+
+ public static String CDI_VALIDATOR_PREFERENCE_PAGE_CDI_VALIDATOR;
+
static {
NLS.initializeMessages(BUNDLE_NAME, CDIPreferencesMessages.class);
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2009-12-21
21:17:38 UTC (rev 19504)
@@ -9,4 +9,16 @@
### Red Hat, Inc. - initial API and implementation
##################################################################################
-CDI_SETTINGS_PREFERENCE_PAGE_CDI_SUPPORT=CDI support\:
\ No newline at end of file
+CDI_SETTINGS_PREFERENCE_PAGE_CDI_SUPPORT=CDI support\:
+
+CDIValidatorConfigurationBlock_common_description=Select the severity level for the
following optional CDI Validator problems:
+
+CDIValidatorConfigurationBlock_needsbuild_title=CDI Validator Settings Changed
+CDIValidatorConfigurationBlock_needsfullbuild_message=The CDI Validator settings have
changed. A full rebuild is required for changes to take effect. Do the full build now?
+CDIValidatorConfigurationBlock_needsprojectbuild_message=The CDI Validator settings have
changed. A rebuild of the project is required for changes to take effect. Build the
project now?
+
+##Section Test
+CDIValidatorConfigurationBlock_section_test=Test
+CDIValidatorConfigurationBlock_pb_test_label=Test:
+
+CDI_VALIDATOR_PREFERENCE_PAGE_CDI_VALIDATOR=CDI Validator
\ No newline at end of file
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.preferences;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIValidatorPreferencePage extends SeverityPreferencePage {
+
+ public static final String PREF_ID =
"org.jboss.tools.cdi.ui.preferences.CDIValidatorPreferencePage"; //$NON-NLS-1$
+ public static final String PROP_ID =
"org.jboss.tools.cdi.ui.propertyPages.CDIValidatorPreferencePage";
//$NON-NLS-1$
+
+ public CDIValidatorPreferencePage() {
+ setPreferenceStore(CDICorePlugin.getDefault().getPreferenceStore());
+ setTitle(CDIPreferencesMessages.CDI_VALIDATOR_PREFERENCE_PAGE_CDI_VALIDATOR);
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageID()
+ */
+ @Override
+ protected String getPreferencePageID() {
+ return PREF_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageID()
+ */
+ @Override
+ protected String getPropertyPageID() {
+ return PROP_ID;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer)
getContainer();
+ fConfigurationBlock = new CDIConfigurationBlock(getNewStatusChangedListener(),
getProject(), container);
+
+ super.createControl(parent);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIValidatorPreferencePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2009-12-21
18:10:08 UTC (rev 19503)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2009-12-21
21:17:38 UTC (rev 19504)
@@ -11,7 +11,8 @@
org.eclipse.jdt.ui,
org.eclipse.core.resources,
org.eclipse.ui.ide,
- org.eclipse.jst.j2ee.ui
+ org.eclipse.jst.j2ee.ui,
+ org.eclipse.ui.forms
Export-Package: org.jboss.tools.common.ui,
org.jboss.tools.common.ui.preferences,
org.jboss.tools.common.ui.widget.editor,
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -15,8 +15,10 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock;
+import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontMetrics;
@@ -25,6 +27,8 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.preferences.SeverityPreferences;
@@ -57,14 +61,69 @@
protected static final String ENABLED = JavaCore.ENABLED;
protected static final String DISABLED = JavaCore.DISABLED;
- protected abstract Composite createStyleTabContent(Composite folder);
+ protected String[] errorWarningIgnore = new String[] {ERROR, WARNING, IGNORE};
+ protected String[] enableDisableValues= new String[] {ENABLED, DISABLED};
+ protected String[] errorWarningIgnoreLabels = new String[] {
+ SeverityPreferencesMessages.VALIDATOR_CONFIGURATION_BLOCK_ERROR,
+ SeverityPreferencesMessages.VALIDATOR_CONFIGURATION_BLOCK_WARNING,
+ SeverityPreferencesMessages.VALIDATOR_CONFIGURATION_BLOCK_IGNORE
+ };
+
public SeverityConfigurationBlock(IStatusChangeListener context,
IProject project, Key[] allKeys,
IWorkbenchPreferenceContainer container) {
super(context, project, allKeys, container);
}
+ protected abstract String getCommonDescription();
+
+ protected abstract SectionDescription[] getAllSections();
+
+ protected abstract IDialogSettings getDialogSettings();
+
+ protected Composite createStyleTabContent(Composite folder) {
+ int nColumns = 3;
+
+ final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
+
+ Composite composite = sc1.getBody();
+ GridLayout layout= new GridLayout(nColumns, false);
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ composite.setLayout(layout);
+
+ Label description= new Label(composite, SWT.LEFT | SWT.WRAP);
+ description.setFont(description.getFont());
+ description.setText(getCommonDescription());
+ description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true,
false, nColumns - 1, 1));
+
+ int defaultIndent = 0;
+
+ SectionDescription[] sections = getAllSections();
+ for (int i = 0; i < sections.length; i++) {
+ SectionDescription section = sections[i];
+ String label = section.label;
+ ExpandableComposite excomposite = createStyleSection(composite, label, nColumns);
+
+ Composite inner = new Composite(excomposite, SWT.NONE);
+ inner.setFont(composite.getFont());
+ inner.setLayout(new GridLayout(nColumns, false));
+ excomposite.setClient(inner);
+
+ for (int j = 0; j < section.options.length; j++) {
+ OptionDescription option = section.options[j];
+ label = option.label;
+ addComboBox(inner, label, option.key, errorWarningIgnore, errorWarningIgnoreLabels,
defaultIndent);
+ }
+ }
+
+ IDialogSettings section = getDialogSettings();
+ restoreSectionExpansionStates(section);
+
+ return sc1;
+ }
+
@Override
protected Control createContents(Composite parent) {
setShell(parent.getShell());
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidatorConfigurationBlock.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidatorConfigurationBlock.java 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidatorConfigurationBlock.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -29,7 +29,6 @@
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock;
-import org.jboss.tools.common.ui.preferences.SeverityPreferencesMessages;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
@@ -81,15 +80,6 @@
@Override
protected Composite createStyleTabContent(Composite folder) {
- String[] errorWarningIgnore = new String[] {ERROR, WARNING, IGNORE};
- String[] enableDisableValues= new String[] {ENABLED, DISABLED};
-
- String[] errorWarningIgnoreLabels = new String[] {
- SeverityPreferencesMessages.VALIDATOR_CONFIGURATION_BLOCK_ERROR,
- SeverityPreferencesMessages.VALIDATOR_CONFIGURATION_BLOCK_WARNING,
- SeverityPreferencesMessages.VALIDATOR_CONFIGURATION_BLOCK_IGNORE
- };
-
int nColumns = 3;
final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
@@ -102,7 +92,7 @@
Label description= new Label(composite, SWT.LEFT | SWT.WRAP);
description.setFont(description.getFont());
- description.setText(JSFSeverityPreferencesMessages.JSFValidatorConfigurationBlock_common_description);
+ description.setText(getCommonDescription());
description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true,
false, nColumns - 1, 1));
int defaultIndent = 0;
@@ -153,8 +143,7 @@
}
}
- IDialogSettings section =
JSFModelPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
- restoreSectionExpansionStates(section);
+ restoreSectionExpansionStates(getDialogSettings());
updateELCombox();
@@ -172,4 +161,19 @@
recognizeVarsCheckBox.setEnabled(enable);
revalidateUnresolvedElCheckBox.setEnabled(enable);
}
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return ALL_SECTIONS;
+ }
+
+ @Override
+ protected String getCommonDescription() {
+ return
JSFSeverityPreferencesMessages.JSFValidatorConfigurationBlock_common_description;
+ }
+
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return
JSFModelPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2009-12-21 18:10:08
UTC (rev 19503)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2009-12-21 21:17:38
UTC (rev 19504)
@@ -6,7 +6,6 @@
Bundle-Activator: org.jboss.tools.seam.ui.SeamGuiPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.ui.forms,
org.eclipse.ui.navigator,
org.eclipse.ui.navigator.resources,
org.eclipse.jst.servlet.ui,
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -85,14 +85,8 @@
public static String SEAM_SETTINGS_PREFERENCE_PAGE_TEST_PACKAGE_HAS_WARNING;
- public static String SEAM_VALIDATOR_CONFIGURATION_BLOCK_ERROR;
-
- public static String SEAM_VALIDATOR_CONFIGURATION_BLOCK_IGNORE;
-
public static String
SEAM_VALIDATOR_CONFIGURATION_BLOCK_SEAM_VALIDATOR_CONFIGURATION_BLOCK;
- public static String SEAM_VALIDATOR_CONFIGURATION_BLOCK_WARNING;
-
public static String SEAM_VALIDATOR_PREFERENCE_PAGE_SEAM_VALIDATOR;
public static String SEAM_SETTINGS_PREFERENCE_PAGE_CREATE_TEST;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2009-12-21
21:17:38 UTC (rev 19504)
@@ -60,11 +60,8 @@
SeamValidatorConfigurationBlock_pb_invalidXMLVersion_label=Invalid components.xml
version:
SEAM_VALIDATOR_CONFIGURATION_BLOCK_SEAM_VALIDATOR_CONFIGURATION_BLOCK=SeamValidatorConfigurationBlock
-SEAM_VALIDATOR_CONFIGURATION_BLOCK_ERROR=Error
-SEAM_VALIDATOR_CONFIGURATION_BLOCK_WARNING=Warning
SEAM_VALIDATOR_PREFERENCE_PAGE_SEAM_VALIDATOR=Seam Validator
-SEAM_VALIDATOR_CONFIGURATION_BLOCK_IGNORE=Ignore
SEAM_SETTINGS_PREFERENCES_PAGE_SEAM_PROJECT=Main Seam Project:
SEAM_SETTINGS_PREFERENCES_PAGE_EJB_PROJECT=Seam EJB Project:
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -14,23 +14,15 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
/**
- * Find in SeamPreferences the instruction to Framework for Severity preferences
+ * Find the Severity Framework instruction in SeamPreferences
* To modify section descriptions:
* 1) If new option is to be added to existing description,
* add array of two String objects, where first is the preference name
@@ -133,13 +125,6 @@
SECTION_SETTINGS
};
- private static final String ERROR = SeamPreferences.ERROR;
- private static final String WARNING = SeamPreferences.WARNING;
- private static final String IGNORE = SeamPreferences.IGNORE;
-
- private static final String ENABLED= JavaCore.ENABLED;
- private static final String DISABLED= JavaCore.DISABLED;
-
//private PixelConverter fPixelConverter;
private static Key[] getKeys() {
@@ -159,52 +144,17 @@
}
@Override
- protected Composite createStyleTabContent(Composite folder) {
- String[] errorWarningIgnore = new String[] {ERROR, WARNING, IGNORE};
+ protected SectionDescription[] getAllSections() {
+ return ALL_SECTIONS;
+ }
- String[] errorWarningIgnoreLabels = new String[] {
- SeamPreferencesMessages.SEAM_VALIDATOR_CONFIGURATION_BLOCK_ERROR,
- SeamPreferencesMessages.SEAM_VALIDATOR_CONFIGURATION_BLOCK_WARNING,
- SeamPreferencesMessages.SEAM_VALIDATOR_CONFIGURATION_BLOCK_IGNORE
- };
+ @Override
+ protected String getCommonDescription() {
+ return SeamPreferencesMessages.SeamValidatorConfigurationBlock_common_description;
+ }
- int nColumns = 3;
-
- final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
-
- Composite composite = sc1.getBody();
- GridLayout layout= new GridLayout(nColumns, false);
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
-
- Label description= new Label(composite, SWT.LEFT | SWT.WRAP);
- description.setFont(description.getFont());
- description.setText(SeamPreferencesMessages.SeamValidatorConfigurationBlock_common_description);
- description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true,
false, nColumns - 1, 1));
-
- int defaultIndent = 0;
-
- for (int i = 0; i < ALL_SECTIONS.length; i++) {
- SectionDescription section = ALL_SECTIONS[i];
- String label = section.label;
- ExpandableComposite excomposite = createStyleSection(composite, label, nColumns);
-
- Composite inner = new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
-
- for (int j = 0; j < section.options.length; j++) {
- OptionDescription option = section.options[j];
- label = option.label;
- addComboBox(inner, label, option.key, errorWarningIgnore, errorWarningIgnoreLabels,
defaultIndent);
- }
- }
-
- IDialogSettings section =
SeamCorePlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
- restoreSectionExpansionStates(section);
-
- return sc1;
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return
SeamCorePlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
}
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java 2009-12-21
18:10:08 UTC (rev 19503)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java 2009-12-21
21:17:38 UTC (rev 19504)
@@ -11,7 +11,6 @@
package org.jboss.tools.seam.ui.preferences;
-import org.eclipse.core.resources.IProject;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
@@ -40,11 +39,6 @@
}
@Override
- protected boolean hasProjectSpecificOptions(IProject project) {
- return fConfigurationBlock.hasProjectSpecificOptions(project);
- }
-
- @Override
public void createControl(Composite parent) {
IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer)
getContainer();
fConfigurationBlock = new
SeamValidatorConfigurationBlock(getNewStatusChangedListener(), getProject(), container);