Author: scabanovich
Date: 2011-08-03 17:11:53 -0400 (Wed, 03 Aug 2011)
New Revision: 33559
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilderMarker.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSettingsPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java
Log:
JBIDE-9120
https://issues.jboss.org/browse/JBIDE-9120
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2011-08-03 20:50:48 UTC (rev
33558)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2011-08-03 21:11:53 UTC (rev
33559)
@@ -306,6 +306,17 @@
</adapt>
</enabledWhen>
</page>
+ <page
+ name="%PreferencePage_KBValidator"
+
class="org.jboss.tools.jst.web.kb.preferences.KBValidationPreferencePage"
+
id="org.jboss.tools.jst.web.kb.propertyPages.KBValidationPreferencePage"
+
category="org.jboss.tools.jst.web.kb.propertyPages.KBSettingsPreferencePage">
+ <enabledWhen>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.jdt.core.javanature"/>
+ </adapt>
+ </enabledWhen>
+ </page>
</extension>
<extension point="org.eclipse.ui.preferencePages">
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -42,6 +42,4 @@
public static String ILLEGAL_CONTENTTYPE;
public static String EXCEPTION_DURING_CREATING_MARKER;
-
- public static String KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT;
-}
\ No newline at end of file
+ }
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilderMarker.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilderMarker.java 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilderMarker.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -4,11 +4,14 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.jst.web.kb.KbMessages;
import org.jboss.tools.jst.web.kb.KbProjectFactory;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.preferences.KBSeverityPreferences;
public class KbBuilderMarker {
@@ -44,8 +47,15 @@
}
public static IMarker createOrUpdateKbProblemMarker(IMarker m, IResource r, String
message, int kind) throws CoreException {
- String location = MessageFormat.format(KbMessages.KBPROBLEM_LOCATION, new Object[]
{r.getProject().getName()});
+ String preferenceValue = getPreference(r.getProject(), kind);
+ if(SeverityPreferences.IGNORE.equals(preferenceValue)) {
+ if(m != null) {
+ m.delete();
+ }
+ return null;
+ }
+
if (m == null) {
m = r.createMarker(KB_BUILDER_PROBLEM_MARKER_TYPE);
m.setAttribute(KbBuilderMarker.ATTR_KIND,
KbBuilderMarker.KIND_KB_NATURE_OR_BUILDER_MISSING);
@@ -54,13 +64,32 @@
KbProjectFactory.getKbProject(r.getProject(), true);
}
}
+
+ int severity = IMarker.SEVERITY_WARNING;
+ if(SeverityPreferences.ERROR.equals(preferenceValue)) {
+ severity = IMarker.SEVERITY_ERROR;
+ }
+ String location = MessageFormat.format(KbMessages.KBPROBLEM_LOCATION, new Object[]
{r.getProject().getName()});
+
m.setAttribute(ATTR_KIND, kind);
m.setAttribute(IMarker.LOCATION, location);
m.setAttribute(IMarker.MESSAGE, message);
- m.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ m.setAttribute(IMarker.SEVERITY, severity);
m.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_NORMAL);
return m;
}
+ protected static String getPreference(IProject project, int kind) {
+ if(kind == KIND_KB_NATURE_OR_BUILDER_MISSING) {
+ return getPreference(project,
KBSeverityPreferences.REQUIRED_KB_CAPABILITIES_ARE_MISSING);
+ } else if(kind == KIND_DEPENDS_ON_NON_KB_POJECTS) {
+ return getPreference(project,
KBSeverityPreferences.KB_CAPABILITIES_ARE_NOT_ENABLED_IN_JAVA_MODULE);
+ }
+ return getPreference(project,
KBSeverityPreferences.REQUIRED_KB_CAPABILITIES_ARE_MISSING);
+ }
+
+ protected static String getPreference(IProject project, String preferenceKey) {
+ return KBSeverityPreferences.getInstance().getProjectPreference(project,
preferenceKey);
+ }
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/ELPreferenceInitializer.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -28,6 +28,8 @@
public void initializeDefaultPreferences() {
IEclipsePreferences defaultPreferences = ((IScopeContext) new
DefaultScope()).getNode(WebKbPlugin.PLUGIN_ID);
+
+ //EL Preferences
defaultPreferences.putBoolean(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
defaultPreferences.put(SeverityPreferences.WRONG_BUILDER_ORDER_PREFERENCE_NAME,
ELSeverityPreferences.ERROR);
for (String name : ELSeverityPreferences.SEVERITY_OPTION_NAMES) {
@@ -41,5 +43,9 @@
defaultPreferences.put(ELSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
ELSeverityPreferences.ENABLE);
defaultPreferences.putInt(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME,
SeverityPreferences.DEFAULT_MAX_NUMBER_OF_MARKERS_PER_FILE);
defaultPreferences.put(ELSeverityPreferences.NON_EXTERNALIZED_STRINGS,
ELSeverityPreferences.IGNORE);
+
+ //KB preferences
+ defaultPreferences.put(KBSeverityPreferences.REQUIRED_KB_CAPABILITIES_ARE_MISSING,
SeverityPreferences.WARNING);
+ defaultPreferences.put(KBSeverityPreferences.KB_CAPABILITIES_ARE_NOT_ENABLED_IN_JAVA_MODULE,
SeverityPreferences.WARNING);
}
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.java 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -22,6 +22,12 @@
public static String KB_DESCRIPTION;
public static String KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT;
+ public static String KB_VALIDATOR_PREFERENCE_PAGE_KB_VALIDATOR;
+
+ public static String KBValidationConfigurationBlock_common_description;
+ public static String KBValidationConfigurationBlock_section_config;
+ public static String
KBValidationConfigurationBlock_pb_requiredKbCapabilitiesAreMissing_label;
+ public static String
KBValidationConfigurationBlock_pb_kbCapabilitiesAreNotEnabledInJavaModule_label;
static {
NLS.initializeMessages(BUNDLE_NAME, KBPreferencesMessages.class);
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.properties 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBPreferencesMessages.properties 2011-08-03
21:11:53 UTC (rev 33559)
@@ -23,3 +23,13 @@
KB_VALIDATOR_PREFERENCE_PAGE_KB_VALIDATOR=KB Validator
+KBValidationConfigurationBlock_common_description=\
+Enabling Knowledge Base capabilities (nature and builder) on a project \n\
+is required for correct work of other JBoss Tools capabilities. \n\
+Since each Java archive is ready to provide JSF 2 resources, \n\
+it is recommended to enable Knowledge Base capabilities on any \n\
+Java project that is used as a module by another Web project.
+
+KBValidationConfigurationBlock_section_config=Configuration
+KBValidationConfigurationBlock_pb_requiredKbCapabilitiesAreMissing_label=Required
Capabilities are missing\:
+KBValidationConfigurationBlock_pb_kbCapabilitiesAreNotEnabledInJavaModule_label=Capabilities
are not enabled in Java module\:
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSettingsPreferencePage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSettingsPreferencePage.java 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSettingsPreferencePage.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -22,12 +22,11 @@
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.jboss.tools.common.ui.preferences.SettingsPage;
import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
import org.jboss.tools.jst.web.kb.IKbProject;
-import org.jboss.tools.jst.web.kb.KbMessages;
-import org.jboss.tools.jst.web.kb.KbProjectFactory;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
/**
@@ -68,6 +67,9 @@
GridLayout gridLayout = new GridLayout(1, false);
root.setLayout(gridLayout);
+ Label lable = new Label(root, 0);
+ lable.setText(KBPreferencesMessages.KB_DESCRIPTION);
+
Composite generalGroup = new Composite(root, SWT.NONE);
generalGroup.setLayoutData(gd);
gridLayout = new GridLayout(4, false);
@@ -76,7 +78,7 @@
initialState = isKBEnabled(project);
IFieldEditor kbSupportCheckBox = IFieldEditorFactory.INSTANCE.createCheckboxEditor(
- KbMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT,
KbMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT, initialState);
+ KBPreferencesMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT,
KBPreferencesMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT, initialState);
kbSupportCheckBox.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
Object value = evt.getNewValue();
@@ -99,7 +101,7 @@
*/
@Override
protected void performDefaults() {
- getEditor(KbMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT).setValue(isKBEnabled(project));
+ getEditor(KBPreferencesMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT).setValue(isKBEnabled(project));
validate();
}
@@ -145,7 +147,7 @@
public void setEnabledKBSuport(boolean enabled) {
kbEnabled = enabled;
- editorRegistry.get(KbMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT).setValue(enabled);
+ editorRegistry.get(KBPreferencesMessages.KB_SETTINGS_PREFERENCE_PAGE_KB_SUPPORT).setValue(enabled);
}
/*
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jst.web.kb.preferences;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class KBSeverityPreferences extends SeverityPreferences {
+
+ public static final Set<String> SEVERITY_OPTION_NAMES = new
HashSet<String>();
+
+ private static KBSeverityPreferences INSTANCE = new KBSeverityPreferences();
+
+ // Expression Language
+
+ // Mark EL Variable name which we can't resolve.
+ public static final String REQUIRED_KB_CAPABILITIES_ARE_MISSING =
INSTANCE.createSeverityOption("requiredKbCapabilitiesAreMissing");
//$NON-NLS-1$
+ // Check "var" attributes.
+ public static final String KB_CAPABILITIES_ARE_NOT_ENABLED_IN_JAVA_MODULE =
INSTANCE.createSeverityOption("kbCapabilitiesAreNotEnabledInJavaModule");
//$NON-NLS-1$
+
+ /**
+ * @return the only instance of KBSeverityPreferences
+ */
+ public static KBSeverityPreferences getInstance() {
+ return INSTANCE;
+ }
+
+ private KBSeverityPreferences() {
+ }
+
+ /* (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 WebKbPlugin.PLUGIN_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.preferences.SeverityPreferences#getSeverityOptionNames()
+ */
+ @Override
+ protected Set<String> getSeverityOptionNames() {
+ return SEVERITY_OPTION_NAMES;
+ }
+
+ public static boolean isValidationEnabled(IProject project) {
+ return INSTANCE.isEnabled(project);
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBSeverityPreferences.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.jst.web.kb.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.common.ui.preferences.SeverityConfigurationBlock;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class KBValidationConfigurationBlock extends SeverityConfigurationBlock {
+
+ private static final String SETTINGS_SECTION_NAME =
"KBValidationConfigurationBlock"; //$NON-NLS-1$
+
+ private static SectionDescription SECTION_KB_CONFIG = new SectionDescription(
+ KBPreferencesMessages.KBValidationConfigurationBlock_section_config,
+ new String[][]{
+ {KBSeverityPreferences.REQUIRED_KB_CAPABILITIES_ARE_MISSING,
KBPreferencesMessages.KBValidationConfigurationBlock_pb_requiredKbCapabilitiesAreMissing_label},
+ {KBSeverityPreferences.KB_CAPABILITIES_ARE_NOT_ENABLED_IN_JAVA_MODULE,
KBPreferencesMessages.KBValidationConfigurationBlock_pb_kbCapabilitiesAreNotEnabledInJavaModule_label},
+ },
+ WebKbPlugin.PLUGIN_ID
+ );
+
+ private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ SECTION_KB_CONFIG,
+ };
+
+ private static Key[] getKeys() {
+ ArrayList<Key> keys = new ArrayList<Key>();
+ for (SectionDescription s: ALL_SECTIONS) {
+ s.collectKeys(keys);
+ }
+ return keys.toArray(new Key[0]);
+ }
+
+ @Override
+ protected Key getMaxNumberOfProblemsKey() {
+ return null;
+ }
+
+ public KBValidationConfigurationBlock(IStatusChangeListener context,
+ IProject project, IWorkbenchPreferenceContainer container) {
+ super(context, project, getKeys(), container);
+ }
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return ALL_SECTIONS;
+ }
+
+ @Override
+ protected String getCommonDescription() {
+ return KBPreferencesMessages.KBValidationConfigurationBlock_common_description;
+ }
+
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return WebKbPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationConfigurationBlock.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java 2011-08-03
20:50:48 UTC (rev 33558)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/preferences/KBValidationPreferencePage.java 2011-08-03
21:11:53 UTC (rev 33559)
@@ -10,33 +10,43 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.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;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
/**
* @author Viacheslav Kabanovich
*/
-public class KBValidationPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
-
- /**
- * @see plugin.xml descriptor for ID
- */
- public static final String ID = "org.jboss.tools.common.model.ui.kb";
//$NON-NLS-1$
+public class KBValidationPreferencePage extends SeverityPreferencePage {
+ public static final String PREF_ID =
"org.jboss.tools.jst.web.kb.preferences.KBValidationPreferencePage";
//$NON-NLS-1$
+ public static final String PROP_ID =
"org.jboss.tools.jst.web.kb.propertyPages.KBValidationPreferencePage";
//$NON-NLS-1$\
+ public KBValidationPreferencePage() {
+ setPreferenceStore(WebKbPlugin.getDefault().getPreferenceStore());
+ setTitle(KBPreferencesMessages.KB_VALIDATOR_PREFERENCE_PAGE_KB_VALIDATOR);
+ }
+
@Override
- protected Control createContents(Composite parent) {
- Composite root = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout(1, false);
- root.setLayout(gl);
+ public void createControl(Composite parent) {
+ IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer)
getContainer();
+ fConfigurationBlock = new KBValidationConfigurationBlock(getNewStatusChangedListener(),
getProject(), container);
- return root;
+ super.createControl(parent);
}
public void init(IWorkbench workbench) {
}
+
+ @Override
+ protected String getPreferencePageID() {
+ // TODO Auto-generated method stub
+ return PREF_ID;
+ }
+
+ @Override
+ protected String getPropertyPageID() {
+ return PROP_ID;
+ }
}
\ No newline at end of file