JBoss Tools SVN: r2502 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-07-18 10:16:11 -0400 (Wed, 18 Jul 2007)
New Revision: 2502
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
Log:
http://jira.jboss.com/jira/browse/EXIN-365
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java 2007-07-18 13:35:15 UTC (rev 2501)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java 2007-07-18 14:16:11 UTC (rev 2502)
@@ -73,7 +73,8 @@
else
figure.setSize(-1,-1);
- refreshReference((ExpandeableShape)getCastedModel());
+ referenceList.add((OrmShape)getCastedModel().getParent());
+ refreshReference((ExpandeableShape)getCastedModel(), ((ExpandeableShape)getCastedModel()).isReferenceVisible());
((OrmShape)getParent().getModel()).refreshReference();
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-18 13:35:15 UTC (rev 2501)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-18 14:16:11 UTC (rev 2502)
@@ -69,8 +69,8 @@
}
}else if (ExpandeableShape.SHOW_REFERENCES.equals(prop)) {
- referenceList.add(getCastedModel().getParent());
- refreshReference((ExpandeableShape)getCastedModel());
+ referenceList.add((OrmShape)getCastedModel().getParent());
+ refreshReference((ExpandeableShape)getCastedModel(), ((ExpandeableShape)getCastedModel()).isReferenceVisible());
// ((IFigure)getFigure().getChildren().get(0)).setBackgroundColor(getSelectionColor());
// ((IFigure)getFigure().getChildren().get(0)).setForegroundColor(ResourceManager.getInstance().getColor(new RGB(255,255,255)));
} else {
@@ -78,16 +78,17 @@
}
}
- private ArrayList referenceList = new ArrayList();
+ protected ArrayList<OrmShape> referenceList = new ArrayList<OrmShape>();
- protected void refreshReference(ExpandeableShape shape){
+ protected void refreshReference(ExpandeableShape shape, boolean visible){
OrmShape refShape = shape.getReference();
if(refShape == null) return;
+ if(!isReferencesCorrect(refShape)) return;
OrmEditPart refPart = (OrmEditPart)getViewer().getEditPartRegistry().get(refShape);
if(refPart != null){
- refPart.getFigure().setVisible(shape.isReferenceVisible());
- setLinksVisible(refPart, shape.isReferenceVisible());
+ refPart.getFigure().setVisible(visible);
+ setLinksVisible(refPart, visible);
}
Object element = refShape.getOrmElement();
if(element instanceof RootClass){
@@ -96,19 +97,18 @@
OrmShape tableShape = refShape.getOrmDiagram().getShape(table);
OrmEditPart tablePart = (OrmEditPart)getViewer().getEditPartRegistry().get(tableShape);
if(tablePart != null){
- tablePart.getFigure().setVisible(shape.isReferenceVisible());
- setLinksVisible(tablePart, shape.isReferenceVisible());
+ tablePart.getFigure().setVisible(visible);
+ setLinksVisible(tablePart, visible);
}
}
- if(isReferencesCorrect(refShape)){
- referenceList.add(refShape);
- for(int i=0;i<refShape.getChildren().size();i++){
- if(refShape.getChildren().get(i) instanceof ExpandeableShape){
- refreshReference((ExpandeableShape)refShape.getChildren().get(i));
- }
+
+ referenceList.add(refShape);
+ for(int i=0;i<refShape.getChildren().size();i++){
+ if(refShape.getChildren().get(i) instanceof ExpandeableShape){
+ refreshReference((ExpandeableShape)refShape.getChildren().get(i), visible);
}
- referenceList.remove(refShape);
}
+ referenceList.remove(refShape);
}
private boolean isReferencesCorrect(OrmShape shape){
17 years, 6 months
JBoss Tools SVN: r2501 - in trunk/seam/plugins/org.jboss.tools.seam.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-18 09:35:15 -0400 (Wed, 18 Jul 2007)
New Revision: 2501
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/
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
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
EXIN-327 Preferences page for seam validation
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 2007-07-18 13:29:40 UTC (rev 2500)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-18 13:35:15 UTC (rev 2501)
@@ -9,6 +9,7 @@
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.ui.ide,
+ org.eclipse.ui.forms,
org.eclipse.ui.navigator,
org.eclipse.jst.servlet.ui,
org.eclipse.wst.web.ui,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-18 13:29:40 UTC (rev 2500)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-18 13:35:15 UTC (rev 2501)
@@ -225,4 +225,26 @@
</objectContribution>
</extension>
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.jboss.tools.common.model.ui"
+ class="org.jboss.tools.seam.ui.preferences.SeamValidatorPreferencePage"
+ id="org.jboss.tools.seam.ui.preferences.SeamValidatorPreferencePage"
+ name="Seam Validator">
+ </page>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ name="Seam Validator"
+ class="org.jboss.tools.seam.ui.preferences.SeamValidatorPreferencePage"
+ id="org.jboss.tools.seam.ui.propertyPages.SeamValidatorPreferencePage">
+ <enabledWhen>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature" value="org.jboss.tools.seam.core.seamnature"/>
+ </adapt>
+ </enabledWhen>
+ </page>
+ </extension>
</plugin>
Added: 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 (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2007-07-18 13:35:15 UTC (rev 2501)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.preferences;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamPreferencesMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages"; //$NON-NLS-1$
+
+ //Validator Preference page
+ public static String SeamValidatorConfigurationBlock_common_description;
+
+ public static String SeamValidatorConfigurationBlock_needsbuild_title;
+ public static String SeamValidatorConfigurationBlock_needsfullbuild_message;
+ public static String SeamValidatorConfigurationBlock_needsprojectbuild_message;
+
+ //Section Components
+ public static String SeamValidatorConfigurationBlock_section_component;
+ public static String SeamValidatorConfigurationBlock_pb_nonUniqueComponentName_label;
+ public static String SeamValidatorConfigurationBlock_pb_statefulComponentDoesNotContainRemove_label;
+ public static String SeamValidatorConfigurationBlock_pb_statefulComponentDoesNotContainDestroy_label;
+ public static String SeamValidatorConfigurationBlock_pb_statefulComponentHasWrongScope_label;
+
+ //Section Entities
+ public static String SeamValidatorConfigurationBlock_section_entities;
+ public static String SeamValidatorConfigurationBlock_pb_entityComponentHasWrongScope_label;
+ public static String SeamValidatorConfigurationBlock_pb_duplicateRemove_label;
+
+ //Section Component life-cycle methods
+ public static String SeamValidatorConfigurationBlock_section_lifecycle;
+ public static String SeamValidatorConfigurationBlock_pb_duplicateDestroy_label;
+ public static String SeamValidatorConfigurationBlock_pb_duplicateCreate_label;
+ public static String SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label;
+ public static String SeamValidatorConfigurationBlock_pb_destroyDoesNotBelongToComponent_label;
+ public static String SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label;
+ public static String SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label;
+ public static String SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label;
+
+ //Section Factories
+ public static String SeamValidatorConfigurationBlock_section_factory;
+ public static String SeamValidatorConfigurationBlock_pb_unknownFactoryName_label;
+
+ //Section Bijections
+ public static String SeamValidatorConfigurationBlock_section_bijection;
+ public static String SeamValidatorConfigurationBlock_pb_multipleDataBinder_label;
+ public static String SeamValidatorConfigurationBlock_pb_unknownDataModel_label;
+
+ //Section Context variables
+ public static String SeamValidatorConfigurationBlock_section_variable;
+ public static String SeamValidatorConfigurationBlock_pb_duplicateVariableName_label;
+ public static String SeamValidatorConfigurationBlock_pb_unknownInjectionName_label;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, SeamPreferencesMessages.class);
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2007-07-18 13:35:15 UTC (rev 2501)
@@ -0,0 +1,42 @@
+#Preferences Page
+SeamValidatorConfigurationBlock_common_description=Select the severity level for the following optional Seam Validator problems:
+
+SeamValidatorConfigurationBlock_needsbuild_title=Seam Validator Settings Changed
+SeamValidatorConfigurationBlock_needsfullbuild_message=The Seam Validator settings have changed. A full rebuild is required for changes to take effect. Do the full build now?
+SeamValidatorConfigurationBlock_needsprojectbuild_message=The Seam Validator settings have changed. A rebuild of the project is required for changes to take effect. Build the project now?
+
+##Section Components
+SeamValidatorConfigurationBlock_section_component=Components
+SeamValidatorConfigurationBlock_pb_nonUniqueComponentName_label=Non-unique component name:
+SeamValidatorConfigurationBlock_pb_statefulComponentDoesNotContainRemove_label=Stateful component does not contain remove:
+SeamValidatorConfigurationBlock_pb_statefulComponentDoesNotContainDestroy_label=Stateful component does not contain destroy:
+SeamValidatorConfigurationBlock_pb_statefulComponentHasWrongScope_label=Stateful component has wrong scope:
+
+##Section Entities
+SeamValidatorConfigurationBlock_section_entities=Entities
+SeamValidatorConfigurationBlock_pb_entityComponentHasWrongScope_label=Entity component has wrong scope:
+SeamValidatorConfigurationBlock_pb_duplicateRemove_label=Duplicate remove:
+
+##Section Component life-cycle methods
+SeamValidatorConfigurationBlock_section_lifecycle=Component life-cycle methods:
+SeamValidatorConfigurationBlock_pb_duplicateDestroy_label=Duplicate destroy:
+SeamValidatorConfigurationBlock_pb_duplicateCreate_label=Duplicate create:
+SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label=Duplicate unwrap:
+SeamValidatorConfigurationBlock_pb_destroyDoesNotBelongToComponent_label=Destroy does not belong to component:
+SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label=Create does not belong to component:
+SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label=Unwrap does not belong to component:
+SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label=Observer does not belong to component:
+
+##Section Factories
+SeamValidatorConfigurationBlock_section_factory=Factories
+SeamValidatorConfigurationBlock_pb_unknownFactoryName_label=Unknown factory name:
+
+##Section Bijections
+SeamValidatorConfigurationBlock_section_bijection=Bijections
+SeamValidatorConfigurationBlock_pb_multipleDataBinder_label=Multiple data binder:
+SeamValidatorConfigurationBlock_pb_unknownDataModel_label=Unknown data model:
+
+##Section Context variables
+SeamValidatorConfigurationBlock_section_variable=Context variables
+SeamValidatorConfigurationBlock_pb_duplicateVariableName_label=Duplicate variable name:
+SeamValidatorConfigurationBlock_pb_unknownInjectionName_label=Unknown injection name:
Added: 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 (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2007-07-18 13:35:15 UTC (rev 2501)
@@ -0,0 +1,267 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock;
+import org.eclipse.jdt.internal.ui.preferences.PreferencesMessages;
+import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
+import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock.Key;
+import org.eclipse.jdt.internal.ui.util.PixelConverter;
+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.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamPreferences;
+
+/**
+ * Find in SeamPreferences the instruction to Framework for Severity preferences
+ * 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
+ * defined in SeamPreferences, and second is label defined in
+ * SeamPreferencesMessages (do not forget put property to SeamPreferencesMessages.properties
+ * and constant to SeamPreferencesMessages.java)
+ *
+ * 2) If new section named A is to be created create constant
+ * private static SectionDescription SECTION_A = new SectionDescription(
+ * SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_a,
+ * new String[][]{
+ * }
+ * );
+ * create required constant and property in SeamPreferencesMessages,
+ * and add SECTION_A to array ALL_SECTIONS.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public class SeamValidatorConfigurationBlock extends OptionsConfigurationBlock {
+ private static final String SETTINGS_SECTION_NAME = "SeamValidatorConfigurationBlock";
+
+ private static SectionDescription SECTION_COMPONENT = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_component,
+ new String[][]{
+ {SeamPreferences.NONUNIQUE_COMPONENT_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_nonUniqueComponentName_label},
+ {SeamPreferences.STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_statefulComponentDoesNotContainRemove_label},
+ {SeamPreferences.STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_statefulComponentDoesNotContainDestroy_label},
+ {SeamPreferences.STATEFUL_COMPONENT_WRONG_SCOPE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_statefulComponentHasWrongScope_label},
+ }
+ );
+
+ private static SectionDescription SECTION_ENTITY = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_entities,
+ new String[][]{
+ {SeamPreferences.ENTITY_COMPONENT_WRONG_SCOPE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_entityComponentHasWrongScope_label},
+ {SeamPreferences.DUPLICATE_REMOVE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateRemove_label},
+ }
+ );
+
+ private static SectionDescription SECTION_LIFECYCLE = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_lifecycle,
+ new String[][]{
+ {SeamPreferences.DUPLICATE_DESTROY, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateDestroy_label},
+ {SeamPreferences.DUPLICATE_CREATE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateCreate_label},
+ {SeamPreferences.DUPLICATE_UNWRAP, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label},
+ {SeamPreferences.DESTROY_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_destroyDoesNotBelongToComponent_label},
+ {SeamPreferences.CREATE_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_createDoesNotBelongToComponent_label},
+ {SeamPreferences.UNWRAP_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unwrapDoesNotBelongToComponent_label},
+ {SeamPreferences.OBSERVER_DOESNT_BELONG_TO_COMPONENT, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_observerDoesNotBelongToComponent_label},
+ }
+ );
+
+ private static SectionDescription SECTION_FACTORY = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_factory,
+ new String[][]{
+ {SeamPreferences.UNKNOWN_FACTORY_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownFactoryName_label},
+ }
+ );
+
+ private static SectionDescription SECTION_BIJECTION = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_bijection,
+ new String[][]{
+ {SeamPreferences.MULTIPLE_DATA_BINDER, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_multipleDataBinder_label},
+ {SeamPreferences.UNKNOWN_DATA_MODEL, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownDataModel_label},
+ }
+ );
+
+ private static SectionDescription SECTION_VARIABLE = new SectionDescription(
+ SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_variable,
+ new String[][]{
+ {SeamPreferences.DUPLICATE_VARIABLE_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateVariableName_label},
+ {SeamPreferences.UNKNOWN_INJECTION_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownInjectionName_label},
+ }
+ );
+
+ private static SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ SECTION_COMPONENT,
+ SECTION_ENTITY,
+ SECTION_LIFECYCLE,
+ SECTION_FACTORY,
+ SECTION_BIJECTION,
+ SECTION_VARIABLE,
+ };
+
+ private static Key PREF_NON_UNIQUE_COMPONENT_NAME = getSeamKey(SeamPreferences.NONUNIQUE_COMPONENT_NAME);
+
+ private static final String ERROR = SeamPreferences.ERROR;
+ private static final String WARNING = SeamPreferences.WARNING;
+ private static final String IGNORE = SeamPreferences.IGNORE;
+
+ private PixelConverter fPixelConverter;
+
+ 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 SeamValidatorConfigurationBlock(IStatusChangeListener context,
+ IProject project,
+ IWorkbenchPreferenceContainer container) {
+ super(context, project, getKeys(), container);
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ fPixelConverter = new PixelConverter(parent);
+ setShell(parent.getShell());
+
+ Composite mainComp = new Composite(parent, SWT.NONE);
+ mainComp.setFont(parent.getFont());
+ GridLayout layout= new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ mainComp.setLayout(layout);
+
+ Composite commonComposite = createStyleTabContent(mainComp);
+ GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
+ gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
+ commonComposite.setLayoutData(gridData);
+
+ validateSettings(null, null, null);
+
+ return mainComp;
+ }
+
+ private Composite createStyleTabContent(Composite folder) {
+ String[] errorWarningIgnore = new String[] {ERROR, WARNING, IGNORE};
+
+ String[] errorWarningIgnoreLabels = new String[] {
+ "Error",
+ "Warning",
+ "Ignore"
+ };
+
+ 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 String[] getFullBuildDialogStrings(boolean workspaceSettings) {
+ String title= SeamPreferencesMessages.SeamValidatorConfigurationBlock_needsbuild_title;
+ String message;
+ if (workspaceSettings) {
+ message= SeamPreferencesMessages.SeamValidatorConfigurationBlock_needsfullbuild_message;
+ } else {
+ message= SeamPreferencesMessages.SeamValidatorConfigurationBlock_needsprojectbuild_message;
+ }
+ return new String[] { title, message };
+ }
+
+ @Override
+ protected void validateSettings(Key changedKey, String oldValue,
+ String newValue) {
+ if (!areSettingsEnabled()) {
+ return;
+ }
+
+ //updateEnableStates();
+
+ fContext.statusChanged(new StatusInfo());
+ }
+
+ protected static Key getSeamKey(String key) {
+ return getKey(SeamCorePlugin.PLUGIN_ID, key);
+ }
+
+ static class SectionDescription {
+ String label;
+ OptionDescription[] options;
+
+ public SectionDescription(String label, String[][] optionLabelsAndKeys) {
+ this.label = label;
+ options = new OptionDescription[optionLabelsAndKeys.length];
+ for (int i = 0; i < options.length; i++) {
+ options[i] = new OptionDescription(optionLabelsAndKeys[i][0], optionLabelsAndKeys[i][1]);
+ }
+ }
+ }
+
+ static class OptionDescription {
+ String label;
+ Key key;
+
+ public OptionDescription(String keyName, String label) {
+ this.label = label;
+ key = getSeamKey(keyName);
+ }
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorPreferencePage.java 2007-07-18 13:35:15 UTC (rev 2501)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamValidatorPreferencePage extends PropertyAndPreferencePage {
+ public static final String PREF_ID = "org.jboss.tools.seam.ui.preferences.SeamValidatorPreferencePage";
+ public static final String PROP_ID = "org.jboss.tools.seam.ui.propertyPages.SeamValidatorPreferencePage";
+
+ private SeamValidatorConfigurationBlock fConfigurationBlock;
+
+ public SeamValidatorPreferencePage() {
+ setPreferenceStore(SeamCorePlugin.getDefault().getPreferenceStore());
+ setTitle("Seam Validator");
+ }
+
+ @Override
+ protected Control createPreferenceContent(Composite composite) {
+ return fConfigurationBlock.createContents(composite);
+ }
+
+ @Override
+ protected String getPreferencePageID() {
+ return PREF_ID;
+ }
+
+ @Override
+ protected String getPropertyPageID() {
+ return PROP_ID;
+ }
+
+ @Override
+ protected boolean hasProjectSpecificOptions(IProject project) {
+ return fConfigurationBlock.hasProjectSpecificOptions(project);
+ }
+
+ public void createControl(Composite parent) {
+ IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
+ fConfigurationBlock = new SeamValidatorConfigurationBlock(getNewStatusChangedListener(), getProject(), container);
+
+ super.createControl(parent);
+ if (isProjectPreferencePage()) {
+ // help goes here
+ } else {
+ // help goes here
+ }
+ }
+
+ /*
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ public void dispose() {
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.dispose();
+ }
+ super.dispose();
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#enableProjectSpecificSettings(boolean)
+ */
+ protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings) {
+ super.enableProjectSpecificSettings(useProjectSpecificSettings);
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.useProjectSpecificSettings(useProjectSpecificSettings);
+ }
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
+ */
+ protected void performDefaults() {
+ super.performDefaults();
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.performDefaults();
+ }
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) {
+ return false;
+ }
+ return super.performOk();
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.IPreferencePage#performApply()
+ */
+ public void performApply() {
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.performApply();
+ }
+ }
+
+}
17 years, 6 months
JBoss Tools SVN: r2500 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-18 09:29:40 -0400 (Wed, 18 Jul 2007)
New Revision: 2500
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
Log:
EXIN-327 Preferences for validation - instruction added to SeamPreferences
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 12:21:00 UTC (rev 2499)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 13:29:40 UTC (rev 2500)
@@ -18,6 +18,23 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
/**
+ * Constants for names of seam preferences.
+ * Static accesses to seam preferences.
+ *
+ * Framework for Severity preferences.
+ * 1) Add constant using static method createSeverityOption(String)
+ * Put it under relevant section, e.g. //components, or create new section
+ * 2) Create in org.jboss.tools.seam.internal.core.validation.messages.properties
+ * error message with the same name
+ * 3) Add to org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages
+ * and to org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages.properties
+ * constant and property named SeamValidatorConfigurationBlock_pb_%name%_label,
+ * where %name% is produced from constant name in SeamPreferences like AAA_BBB_CCC -> aaaBbbCcc.
+ * Put these entries under relevant section. For a new section add constant and property
+ * SeamValidatorConfigurationBlock_section_%newSectionName%
+ * 4) In class org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages
+ * modify SectionDescription constants, according to instruction there.
+ *
* @author Viacheslav Kabanovich
*/
public class SeamPreferences {
17 years, 6 months
JBoss Tools SVN: r2499 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-18 08:21:00 -0400 (Wed, 18 Jul 2007)
New Revision: 2499
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
Log:
http://jira.jboss.com/jira/browse/EXIN-327 @Unwrap validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java 2007-07-18 11:44:26 UTC (rev 2498)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java 2007-07-18 12:21:00 UTC (rev 2499)
@@ -19,7 +19,8 @@
CREATE(CREATE_ANNOTATION_TYPE),
DESTROY(DESTROY_ANNOTATION_TYPE),
REMOVE(REMOVE_ANNOTATION_TYPE),
- UNWRAP(UNWRAP_ANNOTATION_TYPE);
+ UNWRAP(UNWRAP_ANNOTATION_TYPE),
+ OBSERVER(OBSERVER_ANNOTATION_TYPE);
String annotationType;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-18 11:44:26 UTC (rev 2498)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-18 12:21:00 UTC (rev 2499)
@@ -650,7 +650,21 @@
public Map<String, SeamJavaComponentDeclaration> getAllJavaComponentDeclarations() {
return javaDeclarations;
}
-
+
+ /**
+ * Returns set of java classes that contain seam annotations with specified path.
+ * They may be seam components, as well as cases of incomplete annotating
+ * that does not create a seam component.
+ * @return
+ */
+ public Set<SeamJavaComponentDeclaration> findJavaDeclarations(IPath source) {
+ Set<SeamJavaComponentDeclaration> set = new HashSet<SeamJavaComponentDeclaration>();
+ for (SeamJavaComponentDeclaration d: javaDeclarations.values()) {
+ if(source.equals(d.getSourcePath())) set.add(d);
+ }
+ return set;
+ }
+
public SeamComponent getComponent(String name) {
return name == null ? null : allComponents.get(name);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-18 11:44:26 UTC (rev 2498)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-18 12:21:00 UTC (rev 2499)
@@ -31,6 +31,7 @@
public static String CREATE_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Create";
public static String DESTROY_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Destroy";
public static String UNWRAP_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Unwrap";
+ public static String OBSERVER_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Observer";
public static String REMOVE_ANNOTATION_TYPE = "javax.ejb.Remove";
public static String FACTORY_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Factory";
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-18 11:44:26 UTC (rev 2498)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-18 12:21:00 UTC (rev 2499)
@@ -10,8 +10,10 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.validation;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -25,6 +27,7 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
@@ -46,6 +49,7 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractContextVariable;
import org.jboss.tools.seam.internal.core.SeamComponentDeclaration;
+import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.SeamTextSourceReference;
@@ -60,10 +64,13 @@
private static final String NONUNIQUE_COMPONENT_NAME_MESSAGE_ID = "NONUNIQUE_COMPONENT_NAME_MESSAGE";
private static final String UNKNOWN_INJECTION_NAME_MESSAGE_ID = "UNKNOWN_INJECTION_NAME";
private static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_METHOD_SUFIX_MESSAGE_ID = "STATEFUL_COMPONENT_DOES_NOT_CONTENT_";
- private static final String DUPLICATE_METHOD_SUFIX_MESSAGE_ID = "DUPLICATE_";
- private static final String REMOVE_METHOD_POSTFIX_MESSAGE_ID = "REMOVE";
- private static final String DESTROY_METHOD_POSTFIX_MESSAGE_ID = "DESTROY";
- private static final String CREATE_METHOD_POSTFIX_MESSAGE_ID = "CREATE";
+ private static final String DUPLICATE_METHOD_PREFIX_MESSAGE_ID = "DUPLICATE_";
+ private static final String REMOVE_METHOD_SUFIX_MESSAGE_ID = "REMOVE";
+ private static final String DESTROY_METHOD_SUFIX_MESSAGE_ID = "DESTROY";
+ private static final String CREATE_METHOD_SUFIX_MESSAGE_ID = "CREATE";
+ private static final String UNWRAP_METHOD_SUFIX_MESSAGE_ID = "UNWRAP";
+ private static final String OBSERVER_METHOD_SUFIX_MESSAGE_ID = "OBSERVER";
+ private static final String NONCOMPONENTS_METHOD_SUFIX_MESSAGE_ID = "_DOESNT_BELONG_TO_COMPONENT";
private static final String STATEFUL_COMPONENT_WRONG_SCOPE_MESSAGE_ID = "STATEFUL_COMPONENT_WRONG_SCOPE";
private static final String ENTITY_COMPONENT_WRONG_SCOPE_MESSAGE_ID = "ENTITY_COMPONENT_WRONG_SCOPE";
private static final String UNKNOWN_FACTORY_NAME_MESSAGE_ID = "UNKNOWN_FACTORY_NAME";
@@ -71,7 +78,6 @@
private static final String DUPLICATE_VARIABLE_NAME_MESSAGE_ID = "DUPLICATE_VARIABLE_NAME";
private static final String UNKNOWN_DATA_MODEL_MESSAGE_ID = "UNKNOWN_DATA_MODEL";
-
private SeamValidationContext validationContext;
private ISeamProject project;
@@ -92,6 +98,7 @@
Set<String> markedDuplicateFactoryNames = new HashSet<String>();
// Collect all resources which we must validate.
Set<IPath> resources = new HashSet<IPath>(); // Resources which we have to validate.
+ Set<IPath> newResources = new HashSet<IPath>(); // New (unlinked) resources file
for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
currentFile = root.getFile(new Path(uris[i]));
// Don't handle one resource twice.
@@ -120,11 +127,11 @@
resources.addAll(linkedResources);
}
}
-
} else {
// Validate new (unlinked) Java file.
resources.add(currentFile.getFullPath());
}
+ newResources.add(currentFile.getFullPath());
}
}
// Validate all collected linked resources.
@@ -138,6 +145,16 @@
validateFactory(linkedResource, markedDuplicateFactoryNames);
// TODO
}
+
+ // Validate all unnamed resources.
+ Set<IPath> unnamedResources = validationContext.getUnnamedResources();
+ newResources.addAll(unnamedResources);
+ for (IPath path : newResources) {
+ Set<SeamJavaComponentDeclaration> declarations = ((SeamProject)project).findJavaDeclarations(path);
+ for (SeamJavaComponentDeclaration d : declarations) {
+ validateMethodsOfUnknownComponent(d);
+ }
+ }
} else {
return validateAll();
}
@@ -213,7 +230,7 @@
this.addError(UNKNOWN_FACTORY_NAME_MESSAGE_ID, new String[]{factoryName}, getLocationOfName(factory), factory.getResource(), MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
}
}
- } catch (Exception e) {
+ } catch (JavaModelException e) {
SeamCorePlugin.getDefault().logError(e);
}
} else {
@@ -298,6 +315,13 @@
validateFactory((ISeamAnnotatedFactory)factory, markedDuplicateFactoryNames);
}
}
+
+ Map<String,SeamJavaComponentDeclaration> declarations = ((SeamProject)project).getAllJavaComponentDeclarations();
+ Collection<SeamJavaComponentDeclaration> values = declarations.values();
+ for (SeamJavaComponentDeclaration d : values) {
+ validateMethodsOfUnknownComponent(d);
+ }
+
// TODO
return OK_STATUS;
}
@@ -389,7 +413,7 @@
try {
length = declaration.getSourceMember().getNameRange().getLength();
offset = declaration.getSourceMember().getNameRange().getOffset();
- } catch (Exception e) {
+ } catch (JavaModelException e) {
SeamCorePlugin.getDefault().logError(e);
}
return new SeamTextSourceReference(length, offset);
@@ -398,8 +422,8 @@
private void validateStatefulComponent(ISeamComponent component) {
if(component.isStateful()) {
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
- validateStatefulComponentMethods(SeamComponentMethodType.DESTROY, component, DESTROY_METHOD_POSTFIX_MESSAGE_ID);
- validateStatefulComponentMethods(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_POSTFIX_MESSAGE_ID);
+ validateStatefulComponentMethods(SeamComponentMethodType.DESTROY, component, DESTROY_METHOD_SUFIX_MESSAGE_ID);
+ validateStatefulComponentMethods(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_SUFIX_MESSAGE_ID);
ScopeType scope = component.getScope();
if(scope == ScopeType.PAGE || scope == ScopeType.STATELESS) {
ISeamTextSourceReference location = getScopeLocation(component);
@@ -418,9 +442,10 @@
}
private void validateDuplicateComponentMethods(ISeamComponent component) {
- validateDuplicateComponentMethod(SeamComponentMethodType.DESTROY, component, DESTROY_METHOD_POSTFIX_MESSAGE_ID);
- validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_POSTFIX_MESSAGE_ID);
- validateDuplicateComponentMethod(SeamComponentMethodType.CREATE, component, CREATE_METHOD_POSTFIX_MESSAGE_ID);
+ validateDuplicateComponentMethod(SeamComponentMethodType.DESTROY, component, DESTROY_METHOD_SUFIX_MESSAGE_ID);
+ validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_SUFIX_MESSAGE_ID);
+ validateDuplicateComponentMethod(SeamComponentMethodType.CREATE, component, CREATE_METHOD_SUFIX_MESSAGE_ID);
+ validateDuplicateComponentMethod(SeamComponentMethodType.UNWRAP, component, UNWRAP_METHOD_SUFIX_MESSAGE_ID);
}
private void validateDuplicateComponentMethod(SeamComponentMethodType methodType, ISeamComponent component, String postfixMessageId) {
@@ -428,13 +453,9 @@
Set<ISeamComponentMethod> methods = javaDeclaration.getMethodsByType(methodType);
if(methods!=null && methods.size()>1) {
for (ISeamComponentMethod method : methods) {
- try {
- IMethod javaMethod = (IMethod)method.getSourceMember();
- String methodName = javaMethod.getElementName();
- addError(DUPLICATE_METHOD_SUFIX_MESSAGE_ID + postfixMessageId, new String[]{methodName}, method, javaDeclaration.getResource(), MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
- } catch (Exception e) {
- SeamCorePlugin.getDefault().logError(e);
- }
+ IMethod javaMethod = (IMethod)method.getSourceMember();
+ String methodName = javaMethod.getElementName();
+ addError(DUPLICATE_METHOD_PREFIX_MESSAGE_ID + postfixMessageId, new String[]{methodName}, method, javaDeclaration.getResource(), MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
}
}
}
@@ -500,4 +521,32 @@
addError(UNKNOWN_DATA_MODEL_MESSAGE_ID, new String[]{name}, getLocationOfName(bijection), declaration.getResource(), MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
}
}
+
+ /*
+ * Validates methods of java classes. They must belong components.
+ */
+ private void validateMethodsOfUnknownComponent(ISeamJavaComponentDeclaration declaration) {
+ if(project.getComponentsByPath(declaration.getSourcePath()).size()>0) {
+ validationContext.removeUnnamedResource(declaration.getSourcePath());
+ return;
+ }
+ validateMethodOfUnknownComponent(SeamComponentMethodType.DESTROY, declaration, DESTROY_METHOD_SUFIX_MESSAGE_ID);
+ validateMethodOfUnknownComponent(SeamComponentMethodType.CREATE, declaration, CREATE_METHOD_SUFIX_MESSAGE_ID);
+ validateMethodOfUnknownComponent(SeamComponentMethodType.UNWRAP, declaration, UNWRAP_METHOD_SUFIX_MESSAGE_ID);
+ validateMethodOfUnknownComponent(SeamComponentMethodType.OBSERVER, declaration, OBSERVER_METHOD_SUFIX_MESSAGE_ID);
+ }
+
+ private void validateMethodOfUnknownComponent(SeamComponentMethodType methodType, ISeamJavaComponentDeclaration declaration, String sufixMessageId) {
+ Set<ISeamComponentMethod> methods = declaration.getMethodsByType(methodType);
+ if(methods!=null && methods.size()>0) {
+ for (ISeamComponentMethod method : methods) {
+ IMethod javaMethod = (IMethod)method.getSourceMember();
+ String methodName = javaMethod.getElementName();
+ addError(sufixMessageId + NONCOMPONENTS_METHOD_SUFIX_MESSAGE_ID, new String[]{methodName}, method, declaration.getResource(), MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
+ validationContext.addUnnamedResource(declaration.getSourcePath());
+ }
+ } else {
+ validationContext.removeUnnamedResource(declaration.getSourcePath());
+ }
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2007-07-18 11:44:26 UTC (rev 2498)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2007-07-18 12:21:00 UTC (rev 2499)
@@ -12,7 +12,6 @@
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -31,6 +30,7 @@
private Map<String, Set<IPath>> resourcesByVariableName = new HashMap<String, Set<IPath>>();
private Map<IPath, Set<String>> variableNamesByResource = new HashMap<IPath, Set<String>>();
+ private Set<IPath> unnamedResources = new HashSet<IPath>();
/**
* Save link between resource and variable name.
@@ -96,15 +96,40 @@
return resourcesByVariableName.get(variableName);
}
- public Set<String> getVariableNamesByResource(IPath sourcePath) {
- return variableNamesByResource.get(sourcePath);
+ public Set<String> getVariableNamesByResource(IPath fullPath) {
+ return variableNamesByResource.get(fullPath);
}
+ /**
+ * Adds resource without any link to any context variable name.
+ * @param fullPath
+ */
+ public void addUnnamedResource(IPath fullPath) {
+ unnamedResources.add(fullPath);
+ }
+
+ /**
+ * @return Set of resources without any link to any context variable name.
+ * @param fullPath
+ */
+ public Set<IPath> getUnnamedResources() {
+ return unnamedResources;
+ }
+
+ /**
+ * Removes unnamed resource.
+ * @param fullPath
+ */
+ public void removeUnnamedResource(IPath fullPath) {
+ unnamedResources.remove(fullPath);
+ }
+
public void clear() {
resourcesByVariableName.clear();
variableNamesByResource.clear();
+ unnamedResources.clear();
}
-
+
public void store(Element root) {
Element validation = XMLUtilities.createElement(root, "validation");
Set<String> variables = resourcesByVariableName.keySet();
@@ -117,8 +142,12 @@
linkedResource.setAttribute("path", path.toString());
}
}
+ for (IPath unnamedPath: unnamedResources) {
+ Element unnamedPathElement = XMLUtilities.createElement(validation, "unnamed-path");
+ unnamedPathElement.setAttribute("path", unnamedPath.toString());
+ }
}
-
+
public void load(Element root) {
Element validation = XMLUtilities.getUniqueChild(root, "validation");
if(validation == null) return;
@@ -128,13 +157,22 @@
if(name == null || name.trim().length() == 0) continue;
String path = linkedResources[i].getAttribute("path");
if(path == null || path.trim().length() == 0) continue;
- IPath pathObject = null;
try {
- pathObject = new Path(path);
+ IPath pathObject = new Path(path);
+ addLinkedResource(name, pathObject);
} catch (Exception e) {
SeamCorePlugin.getPluginLog().logError(e);
}
- addLinkedResource(name, pathObject);
- }
+ }
+ Element[] unnamedPathElement = XMLUtilities.getChildren(validation, "unnamed-path");
+ if(unnamedPathElement != null) for (int i = 0; i < unnamedPathElement.length; i++) {
+ String path = unnamedPathElement[i].getAttribute("path");
+ try {
+ IPath pathObject = new Path(path);
+ addUnnamedResource(pathObject);
+ } catch (Exception e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
}
}
\ No newline at end of file
17 years, 6 months
JBoss Tools SVN: r2498 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core/preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-18 07:44:26 -0400 (Wed, 18 Jul 2007)
New Revision: 2498
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java
Log:
EXIN-327 Preferences for validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 11:42:48 UTC (rev 2497)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 11:44:26 UTC (rev 2498)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.core;
import java.util.HashSet;
@@ -7,6 +17,9 @@
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+/**
+ * @author Viacheslav Kabanovich
+ */
public class SeamPreferences {
public static final String ERROR = "error";
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java 2007-07-18 11:42:48 UTC (rev 2497)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java 2007-07-18 11:44:26 UTC (rev 2498)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.internal.core.preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
@@ -7,6 +17,9 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
+/**
+ * @author Viacheslav Kabanovich
+ */
public class SeamPreferenceInitializer extends AbstractPreferenceInitializer {
public SeamPreferenceInitializer() {}
17 years, 6 months
JBoss Tools SVN: r2497 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-18 07:42:48 -0400 (Wed, 18 Jul 2007)
New Revision: 2497
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
Log:
EXIN-327 Preferences for validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 11:42:01 UTC (rev 2496)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 11:42:48 UTC (rev 2497)
@@ -57,21 +57,21 @@
allOptionNames.addAll(severityOptionNames);
}
- public IEclipsePreferences getProjectPreferences(ISeamProject project) {
+ public static IEclipsePreferences getProjectPreferences(ISeamProject project) {
return new ProjectScope(project.getProject()).getNode(SeamCorePlugin.PLUGIN_ID);
}
- public IEclipsePreferences getDefaultPreferences() {
+ public static IEclipsePreferences getDefaultPreferences() {
return new DefaultScope().getNode(SeamCorePlugin.PLUGIN_ID);
}
- public String getProjectPreference(ISeamProject project, String key) {
+ public static String getProjectPreference(ISeamProject project, String key) {
IEclipsePreferences p = getProjectPreferences(project);
if(p == null) return null;
return p.get(key, null);
}
- public String getDefaultPreference(String key) {
+ public static String getDefaultPreference(String key) {
IEclipsePreferences p = getDefaultPreferences();
if(p == null) return null;
return p.get(key, null);
17 years, 6 months
JBoss Tools SVN: r2496 - in trunk/seam/plugins/org.jboss.tools.seam.core: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-18 07:42:01 -0400 (Wed, 18 Jul 2007)
New Revision: 2496
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
Log:
EXIN-327 Preferences for validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-18 11:39:08 UTC (rev 2495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-18 11:42:01 UTC (rev 2496)
@@ -26,7 +26,8 @@
org.eclipse.jst.ws
Provide-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.internal.core,
- org.jboss.tools.seam.internal.core.scanner
+ org.jboss.tools.seam.internal.core.scanner,
+ org.jboss.tools.seam.internal.core.preferences
Bundle-Version: 2.0.0
Export-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.core.event,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-18 11:39:08 UTC (rev 2495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-18 11:42:01 UTC (rev 2496)
@@ -26,6 +26,11 @@
id="org.jboss.tools.seam.core.seambuilder">
</builder>
</extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.jboss.tools.seam.internal.core.preferences.SeamPreferenceInitializer"/>
+ </extension>
+
<extension
id="seamProblem"
name="Seam Problem"
@@ -163,4 +168,5 @@
type="org.eclipse.wst.validation.problemmarker">
</super>
</extension>
+
</plugin>
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java 2007-07-18 11:39:08 UTC (rev 2495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java 2007-07-18 11:42:01 UTC (rev 2496)
@@ -17,18 +17,30 @@
* @author Alexey Kazakov
*/
public enum BijectedAttributeType implements SeamAnnotations {
- IN(IN_ANNOTATION_TYPE),
- OUT(OUT_ANNOTATION_TYPE),
- DATA_BINDER(DATA_MODEL_ANNOTATION_TYPE),
- DATA_MODEL_SELECTION(DATA_MODEL_SELECTION_ANNOTATION_TYPE),
- DATA_MODEL_SELECTION_INDEX(DATA_MODEL_SELECTION_INDEX_ANNOTATION_TYPE);
+ IN(IN_ANNOTATION_TYPE, true),
+ OUT(OUT_ANNOTATION_TYPE, true),
+ DATA_BINDER(DATA_MODEL_ANNOTATION_TYPE, true),
+ DATA_MODEL_SELECTION(DATA_MODEL_SELECTION_ANNOTATION_TYPE, false),
+ DATA_MODEL_SELECTION_INDEX(DATA_MODEL_SELECTION_INDEX_ANNOTATION_TYPE, false);
- BijectedAttributeType(String annotationType) {
+ boolean isUsingMemberName;
+
+ BijectedAttributeType(String annotationType, boolean isUsingMemberName) {
this.annotationType = annotationType;
+ this.isUsingMemberName = isUsingMemberName;
}
String annotationType;
public String getAnnotationType() {
return annotationType;
}
+
+ /**
+ *
+ * @return
+ */
+ public boolean isUsingMemberName() {
+ return isUsingMemberName;
+ }
+
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-18 11:39:08 UTC (rev 2495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-18 11:42:01 UTC (rev 2496)
@@ -12,12 +12,18 @@
import java.util.Set;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
public interface ISeamProject extends ISeamElement {
public static String NATURE_ID = "org.jboss.tools.seam.core.seamnature";
+
+ /**
+ * Returns Eclipse project.
+ */
+ public IProject getProject();
/**
* Returns list of scope objects for all scope types.
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-18 11:42:01 UTC (rev 2496)
@@ -0,0 +1,80 @@
+package org.jboss.tools.seam.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+
+public class SeamPreferences {
+
+ public static final String ERROR = "error";
+ public static final String WARNING = "warning";
+ public static final String IGNORE = "ignore";
+
+ public static final Set<String> severityOptionNames = new HashSet<String>();
+
+ //Components
+ public static final String NONUNIQUE_COMPONENT_NAME = createSeverityOption("nonUniqueComponentName");
+ public static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE = createSeverityOption("statefulComponentDoesNotContainRemove");
+ public static final String STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY = createSeverityOption("statefulComponentDoesNotContainDestroy");
+ public static final String STATEFUL_COMPONENT_WRONG_SCOPE = createSeverityOption("statefulComponentHasWrongScope");
+
+ //Entities
+ public static final String ENTITY_COMPONENT_WRONG_SCOPE = createSeverityOption("entityComponentHasWrongScope");
+ public static final String DUPLICATE_REMOVE = createSeverityOption("duplicateRemove");
+
+ //Component life-cycle methods
+ public static final String DUPLICATE_DESTROY = createSeverityOption("duplicateDestroy");
+ public static final String DUPLICATE_CREATE = createSeverityOption("duplicateCreate");
+ public static final String DUPLICATE_UNWRAP = createSeverityOption("duplicateUnwrap");
+ public static final String DESTROY_DOESNT_BELONG_TO_COMPONENT = createSeverityOption("destroyDoesNotBelongToComponent");
+ public static final String CREATE_DOESNT_BELONG_TO_COMPONENT = createSeverityOption("createDoesNotBelongToComponent");
+ public static final String UNWRAP_DOESNT_BELONG_TO_COMPONENT = createSeverityOption("unwrapDoesNotBelongToComponent");
+ public static final String OBSERVER_DOESNT_BELONG_TO_COMPONENT = createSeverityOption("observerDoesNotBelongToComponent");
+
+ //Factories
+ public static final String UNKNOWN_FACTORY_NAME = createSeverityOption("unknownFactoryName");
+
+ //Bijections
+ public static final String MULTIPLE_DATA_BINDER = createSeverityOption("multipleDataBinder");
+ public static final String UNKNOWN_DATA_MODEL = createSeverityOption("unknownDataModel");
+
+ //Context variables
+ public static final String DUPLICATE_VARIABLE_NAME = createSeverityOption("duplicateVariableName");
+ public static final String UNKNOWN_INJECTION_NAME = createSeverityOption("unknownInjectionName");
+
+ private static String createSeverityOption(String shortName) {
+ String name = SeamCorePlugin.PLUGIN_ID + ".validator.problem." + shortName;
+ severityOptionNames.add(name);
+ return name;
+ }
+
+ public static final Set<String> allOptionNames = new HashSet<String>();
+
+ static {
+ allOptionNames.addAll(severityOptionNames);
+ }
+
+ public IEclipsePreferences getProjectPreferences(ISeamProject project) {
+ return new ProjectScope(project.getProject()).getNode(SeamCorePlugin.PLUGIN_ID);
+ }
+
+ public IEclipsePreferences getDefaultPreferences() {
+ return new DefaultScope().getNode(SeamCorePlugin.PLUGIN_ID);
+ }
+
+ public String getProjectPreference(ISeamProject project, String key) {
+ IEclipsePreferences p = getProjectPreferences(project);
+ if(p == null) return null;
+ return p.get(key, null);
+ }
+
+ public String getDefaultPreference(String key) {
+ IEclipsePreferences p = getDefaultPreferences();
+ if(p == null) return null;
+ return p.get(key, null);
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-18 11:39:08 UTC (rev 2495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-18 11:42:01 UTC (rev 2496)
@@ -641,6 +641,16 @@
allVariables.remove(factory);
}
+ /**
+ * Returns map of all java classes that contain seam annotations.
+ * They may be seam components, as well as cases of incomplete annotating
+ * that does not create a seam component.
+ * @return
+ */
+ public Map<String, SeamJavaComponentDeclaration> getAllJavaComponentDeclarations() {
+ return javaDeclarations;
+ }
+
public SeamComponent getComponent(String name) {
return name == null ? null : allComponents.get(name);
}
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java 2007-07-18 11:42:01 UTC (rev 2496)
@@ -0,0 +1,24 @@
+package org.jboss.tools.seam.internal.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.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamPreferences;
+
+public class SeamPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ public SeamPreferenceInitializer() {}
+
+ @Override
+ public void initializeDefaultPreferences() {
+
+ IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(SeamCorePlugin.PLUGIN_ID);
+ for (String name : SeamPreferences.severityOptionNames) {
+ defaultPreferences.put(name, SeamPreferences.ERROR);
+ }
+
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-07-18 11:39:08 UTC (rev 2495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-07-18 11:42:01 UTC (rev 2496)
@@ -159,7 +159,7 @@
att.setTypes(types.toArray(new BijectedAttributeType[0]));
ValueInfo name = ValueInfo.getValueInfo(main, null);
- if(name == null) {
+ if(name == null && types.size() > 0 && types.get(0).isUsingMemberName()) {
name = new ValueInfo();
name.value = m.getName().getIdentifier();
}
17 years, 6 months
JBoss Tools SVN: r2495 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-07-18 07:39:08 -0400 (Wed, 18 Jul 2007)
New Revision: 2495
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
Log:
http://jira.jboss.com/jira/browse/EXIN-365
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-18 10:44:14 UTC (rev 2494)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-18 11:39:08 UTC (rev 2495)
@@ -37,7 +37,6 @@
import org.hibernate.type.Type;
import org.jboss.tools.hibernate.ui.veditor.VisualEditorPlugin;
-
public class OrmDiagram extends ModelElement {
public static final String REFRESH = "refresh";
@@ -56,20 +55,22 @@
ormElement = (RootClass)ioe;
if (ormElement instanceof RootClass) {
String string = "";
-// resource =((RootClass)ormElement).getPersistentClassMapping().getStorage().getResource();
-// try {
-// int i = 0;
-// String tempString;
-// do {
-// tempString = resource.getPersistentProperty(new QualifiedName(VisualEditorPlugin.PLUGIN_ID,qualifiedNameString+i++));
-// string += tempString;
-// } while (tempString != null);
-// } catch (CoreException e) {
-//// ExceptionHandler.logThrowableError(e, e.getMessage());
-// }
+// resource
+// =((RootClass)ormElement).getPersistentClassMapping().getStorage().getResource();
+// try {
+// int i = 0;
+// String tempString;
+// do {
+// tempString = resource.getPersistentProperty(new
+// QualifiedName(VisualEditorPlugin.PLUGIN_ID,qualifiedNameString+i++));
+// string += tempString;
+// } while (tempString != null);
+// } catch (CoreException e) {
+// // ExceptionHandler.logThrowableError(e, e.getMessage());
+// }
childrenLocations = string.split("#");
- } //else
-// throw new IllegalArgumentException();
+ } // else
+// throw new IllegalArgumentException();
getOrCreatePersistentClass(ormElement, null);
}
@@ -86,8 +87,10 @@
saveHelper();
getChildren().clear();
elements.clear();
-// if( ((IPersistentClass)ormElement).getProjectMapping().findClass(ormElement.getName()) != null)
-/// getOrCreatePersistentClass((IPersistentClass)ormElement, null);
+// if(
+// ((IPersistentClass)ormElement).getProjectMapping().findClass(ormElement.getName())
+// != null)
+// / getOrCreatePersistentClass((IPersistentClass)ormElement, null);
firePropertyChange(REFRESH, null, null);
}
@@ -106,7 +109,7 @@
resource.setPersistentProperty((new QualifiedName(VisualEditorPlugin.PLUGIN_ID,qualifiedNameString+i)),
string.substring(2048*i));
} catch (CoreException e) {
-// ExceptionHandler.logThrowableError(e, e.getMessage());
+// ExceptionHandler.logThrowableError(e, e.getMessage());
}
}
@@ -119,8 +122,8 @@
childrenLocations[i] = ((RootClass)ormElement).getEntityName() + "@";
} else if (ormElement instanceof Table) {
childrenLocations[i] = ((Table)ormElement).getSchema() + "." + ((Table)ormElement).getName()+"@";
-// } else if (ormElement instanceof Component) {
-// childrenLocations[i] = ((Component)ormElement).getComponentClassName()+"@";
+// } else if (ormElement instanceof Component) {
+// childrenLocations[i] = ((Component)ormElement).getComponentClassName()+"@";
}
childrenLocations[i] += shape.getLocation().x + ";" + shape.getLocation().y+";" + shape.isHiden();
}
@@ -179,8 +182,11 @@
shape = elements.get(componentClassDatabaseTable.getSchema() + "." + componentClassDatabaseTable.getName());
if (shape == null) shape = getOrCreateDatabaseTable(componentClassDatabaseTable);
createConnections(classShape, shape);
- if(!isConnectionExist(classShape, shape))
+ if(!isConnectionExist(classShape, shape)){
new Connection(classShape, shape);
+ classShape.firePropertyChange(REFRESH, null, null);
+ shape.firePropertyChange(REFRESH, null, null);
+ }
}
RootClass rc = (RootClass)persistentClass;
Iterator iter = rc.getSubclassIterator();
@@ -194,12 +200,18 @@
Table jcTable = ((Subclass)element).getTable();
OrmShape jcTableShape = getOrCreateDatabaseTable(jcTable);
createConnections(subclassShape, jcTableShape);
- if(!isConnectionExist(subclassShape, jcTableShape))
+ if(!isConnectionExist(subclassShape, jcTableShape)){
new Connection(subclassShape, jcTableShape);
+ subclassShape.firePropertyChange(REFRESH, null, null);
+ jcTableShape.firePropertyChange(REFRESH, null, null);
+ }
} else {
createConnections(subclassShape, shape);
- if(!isConnectionExist(subclassShape, shape))
+ if(!isConnectionExist(subclassShape, shape)){
new Connection(subclassShape, shape);
+ subclassShape.firePropertyChange(REFRESH, null, null);
+ shape.firePropertyChange(REFRESH, null, null);
+ }
}
OrmShape ownerTableShape = getOrCreateDatabaseTable(((Subclass)element).getRootTable());
createConnections(subclassShape, ownerTableShape);
@@ -238,9 +250,9 @@
if (elements.get(cls.getEntityName()) == null)
getOrCreatePersistentClass(cls, null);
}
-// } else if (clazz instanceof SingleTableSubclass) {
-// SingleTableSubclass singleTableSubclass = (SingleTableSubclass)clazz;
-// getOrCreatePersistentClass(singleTableSubclass, null);
+// } else if (clazz instanceof SingleTableSubclass) {
+// SingleTableSubclass singleTableSubclass = (SingleTableSubclass)clazz;
+// getOrCreatePersistentClass(singleTableSubclass, null);
}
}
}
@@ -268,8 +280,11 @@
for (int j = 0; j < databaseColumns.size(); j++) {
if (databaseColumn.getName().equals(((Column)((Shape)databaseColumns.get(j)).getOrmElement()).getName())) {
Shape databaseShape = (Shape)databaseColumns.remove(j);
- if(!isConnectionExist(shape, databaseShape))
+ if(!isConnectionExist(shape, databaseShape)){
new Connection(shape, databaseShape);
+ shape.firePropertyChange(REFRESH, null, null);
+ databaseShape.firePropertyChange(REFRESH, null, null);
+ }
databaseColumns2.add(i++, databaseShape);
}
}
@@ -319,28 +334,32 @@
if (clazz instanceof RootClass) {
RootClass rootClass = (RootClass)clazz;
s = getOrCreatePersistentClass(rootClass, null);
-// HashMap targets = new HashMap();
-// Iterator iterator = shape.getSourceConnections().iterator();
-// while (iterator.hasNext()) {
-// Connection connection = (Connection)iterator.next();
-// connection.setHiden(shape.getHide());
-// Object el = connection.getTarget().getOrmElement();
-// if (el instanceof Column) {
-// targets.put(((Column)el).getName(), connection.getTarget());
-// } else if (el instanceof RootClass) {
-// targets.put(((RootClass)el).getEntityName(), connection.getTarget());
-// }
-// }
-// KeyValue id = rootClass.getIdentifier();
-// iterator = id.getColumnIterator();
-// while (iterator.hasNext()) {
-// Column column = (Column)iterator.next();
-// if (targets.get(column.getName()) != null && !isConnectionExist(s, (Shape)targets.get(column.getName()))) {
-// new Connection(s, (Shape)targets.get(column.getName()));
-// }
-// }
- if(!isConnectionExist(shape, s))
+// HashMap targets = new HashMap();
+// Iterator iterator = shape.getSourceConnections().iterator();
+// while (iterator.hasNext()) {
+// Connection connection = (Connection)iterator.next();
+// connection.setHiden(shape.getHide());
+// Object el = connection.getTarget().getOrmElement();
+// if (el instanceof Column) {
+// targets.put(((Column)el).getName(), connection.getTarget());
+// } else if (el instanceof RootClass) {
+// targets.put(((RootClass)el).getEntityName(), connection.getTarget());
+// }
+// }
+// KeyValue id = rootClass.getIdentifier();
+// iterator = id.getColumnIterator();
+// while (iterator.hasNext()) {
+// Column column = (Column)iterator.next();
+// if (targets.get(column.getName()) != null && !isConnectionExist(s,
+// (Shape)targets.get(column.getName()))) {
+// new Connection(s, (Shape)targets.get(column.getName()));
+// }
+// }
+ if(!isConnectionExist(shape, s)){
new Connection(shape, s);
+ shape.firePropertyChange(REFRESH, null, null);
+ s.firePropertyChange(REFRESH, null, null);
+ }
} else if (clazz instanceof Subclass) {
s = getOrCreatePersistentClass(((SingleTableSubclass)clazz).getRootClass(), null);
}
@@ -366,36 +385,52 @@
if (valueType.isCollectionType()) {
Collection collection = (Collection)property.getValue();
Value component = collection.getElement();
- if (component instanceof Component) {//valueType.isComponentType()
+ if (component instanceof Component) {// valueType.isComponentType()
childShape = (OrmShape)elements.get(((Component)component).getComponentClassName());
if(childShape == null) childShape = getOrCreateComponentClass(property);
- if(!isConnectionExist((Shape)(componentShape.getChildren().get(1)), childShape))
+ if(!isConnectionExist((Shape)(componentShape.getChildren().get(1)), childShape)){
new Connection((Shape)(componentShape.getChildren().get(1)), childShape);
+ ((Shape)(componentShape.getChildren().get(1))).firePropertyChange(REFRESH, null, null);
+ childShape.firePropertyChange(REFRESH, null, null);
+ }
} else if (collection.isOneToMany()) {
childShape = getOrCreateAssociationClass(property);
- if(!isConnectionExist((Shape)(componentShape.getChildren().get(1)), childShape))
+ if(!isConnectionExist((Shape)(componentShape.getChildren().get(1)), childShape)){
new Connection((Shape)(componentShape.getChildren().get(1)), childShape);
+ ((Shape)(componentShape.getChildren().get(1))).firePropertyChange(REFRESH, null, null);
+ childShape.firePropertyChange(REFRESH, null, null);
+ }
OrmShape keyTableShape = getOrCreateDatabaseTable(collection.getKey().getTable());
Iterator iter = collection.getKey().getColumnIterator();
while (iter.hasNext()) {
Column col = (Column)iter.next();
Shape keyColumnShape = keyTableShape.getChild(col);
- if (keyColumnShape != null && !isConnectionExist((Shape)(componentShape.getChildren().get(0)), keyColumnShape)) new Connection((Shape)(componentShape.getChildren().get(0)), keyColumnShape);
+ if (keyColumnShape != null && !isConnectionExist((Shape)(componentShape.getChildren().get(0)), keyColumnShape)){
+ new Connection((Shape)(componentShape.getChildren().get(0)), keyColumnShape);
+ ((Shape)(componentShape.getChildren().get(0))).firePropertyChange(REFRESH, null, null);
+ keyColumnShape.firePropertyChange(REFRESH, null, null);
+ }
}
- } else /*if (collection.isMap() || collection.isSet())*/ {
+ } else /* if (collection.isMap() || collection.isSet()) */ {
childShape = getOrCreateDatabaseTable(collection.getCollectionTable());
Shape keyShape = childShape.getChild((Column)((DependantValue)((Shape)componentShape.getChildren().get(0)).getOrmElement()).getColumnIterator().next());
- if(!isConnectionExist((Shape)componentShape.getChildren().get(0), keyShape))
+ if(!isConnectionExist((Shape)componentShape.getChildren().get(0), keyShape)){
new Connection((Shape)componentShape.getChildren().get(0), keyShape);
+ ((Shape)componentShape.getChildren().get(0)).firePropertyChange(REFRESH, null, null);
+ keyShape.firePropertyChange(REFRESH, null, null);
+ }
Iterator iter = ((SimpleValue)((Shape)componentShape.getChildren().get(1)).getOrmElement()).getColumnIterator();
while (iter.hasNext()) {
Column col = (Column)iter.next();
Shape elementShape = childShape.getChild(col);
- if(!isConnectionExist((Shape)componentShape.getChildren().get(1), elementShape))
+ if(!isConnectionExist((Shape)componentShape.getChildren().get(1), elementShape)){
new Connection((Shape)componentShape.getChildren().get(1), elementShape);
+ ((Shape)componentShape.getChildren().get(1)).firePropertyChange(REFRESH, null, null);
+ elementShape.firePropertyChange(REFRESH, null, null);
+ }
}
}
if(!componentShape.getParent().equals(childShape))
@@ -414,12 +449,18 @@
OrmShape tableShape = (OrmShape)elements.get(component.getTable().getSchema() + "." + component.getTable().getName());
if (tableShape == null) tableShape = getOrCreateDatabaseTable(component.getTable());
createConnections(classShape, tableShape);
- if(!isConnectionExist(classShape, tableShape))
+ if(!isConnectionExist(classShape, tableShape)){
new Connection(classShape, tableShape);
+ classShape.firePropertyChange(REFRESH, null, null);
+ tableShape.firePropertyChange(REFRESH, null, null);
+ }
Shape parentShape = ((SpecialOrmShape)classShape).getParentShape();
OrmShape parentClassShape = (OrmShape)elements.get(((Property)parentShape.getOrmElement()).getPersistentClass().getEntityName());
- if(!isConnectionExist(parentShape, parentClassShape))
+ if(!isConnectionExist(parentShape, parentClassShape)){
new Connection(parentShape, parentClassShape);
+ parentShape.firePropertyChange(REFRESH, null, null);
+ parentClassShape.firePropertyChange(REFRESH, null, null);
+ }
}
} else if (property.getValue() instanceof Component) {
classShape = createShape(property);
@@ -436,8 +477,11 @@
OrmShape tableShape = (OrmShape)elements.get(component.getAssociatedClass().getTable().getSchema() + "." + component.getAssociatedClass().getTable().getName());
if (tableShape == null) tableShape = getOrCreateDatabaseTable(component.getAssociatedClass().getTable());
createConnections(classShape, tableShape);
- if(!isConnectionExist(classShape, tableShape))
+ if(!isConnectionExist(classShape, tableShape)){
new Connection(classShape, tableShape);
+ classShape.firePropertyChange(REFRESH, null, null);
+ tableShape.firePropertyChange(REFRESH, null, null);
+ }
}
return classShape;
}
17 years, 6 months
JBoss Tools SVN: r2494 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-18 06:44:14 -0400 (Wed, 18 Jul 2007)
New Revision: 2494
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
Log:
http://jira.jboss.com/jira/browse/EXIN-327
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-18 09:58:43 UTC (rev 2493)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-18 10:44:14 UTC (rev 2494)
@@ -8,16 +8,32 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
+#Components
NONUNIQUE_COMPONENT_NAME_MESSAGE=Duplicate component name: {0}
-UNKNOWN_INJECTION_NAME=Unknown context variable name: {0}
STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE=Stateful component "{0}" must have a method marked @Remove
STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY=Stateful component "{0}" must have a method marked @Destroy
STATEFUL_COMPONENT_WRONG_SCOPE=Stateful component "{0}" should not have org.jboss.seam.ScopeType.PAGE, nor org.jboss.seam.ScopeType.STATELESS
+
+#Entities
ENTITY_COMPONENT_WRONG_SCOPE=Entity component "{0}" should not have org.jboss.seam.ScopeType.STATELESS
DUPLICATE_REMOVE=Duplicate @Remove method "{0}"
+
+#Component lifecycle methods
DUPLICATE_DESTROY=Duplicate @Destroy method "{0}"
DUPLICATE_CREATE=Duplicate @Create method "{0}"
+DUPLICATE_UNWRAP=Duplicate @Unwrap method "{0}"
+DESTROY_DOESNT_BELONG_TO_COMPONENT=@Destroy method "{0}" must be declared in component class
+CREATE_DOESNT_BELONG_TO_COMPONENT=@Create method "{0}" must be declared in component class
+UNWRAP_DOESNT_BELONG_TO_COMPONENT=@Unwrap method "{0}" must be declared in component class
+OBSERVER_DOESNT_BELONG_TO_COMPONENT=@Observer method "{0}" must be declared in component class
+
+#Factories
UNKNOWN_FACTORY_NAME=Factory method "{0}" with a void return type must have an associated @Out/Databinder
-MULTIPLE_DATA_BINDER=@DataModelSelection and @DataModelSelectionIndex without name requires the only one @DataModel in the component.
+
+#Bijections
+MULTIPLE_DATA_BINDER=@DataModelSelection and @DataModelSelectionIndex without name requires the only one @DataModel in the component
+UNKNOWN_DATA_MODEL=Unknown @DataModel/@Out name: {0}
+
+#Context variables
DUPLICATE_VARIABLE_NAME=Duplicate variable name: {0}
-UNKNOWN_DATA_MODEL=Unknown @DataModel/@Out name: {0}
\ No newline at end of file
+UNKNOWN_INJECTION_NAME=Unknown context variable name: {0}
\ No newline at end of file
17 years, 6 months
JBoss Tools SVN: r2493 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core/scanner/java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-18 05:58:43 -0400 (Wed, 18 Jul 2007)
New Revision: 2493
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-514 Added @Unwrap method into seam model
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java 2007-07-18 09:18:22 UTC (rev 2492)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java 2007-07-18 09:58:43 UTC (rev 2493)
@@ -18,10 +18,11 @@
public enum SeamComponentMethodType implements SeamAnnotations {
CREATE(CREATE_ANNOTATION_TYPE),
DESTROY(DESTROY_ANNOTATION_TYPE),
- REMOVE(REMOVE_ANNOTATION_TYPE);
-
+ REMOVE(REMOVE_ANNOTATION_TYPE),
+ UNWRAP(UNWRAP_ANNOTATION_TYPE);
+
String annotationType;
-
+
SeamComponentMethodType(String annotationType) {
this.annotationType = annotationType;
}
@@ -29,5 +30,4 @@
public String getAnnotationType() {
return annotationType;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-18 09:18:22 UTC (rev 2492)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-18 09:58:43 UTC (rev 2493)
@@ -30,6 +30,7 @@
public static String CREATE_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Create";
public static String DESTROY_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Destroy";
+ public static String UNWRAP_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Unwrap";
public static String REMOVE_ANNOTATION_TYPE = "javax.ejb.Remove";
public static String FACTORY_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Factory";
17 years, 6 months