JBoss Tools SVN: r2402 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-12 10:41:42 -0400 (Thu, 12 Jul 2007)
New Revision: 2402
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/project/facet/SeamFacetInstallDelegete.java
Log:
EXIN-217 XModel configured in seam facet
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-12 13:56:17 UTC (rev 2401)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-12 14:41:42 UTC (rev 2402)
@@ -260,6 +260,10 @@
current = null;
c = getComponent(name);
} else {
+ if(loaded instanceof ISeamXmlComponentDeclaration) {
+ ISeamXmlComponentDeclaration xml = (ISeamXmlComponentDeclaration)loaded;
+ onXMLLoadedDeclaration(c, oldClassName, xml);
+ }
continue;
}
}
@@ -292,24 +296,7 @@
}
} else if(loaded instanceof ISeamXmlComponentDeclaration) {
ISeamXmlComponentDeclaration xml = (ISeamXmlComponentDeclaration)loaded;
- String className = xml.getClassName();
- List<Change> changes = null;
- if(isClassNameChanged(oldClassName, className)) {
- SeamComponentDeclaration[] ds1 = c.getAllDeclarations().toArray(new SeamComponentDeclaration[0]);
- for (int i1 = 0; i1 < ds1.length; i1++) {
- if(!(ds1[i1] instanceof ISeamJavaComponentDeclaration)) continue;
- ISeamJavaComponentDeclaration jcd = (ISeamJavaComponentDeclaration)ds1[i1];
- if(jcd.getClassName().equals(className)) continue;
- c.removeDeclaration(jcd);
- changes = Change.addChange(changes, new Change(c, null, jcd, null));
- }
- }
- SeamJavaComponentDeclaration j = javaDeclarations.get(className);
- if(j != null) {
- c.addDeclaration(j);
- changes = Change.addChange(changes, new Change(c, null, null, j));
- }
- fireChanges(changes);
+ onXMLLoadedDeclaration(c, oldClassName, xml);
}
}
fireChanges(addedComponents);
@@ -350,6 +337,27 @@
if(newClassName == null || newClassName.length() == 0) return false;
return !oldClassName.equals(newClassName);
}
+
+ private void onXMLLoadedDeclaration(SeamComponent c, String oldClassName, ISeamXmlComponentDeclaration xml) {
+ String className = xml.getClassName();
+ List<Change> changes = null;
+ if(isClassNameChanged(oldClassName, className)) {
+ SeamComponentDeclaration[] ds1 = c.getAllDeclarations().toArray(new SeamComponentDeclaration[0]);
+ for (int i1 = 0; i1 < ds1.length; i1++) {
+ if(!(ds1[i1] instanceof ISeamJavaComponentDeclaration)) continue;
+ ISeamJavaComponentDeclaration jcd = (ISeamJavaComponentDeclaration)ds1[i1];
+ if(jcd.getClassName().equals(className)) continue;
+ c.removeDeclaration(jcd);
+ changes = Change.addChange(changes, new Change(c, null, jcd, null));
+ }
+ }
+ SeamJavaComponentDeclaration j = javaDeclarations.get(className);
+ if(j != null && !c.getAllDeclarations().contains(j)) {
+ c.addDeclaration(j);
+ changes = Change.addChange(changes, new Change(c, null, null, j));
+ }
+ fireChanges(changes);
+ }
/**
* Package local method called by builder.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-07-12 13:56:17 UTC (rev 2401)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-07-12 14:41:42 UTC (rev 2402)
@@ -13,7 +13,9 @@
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
+import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
@@ -27,9 +29,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.core.JavaModel;
-import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -300,10 +299,11 @@
new FilterSetCollection(projectFilterSet), true);
}
+ writeXModel(project, model);
+
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- //TODO check if template file org.jboss.tools.jst.web.xml is added to .settings
EclipseResourceUtil.addNatureToProject(project, "org.jboss.tools.jsf.jsfnature");
EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
@@ -499,5 +499,55 @@
}
}
+ private void writeXModel(IProject project, IDataModel model) {
+ String projectName = project.getName();
+ String webContent = "WebContent";
+
+ //TODO This returns null. Why? How else can we get WebContent folder name?
+ webContent = (String)model.getProperty(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER);
+
+ if(webContent == null) {
+ webContent = "WebContent";
+ }
+ String src = "src";
+
+ String[] srcs = EclipseResourceUtil.getJavaProjectSrcLocations(project);
+ if (srcs.length > 0) {
+ src = srcs[0].replace('\\','/').substring(srcs[0].lastIndexOf('/') + 1);
+ }
+ File location = new File(project.getLocation().toFile(),".settings/org.jboss.tools.jst.web.xml");
+
+ Object[] arguments = {
+ projectName,
+ webContent,
+ src
+ };
+ String body = MessageFormat.format(XMODEL, arguments);
+
+ org.jboss.tools.common.util.FileUtil.writeFile(location, body);
+ }
+ /**
+ * {0} - project name
+ * {1} - WebContent folder name
+ * {2} - src folder name
+ */
+ private static String XMODEL =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+ "<FILESYSTEMS APPLICATION_NAME=\"{0}\" ENTITY=\"FileSystems\"" +
+ " VERSION=\"2.0.0\" WORKSPACE_HOME=\"./{1}/WEB-INF\">" +
+ "<FILESYSTEM ENTITY=\"FileSystemFolder\" LOCATION=\"%redhat.workspace%\" NAME=\"WEB-INF\"/>" +
+ "<FILESYSTEM ENTITY=\"FileSystemFolder\" INFO=\"Content-Type=Web\"" +
+ " LOCATION=\"%redhat.workspace%/..\" NAME=\"WEB-ROOT\"/>" +
+ "<FILESYSTEM ENTITY=\"FileSystemFolder\"" +
+ " LOCATION=\"%redhat.workspace%/../../{2}\" NAME=\"src\"/>" +
+ "<FILESYSTEM ENTITY=\"FileSystemFolder\" LOCATION=\"%redhat.workspace%/lib\" NAME=\"lib\"/>" +
+ "<FILESYSTEM ENTITY=\"FileSystemFolder\"" +
+ " LOCATION=\"%redhat.workspace%/classes\" NAME=\"classes\"/>" +
+ "<WEB ENTITY=\"JstWeb\" MODEL_PATH=\"/web.xml\" SERVLET_VERSION=\"2.4\">" +
+ " <MODULE ENTITY=\"WebJSFModule\" MODEL_PATH=\"/faces-config.xml\"" +
+ " ROOT=\"WEB-ROOT\" SRC=\"src\" URI=\"/WEB-INF/faces-config.xml\"/>" +
+ "</WEB>" +
+ "</FILESYSTEMS>"
+ ;
}
17 years, 6 months
JBoss Tools SVN: r2401 - in trunk/documentation/GettingStartedGuide/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-07-12 09:56:17 -0400 (Thu, 12 Jul 2007)
New Revision: 2401
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/DataFields.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/EditPage.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/GeneratedEditPage.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/HQLDesignerView.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/NoButtons.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SearchPage.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SearchPanel.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/ValidationInEditPage.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
Log:
http://jira.jboss.org/jira/browse/EXIN-353 added new screenshots, updated textual context
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/DataFields.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/EditPage.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/GeneratedEditPage.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/HQLDesignerView.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/NoButtons.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SearchPage.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SearchPanel.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/ValidationInEditPage.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-12 13:24:46 UTC (rev 2400)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-12 13:56:17 UTC (rev 2401)
@@ -415,11 +415,11 @@
<para>You can search for any "checknumber" by typing in the number or by paging through the list
of payments. But what if you only knew a few of the digits/alphabets in the "checknumber"? It
would be very useful to filter the list based on that. AJAX provides very useful techniques to
- build these types of applications and Ajax4Jsf provides the building blocks to simplify these
+ build these types of applications and Ajax4jsf provides the building blocks to simplify these
techniques.</para>
<para>Double Click on the PaymentsList.xhtml to open the visual facelet designer. You will
notice that in the beginning of the source, Seam Gen has already add the tag library references
- to Ajax4Jsf and RichFaces as shown below.</para>
+ to Ajax4jsf and RichFaces as shown below.</para>
<programlisting role="JAVA"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
@@ -435,7 +435,7 @@
<listitem>Letting the framework know on which event to send an AJAX request to the server.</listitem>
<listitem>Specifying what component(s) to update with the output from the server.</listitem>
</itemizedlist>
-<para>Ajax4Jsf provides a simple JSF component <emphasis role="bold"><property><aj4:support></property></emphasis> that simplifies this process. Let us
+<para>Ajax4jsf provides a simple JSF component <emphasis role="bold"><property><aj4:support></property></emphasis> that simplifies this process. Let us
take our example and add AJAX to it.</para>
<itemizedlist>
<listitem>Click on the checknumber field in the visual designer, it will position you at the
@@ -448,7 +448,7 @@
</h:inputText>
]]></programlisting>
<itemizedlist continuation="continues">
-<listitem>Now let us add the AJAX support tag to let Ajax4Jsf know that when the user presses a
+<listitem>Now let us add the AJAX support tag to let Ajax4jsf know that when the user presses a
key we want to go to the server to get a list of payments that match the characters entered in
the checknumber text box. Add the tag that is highlighted below to the inputText tag.</listitem>
</itemizedlist>
@@ -459,7 +459,7 @@
]]></programlisting>
<para>This tag is pretty self explanatory, it posts the server when a key is pressed and then
takes the response from the server and re-renders the section of the page that has an id of
- "paymentList".</para>
+ "paymentsList".</para>
<itemizedlist continuation="continues">
<listitem>If you follow along in the page, you will see that the section that displays the
results is in a div tag that has an id of "paymentsList"</listitem>
@@ -483,12 +483,17 @@
<imagedata fileref="images/DataFields.png"/>
</imageobject>
</mediaobject>
+<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Buttons.png"/>
+ </imageobject>
+</mediaobject>
</figure>
<para>But there is still one more problem in this page, you will see that the "Next" and
"Previous" buttons will be displayed even for search results that are small as shown above.</para>
<itemizedlist continuation="continues">
<listitem>The tag that we added in the previous step only updates the table. Let us add an AJAX
-region around the page buttons at the bottom of the table. This will allow Ajax4Jsf to update
+region around the page buttons at the bottom of the table. This will allow Ajax4jsf to update
those buttons independently.</listitem>
</itemizedlist>
<programlisting role="JSP"><![CDATA[<a4j:outputPanel ajaxRendered="true">
@@ -513,7 +518,7 @@
the "checknumber" field, there is no visual feedback to the user that there is a request being
made to the server.</listitem>
</itemizedlist>
- <para>Ajax4Jsf has a pre-built tag <emphasis role="bold"><property><a4j:status></property></emphasis> that allows you to either render a text or an
+ <para>Ajax4jsf has a pre-built tag <emphasis role="bold"><property><a4j:status></property></emphasis> that allows you to either render a text or an
image in response to an AJAX event. Add the following code, right after the end of the
<emphasis role="bold"><property><h:inputText></property></emphasis> tag.</para>
<programlisting role="JSP"><![CDATA[<a4j:status>
@@ -555,7 +560,7 @@
allow users to change numerical values without using the keyboard.</para>
<para>Double Click on the OrderdetailsEdit.xhtml to open the visual facelet designer. You will
notice that in the beginning of the source, Seam Gen has already included the tag library
- references to Ajax4Jsf and RichFaces as shown below.</para>
+ references to Ajax4jsf and RichFaces as shown below.</para>
<programlisting role="JSP"><![CDATA[<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
@@ -675,7 +680,7 @@
</h:inputText>
</s:decorate>
]]></programlisting>
-<para>Seam uses Ajax4Jsf to make a server side call to validate the field.</para>
+<para>Seam uses Ajax4jsf to make a server side call to validate the field.</para>
</section>
</section>
17 years, 6 months
JBoss Tools SVN: r2400 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-07-12 09:24:46 -0400 (Thu, 12 Jul 2007)
New Revision: 2400
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
Log:
EXIN-366: Adding elements on the diagram by double-click on fields of classes which have additional information in mapping files
Add <joined-subclass> presentation
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-07-12 13:23:15 UTC (rev 2399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-07-12 13:24:46 UTC (rev 2400)
@@ -33,6 +33,7 @@
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
public class OrmLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
@@ -83,8 +84,8 @@
} else {
return name;
}
- } else if (element instanceof SingleTableSubclass) {
- String name = (String)ormModelNameVisitor.visitPersistentClass((SingleTableSubclass)element, null);
+ } else if (element instanceof Subclass) {
+ String name = (String)ormModelNameVisitor.visitPersistentClass((Subclass)element, null);
if (name == null) {
return "OrmElement";
} else {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-07-12 13:23:15 UTC (rev 2399)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-07-12 13:24:46 UTC (rev 2400)
@@ -20,6 +20,7 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
/**
@@ -495,7 +496,7 @@
return name.toString();
}
- public Object visitPersistentClass(SingleTableSubclass clazz, Object argument) {
+ public Object visitPersistentClass(Subclass clazz, Object argument) {
StringBuffer name = new StringBuffer();
// if (((OrmContentProvider) viewer.getContentProvider()).getTip() == OrmContentProvider.PACKAGE_CLASS_FIELD_CONTENT_PROVIDER) {
17 years, 6 months
JBoss Tools SVN: r2399 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors: parts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-07-12 09:23:15 -0400 (Thu, 12 Jul 2007)
New Revision: 2399
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/OrmShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java
Log:
EXIN-366: Adding elements on the diagram by double-click on fields of classes which have additional information in mapping files
Add <joined-subclass> representation
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-12 11:42:40 UTC (rev 2398)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-12 13:23:15 UTC (rev 2399)
@@ -23,6 +23,7 @@
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.DependantValue;
+import org.hibernate.mapping.JoinedSubclass;
import org.hibernate.mapping.KeyValue;
import org.hibernate.mapping.OneToMany;
import org.hibernate.mapping.PersistentClass;
@@ -30,6 +31,7 @@
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.Value;
import org.hibernate.type.EntityType;
@@ -141,10 +143,10 @@
ormShape = new SpecialOrmShape(specialRootClass);
getChildren().add(ormShape);
elements.put(specialRootClass.getClassName(), ormShape);
- } else if (ormElement instanceof SingleTableSubclass) {
+ } else if (ormElement instanceof Subclass) {
ormShape = new OrmShape(ormElement);
getChildren().add(ormShape);
- elements.put(((SingleTableSubclass)ormElement).getEntityName(), ormShape);
+ elements.put(((Subclass)ormElement).getClassName(), ormShape);
}
return ormShape;
}
@@ -183,11 +185,23 @@
RootClass rc = (RootClass)persistentClass;
Iterator iter = rc.getSubclassIterator();
while (iter.hasNext()) {
- SingleTableSubclass singleTableSubclass = (SingleTableSubclass)iter.next();
- OrmShape singleTableSubclassShape = elements.get(singleTableSubclass.getEntityPersisterClass().getCanonicalName());
- if (singleTableSubclassShape == null) singleTableSubclassShape = createShape(singleTableSubclass);
- if(!isConnectionExist(singleTableSubclassShape, shape))
- new Connection(singleTableSubclassShape, shape);
+ Object element = iter.next();
+ if (element instanceof Subclass) {
+ Subclass subclass = (Subclass)element;
+ OrmShape subclassShape = elements.get(subclass.getClassName());
+ if (subclassShape == null) subclassShape = createShape(subclass);
+ if (((Subclass)element).isJoinedSubclass()) {
+ Table jcTable = ((Subclass)element).getTable();
+ OrmShape jcTableShape = getOrCreateDatabaseTable(jcTable);
+ createConnections(subclassShape, jcTableShape);
+ if(!isConnectionExist(subclassShape, jcTableShape))
+ new Connection(subclassShape, jcTableShape);
+ } else {
+ createConnections(subclassShape, shape);
+ if(!isConnectionExist(subclassShape, shape))
+ new Connection(subclassShape, shape);
+ }
+ }
}
if (persistentClass.getIdentifier() instanceof Component) {
@@ -204,6 +218,7 @@
}
return classShape;
}
+
private OrmShape getOrCreateDatabaseTable(Table databaseTable){
OrmShape tableShape = null;
if(databaseTable != null) {
@@ -265,9 +280,11 @@
private boolean isConnectionExist(Shape source, Shape target){
Connection conn;
- for(int i=0;i<source.getSourceConnections().size();i++){
- conn = (Connection)source.getSourceConnections().get(i);
- if(conn.getTarget().equals(target)) return true;
+ if (source != null && source.getSourceConnections() != null) {
+ for(int i=0;i<source.getSourceConnections().size();i++){
+ conn = (Connection)source.getSourceConnections().get(i);
+ if(conn.getTarget().equals(target)) return true;
+ }
}
return false;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-07-12 11:42:40 UTC (rev 2398)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-07-12 13:23:15 UTC (rev 2399)
@@ -21,6 +21,7 @@
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
public class OrmShape extends ExpandeableShape {
@@ -60,9 +61,10 @@
Iterator iterator = rootClass.getPropertyIterator();
while (iterator.hasNext()) {
Property field = (Property)iterator.next();
- if (field.isComposite()) {
+ if (!field.isComposite()) {
+/* if (field.isComposite()) {
bodyOrmShape = new ExpandeableShape(field);
- } else if (field.getValue().isSimpleValue() && !((SimpleValue)field.getValue()).isTypeSpecified()) {
+ } else */if (field.getValue().isSimpleValue() && !((SimpleValue)field.getValue()).isTypeSpecified()) {
bodyOrmShape = new Shape(field);
} else if (field.getValue().getType().isEntityType()) {
bodyOrmShape = new ExpandeableShape(field);
@@ -72,76 +74,80 @@
bodyOrmShape = new Shape(field);
}
getChildren().add(bodyOrmShape);
-// } else {
-// Component component = (Component)field.getValue();
-// Iterator iter = component.getPropertyIterator();
-// while (iter.hasNext()) {
-// Property property = (Property)iter.next();
-// if (property.getValue().getType().isEntityType()) {
-// bodyOrmShape = new ExpandeableShape(property);
-// } else if (property.getValue().getType().isCollectionType()) {
-// bodyOrmShape = new ComponentShape(property);
-// } else {
-// bodyOrmShape = new Shape(property);
-// }
-// getChildren().add(bodyOrmShape);
-// }
-// }
+ } else {
+ Component component = (Component)field.getValue();
+ Iterator iter = component.getPropertyIterator();
+ while (iter.hasNext()) {
+ Property property = (Property)iter.next();
+ if (property.getValue().getType().isEntityType()) {
+ bodyOrmShape = new ExpandeableShape(property);
+ } else if (property.getValue().getType().isCollectionType()) {
+ bodyOrmShape = new ComponentShape(property);
+ } else {
+ bodyOrmShape = new Shape(property);
+ }
+ getChildren().add(bodyOrmShape);
+ }
+ }
}
- } else if (ormElement instanceof SingleTableSubclass) {
- RootClass rootClass = ((SingleTableSubclass)ormElement).getRootClass();
+ } else if (ormElement instanceof Subclass) {
+ RootClass rootClass = ((Subclass)ormElement).getRootClass();
-// Property identifierProperty = rootClass.getIdentifierProperty();
-// if (identifierProperty != null) {
-// getChildren().add(new Shape(identifierProperty));
-// }
+ Property identifierProperty = rootClass.getIdentifierProperty();
+ if (identifierProperty != null) {
+ getChildren().add(new Shape(identifierProperty));
+ }
-// KeyValue identifier = rootClass.getIdentifier();
-// if (identifier instanceof Component) {
-// Iterator iterator = ((Component)identifier).getPropertyIterator();
-// while (iterator.hasNext()) {
-// Property property = (Property) iterator.next();
-// getChildren().add(new Shape(property));
-// }
-// }
+ KeyValue identifier = rootClass.getIdentifier();
+ if (identifier instanceof Component) {
+ Iterator iterator = ((Component)identifier).getPropertyIterator();
+ while (iterator.hasNext()) {
+ Property property = (Property) iterator.next();
+ getChildren().add(new Shape(property));
+ }
+ }
-// Iterator iterator = rootClass.getPropertyIterator();
-// while (iterator.hasNext()) {
-// Property field = (Property)iterator.next();
-// if (!field.isComposite()) {
-// if (field.getValue().getType().isEntityType()) {
-// bodyOrmShape = new ExpandeableShape(field);
-// } else if (field.getValue().getType().isCollectionType()) {
-// bodyOrmShape = new ComponentShape(field);
-// } else {
-// bodyOrmShape = new Shape(field);
-// }
-// getChildren().add(bodyOrmShape);
-// } else {
-// Component component = (Component)field.getValue();
-// Iterator iter = component.getPropertyIterator();
-// while (iter.hasNext()) {
-// Property property = (Property)iter.next();
-// if (property.getValue().getType().isEntityType()) {
-// bodyOrmShape = new ExpandeableShape(property);
-// } else if (property.getValue().getType().isCollectionType()) {
-// bodyOrmShape = new ComponentShape(property);
-// } else {
-// bodyOrmShape = new Shape(property);
-// }
-// getChildren().add(bodyOrmShape);
-// }
-// }
-// }
- Iterator iter = ((SingleTableSubclass)ormElement).getPropertyIterator();
+ Iterator iterator = rootClass.getPropertyIterator();
+ while (iterator.hasNext()) {
+ Property field = (Property)iterator.next();
+ if (!field.isComposite()) {
+ if (field.getValue().getType().isEntityType()) {
+ bodyOrmShape = new ExpandeableShape(field);
+ } else if (field.getValue().getType().isCollectionType()) {
+ bodyOrmShape = new ComponentShape(field);
+ } else {
+ bodyOrmShape = new Shape(field);
+ }
+ getChildren().add(bodyOrmShape);
+ } else {
+ Component component = (Component)field.getValue();
+ Iterator iter = component.getPropertyIterator();
+ while (iter.hasNext()) {
+ Property property = (Property)iter.next();
+ if (property.getValue().getType().isEntityType()) {
+ bodyOrmShape = new ExpandeableShape(property);
+ } else if (property.getValue().getType().isCollectionType()) {
+ bodyOrmShape = new ComponentShape(property);
+ } else {
+ bodyOrmShape = new Shape(property);
+ }
+ getChildren().add(bodyOrmShape);
+ }
+ }
+ }
+ Iterator iter = ((Subclass)ormElement).getPropertyIterator();
while (iter.hasNext()) {
Property property = (Property)iter.next();
- if (property.getValue().getType().isEntityType()) {
+ if (!property.isComposite()) {
+ if (property.getValue().getType().isEntityType()) {
+ bodyOrmShape = new ExpandeableShape(property);
+ } else if (property.getValue().getType().isCollectionType()) {
+ bodyOrmShape = new ComponentShape(property);
+ } else {
+ bodyOrmShape = new Shape(property);
+ }
+ } else {
bodyOrmShape = new ExpandeableShape(property);
- } else if (property.getValue().getType().isCollectionType()) {
- bodyOrmShape = new ComponentShape(property);
- } else {
- bodyOrmShape = new Shape(property);
}
getChildren().add(bodyOrmShape);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java 2007-07-12 11:42:40 UTC (rev 2398)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java 2007-07-12 13:23:15 UTC (rev 2399)
@@ -32,6 +32,7 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.RoundLineBorder;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TitleFigure;
@@ -55,8 +56,8 @@
} else if (element instanceof Table) {
Table table = (Table)element;
text = table.getSchema() + "." + table.getName();
- } else if (element instanceof SingleTableSubclass) {
- text = ormLabelProvider.getText((SingleTableSubclass)element);
+ } else if (element instanceof Subclass) {
+ text = ormLabelProvider.getText((Subclass)element);
}
label.setText(text);
label.setIcon(ormLabelProvider.getImage(getCastedModel().getOrmElement()));
17 years, 6 months
JBoss Tools SVN: r2398 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/views and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-12 07:42:40 -0400 (Thu, 12 Jul 2007)
New Revision: 2398
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamActionProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamOpenAction.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
Log:
EXIN-218 Added action Open to component sources.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-12 11:41:09 UTC (rev 2397)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-12 11:42:40 UTC (rev 2398)
@@ -89,17 +89,10 @@
</category>
<view
category="org.jboss.tools.seam.ui"
- class="org.jboss.tools.seam.ui.views.SeamComponentsView"
- icon="icons/sample.gif"
- id="org.jboss.tools.seam.ui.views.SeamComponentsView"
- name="Seam Components">
- </view>
- <view
- category="org.jboss.tools.seam.ui"
class="org.eclipse.ui.navigator.CommonNavigator"
icon="icons/sample.gif"
id="org.jboss.tools.seam.ui.views.SeamComponentsNavigator"
- name="Seam Components Navigator">
+ name="Seam Components">
</view>
</extension>
<extension
@@ -125,7 +118,7 @@
<extension point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
- name="Seam Root Content Provider"
+ name="Seam Components"
priority="highest"
icon="icons/sample.gif"
activeByDefault="true"
@@ -145,6 +138,15 @@
<instanceof value="org.jboss.tools.seam.core.ISeamElement" />
</or>
</possibleChildren>
+ <actionProvider
+ class="org.jboss.tools.seam.ui.views.actions.SeamActionProvider"
+ id="org.jboss.tools.seam.ui.views.actions.SeamActionProvider">
+ <enablement>
+ <or>
+ <instanceof value="org.jboss.tools.seam.core.ISeamElement"/>
+ </or>
+ </enablement>
+ </actionProvider>
</navigatorContent>
</extension>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-12 11:41:09 UTC (rev 2397)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-12 11:42:40 UTC (rev 2398)
@@ -33,7 +33,7 @@
IProject[] ps = root.getProjects();
List<ISeamProject> children = new ArrayList<ISeamProject>();
for (int i = 0; i < ps.length; i++) {
- ISeamProject p = SeamCorePlugin.getSeamProject(ps[i]);
+ ISeamProject p = SeamCorePlugin.getSeamProject(ps[i], false);
if(p != null) {
if(!processed.contains(p)) {
processed.add(p);
@@ -46,6 +46,7 @@
} else if(parentElement instanceof ISeamProject) {
return ((ISeamProject)parentElement).getScopes();
} else if(parentElement instanceof ISeamScope) {
+ ((ISeamScope)parentElement).getSeamProject().resolve();
return ((ISeamScope)parentElement).getComponents().toArray(new Object[0]);
} else if(parentElement instanceof ISeamComponent) {
return ((ISeamComponent)parentElement).getAllDeclarations().toArray(new Object[0]);
@@ -96,7 +97,7 @@
System.out.println("event without source");
}
}
-
+
void refresh(final Object o) {
if(viewer == null || viewer.getControl() == null || viewer.getControl().isDisposed()) return;
if(!(viewer instanceof StructuredViewer)) return;
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamActionProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamActionProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamActionProvider.java 2007-07-12 11:42:40 UTC (rev 2398)
@@ -0,0 +1,31 @@
+package org.jboss.tools.seam.ui.views.actions;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.jboss.tools.seam.core.IOpenableElement;
+import org.jboss.tools.seam.core.ISeamElement;
+
+public class SeamActionProvider extends CommonActionProvider {
+
+ public SeamActionProvider() {}
+
+ public void fillContextMenu(IMenuManager menu) {
+ ActionContext c = getContext();
+ ISelection s = c.getSelection();
+ if(s == null || s.isEmpty() || !(s instanceof IStructuredSelection)) return;
+ Object e = ((IStructuredSelection)s).getFirstElement();
+ if(e instanceof ISeamElement) {
+ ISeamElement element = (ISeamElement)e;
+
+ if(element instanceof IOpenableElement) {
+ SeamOpenAction action = new SeamOpenAction((IOpenableElement)element);
+ menu.add(action);
+ }
+
+ }
+ }
+
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamOpenAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamOpenAction.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/SeamOpenAction.java 2007-07-12 11:42:40 UTC (rev 2398)
@@ -0,0 +1,20 @@
+package org.jboss.tools.seam.ui.views.actions;
+
+import org.eclipse.jface.action.Action;
+import org.jboss.tools.seam.core.IOpenableElement;
+
+public class SeamOpenAction extends Action {
+ IOpenableElement element;
+
+ public SeamOpenAction(IOpenableElement element) {
+ setText("Open");
+ this.element = element;
+ }
+
+ public void run() {
+ if(element != null) {
+ element.open();
+ }
+ }
+
+}
17 years, 6 months
JBoss Tools SVN: r2397 - 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-12 07:41:09 -0400 (Thu, 12 Jul 2007)
New Revision: 2397
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IOpenableElement.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/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.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/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
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/validation/SeamJavaHelper.java
Log:
EXIN-217
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-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-12 11:41:09 UTC (rev 2397)
@@ -8,9 +8,11 @@
Bundle-SymbolicName: org.jboss.tools.seam.core; singleton:=true
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.ide,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.jdt.core,
+ org.eclipse.jdt.ui,
org.jboss.tools.common.model,
org.eclipse.wst.common.frameworks.ui,
org.eclipse.wst.common.project.facet.core,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-12 11:41:09 UTC (rev 2397)
@@ -27,17 +27,6 @@
</builder>
</extension>
<extension
- id="xmlProblem"
- name="XML Problem"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <persistent
- value="true">
- </persistent>
- </extension>
- <extension
id="seamProblem"
name="Seam Problem"
point="org.eclipse.core.resources.markers">
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IOpenableElement.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IOpenableElement.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IOpenableElement.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -0,0 +1,6 @@
+package org.jboss.tools.seam.core;
+
+public interface IOpenableElement {
+
+ public void open();
+}
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-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -145,4 +145,9 @@
*/
public void removeSeamProjectListener(ISeamProjectChangeListener listener);
+ /**
+ * Loads results of last build if that was not done before.
+ */
+ public void resolve();
+
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -12,12 +12,6 @@
import java.util.Map;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
@@ -31,9 +25,6 @@
import org.jboss.tools.seam.internal.core.scanner.java.JavaScanner;
import org.jboss.tools.seam.internal.core.scanner.lib.LibraryScanner;
import org.jboss.tools.seam.internal.core.scanner.xml.XMLScanner;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
public class SeamCoreBuilder extends IncrementalProjectBuilder {
public static String BUILDER_ID = "org.jboss.tools.seam.core.seambuilder";
@@ -46,14 +37,10 @@
SeamResourceVisitor resourceVisitor = null;
- SeamProject getSeamProject() {
- IProject p = getProject();
- try {
- return p == null ? null : (SeamProject)p.getNature(ISeamProject.NATURE_ID);
- } catch (CoreException e) {
- //TODO
- return null;
- }
+ SeamProject getSeamProject() {
+ IProject p = getProject();
+ if(p == null) return null;
+ return (SeamProject)SeamCorePlugin.getSeamProject(p, false);
}
SeamResourceVisitor getResourceVisitor() {
@@ -87,53 +74,8 @@
}
}
- class XMLErrorHandler extends DefaultHandler {
-
- private IFile file;
-
- public XMLErrorHandler(IFile file) {
- this.file = file;
- }
-
- private void addMarker(SAXParseException e, int severity) {
- SeamCoreBuilder.this.addMarker(file, e.getMessage(), e
- .getLineNumber(), severity);
- }
-
- public void error(SAXParseException exception) throws SAXException {
- addMarker(exception, IMarker.SEVERITY_ERROR);
- }
-
- public void fatalError(SAXParseException exception) throws SAXException {
- addMarker(exception, IMarker.SEVERITY_ERROR);
- }
-
- public void warning(SAXParseException exception) throws SAXException {
- addMarker(exception, IMarker.SEVERITY_WARNING);
- }
- }
-
- private static final String MARKER_TYPE = "org.jboss.tools.seam.core.xmlProblem";
-
- private SAXParserFactory parserFactory;
-
- private void addMarker(IFile file, String message, int lineNumber,
- int severity) {
- try {
- IMarker marker = file.createMarker(MARKER_TYPE);
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.SEVERITY, severity);
- if (lineNumber == -1) {
- lineNumber = 1;
- }
- marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
- } catch (CoreException e) {
- }
- }
-
- /*
- *
- * @see org.eclipse.core.internal.events.InternalBuilder#build(int,
+ /**
+ * @see org.eclipse.core.resource.InternalProjectBuilder#build(int,
* java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
@@ -159,25 +101,6 @@
return null;
}
- void checkXML(IResource resource) {
- if (resource instanceof IFile && resource.getName().endsWith(".xml")) {
- IFile file = (IFile) resource;
- deleteMarkers(file);
- XMLErrorHandler reporter = new XMLErrorHandler(file);
- try {
- getParser().parse(file.getContents(), reporter);
- } catch (Exception e1) {
- }
- }
- }
-
- private void deleteMarkers(IFile file) {
- try {
- file.deleteMarkers(MARKER_TYPE, false, IResource.DEPTH_ZERO);
- } catch (CoreException ce) {
- }
- }
-
protected void fullBuild(final IProgressMonitor monitor)
throws CoreException {
try {
@@ -187,14 +110,6 @@
}
}
- private SAXParser getParser() throws ParserConfigurationException,
- SAXException {
- if (parserFactory == null) {
- parserFactory = SAXParserFactory.newInstance();
- }
- return parserFactory.newSAXParser();
- }
-
protected void incrementalBuild(IResourceDelta delta,
IProgressMonitor monitor) throws CoreException {
// the visitor does the work.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -15,7 +15,6 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
-import org.jboss.tools.seam.internal.core.SeamProject;
import org.osgi.framework.BundleContext;
/**
@@ -88,9 +87,10 @@
* (3) project has no seam nature
* (4) creating seam project failed.
* @param project
+ * @param resolve if true and results of last build have not been resolved they are loaded.
* @return
*/
- public static ISeamProject getSeamProject(IProject project) {
+ public static ISeamProject getSeamProject(IProject project, boolean resolve) {
if(project == null || !project.exists() || !project.isOpen()) return null;
try {
if(!project.hasNature(ISeamProject.NATURE_ID)) return null;
@@ -99,8 +99,8 @@
return null;
}
try {
- SeamProject seamProject = (SeamProject)project.getNature(ISeamProject.NATURE_ID);
- seamProject.resolveStorage(true);
+ ISeamProject seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
+ if(resolve) seamProject.resolve();
return seamProject;
} catch (Exception e) {
getPluginLog().logError(e);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -77,7 +77,7 @@
if(javaDeclaration != null) return javaDeclaration.getClassName();
Set<ISeamXmlComponentDeclaration> xml = getXmlDeclarations();
for(ISeamXmlComponentDeclaration d: xml) {
- if(d.getClassName() != null) return d.getClassName();
+ if(d.getClassName() != null && d.getClassName().length() > 0) return d.getClassName();
}
return null;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.seam.core.IOpenableElement;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
@@ -26,7 +27,7 @@
/**
* @author Viacheslav Kabanovich
*/
-public abstract class SeamComponentDeclaration extends SeamObject implements ISeamComponentDeclaration {
+public abstract class SeamComponentDeclaration extends SeamObject implements ISeamComponentDeclaration, IOpenableElement {
public static final String PATH_OF_NAME = "name";
@@ -116,5 +117,9 @@
attributes.put(ISeamXmlComponentDeclaration.NAME, value);
name = value == null ? null : value.getValue();
}
+
+ public void open() {
+
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -8,6 +8,7 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.ui.JavaUI;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.IRole;
@@ -18,6 +19,7 @@
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.core.SeamComponentPrecedenceType;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
@@ -329,4 +331,12 @@
}
}
+ public void open() {
+ if(type == null) return;
+ try {
+ JavaUI.openInEditor(type);
+ } catch (Exception e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
}
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-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -119,7 +119,7 @@
setSourcePath(project.getFullPath());
resource = project;
classPath.init();
- load();
+// load();
}
public ClassPath getClassPath() {
@@ -135,6 +135,10 @@
}
}
+ public void resolve() {
+ resolveStorage(true);
+ }
+
/**
* Loads results of last build, which are considered
* actual until next build.
@@ -236,6 +240,8 @@
boolean nameChanged = current != null && !stringsEqual(name, current.getName());
SeamComponent c = getComponent(name);
+
+ String oldClassName = c == null ? null : c.getClassName();
if(current != null) {
List<Change> changes = current.merge(loaded);
@@ -287,12 +293,23 @@
} else if(loaded instanceof ISeamXmlComponentDeclaration) {
ISeamXmlComponentDeclaration xml = (ISeamXmlComponentDeclaration)loaded;
String className = xml.getClassName();
+ List<Change> changes = null;
+ if(isClassNameChanged(oldClassName, className)) {
+ SeamComponentDeclaration[] ds1 = c.getAllDeclarations().toArray(new SeamComponentDeclaration[0]);
+ for (int i1 = 0; i1 < ds1.length; i1++) {
+ if(!(ds1[i1] instanceof ISeamJavaComponentDeclaration)) continue;
+ ISeamJavaComponentDeclaration jcd = (ISeamJavaComponentDeclaration)ds1[i1];
+ if(jcd.getClassName().equals(className)) continue;
+ c.removeDeclaration(jcd);
+ changes = Change.addChange(changes, new Change(c, null, jcd, null));
+ }
+ }
SeamJavaComponentDeclaration j = javaDeclarations.get(className);
if(j != null) {
c.addDeclaration(j);
- List<Change> changes = Change.addChange(null, new Change(c, null, null, j));
- fireChanges(changes);
+ changes = Change.addChange(changes, new Change(c, null, null, j));
}
+ fireChanges(changes);
}
}
fireChanges(addedComponents);
@@ -323,10 +340,16 @@
factoryDeclarationsRemoved(currentFactories);
}
-
+
boolean stringsEqual(String s1, String s2) {
return s1 == null ? s2 == null : s1.equals(s2);
}
+
+ private boolean isClassNameChanged(String oldClassName, String newClassName) {
+ if(oldClassName == null || oldClassName.length() == 0) return false;
+ if(newClassName == null || newClassName.length() == 0) return false;
+ return !oldClassName.equals(newClassName);
+ }
/**
* Package local method called by builder.
@@ -354,17 +377,9 @@
changes = Change.addChange(changes, new Change(c, null, ds[i], null));
}
}
- if(c.getAllDeclarations().size() == 0) {
+ if(isComponentEmpty(c)) {
iterator.remove();
- ISeamElement p = c.getParent();
- if(p instanceof SeamScope) {
- ((SeamScope)p).removeComponent(c);
- changes = Change.addChange(changes, new Change(p, null, c, null));
- }
- allVariables.remove(c);
- changes = null;
- changes = Change.addChange(changes, new Change(this, null, c, null));
-
+ changes = removeEmptyComponent(c);
}
fireChanges(changes);
}
@@ -419,19 +434,33 @@
changes = Change.addChange(changes, new Change(c, null, ds[i], null));
}
}
- if(c.getAllDeclarations().size() == 0) {
+ if(isComponentEmpty(c)) {
iterator.remove();
- ISeamElement p = c.getParent();
- if(p instanceof SeamScope) {
- ((SeamScope)p).removeComponent(c);
- changes = Change.addChange(changes, new Change(p, null, c, null));
- }
- allVariables.remove(c);
- changes = Change.addChange(null, new Change(this, null, c, null));
+ changes = removeEmptyComponent(c);
}
fireChanges(changes);
}
}
+
+ private List<Change> removeEmptyComponent(SeamComponent c) {
+ List<Change> changes = null;
+ ISeamElement p = c.getParent();
+ if(p instanceof SeamScope) {
+ ((SeamScope)p).removeComponent(c);
+ changes = Change.addChange(null, new Change(p, null, c, null));
+ }
+ allVariables.remove(c);
+ changes = Change.addChange(changes, new Change(this, null, c, null));
+ return changes;
+ }
+
+ private boolean isComponentEmpty(SeamComponent c) {
+ if(c.getAllDeclarations().size() == 0) return true;
+ for (ISeamComponentDeclaration d: c.getAllDeclarations()) {
+ if(c.getName().equals(d.getName())) return false;
+ }
+ return true;
+ }
public Map<Object,ISeamFactory> findFactoryDeclarations(IPath source) {
Map<Object,ISeamFactory> map = new HashMap<Object, ISeamFactory>();
@@ -619,8 +648,7 @@
return result;
}
- /*
- * (non-Javadoc)
+ /**
* @see org.jboss.tools.seam.core.ISeamProject#getVariablesByPath(org.eclipse.core.runtime.IPath)
*/
public Set<ISeamContextVariable> getVariablesByPath(IPath path) {
@@ -707,4 +735,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -6,8 +6,14 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.seam.core.ISeamPropertiesDeclaration;
import org.jboss.tools.seam.core.ISeamProperty;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.event.Change;
public class SeamPropertiesDeclaration extends SeamComponentDeclaration
@@ -85,4 +91,23 @@
return changes;
}
+ public void open() {
+ if(id instanceof XModelObject) {
+ XModelObject o = (XModelObject)id;
+ try {
+ FindObjectHelper.findModelObject(o, FindObjectHelper.IN_EDITOR_ONLY);
+ } catch(Exception e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ } else if(getResource() instanceof IFile) {
+ IFile f = (IFile)getResource();
+ try {
+ IWorkbenchPage page = SeamCorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if(page != null) IDE.openEditor(page, f);
+ } catch(Exception e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
+ }
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -11,8 +11,15 @@
package org.jboss.tools.seam.internal.core;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
@@ -29,8 +36,11 @@
};
SeamProject p;
+ IPath output = null;
+
public SeamResourceVisitor(SeamProject p) {
this.p = p;
+ getJavaProjectOutput(p.getProject());
}
public IResourceVisitor getVisitor() {
@@ -40,6 +50,9 @@
public boolean visit(IResource resource) {
if(resource instanceof IFile) {
IFile f = (IFile)resource;
+ if(output != null && output.isPrefixOf(resource.getFullPath())) {
+ return false;
+ }
for (int i = 0; i < FILE_SCANNERS.length; i++) {
IFileScanner scanner = FILE_SCANNERS[i];
if(scanner.isRelevant(f)) {
@@ -57,6 +70,11 @@
}
}
}
+ if(resource instanceof IFolder) {
+ if(output != null && output.isPrefixOf(resource.getFullPath())) {
+ return false;
+ }
+ }
//return true to continue visiting children.
return true;
}
@@ -66,4 +84,17 @@
p.registerComponents(c, resource.getFullPath());
}
+ public IPath getJavaProjectOutput(IProject project) {
+ if(project == null || !project.isOpen()) return null;
+ if(output != null) return output;
+ try {
+ if(!project.hasNature(JavaCore.NATURE_ID)) return null;
+ IJavaProject javaProject = JavaCore.create(project);
+ return output = javaProject.getOutputLocation();
+ } catch (Exception e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ return null;
+ }
+ }
+
}
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-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -24,7 +24,6 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamXmlComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamXmlFactory;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaHelper.java 2007-07-12 07:28:17 UTC (rev 2396)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaHelper.java 2007-07-12 11:41:09 UTC (rev 2397)
@@ -19,7 +19,7 @@
public ISeamProject getSeamProject() {
ISeamProject project = null;
try {
- project = SeamCorePlugin.getSeamProject(getProject());
+ project = SeamCorePlugin.getSeamProject(getProject(), true);
} catch (Exception e) {
SeamCorePlugin.getDefault().logError("Can't get Seam Project", e);
}
17 years, 6 months
JBoss Tools SVN: r2396 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/internal/project/facet and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-12 03:28:17 -0400 (Thu, 12 Jul 2007)
New Revision: 2396
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
http://jira.jboss.org/jira/browse/EXIN-221
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-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-12 07:28:17 UTC (rev 2396)
@@ -27,6 +27,7 @@
org.eclipse.jem,
org.eclipse.jem.util,
org.eclipse.emf.ecore,
+ org.eclipse.jst.j2ee.ui,
org.eclipse.jst.j2ee.web
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -10,7 +10,8 @@
******************************************************************************/
package org.jboss.tools.seam.ui.internal.project.facet;
-import java.util.ArrayList;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.Arrays;
import org.eclipse.jface.wizard.IWizard;
@@ -29,6 +30,7 @@
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor;
/**
* @author eskimo
@@ -52,9 +54,9 @@
DataModelValidatorDelegate validatorDelegate;
// General group
- IFieldEditor jBossAsHomeEditor = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
- ISeamFacetDataModelProperties.JBOSS_AS_HOME,
- "JBoss AS Home Folder:","C:\\java\\jboss-4.0.5.GA");
+ // IFieldEditor jBossAsHomeEditor = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
+ // ISeamFacetDataModelProperties.JBOSS_AS_HOME,
+ // "JBoss AS Home Folder:","C:\\java\\jboss-4.0.5.GA");
IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
"JBoss Seam Home Folder:","C:\\java\\jboss-seam-1.2.1.GA");
@@ -66,15 +68,17 @@
IFieldEditor jBossAsDbTypeEditor = IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.DB_TYPE,
"Database Type:",Arrays.asList(HIBERNATE_HELPER.getDialectNames()),"HSQL");
- IFieldEditor jBossHibernateDialectEditor = IFieldEditorFactory.INSTANCE.createComboEditor(
+ IFieldEditor jBossHibernateDialectEditor = IFieldEditorFactory.INSTANCE.createUneditableTextEditor(
ISeamFacetDataModelProperties.HIBERNATE_DIALECT,
- "Hibernate Dialect:",Arrays.asList(HIBERNATE_HELPER.getDialectNames()),"HSQL");
- IFieldEditor jdbcDriverClassname = IFieldEditorFactory.INSTANCE.createTextEditor(
+ "Hibernate Dialect:",HIBERNATE_HELPER.getDialectClass("HSQL"));
+
+ ITaggedFieldEditor jdbcDriverClassname = IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME,
- "JDBC Driver Class for Your Database:","com.package1.Classname");
- IFieldEditor jdbcUrlForDb = IFieldEditorFactory.INSTANCE.createTextEditor(
+ "JDBC Driver Class for Your Database:",Arrays.asList(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))),HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0]);
+ ITaggedFieldEditor jdbcUrlForDb = IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,
- "JDBC Url for Your Database:", "url://domain/");
+ "JDBC Url for Your Database:",
+ Arrays.asList(HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])),HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])[0]);
IFieldEditor dbUserName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_USER_NAME,
"Database User Name:", "username");
@@ -180,7 +184,7 @@
gridLayout = new GridLayout(3, false);
generalGroup.setLayout(gridLayout);
- registerEditor(jBossAsHomeEditor,generalGroup, 3);
+// registerEditor(jBossAsHomeEditor,generalGroup, 3);
registerEditor(jBossSeamHomeEditor,generalGroup, 3);
registerEditor(jBossAsDeployAsEditor,generalGroup, 3);
@@ -219,9 +223,25 @@
setControl(root);
validatorDelegate.addValidatorForProperty(jBossSeamHomeEditor.getName(), ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR);
- validatorDelegate.addValidatorForProperty(jBossAsHomeEditor.getName(), ValidatorFactory.JBOSS_AS_HOME_FOLDER_VALIDATOR);
+// validatorDelegate.addValidatorForProperty(jBossAsHomeEditor.getName(), ValidatorFactory.JBOSS_AS_HOME_FOLDER_VALIDATOR);
validatorDelegate.addValidatorForProperty(pathToJdbcDriverJar.getName(), ValidatorFactory.FILESYSTEM_FILE_EXISTS_VALIDATOR);
+ jBossAsDbTypeEditor.addPropertyChangeListener(new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ jBossHibernateDialectEditor.setValue(HIBERNATE_HELPER.getDialectClass(evt.getNewValue().toString()));
+ jdbcDriverClassname.setTags(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass(evt.getNewValue().toString())));
+
+ }
+ });
+
+ jdbcDriverClassname.addPropertyChangeListener(new PropertyChangeListener(){
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ jdbcUrlForDb.setTags(HIBERNATE_HELPER.getConnectionURLS(evt.getNewValue().toString()));
+ }
+ });
+
}
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -21,7 +21,9 @@
import org.jboss.tools.seam.ui.widget.editor.CompositeEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.LabelFieldEditor;
+import org.jboss.tools.seam.ui.widget.editor.TaggedComboFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.TextFieldEditor;
/**
@@ -45,11 +47,9 @@
/**
*
*/
- public IFieldEditor createComboEditor(String name, String label,
+ public ITaggedFieldEditor createComboEditor(String name, String label,
List values, Object defaultValue) {
- CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
- editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
- new ComboFieldEditor(name,label,values,defaultValue.toString())});
+ TaggedComboFieldEditor editor = new TaggedComboFieldEditor(name,label,values, defaultValue,true);
return editor;
}
@@ -66,6 +66,16 @@
/**
*
*/
+ public IFieldEditor createUneditableTextEditor(String name, String label, String defaultValue) {
+ CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
+ editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
+ new TextFieldEditor(name,label, defaultValue,false)});
+ return editor;
+ }
+
+ /**
+ *
+ */
public IFieldEditor createBrowseFolderEditor(String name, String label, String defaultValue) {
CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.widget.editor;
+import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -206,4 +207,23 @@
public void setLabelText(String labelText) {
this.labelText = labelText;
}
+
+ /**
+ *
+ */
+ private boolean editable = true;
+
+ /**
+ *
+ */
+ public boolean isEditable() {
+ return editable;
+ }
+
+ /**
+ *
+ */
+ public void setEditable(boolean aEditable) {
+ this.editable = aEditable;
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -25,9 +25,13 @@
public class ComboFieldEditor extends BaseFieldEditor implements PropertyChangeListener{
List values = null;
- public ComboFieldEditor(String name, String label, List values,Object defaultValue) {
+
+ boolean flat = false;
+
+ public ComboFieldEditor(String name, String label, List values,Object defaultValue,boolean flat) {
super(name, label, defaultValue);
this.values = Collections.unmodifiableList(values);
+ this.flat = flat;
}
private Control comboControl;
@@ -45,7 +49,7 @@
public Control getComboControl(Composite composite) {
// TODO Auto-generated method stub
if(comboControl == null) {
- ComboBoxField comboField = new ComboBoxField(composite,values,getValue());
+ ComboBoxField comboField = new ComboBoxField(composite,values,getValue(),flat);
comboControl = comboField.getComboControl();
comboField.addPropertyChangeListener(this);
} else if(composite!=null) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -40,7 +40,7 @@
for(int i=0;i<controls.length;i++) {
GridData gd = new GridData();
gd.horizontalSpan = controls.length-1==i?gl.numColumns-i:1;
- gd.horizontalAlignment = controls[i] instanceof Combo?SWT.BEGINNING:GridData.FILL;
+ gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = (i==1);
controls[i].setLayoutData(gd);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -33,7 +33,7 @@
* @param defaultValue
* @return
*/
- IFieldEditor createComboEditor(String name, String label, List values, Object defaultValue);
+ ITaggedFieldEditor createComboEditor(String name, String label, List values, Object defaultValue);
/**
*
@@ -61,5 +61,13 @@
* @return
*/
IFieldEditor createBrowseFileEditor(String name, String label, String defaultValue);
+ /**
+ * @param jdbcDriverClassName
+ * @param string
+ * @param string2
+ * @return
+ */
+ IFieldEditor createUneditableTextEditor(String jdbcDriverClassName,
+ String string, String string2);
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.widget.editor;
+
+/**
+ * @author eskimo
+ *
+ */
+public interface ITaggedFieldEditor extends IFieldEditor {
+
+ /**
+ *
+ * @return
+ */
+ public String[] getTags();
+
+ /**
+ *
+ * @param tags
+ */
+ public void setTags(String[] tags);
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.widget.editor;
+
+import java.beans.PropertyChangeListener;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Control;
+
+public class TaggedComboFieldEditor extends CompositeEditor implements ITaggedFieldEditor, PropertyChangeListener{
+
+ List values = null;
+
+ boolean floatStyle = true;
+ ComboFieldEditor combo = null;
+
+ public TaggedComboFieldEditor(String name, String label, List values,Object defaultValue, boolean floatStyle) {
+ super(name, label, defaultValue);
+ this.values = Collections.unmodifiableList(values);
+ this.floatStyle = floatStyle;
+ combo = new ComboFieldEditor(name,label,values,defaultValue.toString(),floatStyle);
+ addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
+ combo});
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#getTags()
+ */
+ public String[] getTags() {
+ return ((Combo)getEditorControls()[1]).getItems();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#setTags(java.lang.String[])
+ */
+ public void setTags(String[] tags) {
+ ((Combo)getEditorControls()[1]).setItems(tags);
+ combo.setValue(tags.length==0? "":tags[0]);
+ ((Combo)getEditorControls()[1]).getParent().layout(new Control[]{(Combo)getEditorControls()[1]});
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -8,7 +8,6 @@
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.tools.seam.ui.widget.editor;
@@ -43,13 +42,31 @@
protected int style = -1;
+ /**
+ *
+ * @param name
+ * @param aLabelText
+ * @param defaultvalue
+ */
public TextFieldEditor(String name,String aLabelText,String defaultvalue) {
super(name, aLabelText, defaultvalue);
}
/**
*
+ * @param name
+ * @param aLabelText
+ * @param defaultvalue
+ * @param editable
*/
+ public TextFieldEditor(String name,String aLabelText,String defaultvalue,boolean editable) {
+ super(name, aLabelText, defaultvalue);
+ setEditable(editable);
+ }
+
+ /**
+ *
+ */
protected TextField fTextField = null;
/**
@@ -97,17 +114,25 @@
textField.setFont(parent.getFont());
Object value = getValue();
textField.setText(getValue().toString());
+ textField.setEditable(isEditable());
fTextField.addPropertyChangeListener(this);
} else if (parent!=null){
Assert.isTrue(parent==fTextField.getTextControl().getParent());
}
return fTextField.getTextControl();
}
-
+
+ /**
+ *
+ */
protected void updateWidgetValues() {
setValueAsString(getValueAsString());
}
+ /**
+ *
+ * @return
+ */
protected int getInitialStyle() {
if(this.style >= 0) return style;
return SWT.SINGLE | SWT.BORDER;
@@ -146,6 +171,7 @@
private String checkSimple(Object value){
return (value != null) ? value.toString() : new String("");
}
+
/**
*
*/
@@ -160,10 +186,9 @@
* text field is created yet
*/
protected Text getTextControl() {
- return fTextField.getTextControl();
+ return fTextField!=null?fTextField.getTextControl():null;
}
-
/**
* @see com.kabira.ide.ex.workbench.ui.feature.eitors.BaseFeatureFieldEditor#setFocus()
*/
@@ -174,30 +199,41 @@
return setfocus;
}
+ /**
+ *
+ */
@Override
public Object[] getEditorControls(Object composite) {
return new Control[]{getTextControl((Composite)composite)};
}
+ /**
+ *
+ * @param object
+ */
public void save(Object object) {
}
+ /**
+ *
+ */
public void setValue(Object newWalue) {
fTextField.removePropertyChangeListener(this);
fTextField.getTextControl().setText(newWalue.toString());
fTextField.addPropertyChangeListener(this);
}
-
- public boolean isEditable() {
- // TODO Auto-generated method stub
- return false;
+
+ /**
+ *
+ */
+ public void setEditable(boolean aEditable) {
+ super.setEditable(aEditable);
+ if(getTextControl()!=null) getTextControl().setEditable(aEditable);
}
-
- public void setEditable(boolean aEdiatble) {
- // TODO Auto-generated method stub
-
- }
-
+
+ /**
+ *
+ */
public void propertyChange(PropertyChangeEvent evt) {
super.setValue(evt.getNewValue());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -38,9 +38,11 @@
ComboViewer comboControl = null;
List values = new ArrayList();
- public ComboBoxField(Composite parent,List values, Object value) {
+
+
+ public ComboBoxField(Composite parent,List values, Object value, boolean floatStyle) {
this.values = values;
- comboControl = new ComboViewer(parent, SWT.READ_ONLY);
+ comboControl = new ComboViewer(parent,floatStyle?SWT.FLAT:SWT.READ_ONLY);
comboControl.setContentProvider(new IStructuredContentProvider() {
@@ -101,7 +103,7 @@
}
public void selectionChanged(SelectionChangedEvent event) {
- firePropertyChange("", event.getSelection());
+ firePropertyChange("", ((StructuredSelection)event.getSelection()).getFirstElement());
}
public Combo getComboControl() {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-07-12 07:23:47 UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-07-12 07:28:17 UTC (rev 2396)
@@ -14,16 +14,20 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.ui.PresetSelectionPanel;
import org.osgi.framework.Bundle;
/**
-
+ *
+ * @author eskimo
+ *
*/
-
public class SeamProjectWizard extends WebProjectWizard {
@@ -50,6 +54,42 @@
page.setDescription("TBD Description of wizard");
return page;
}
+
+ @Override
+ public void createPageControls(Composite container) {
+ super.createPageControls(container);
+ getModel().setSelectedPreset("preset.jst.seam.v2_0");
+ Control control = findControlByClass((Composite)getShell(), PresetSelectionPanel.class);
+ control.setVisible(false);
+ control = findGroupByText((Composite)getShell(), "EAR Membership");
+ control.setVisible(false);
+ }
+ Control findControlByClass(Composite comp, Class claz) {
+ for (Control child : comp.getChildren()) {
+ System.out.println(child.getClass().getName());
+ if(child.getClass()==claz) {
+ return child;
+ } else if(child instanceof Composite){
+ Control control = findControlByClass((Composite)child, claz);
+ if(control!=null) return control;
+ }
+ }
+ return null;
+ }
+
+
+ Control findGroupByText(Composite comp, String text) {
+ for (Control child : comp.getChildren()) {
+ System.out.println(child.getClass().getName());
+ if(child instanceof Group && ((Group)child).getText().equals(text)) {
+ return child;
+ } else if(child instanceof Composite){
+ Control control = findGroupByText((Composite)child, text);
+ if(control!=null) return control;
+ }
+ }
+ return null;
+ }
}
\ No newline at end of file
17 years, 6 months
JBoss Tools SVN: r2395 - in trunk/common/plugins/org.jboss.tools.common.model: images/actions and 18 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-12 03:23:47 -0400 (Thu, 12 Jul 2007)
New Revision: 2395
Added:
trunk/common/plugins/org.jboss.tools.common.model/images/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/icons/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/java/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/map/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/mapeditor/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/meta/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/navigationtree/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/palette/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/project/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/struts/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/struts/pro/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/tabicons/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/webxml/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/xstudio/Thumbs.db
Modified:
trunk/common/plugins/org.jboss.tools.common.model/images/actions/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/actions/cancel.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/compilecode.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/copy.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/cut.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/delete.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/edit.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/find.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/generatecode.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/model_history.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/new.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/ok.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/paste.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/redo.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/refresh.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/retry.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/saveallmodel.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/savemodel.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/select.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/start.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/stop.gif
trunk/common/plugins/org.jboss.tools.common.model/images/actions/undo.gif
trunk/common/plugins/org.jboss.tools.common.model/images/common/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/common/fire_changes.gif
trunk/common/plugins/org.jboss.tools.common.model/images/common/new_search_item.gif
trunk/common/plugins/org.jboss.tools.common.model/images/common/qmark.gif
trunk/common/plugins/org.jboss.tools.common.model/images/common/search_item.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/Thumbs.db
trunk/common/plugins/org.jboss.tools.common.model/images/file/clay-config.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/closed_folder.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/computer.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/css_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/dialog-config.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/floppy.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/gif_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/html_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/jar_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/java_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/js_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/jsp_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_ant_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_css_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_folder.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_html_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_jar_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_java_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_js_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_properties_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_taglibs_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_unknow_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_xml_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/new_xsl_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/openned_folder.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/redhat_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/redhat_folder.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/system_folder.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/to_top_folder.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/unknow_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/xml_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/file/xsl_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/icons/warning.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/attribute.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/convertor.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/convertors.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/el-resolver.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/facet.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/factory.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/import_project.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/jsf-config.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/jsf_project.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/lang.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/lifecycle.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/locale_config.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/new-jsf-config.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/new_project.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/properties.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/property-resolver.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/renderer.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/renderer_kit.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/renderer_kits.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/transition.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/variable-resolver.gif
trunk/common/plugins/org.jboss.tools.common.model/images/jsf/web_application.gif
trunk/common/plugins/org.jboss.tools.common.model/images/map/map_rule_source.gif
trunk/common/plugins/org.jboss.tools.common.model/images/mapeditor/auto.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/action.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/actionlist.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/actionlist_global.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/attribute.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/attributeconstraint.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/attributeeditor.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/attributes.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/children.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/entity.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/entity_extension.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/entitydata.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/icon.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/iconsgroup.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/icontype.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/mapping.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/mappingitem.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/meta_file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_action.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_actionlist.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_attribute.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_attributedata.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_constraintitem.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_entity.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_entity_extension.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_icon.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_iconsgroup.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_mapping.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_mappingitem.gif
trunk/common/plugins/org.jboss.tools.common.model/images/meta/renderer.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/class.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/collection.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/collection_small.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/column.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/comment.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/component.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/composite_id.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/connection.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/discriminator.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/dynacomponent.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/field.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/field_key.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/file.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/filled.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/filter.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/id.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/index-manytoany.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/index-manytomany.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/index.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/key-manytoone.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/key-property.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/manytoany.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/manytomany.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/manytoone.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/onetomany.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/onetoone.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/parameter.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/property.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/table.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/timestamp.gif
trunk/common/plugins/org.jboss.tools.common.model/images/orm2/version.gif
trunk/common/plugins/org.jboss.tools.common.model/images/palette/any-tag.gif
trunk/common/plugins/org.jboss.tools.common.model/images/project/import_project.gif
trunk/common/plugins/org.jboss.tools.common.model/images/project/new_project.gif
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
Log:
http://jira.jboss.org/jira/browse/EXIN-239
Added: trunk/common/plugins/org.jboss.tools.common.model/images/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/Thumbs.db
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/cancel.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/compilecode.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/copy.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/cut.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/delete.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/edit.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/find.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/generatecode.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/model_history.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/new.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/ok.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/paste.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/redo.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/refresh.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/retry.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/saveallmodel.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/savemodel.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/select.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/start.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/stop.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/actions/undo.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/common/Thumbs.db
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/common/fire_changes.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/common/new_search_item.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/common/qmark.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/common/search_item.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/Thumbs.db
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/clay-config.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/closed_folder.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/computer.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/css_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/dialog-config.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/floppy.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/gif_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/html_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/jar_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/java_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/js_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/jsp_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_ant_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_css_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_folder.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_html_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_jar_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_java_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_js_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_properties_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_taglibs_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_unknow_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_xml_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/new_xsl_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/openned_folder.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/redhat_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/redhat_folder.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/system_folder.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/to_top_folder.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/unknow_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/xml_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/file/xsl_file.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/icons/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/icons/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/icons/warning.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/java/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/java/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/attribute.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/convertor.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/convertors.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/el-resolver.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/facet.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/factory.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/import_project.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/jsf-config.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/jsf_project.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/lang.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/lifecycle.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/locale_config.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/new-jsf-config.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/new_project.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/properties.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/property-resolver.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/renderer.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/renderer_kit.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/renderer_kits.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/transition.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/variable-resolver.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/jsf/web_application.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/map/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/map/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/map/map_rule_source.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/mapeditor/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/mapeditor/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/mapeditor/auto.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/meta/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/meta/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/action.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/actionlist.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/actionlist_global.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/attribute.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/attributeconstraint.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/attributeeditor.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/attributes.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/children.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/entity.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/entity_extension.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/entitydata.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/icon.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/iconsgroup.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/icontype.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/mapping.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/mappingitem.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/meta_file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_action.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_actionlist.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_attribute.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_attributedata.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_constraintitem.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_entity.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_entity_extension.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_icon.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_iconsgroup.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_mapping.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/new_mappingitem.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/meta/renderer.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/navigationtree/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/navigationtree/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/class.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/collection.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/collection_small.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/column.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/comment.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/component.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/composite_id.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/connection.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/discriminator.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/dynacomponent.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/field.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/field_key.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/file.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/filled.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/filter.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/id.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/index-manytoany.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/index-manytomany.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/index.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/key-manytoone.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/key-property.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/manytoany.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/manytomany.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/manytoone.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/onetomany.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/onetoone.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/parameter.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/property.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/table.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/timestamp.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/orm2/version.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/palette/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/palette/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/palette/any-tag.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/project/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/project/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/project/import_project.gif
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.model/images/project/new_project.gif
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.model/images/struts/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/struts/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.model/images/struts/pro/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/struts/pro/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.model/images/tabicons/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/tabicons/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.model/images/webxml/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/webxml/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.model/images/xstudio/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/images/xstudio/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2007-07-11 17:08:34 UTC (rev 2394)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2007-07-12 07:23:47 UTC (rev 2395)
@@ -638,7 +638,6 @@
ReportProblemWizard.WindowTitle=Report Problems
ReportProblemWizard.Title=Red Hat Developer Studio
-ReportProblemWizard.Message=Creates a zip file with information useful when reporting and debugging issues
SharableImportJSFProject.Register_Web_Context_in_server.xml=Register Web Context in server.xml
SharableImportProject.Register_Web_Context_in_server.xml=Register Web Context in server.xml
17 years, 6 months
JBoss Tools SVN: r2394 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-11 13:08:34 -0400 (Wed, 11 Jul 2007)
New Revision: 2394
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
Log:
http://jira.jboss.com/jira/browse/EXIN-217 Added loging
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2007-07-11 16:20:43 UTC (rev 2393)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2007-07-11 17:08:34 UTC (rev 2394)
@@ -12,9 +12,9 @@
import java.io.File;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
-import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -97,6 +97,7 @@
if(jre != null) newPaths.removeAll(jre);
} catch (Exception e) {
//TODO
+ SeamCorePlugin.getDefault().logError(e);
}
if(paths == null && newPaths == null) return false;
if((newPaths == null || paths == null) || (paths.size() != newPaths.size())) {
17 years, 6 months
JBoss Tools SVN: r2393 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-11 12:20:43 -0400 (Wed, 11 Jul 2007)
New Revision: 2393
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/internal/core/SeamProject.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
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 Added @IN validation. Improved incremental validation.
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-11 15:56:54 UTC (rev 2392)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-11 16:20:43 UTC (rev 2393)
@@ -96,6 +96,12 @@
public Set<ISeamContextVariable> getVariablesByScope(ScopeType scope);
/**
+ * @param full path of IResource where the variable is declared.
+ * @return Set of ISeamContextVariables by resource path.
+ */
+ public Set<ISeamContextVariable> getVariablesByPath(IPath path);
+
+ /**
* @return all factories methods of project
*/
public Set<ISeamFactory> getFactories();
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-11 15:56:54 UTC (rev 2392)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-11 16:20:43 UTC (rev 2393)
@@ -618,7 +618,33 @@
}
return result;
}
-
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamProject#getVariablesByPath(org.eclipse.core.runtime.IPath)
+ */
+ public Set<ISeamContextVariable> getVariablesByPath(IPath path) {
+ Set<ISeamContextVariable> result = new HashSet<ISeamContextVariable>();
+ for (ISeamContextVariable variable : allVariables) {
+ if(variable instanceof ISeamComponent) {
+ ISeamComponent c = (ISeamComponent)variable;
+ for (ISeamComponentDeclaration d: c.getAllDeclarations()) {
+ SeamComponentDeclaration di = (SeamComponentDeclaration)d;
+ if(path.equals(di.getSourcePath())) {
+ result.add(variable);
+ break;
+ }
+ }
+ } else {
+ IResource variableResource = variable.getResource();
+ if(path.equals(variableResource.getFullPath())) {
+ result.add(variable);
+ }
+ }
+ }
+ return result;
+ }
+
int revalidateScopesLock = 0;
void revalidateScopes() {
List<Change> changes = null;
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-11 15:56:54 UTC (rev 2392)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-11 16:20:43 UTC (rev 2393)
@@ -12,6 +12,7 @@
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -21,13 +22,15 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
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;
+import org.jboss.tools.seam.core.BijectedAttributeType;
+import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
+import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
@@ -40,14 +43,15 @@
*/
public class SeamJavaValidator extends SeamValidator {
- private static final String NONUNIQUE_NAME_MESSAGE_GROUP = "nonuniqueName";
+ private static final String MARKED_COMPONENT_MESSAGE_GROUP = "markedComponent";
public static final String NONUNIQUE_COMPONENT_NAME_MESSAGE_ID = "NONUNIQUE_COMPONENT_NAME_MESSAGE";
+ public static final String UNKNOWN_INJECTION_NAME_MESSAGE_ID = "UNKNOWN_INJECTION_NAME";
+
private SeamValidationContext validationContext;
public ISchedulingRule getSchedulingRule(IValidationContext helper) {
- // TODO
return null;
}
@@ -69,44 +73,52 @@
continue;
}
if (currentFile != null && currentFile.exists()) {
- String oldComponentNameOfChangedFile = validationContext.getNonuniqueNameOfComponent(currentFile.getFullPath());
- if(oldComponentNameOfChangedFile!=null) {
+ // Get all variable names that were linked with this resource.
+ Set<String> oldVariablesNamesOfChangedFile = validationContext.getVariableNamesByResource(currentFile.getFullPath());
+ if(oldVariablesNamesOfChangedFile!=null) {
Set<IPath> resources = new HashSet<IPath>(); // Resources which we have to validate.
- // Check if component name was changed in java file
- String newComponentNameOfChangedFile = getComponentNameByResource(currentFile.getFullPath(), project);
- if(newComponentNameOfChangedFile!=null && !oldComponentNameOfChangedFile.equals(newComponentNameOfChangedFile)) {
- // Name was changed.
- // Collect resources with new component name.
- Set<IPath> linkedResources = validationContext.getMarkedNonuniqueNamedResources(newComponentNameOfChangedFile);
- if(linkedResources!=null) {
- resources.addAll(linkedResources);
+ // Check if variable name was changed in java file
+ Set<String> newVariableNamesOfChangedFile = getVariablesNameByResource(currentFile.getFullPath(), project);
+ for (String newVariableName : newVariableNamesOfChangedFile) {
+ if(!oldVariablesNamesOfChangedFile.contains(newVariableName)) {
+ // Name was changed.
+ // Collect resources with new component name.
+ Set<IPath> linkedResources = validationContext.getResourcesByVariableName(newVariableName);
+ if(linkedResources!=null) {
+ resources.addAll(linkedResources);
+ }
}
- // Check if changed file is not component anymore.
- } else if(newComponentNameOfChangedFile == null) {
+ }
+ // Check if changed file is not linked to any variables anymore.
+ if(newVariableNamesOfChangedFile.size() == 0) {
resources.add(currentFile.getFullPath());
}
- // Collect resources with old component name.
- Set<IPath> linkedResources = validationContext.getMarkedNonuniqueNamedResources(oldComponentNameOfChangedFile);
- if(linkedResources!=null) {
- resources.addAll(linkedResources);
+ // Collect all linked resources with old variable names.
+ for (String name : oldVariablesNamesOfChangedFile) {
+ Set<IPath> linkedResources = validationContext.getResourcesByVariableName(name);
+ if(linkedResources!=null) {
+ resources.addAll(linkedResources);
+ }
}
// Validate all collected linked resources.
+ // Remove all links between resources and variables names because they will be linked again during validation.
+ validationContext.clear();
for (IPath linkedResource : resources) {
// Don't validate one resource twice.
if(checkedResources.contains(linkedResource)) {
continue;
}
// Remove markers from collected java file
- reporter.removeMessageSubset(this, linkedResource, NONUNIQUE_NAME_MESSAGE_GROUP);
- validateUniqueComponentName(project, linkedResource, checkedComponents, helper, reporter);
+ reporter.removeMessageSubset(this, linkedResource, MARKED_COMPONENT_MESSAGE_GROUP);
+ validateComponent(project, linkedResource, checkedComponents, helper, reporter);
checkedResources.add(linkedResource);
}
} else {
// Validate new (unmarked) Java file.
- validateUniqueComponentName(project, currentFile.getFullPath(), checkedComponents, helper, reporter);
+ validateComponent(project, currentFile.getFullPath(), checkedComponents, helper, reporter);
}
// TODO
}
@@ -118,23 +130,30 @@
return OK_STATUS;
}
- private void validateUniqueComponentName(ISeamProject project, IPath sourceFilePath, Set<ISeamComponent> checkedComponents, IValidationContext helper, IReporter reporter) {
+ private void validateComponent(ISeamProject project, IPath sourceFilePath, Set<ISeamComponent> checkedComponents, IValidationContext helper, IReporter reporter) {
Set<ISeamComponent> components = project.getComponentsByPath(sourceFilePath);
for (ISeamComponent component : components) {
// Don't validate one component twice.
if(!checkedComponents.contains(component)) {
- validateUniqueComponentName(project, component, helper, reporter);
+ validateComponent(project, component, helper, reporter);
checkedComponents.add(component);
}
}
}
- public String getComponentNameByResource(IPath resourcePath, ISeamProject project) {
- Set<ISeamComponent> components = project.getComponentsByPath(resourcePath);
- for (ISeamComponent component : components) {
- return component.getName();
+ /*
+ * Returns set of variables which are linked with this resource
+ */
+ private Set<String> getVariablesNameByResource(IPath resourcePath, ISeamProject project) {
+ Set<ISeamContextVariable> variables = project.getVariablesByPath(resourcePath);
+ Set<String> result = new HashSet<String>();
+ for (ISeamContextVariable variable : variables) {
+ String name = variable.getName();
+ if(!result.contains(name)) {
+ result.add(name);
+ }
}
- return null;
+ return result;
}
public void cleanup(IReporter reporter) {
@@ -146,16 +165,16 @@
validationContext.clear();
Set<ISeamComponent> components = project.getComponents();
for (ISeamComponent component : components) {
- validateUniqueComponentName(project, component, helper, reporter);
+ validateComponent(project, component, helper, reporter);
// TODO
}
return OK_STATUS;
}
/*
- * Validates that component has unique name
+ * Validates the component
*/
- private void validateUniqueComponentName(ISeamProject project, ISeamComponent component, IValidationContext helper, IReporter reporter) {
+ private void validateComponent(ISeamProject project, ISeamComponent component, IValidationContext helper, IReporter reporter) {
ISeamJavaComponentDeclaration firstJavaDeclaration = component.getJavaDeclaration();
if(firstJavaDeclaration!=null) {
HashMap<Integer, ISeamJavaComponentDeclaration> usedPrecedences = new HashMap<Integer, ISeamJavaComponentDeclaration>();
@@ -164,7 +183,14 @@
usedPrecedences.put(firstJavaDeclarationPrecedence, firstJavaDeclaration);
Set<ISeamComponentDeclaration> declarations = component.getAllDeclarations();
for (ISeamComponentDeclaration declaration : declarations) {
+ if(declaration instanceof ISeamJavaComponentDeclaration && declaration.getResource() instanceof IFile) {
+ // Save link between component name and java source file.
+ validationContext.addLinkedResource(declaration.getName(), declaration.getSourcePath());
+ // Validate all elements in declaration but @Name.
+ validateInjections(project, firstJavaDeclaration, helper, reporter);
+ }
if(declaration instanceof ISeamJavaComponentDeclaration && declaration!=firstJavaDeclaration) {
+ // Validate @Name
// Component class with the same component name. Check precedence.
ISeamJavaComponentDeclaration javaDeclaration = (ISeamJavaComponentDeclaration)declaration;
int javaDeclarationPrecedence = javaDeclaration.getPrecedence();
@@ -178,18 +204,46 @@
// Mark first wrong declaration with that name
IResource checkedDeclarationResource = checkedDeclaration.getResource();
ISeamTextSourceReference location = ((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
- addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, location, checkedDeclarationResource, NONUNIQUE_NAME_MESSAGE_GROUP);
+ if(location!=null) {
+ addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, location, checkedDeclarationResource, MARKED_COMPONENT_MESSAGE_GROUP);
+ }
markedDeclarations.add(checkedDeclaration);
- validationContext.addLinkedResource(checkedDeclaration.getName(), checkedDeclarationResource.getFullPath());
}
// Mark next wrong declaration with that name
markedDeclarations.add(javaDeclaration);
- validationContext.addLinkedResource(javaDeclaration.getName(), javaDeclarationResource.getFullPath());
ISeamTextSourceReference location = ((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
- addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, location, javaDeclarationResource, NONUNIQUE_NAME_MESSAGE_GROUP);
+ if(location!=null) {
+ addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, location, javaDeclarationResource, MARKED_COMPONENT_MESSAGE_GROUP);
+ }
}
}
}
}
}
+
+ private void validateJavaDeclaration(ISeamProject project, ISeamJavaComponentDeclaration declaration, IValidationContext helper, IReporter reporter) {
+ validateInjections(project, declaration, helper, reporter);
+ }
+
+ private void validateInjections(ISeamProject project, ISeamJavaComponentDeclaration declaration, IValidationContext helper, IReporter reporter) {
+ Set<IBijectedAttribute> injections = declaration.getBijectedAttributesByType(BijectedAttributeType.IN);
+ for (IBijectedAttribute injection : injections) {
+ String name = injection.getName();
+ if(name.startsWith("#{")) {
+ // TODO Validate EL
+ } else {
+ Set<ISeamContextVariable> variables = project.getVariablesByName(name);
+ for (ISeamContextVariable variable : variables) {
+ // save link between java source and variable name
+ validationContext.addLinkedResource(name, declaration.getSourcePath());
+ }
+ if(variables.size()<1) {
+ // Injection has unknown name. Mark it.
+ // TODO check preferences to mark it as Error or Warning or ignore it.
+ IResource declarationResource = declaration.getResource();
+ addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, injection, declarationResource, MARKED_COMPONENT_MESSAGE_GROUP);
+ }
+ }
+ }
+ }
}
\ 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-11 15:56:54 UTC (rev 2392)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2007-07-11 16:20:43 UTC (rev 2393)
@@ -24,38 +24,63 @@
*/
public class SeamValidationContext {
- private Map<String, Set<IPath>> markedNonuniqueNamedResources = new HashMap<String, Set<IPath>>();
- private Map<IPath, String> nonuniqueNames = new HashMap<IPath, String>();
+ private Map<String, Set<IPath>> resourcesByVariableName = new HashMap<String, Set<IPath>>();
+ private Map<IPath, Set<String>> variableNamesByResource = new HashMap<IPath, Set<String>>();
/**
- * Save linked resources of component name that we marked.
+ * Save link between resource and variable name.
* It's needed for incremental validation because we must save all linked resources of changed java file.
*/
- public void addLinkedResource(String componentName, IPath linkedResourcePath) {
- Set<IPath> linkedResources = markedNonuniqueNamedResources.get(componentName);
+ public void addLinkedResource(String variableName, IPath linkedResourcePath) {
+ Set<IPath> linkedResources = resourcesByVariableName.get(variableName);
if(linkedResources==null) {
- // create set of linked resources with component name that we must mark.
+ // create set of linked resources with variable name.
linkedResources = new HashSet<IPath>();
- markedNonuniqueNamedResources.put(componentName, linkedResources);
+ resourcesByVariableName.put(variableName, linkedResources);
}
if(!linkedResources.contains(linkedResourcePath)) {
- // save linked resources that we must mark.
+ // save linked resources.
linkedResources.add(linkedResourcePath);
}
- // Save link between component name and marked resource. It's needed if component name changes in java file.
- nonuniqueNames.put(linkedResourcePath, componentName);
+ // Save link between resource and variable names. It's needed if variable name changes in resource file.
+ Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
+ if(variableNames==null) {
+ variableNames = new HashSet<String>();
+ variableNamesByResource.put(linkedResourcePath, variableNames);
+ }
+ if(!variableNames.contains(variableName)) {
+ variableNames.add(variableName);
+ }
}
- public Set<IPath> getMarkedNonuniqueNamedResources(String componentName) {
- return markedNonuniqueNamedResources.get(componentName);
+ /**
+ * Removes link between resource and variable name.
+ * @param oldVariableName
+ * @param linkedResourcePath
+ */
+ public void removeLinkedResource(String oldVariableName, IPath linkedResourcePath) {
+ Set<IPath> linkedResources = resourcesByVariableName.get(oldVariableName);
+ if(linkedResources!=null && linkedResources.contains(linkedResourcePath)) {
+ // remove linked resource.
+ linkedResources.remove(linkedResourcePath);
+ }
+ // Remove link between resource and variable names.
+ Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
+ if(variableNames!=null && variableNames.contains(oldVariableName)) {
+ variableNames.remove(oldVariableName);
+ }
}
- public String getNonuniqueNameOfComponent(IPath sourcePath) {
- return nonuniqueNames.get(sourcePath);
+ public Set<IPath> getResourcesByVariableName(String variableName) {
+ return resourcesByVariableName.get(variableName);
}
+ public Set<String> getVariableNamesByResource(IPath sourcePath) {
+ return variableNamesByResource.get(sourcePath);
+ }
+
public void clear() {
- markedNonuniqueNamedResources.clear();
- nonuniqueNames.clear();
+ resourcesByVariableName.clear();
+ variableNamesByResource.clear();
}
}
\ No newline at end of file
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-11 15:56:54 UTC (rev 2392)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-11 16:20:43 UTC (rev 2393)
@@ -8,4 +8,5 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-NONUNIQUE_COMPONENT_NAME_MESSAGE=Component name must be unique if it has the same precedence.
\ No newline at end of file
+NONUNIQUE_COMPONENT_NAME_MESSAGE=Component name must be unique if it has the same precedence.
+UNKNOWN_INJECTION_NAME=Unknown context variable name.
\ No newline at end of file
17 years, 6 months