JBoss Tools SVN: r2615 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-07-24 06:31:42 -0400 (Tue, 24 Jul 2007)
New Revision: 2615
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml
Log:
JBIDE-605: latest svn has various issues with xmodel ui's
First exception in description fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml 2007-07-24 10:26:43 UTC (rev 2614)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml 2007-07-24 10:31:42 UTC (rev 2615)
@@ -1,42 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.0"?>
<plugin>
- <extension point="org.eclipse.ui.views">
- <category id="web.views.category.id" name="Red Hat Developer Studio"/>
- <view allowMultiple="false" category="web.views.category.id" class="org.jboss.tools.hibernate.view.views.ExplorerClass" icon="images/exdOrm16x16.gif" id="org.jboss.tools.hibernate.view.views.ExplorerClass" name="ORM Explorer">
- </view>
- <view allowMultiple="false" category="web.views.category.id" class="org.jboss.tools.hibernate.view.views.ExplorerBase" icon="images/exdDataPerspective1.gif" id="org.jboss.tools.hibernate.view.views.ExplorerBase" name="Relational Schema"/>
- </extension>
- <extension point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
- <showInPart id="org.jboss.tools.hibernate.view.views.ExplorerClass"/>
- <viewShortcut id="org.jboss.tools.hibernate.view.views.ExplorerClass"/>
- <viewShortcut id="org.jboss.tools.hibernate.view.views.ExplorerBase"/>
- <view id="org.jboss.tools.hibernate.view.views.ExplorerClass" moveable="true" ratio="0.50" relationship="stack" relative="org.eclipse.jdt.ui.PackageExplorer" visible="true"/>
- <view id="org.jboss.tools.hibernate.view.views.ExplorerBase" moveable="true" ratio="0.50" relationship="stack" relative="org.eclipse.ui.views.ContentOutline" visible="true"/>
- </perspectiveExtension>
- <perspectiveExtension targetID="org.jboss.tools.jst.web.ui.RedHat4WebPerspective">
- <showInPart id="org.jboss.tools.hibernate.view.views.ExplorerClass"/>
- <viewShortcut id="org.jboss.tools.hibernate.view.views.ExplorerClass"/>
- <viewShortcut id="org.jboss.tools.hibernate.view.views.ExplorerBase"/>
- <view id="org.jboss.tools.hibernate.view.views.ExplorerClass" moveable="true" ratio="0.50" relationship="stack" relative="org.eclipse.jdt.ui.PackageExplorer" visible="true"/>
- <view id="org.jboss.tools.hibernate.view.views.ExplorerBase" moveable="true" ratio="0.50" relationship="stack" relative="org.eclipse.ui.views.ContentOutline" visible="true"/>
- </perspectiveExtension>
- </extension>
<extension point="org.eclipse.ui.popupMenus">
- <objectContribution adaptable="true" id="org.jboss.tools.hibernate.view.project" objectClass="org.eclipse.core.resources.IProject">
- <menu id="RedHat4Web" label="Red Hat Developer Studio" path="additions">
- <separator name="a"/>
- <separator name="b"/>
- <separator name="c"/>
- <separator name="d"/>
- </menu>
- <action class="org.jboss.tools.hibernate.view.AddOrmNatureActionDelegate" enablesFor="1" icon="images/exdOrm16x16.gif" id="org.jboss.tools.hibernate.view.AddOrmNatureAction" label="%popupMenus.action.addOrmNature" menubarPath="RedHat4Web/a">
- </action>
- <action class="org.jboss.tools.hibernate.view.RemoveOrmNatureActionDelegate" enablesFor="1" id="org.jboss.tools.hibernate.view.RemoveOrmNatureAction" label="%popupMenus.action.removeOrmNature" menubarPath="RedHat4Web/d">
- </action>
- <filter name="nature" value="org.eclipse.jdt.core.javanature"/>
- </objectContribution>
<objectContribution id="diagramEditorAction" objectClass="org.hibernate.mapping.RootClass">
<menu id="org.jboss.tools.hibernate.ui.view.openDiagram" label="Open Mapping Diagram" path="diagramEditorAction"/>
<action
@@ -47,16 +12,4 @@
</action>
</objectContribution>
</extension>
- <extension point="org.eclipse.ui.decorators">
- <decorator adaptable="false" class="org.jboss.tools.hibernate.view.decorator.LightWeightDecorator" id="org.jboss.tools.hibernate.view.orm2decorator" label="ORM2-Decorator" lightweight="true" location="TOP_LEFT" state="true">
- <enablement>
- <objectClass name="org.jboss.tools.hibernate.core.IOrmElement"/>
- </enablement>
- </decorator>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <page category="org.jboss.tools.hibernate.view.ormpref" class="org.jboss.tools.hibernate.preference.AutoMappingSettingPrefPage" id="org.jboss.tools.hibernate.view.automappingsettingprefpage" name="Auto Mapping Setting"/>
- <page category="org.jboss.tools.common.model.ui" class="org.jboss.tools.hibernate.preference.OrmPreferencesPage" id="org.jboss.tools.hibernate.view.ormpref" name="ORM"/>
- </extension>
-
</plugin>
17 years, 5 months
JBoss Tools SVN: r2614 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: scanner/xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-24 06:26:43 -0400 (Tue, 24 Jul 2007)
New Revision: 2614
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
Log:
EXIN-217 null pointer fixed in SeamProperty
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2007-07-23 16:31:27 UTC (rev 2613)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2007-07-24 10:26:43 UTC (rev 2614)
@@ -27,7 +27,7 @@
public void setValue(ISeamValue value) {
this.value = value;
- adopt((SeamObject)value);
+ if(value != null) adopt((SeamObject)value);
}
public List<Change> merge(SeamObject s) {
@@ -40,11 +40,24 @@
name = d.name;
}
- List<Change> cs = ((SeamObject)value).merge((SeamObject)d.value);
- if(cs != null && cs.size() > 0) {
- Change c = new Change(this, "value", value, value);
- c.addChildren(cs);
- }
+ if(value == null) {
+ if(d.value != null) {
+ setValue(d.value);
+ changes = Change.addChange(changes, new Change(this, "value", null, value));
+ }
+ } else if(d.value == null) {
+ if(value != null) {
+ changes = Change.addChange(changes, new Change(this, "value", value, null));
+ }
+ value = null;
+ } else {
+ List<Change> cs = ((SeamObject)value).merge((SeamObject)d.value);
+ if(cs != null && cs.size() > 0) {
+ Change c = new Change(this, "value", value, value);
+ c.addChildren(cs);
+ changes = Change.addChange(changes, c);
+ }
+ }
return changes;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-23 16:31:27 UTC (rev 2613)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-24 10:26:43 UTC (rev 2614)
@@ -210,6 +210,7 @@
e.setValue(value);
vm.addEntry(e);
}
+ p.setValue(vm);
}
}
component.addProperty(p);
17 years, 5 months
JBoss Tools SVN: r2613 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 12:31:27 -0400 (Mon, 23 Jul 2007)
New Revision: 2613
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF
Log:
JBIDE-605 ORM Explorer returned to previous state.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF 2007-07-23 16:10:07 UTC (rev 2612)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/META-INF/MANIFEST.MF 2007-07-23 16:31:27 UTC (rev 2613)
@@ -23,5 +23,6 @@
org.jboss.tools.common,
org.jboss.tools.common.model,
org.hibernate.eclipse,
- org.jboss.tools.hibernate.core
+ org.jboss.tools.hibernate.core,
+ org.jboss.tools.hibernate.view
Eclipse-LazyStart: true
17 years, 5 months
JBoss Tools SVN: r2612 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-23 12:10:07 -0400 (Mon, 23 Jul 2007)
New Revision: 2612
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/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
http://jira.jboss.com/jira/browse/EXIN-327
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-23 15:47:18 UTC (rev 2611)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-23 16:10:07 UTC (rev 2612)
@@ -39,7 +39,7 @@
* @author Viacheslav Kabanovich
*/
public class SeamPreferences {
-
+
public static final String ERROR = "error";
public static final String WARNING = "warning";
public static final String IGNORE = "ignore";
@@ -87,21 +87,21 @@
severityOptionNames.add(name);
return name;
}
-
+
public static final Set<String> allOptionNames = new HashSet<String>();
-
+
static {
allOptionNames.addAll(severityOptionNames);
}
-
+
public static IEclipsePreferences getProjectPreferences(ISeamProject project) {
return new ProjectScope(project.getProject()).getNode(SeamCorePlugin.PLUGIN_ID);
}
-
+
public static IEclipsePreferences getDefaultPreferences() {
return new DefaultScope().getNode(SeamCorePlugin.PLUGIN_ID);
}
-
+
public static IEclipsePreferences getInstancePreferences() {
return new InstanceScope().getNode(SeamCorePlugin.PLUGIN_ID);
}
@@ -124,4 +124,32 @@
if(p == null) return null;
return p.get(key, null);
}
+
+ public static boolean isValidateCore(ISeamProject project) {
+ return !(SeamPreferences.IGNORE.equals(getProjectPreference(project, NONUNIQUE_COMPONENT_NAME)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, STATEFUL_COMPONENT_WRONG_SCOPE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_COMPONENT_CLASS_NAME)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_COMPONENT_PROPERTY)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, ENTITY_COMPONENT_WRONG_SCOPE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_REMOVE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_DESTROY)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_CREATE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_UNWRAP)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DESTROY_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, CREATE_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNWRAP_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, OBSERVER_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_FACTORY_NAME)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, MULTIPLE_DATA_BINDER)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_DATA_MODEL)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_VARIABLE_NAME)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_VARIABLE_NAME)));
+ }
+
+ public static boolean isValidateEL(ISeamProject project) {
+ return !(SeamPreferences.IGNORE.equals(getProjectPreference(project, INVALID_EXPRESSION)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNPAIRED_GETTER_OR_SETTER)));
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-07-23 15:47:18 UTC (rev 2611)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-07-23 16:10:07 UTC (rev 2612)
@@ -64,6 +64,9 @@
*/
@Override
public IStatus validate(Set<IFile> changedFiles) throws ValidationException {
+ if(!SeamPreferences.isValidateCore(project)) {
+ return OK_STATUS;
+ }
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
Set<ISeamComponent> checkedComponents = new HashSet<ISeamComponent>();
Set<String> markedDuplicateFactoryNames = new HashSet<String>();
@@ -137,22 +140,23 @@
public IStatus validateAll() throws ValidationException {
reporter.removeAllMessages(this);
validationContext.clear();
- Set<ISeamComponent> components = project.getComponents();
- for (ISeamComponent component : components) {
- validateComponent(component);
- }
- Set<ISeamFactory> factories = project.getFactories();
- Set<String> markedDuplicateFactoryNames = new HashSet<String>();
- for (ISeamFactory factory : factories) {
- validateFactory(factory, markedDuplicateFactoryNames);
- }
+ if(SeamPreferences.isValidateCore(project)) {
+ Set<ISeamComponent> components = project.getComponents();
+ for (ISeamComponent component : components) {
+ validateComponent(component);
+ }
+ Set<ISeamFactory> factories = project.getFactories();
+ Set<String> markedDuplicateFactoryNames = new HashSet<String>();
+ for (ISeamFactory factory : factories) {
+ validateFactory(factory, markedDuplicateFactoryNames);
+ }
- Map<String,SeamJavaComponentDeclaration> declarations = ((SeamProject)project).getAllJavaComponentDeclarations();
- Collection<SeamJavaComponentDeclaration> values = declarations.values();
- for (SeamJavaComponentDeclaration d : values) {
- validateMethodsOfUnknownComponent(d);
+ Map<String,SeamJavaComponentDeclaration> declarations = ((SeamProject)project).getAllJavaComponentDeclarations();
+ Collection<SeamJavaComponentDeclaration> values = declarations.values();
+ for (SeamJavaComponentDeclaration d : values) {
+ validateMethodsOfUnknownComponent(d);
+ }
}
-
return OK_STATUS;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-07-23 15:47:18 UTC (rev 2611)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-07-23 16:10:07 UTC (rev 2612)
@@ -69,11 +69,13 @@
@Override
public IStatus validateAll() throws ValidationException {
reporter.removeAllMessages(this);
- SeamELValidationHelper vlh = (SeamELValidationHelper)coreHelper;
- Collection files = vlh.getAllFilesForValidation();
- for (Object file : files) {
- if(file instanceof IFile && !reporter.isCancelled()) {
- validateFile((IFile)file);
+ if(SeamPreferences.isValidateEL(project)) {
+ SeamELValidationHelper vlh = (SeamELValidationHelper)coreHelper;
+ Collection files = vlh.getAllFilesForValidation();
+ for (Object file : files) {
+ if(file instanceof IFile && !reporter.isCancelled()) {
+ validateFile((IFile)file);
+ }
}
}
return OK_STATUS;
17 years, 5 months
JBoss Tools SVN: r2611 - trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 11:47:18 -0400 (Mon, 23 Jul 2007)
New Revision: 2611
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java
Log:
EXIN-326 - xmodel objects for core:entity-manager-factory implemented
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java 2007-07-23 15:47:03 UTC (rev 2610)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java 2007-07-23 15:47:18 UTC (rev 2611)
@@ -34,6 +34,9 @@
static String ENT_CONFIG_LOCATIONS = "SeamSpringConfigLocations";
static String ENT_CONTEXT_LOADER = "SeamSpringContextLoader";
+ static String ENT_ENTITY_MANAGER_FACTORY = "SeamCoreEntityManagerFactory";
+ static String ENT_PERSISTENCE_UNIT_PROPERTIES = "SeamCorePersistenceUnitProperties";
+
private static IFormData createListDefinition(String header) {
return new FormData(
header,
@@ -116,6 +119,33 @@
);
}
+ private static IFormData createMapDefinition2(String header, String child) {
+ return new FormData(
+ header,
+ SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
+ child,
+ new FormAttributeData[]{new FormAttributeData(ATTR_KEY, 40), new FormAttributeData(ATTR_VALUE, 60)},
+ new String[]{ENT_SEAM_MAP_ENTRY},
+ FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddEntry") //$NON-NLS-1$
+ );
+ }
+
+ private static IFormData[] createDefinitionsForMapHolder(String header, String entity, String listHeader, String child) {
+ return new IFormData[] {
+ new FormData(
+ header,
+ SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
+ FormLayoutDataUtil.createGeneralFormAttributeData(entity)
+ ),
+ createMapDefinition2(listHeader, child),
+ new FormData(
+ "Advanced",
+ SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
+ FormLayoutDataUtil.createAdvancedFormAttributeData(entity)
+ ),
+ };
+ }
+
private final static IFormData[] HINTS_DEFINITIONS = new IFormData[] {
createMapDefinition("Hints")
};
@@ -130,6 +160,20 @@
final static IFormData RESTRICTIONS_FORM_DEFINITION = new FormData(
ENT_RESTRICTIONS, new String[]{null}, RESTRICTIONS_DEFINITIONS);
+
+ private final static IFormData[] PERSISTENCE_UNIT_PROPERTIES_DEFINITIONS = new IFormData[] {
+ createMapDefinition("Persistence Unit Properties")
+ };
+
+ final static IFormData PERSISTENCE_UNIT_PROPERTIES_FORM_DEFINITION = new FormData(
+ ENT_PERSISTENCE_UNIT_PROPERTIES, new String[]{null}, PERSISTENCE_UNIT_PROPERTIES_DEFINITIONS);
+
+ private final static IFormData[] ENTITY_MANAGER_FACTORY_DEFINITIONS =
+ createDefinitionsForMapHolder("Entity Manager Factory", ENT_ENTITY_MANAGER_FACTORY, "Persistence Unit Properties", "persistence unit properties");
+
+ final static IFormData ENTITY_MANAGER_FACTORY_FORM_DEFINITION = new FormData(
+ ENT_ENTITY_MANAGER_FACTORY, new String[]{null}, ENTITY_MANAGER_FACTORY_DEFINITIONS);
+
/**
* Theme
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java 2007-07-23 15:47:03 UTC (rev 2610)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java 2007-07-23 15:47:18 UTC (rev 2611)
@@ -43,6 +43,9 @@
PropertyListFormLayoutData.CONFIG_LOCATIONS_FORM_DEFINITION,
PropertyListFormLayoutData.CONTEXT_LOADER_FORM_DEFINITION,
+
+ PropertyListFormLayoutData.ENTITY_MANAGER_FACTORY_FORM_DEFINITION,
+ PropertyListFormLayoutData.PERSISTENCE_UNIT_PROPERTIES_FORM_DEFINITION,
};
17 years, 5 months
JBoss Tools SVN: r2610 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 11:47:03 -0400 (Mon, 23 Jul 2007)
New Revision: 2610
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta
Log:
EXIN-326 - xmodel objects for core:entity-manager-factory implemented
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2007-07-23 15:42:13 UTC (rev 2609)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2007-07-23 15:47:03 UTC (rev 2610)
@@ -255,6 +255,64 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactoryClassName=org.jboss.tools.common.model.ui.forms.LayouredFormFactory;formLayoutDataClassName=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="core:entity-manager-factory" name="SeamCoreEntityManagerFactory">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamCorePersistenceUnitProperties" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.core.timeZoneSelector" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="entity manager factory"
+ loader="ElementType" name="element type">
+ <Constraint/>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create"
+ entity="SeamComponent" name="component"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="persistence-unit-name" xmlname="persistence-unit-name">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Constraint/>
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactoryClassName=org.jboss.tools.common.model.ui.forms.LayouredFormFactory;formLayoutDataClassName=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;children=%Ordered%;childrenLoader=list;saveDefault=false"
XMLSUBPATH="core:filters" name="SeamCoreFilters">
<XChildrenEntities>
@@ -837,6 +895,68 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactoryClassName=org.jboss.tools.common.model.ui.forms.LayouredFormFactory;formLayoutDataClassName=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;children=%Ordered%;childrenLoader=map;saveDefault=false"
+ XMLSUBPATH="core:persistence-unit-properties" name="SeamCorePersistenceUnitProperties">
+ <XChildrenEntities>
+ <XChildEntity name="SeamMapEntry"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="persistence-unit-properties"
+ loader="ElementType" name="element type">
+ <Constraint/>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="persistence unit properties" name="name">
+ <Constraint/>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Constraint/>
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add Entry..."
+ kind="action" name="AddEntry">
+ <EntityData EntityName="SeamMapEntry">
+ <AttributeData AttributeName="key"/>
+ <AttributeData AttributeName="value"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.newclass" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactoryClassName=org.jboss.tools.common.model.ui.forms.LayouredFormFactory;formLayoutDataClassName=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="core:pojo-cache" name="SeamCorePojoCache">
<XChildrenEntities/>
@@ -1139,6 +1259,7 @@
<XChildEntity name="SeamCoreResourceBundle"/>
<XChildEntity name="SeamCoreTimeZoneSelector"/>
<XChildEntity name="SeamCoreManagedPersistenceContext"/>
+ <XChildEntity name="SeamCoreEntityManagerFactory"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -1254,6 +1375,14 @@
<AttributeData AttributeName="persistence-unit-jndi-name" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Entity Manager Factory..." kind="action" name="AddEntityManagerFactory">
+ <EntityData EntityName="SeamCoreEntityManagerFactory">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="persistence-unit-name" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
@@ -1374,6 +1503,14 @@
<AttributeData AttributeName="persistence-unit-jndi-name" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Entity Manager Factory..." kind="action" name="AddEntityManagerFactory">
+ <EntityData EntityName="SeamCoreEntityManagerFactory">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="persistence-unit-name" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
17 years, 5 months
JBoss Tools SVN: r2609 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-23 11:42:13 -0400 (Mon, 23 Jul 2007)
New Revision: 2609
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
Log:
EXIN-86 xml validation by meta for components.xml fixed
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2007-07-23 15:25:04 UTC (rev 2608)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2007-07-23 15:42:13 UTC (rev 2609)
@@ -158,6 +158,9 @@
Node n = nl.item(i);
if(n.getNodeType() == Node.ELEMENT_NODE) {
String name = n.getNodeName();
+ if(namespaceMapping != null) {
+ name = namespaceMapping.convertToDefault(name);
+ }
if(allowed.contains(name)) continue;
error = "Unallowed child " + name + " of " + element.getNodeName() + ":0:0";
return true;
17 years, 5 months
JBoss Tools SVN: r2608 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2007-07-23 11:25:04 -0400 (Mon, 23 Jul 2007)
New Revision: 2608
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-531. javadoc fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2007-07-23 14:46:22 UTC (rev 2607)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2007-07-23 15:25:04 UTC (rev 2608)
@@ -304,17 +304,29 @@
boolean isCaseSensitive();
/**
- * Return <code>true</code> if the element has visual preview on tab 'Preview', otherwise <code>false</code>.
- * This value initialized in attribute <b>haveVisualPreview</b> for tag <b><vpe:template></b>.
- * Default value <code>true</code> if this attribute not present. <br/>For example tag <code><h:form></code>:<br/>
- * In visual editor (see tab 'Visual') have a red border, but it not visible on tab 'Preview'. See part code for this template:<br>
- * <code><vpe:template children="yes" modify="yes" haveVisualPreview="no"></code><br><br>
- *This element have visible on tab 'Preview:'<br/>
- *<code><vpe:template children="yes" modify="yes" haveVisualPreview="yes"></code> <br/>
- *or<br/>
- *<code><vpe:template children="yes" modify="yes" ></code><br/>
- * <br/><br/>This element have not visible on tab 'Preview':<br/>
- * <code><vpe:template children="yes" modify="yes" haveVisualPreview="no"></code>
+ * Return <code>true</code> if the element has visual representation on tab
+ * 'Preview', otherwise <code>false</code>.<br/>
+ * This value is initialized by attribute <b>haveVisualPreview</b> of tag
+ * <b><vpe:template></b>. If the attribute is not presented default
+ * value is <code>true</code>.<br/>
+ * <br/>
+ * Example:<br/>
+ * JSF tag <code><h:form></code>:<br/>
+ * <code>
+ * <vpe:tag name="h:form" case-sensitive="yes"><br/>
+ * <vpe:template children="yes" modify="yes" haveVisualPreview="no"><br/>
+ * <div style="border:1px dotted #FF6600;padding: 5px;" title="{tagstring()}"/><br/>
+ * <vpe:dnd><br/>
+ * <vpe:drag start-enable="yes"/><br/>
+ * <vpe:drop container="yes"/><br/>
+ * </vpe:dnd><br/>
+ * </vpe:template><br/>
+ * </vpe:tag><br/>
+ * </code><br/>
+ * In visual editor part (see tab 'Visual') the tag have a red border for
+ * visualization reason, but it is not visual element and it shouldn't have
+ * visual representation on tab 'Preview'.<br/>
+ * <br/>
* @return <code>true</code> if the element is have visual preview
*/
boolean isHaveVisualPreview();
17 years, 5 months
JBoss Tools SVN: r2607 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-07-23 10:46:22 -0400 (Mon, 23 Jul 2007)
New Revision: 2607
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-104?page=all minor change
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-07-23 14:10:02 UTC (rev 2606)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml 2007-07-23 14:46:22 UTC (rev 2607)
@@ -13,7 +13,7 @@
<section id="JDKInstalling">
<?dbhtml filename="JDKInstalling.html"?>
<title>JDK Installation</title>
- <para>Before installing Red Hat Developer Studio make sure you have an appropriate JDK version installed on your Linux system. Studio will properly work with the next JDK's:</para>
+ <para>Before installing Red Hat Developer Studio make sure you have an appropriate JDK version installed on your computer. Studio will properly work with the next JDK's:</para>
<itemizedlist>
<listitem>JDK 1.5</listitem>
<listitem>JDK 1.6</listitem>
17 years, 5 months
JBoss Tools SVN: r2606 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-23 10:10:02 -0400 (Mon, 23 Jul 2007)
New Revision: 2606
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/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
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/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
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.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
Log:
http://jira.jboss.com/jira/browse/JBIDE-517
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-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -80,6 +80,7 @@
// Seam Expression language
public static final String INVALID_EXPRESSION = createSeverityOption("invalidExpression");
+ public static final String UNPAIRED_GETTER_OR_SETTER = createSeverityOption("unpairedGetterOrSetter");
private static String createSeverityOption(String shortName) {
String name = SeamCorePlugin.PLUGIN_ID + ".validator.problem." + shortName;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -64,7 +65,7 @@
if(document!=null) {
documentContent = document.get();
}
- return getCompletions(project, file, documentContent, prefix, position, false);
+ return getCompletions(project, file, documentContent, prefix, position, false, null, null);
}
/**
@@ -75,6 +76,8 @@
* @param prefix the prefix to search for
* @param position Offset of the prefix
* @return the list of all possible suggestions
+ * @param usedVariables - Set of variables which are used in this Expression. It's useful in incremental validation.
+ * @param unpairedGettersOrSetters - map of unpaired getters or setters of property which is used in last segment of Expression. 'key' is property name.
* @param returnCompletedVariablesOnly - if 'true' then returns only variables that equals prefix. It's useful for validation.
* for example:
* we have 'variableName.variableProperty', 'variableName.variableProperty1', 'variableName.variableProperty2'
@@ -87,7 +90,7 @@
* Result is {'1','2'}
*/
public List<String> getCompletions(ISeamProject project, IFile file, String documentContent, CharSequence prefix,
- int position, boolean returnEqualedVariablesOnly) throws BadLocationException, StringIndexOutOfBoundsException {
+ int position, boolean returnEqualedVariablesOnly, Set<ISeamContextVariable> usedVariables, Map<String, IMethod> unpairedGettersOrSetters) throws BadLocationException, StringIndexOutOfBoundsException {
List<String> res= new ArrayList<String>();
SeamELTokenizer tokenizer = new SeamELTokenizer(documentContent, position + prefix.length());
@@ -112,6 +115,11 @@
}
}
+ // Save all resolved variables. It's useful for incremental validation.
+ if(resolvedVariables!=null && resolvedVariables.size()>0 && usedVariables!=null) {
+ usedVariables.addAll(resolvedVariables);
+ }
+
// Here we have a list of vars for some part of expression
// OK. we'll proceed with members of these vars
if (areEqualExpressions(resolvedExpressionPart, tokens)) {
@@ -201,7 +209,7 @@
try {
IType type = (mbr instanceof IType ? (IType)mbr : EclipseJavaUtil.findType(mbr.getJavaProject(), EclipseJavaUtil.getMemberTypeAsString(mbr)));
proposals.addAll(SeamExpressionResolver.getMethodPresentations(type));
- proposals.addAll(SeamExpressionResolver.getPropertyPresentations(type));
+ proposals.addAll(SeamExpressionResolver.getPropertyPresentations(type, unpairedGettersOrSetters));
} catch (JavaModelException ex) {
SeamCorePlugin.getPluginLog().logError(ex);
}
@@ -219,7 +227,7 @@
type = EclipseJavaUtil.findType(mbr.getJavaProject(), EclipseJavaUtil.getMemberTypeAsString(mbr));
}
proposalsToFilter.addAll(SeamExpressionResolver.getMethodPresentations(type));
- proposalsToFilter.addAll(SeamExpressionResolver.getPropertyPresentations(type));
+ proposalsToFilter.addAll(SeamExpressionResolver.getPropertyPresentations(type, unpairedGettersOrSetters));
} catch (JavaModelException ex) {
SeamCorePlugin.getPluginLog().logError(ex);
}
@@ -231,6 +239,14 @@
// This is used for validation.
if (proposal.equals(filter)) {
proposals.add(proposal);
+ if(unpairedGettersOrSetters!=null) {
+ IMethod unpirMethod = unpairedGettersOrSetters.get(filter);
+ unpairedGettersOrSetters.clear();
+ if(unpirMethod!=null) {
+ unpairedGettersOrSetters.put(filter, unpirMethod);
+ }
+ }
+ break;
}
} else {
// This is used for CA.
@@ -243,7 +259,7 @@
res.addAll(proposals);
}
}
-
+
return res;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -13,8 +13,10 @@
import java.lang.reflect.Modifier;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -256,21 +258,57 @@
* @return
*/
public static Set<String> getPropertyPresentations(IType type) {
+ return getPropertyPresentations(type, null);
+ }
+
+ /**
+ * Returns the property presentation strings for the type specified
+ *
+ * @param type
+ * @param unpairedGettersOrSetters - map of unpaired getters or setters of type's properties. 'key' is property name.
+ * @return
+ */
+ public static Set<String> getPropertyPresentations(IType type, Map<String, IMethod> unpairedGettersOrSetters) {
Set<String> properties = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
if (type != null) {
try {
IMethod[] props = type.getMethods();
+ HashMap<String, IMethod> getters = new HashMap<String, IMethod>();
+ HashMap<String, IMethod> setters = new HashMap<String, IMethod>();
for (int i = 0; props != null && i < props.length; i++) {
IMethod m = props[i];
- if (Modifier.isPublic(m.getFlags()) &&
- (m.getElementName().startsWith("get") && !"get".equals(m.getElementName())) ||
- (m.getElementName().startsWith("set") && !"set".equals(m.getElementName()))) {
-
- StringBuffer name = new StringBuffer(m.getElementName());
- name.delete(0, 3);
- name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
-
- properties.add(name.toString());
+ if (Modifier.isPublic(m.getFlags())) {
+ String methodName = m.getElementName();
+ boolean getter = (methodName.startsWith("get") && !"get".equals(methodName)) ||
+ (methodName.startsWith("is") && !"is".equals(methodName));
+ boolean setter = methodName.startsWith("set") && !"set".equals(methodName);
+ if(getter || setter) {
+ StringBuffer name = new StringBuffer(methodName);
+ if(methodName.startsWith("i")) {
+ name.delete(0, 2);
+ } else {
+ name.delete(0, 3);
+ }
+ name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
+ String propertyName = name.toString();
+ if(!properties.contains(propertyName)) {
+ properties.add(propertyName);
+ }
+ if(unpairedGettersOrSetters!=null) {
+ IMethod previousGetter = getters.get(propertyName);
+ IMethod previousSetter = setters.get(propertyName);
+ if((previousGetter!=null && setter)||(previousSetter!=null && getter)) {
+ // We have both Getter and Setter
+ unpairedGettersOrSetters.remove(propertyName);
+ } else if(setter) {
+ setters.put(propertyName, m);
+ unpairedGettersOrSetters.put(propertyName, m);
+ } else if(getter) {
+ getters.put(propertyName, m);
+ unpairedGettersOrSetters.put(propertyName, m);
+ }
+ }
+ }
}
}
} catch (JavaModelException e) {
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-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/preferences/SeamPreferenceInitializer.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -33,5 +33,6 @@
}
defaultPreferences.put(SeamPreferences.INVALID_EXPRESSION, SeamPreferences.WARNING);
defaultPreferences.put(SeamPreferences.UNKNOWN_VARIABLE_NAME, SeamPreferences.WARNING);
+ defaultPreferences.put(SeamPreferences.UNPAIRED_GETTER_OR_SETTER, SeamPreferences.WARNING);
}
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -12,14 +12,17 @@
import java.io.IOException;
import java.util.Collection;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.text.BadLocationException;
@@ -36,6 +39,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
@@ -187,39 +191,55 @@
}
for(EL el: els) {
- if(!validateEl(file, el)) {
- // Mark EL
- addError(INVALID_EXPRESSION_MESSAGE_ID, SeamPreferences.INVALID_EXPRESSION, new String[]{el.getValue()}, el.getLength(), el.getOffset(), file, MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
- }
+ validateEl(file, el);
}
}
- private boolean validateEl(IFile file, EL el) {
+ private void validateEl(IFile file, EL el) {
try {
-// String exp = "#{" + el.value + "}";
String exp = el.value;
int offset = exp.length();
-// String prefix= SeamELCompletionEngine.getPrefix(exp, offset);
-// prefix = (prefix == null ? "" : prefix);
String prefix = SeamELCompletionEngine.getPrefix(exp, offset);
- if(prefix==null) {
- return false;
- }
- int possition = 0;
+ if(prefix!=null) {
+ int possition = 0;
+
+ Set<ISeamContextVariable> usedVariables = new HashSet<ISeamContextVariable>();
+ Map<String, IMethod> unpairedGettersOrSetters = new HashMap<String, IMethod>();
+
+ List<String> suggestions = engine.getCompletions(project, file, exp, prefix, possition, true, usedVariables, unpairedGettersOrSetters);
- // TODO ?
- List<String> suggestions = engine.getCompletions(project, file, exp, prefix, possition, true);
+ // Check pair for getter/setter
+ if(unpairedGettersOrSetters.size()>0) {
+ IMethod unpairedMethod = unpairedGettersOrSetters.values().iterator().next();
+ String methodName = unpairedMethod.getElementName();
+// int indexOfPropertyName = 3;
+// if(methodName.startsWith("i")) {
+// indexOfPropertyName = 2;
+// }
+ String propertyName = unpairedGettersOrSetters.keySet().iterator().next();
+// propertyName.setCharAt(0, Character.toLowerCase(propertyName.charAt(0)));
+ String missingMethodName = "Setter";
+ String existedMethodName = "Getter";
+ if(methodName.startsWith("s")) {
+ missingMethodName = existedMethodName;
+ existedMethodName = "Setter";
+ }
+ addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, el.getLength(), el.getOffset(), file, MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
+ }
- if (suggestions != null && suggestions.size() > 0) {
- return true;
+ if (suggestions != null && suggestions.size() > 0) {
+ // It's valid EL.
+ return;
+ }
}
} catch (BadLocationException e) {
SeamCorePlugin.getDefault().logError("Error validating Seam EL", e);
} catch (StringIndexOutOfBoundsException e) {
SeamCorePlugin.getDefault().logError("Error validating Seam EL", e);
}
- return false;
+ // Mark invalid EL
+ addError(INVALID_EXPRESSION_MESSAGE_ID, SeamPreferences.INVALID_EXPRESSION, new String[]{el.getValue()}, el.getLength(), el.getOffset(), file, MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
}
private IJavaProject getJavaProject() {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -54,6 +54,7 @@
protected static final String UNKNOWN_COMPONENT_CLASS_NAME_MESSAGE_ID = "UNKNOWN_COMPONENT_CLASS_NAME";
protected static final String UNKNOWN_COMPONENT_PROPERTY_MESSAGE_ID = "UNKNOWN_COMPONENT_PROPERTY";
protected static final String INVALID_EXPRESSION_MESSAGE_ID = "INVALID_EXPRESSION";
+ protected static final String UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID = "UNPAIRED_GETTER_OR_SETTER";
protected SeamValidationHelper coreHelper;
protected IReporter reporter;
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-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-23 14:10:02 UTC (rev 2606)
@@ -41,4 +41,5 @@
UNKNOWN_VARIABLE_NAME=Unknown context variable name: {0}
#Seam Expression language
-INVALID_EXPRESSION=Invalid Expression: {0}
\ No newline at end of file
+INVALID_EXPRESSION=Invalid Expression: {0}
+UNPAIRED_GETTER_OR_SETTER=Property "{0}" has only {1}. {2} is missing.
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -66,6 +66,7 @@
//Seam Expression language
public static String SeamValidatorConfigurationBlock_section_el;
public static String SeamValidatorConfigurationBlock_pb_invalidExpression_label;
+ public static String SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label;
static {
NLS.initializeMessages(BUNDLE_NAME, SeamPreferencesMessages.class);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2007-07-23 14:10:02 UTC (rev 2606)
@@ -55,4 +55,5 @@
##Seam Expression language
SeamValidatorConfigurationBlock_section_el=Expression language
-SeamValidatorConfigurationBlock_pb_invalidExpression_label=Invalid Expression:
\ No newline at end of file
+SeamValidatorConfigurationBlock_pb_invalidExpression_label=Invalid Expression:
+SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label=Unpaired Getter/Setter:
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2007-07-23 14:04:30 UTC (rev 2605)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2007-07-23 14:10:02 UTC (rev 2606)
@@ -113,6 +113,7 @@
SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_el,
new String[][]{
{SeamPreferences.INVALID_EXPRESSION, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_invalidExpression_label},
+ {SeamPreferences.UNPAIRED_GETTER_OR_SETTER, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unpairedGetterOrSetter_label}
}
);
17 years, 5 months