JBoss Tools SVN: r24739 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-06 12:03:24 -0400 (Mon, 06 Sep 2010)
New Revision: 24739
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java
Log:
https://jira.jboss.org/browse/JBIDE-3875
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java 2010-09-06 15:08:17 UTC (rev 24738)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/PreferenceModelUtilities.java 2010-09-06 16:03:24 UTC (rev 24739)
@@ -13,10 +13,15 @@
import java.util.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
public class PreferenceModelUtilities {
static final String ENT_OPTION_ROOT = "OptionRoot"; //$NON-NLS-1$
+
+ static {
+ ClassLoaderUtil.init();
+ }
private static class PreferenceModelHolder {
public static XModel preferenceModel;
15 years, 7 months
JBoss Tools SVN: r24738 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-06 11:08:17 -0400 (Mon, 06 Sep 2010)
New Revision: 24738
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java
Log:
https://jira.jboss.org/browse/JBIDE-3875
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java 2010-09-06 15:08:08 UTC (rev 24737)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/MetaLibLoader.java 2010-09-06 15:08:17 UTC (rev 24738)
@@ -151,14 +151,28 @@
}
+ boolean isRootUsed = false;
+
Element parse(InputStream stream) {
+ if(isRootUsed) {
+ root = XMLUtilities.createDocumentElement("meta"); //$NON-NLS-1$
+ ModelPlugin.getDefault().logError("Is root used");
+ System.out.println("Is root used");
+ }
+ isRootUsed = true;
Parser p = new Parser();
p.documentElement = root;
p.current = root;
p.parse(stream);
Element g = p.documentElement;
g = XMLUtilities.getUniqueChild(g, "XModelEntityGroup"); //$NON-NLS-1$
- p.documentElement.removeChild(g);
+ try {
+ p.documentElement.removeChild(g);
+ } catch (NullPointerException e) {
+ ModelPlugin.getDefault().logError("Null pointer while trying to remove child " + g);
+ System.out.println("Null pointer while trying to remove child " + g);
+ }
+ isRootUsed = false;
return g;
}
15 years, 7 months
JBoss Tools SVN: r24737 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical: editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-09-06 11:08:08 -0400 (Mon, 06 Sep 2010)
New Revision: 24737
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AbstractProcessGraphAction.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessGraphicalViewerLabelProvider.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/TaskNodeFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/template/SmooksFreemarkerTemplateGraphicalEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-6986
AddNextTaskNodeAction.addFreemarkerTemplateTask fails if Process Graph node is not properly selected
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AbstractProcessGraphAction.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AbstractProcessGraphAction.java 2010-09-06 14:34:02 UTC (rev 24736)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AbstractProcessGraphAction.java 2010-09-06 15:08:08 UTC (rev 24737)
@@ -21,6 +21,7 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.ui.IEditorPart;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
+import org.jboss.tools.smooks.graphical.editors.SmooksProcessGraphicalEditor;
import org.jboss.tools.smooks.graphical.editors.process.TaskType;
/**
@@ -70,11 +71,19 @@
}
protected List<TaskType> getCurrentSelectedTask(){
+ if(editorPart instanceof SmooksProcessGraphicalEditor) {
+ TaskType currentlySelectedTask = ((SmooksProcessGraphicalEditor)editorPart).getCurrentlySelectedTask();
+ if(currentlySelectedTask != null) {
+ List<TaskType> selectedTasks = new ArrayList<TaskType>();
+ selectedTasks.add(currentlySelectedTask);
+ return selectedTasks;
+ }
+ }
+
if(currentSelection != null){
List<TaskType> selectedTasks = new ArrayList<TaskType>();
- List<?> selections = ((IStructuredSelection)currentSelection).toList();
- for (Iterator<?> iterator = selections.iterator(); iterator.hasNext();) {
- Object object = (Object) iterator.next();
+ List<?> selections = ((IStructuredSelection) currentSelection).toList();
+ for (Object object : selections) {
if(object != null && object instanceof TaskType){
selectedTasks.add((TaskType)object);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2010-09-06 14:34:02 UTC (rev 24736)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2010-09-06 15:08:08 UTC (rev 24737)
@@ -150,6 +150,8 @@
protected boolean needupdatewhenshow = true;
private ProcessType process;
+
+ private TaskType currentlySelectedTask = null;
private Map<Object, String> smooksModelIdMap = new HashMap<Object, String>();
@@ -342,8 +344,7 @@
updateProcessActions(processGraphViewer.getSelection());
fillProcessMenu(manager);
} else {
- for (Iterator<?> iterator = processPanelActions.iterator(); iterator.hasNext();) {
- IAction action = (IAction) iterator.next();
+ for (IAction action : processPanelActions) {
if (action.isEnabled() && !(action instanceof DeleteTaskNodeAction)) {
manager.add(action);
}
@@ -898,7 +899,7 @@
return null;
}
- protected void showTaskControl(Object model) {
+ public void showTaskControl(Object model) {
if (pageBook == null)
return;
if (model == null)
@@ -969,6 +970,7 @@
pageBook.showPage(id);
}
}
+ currentlySelectedTask = (TaskType) finalModel;
} else {
// pageBook.showEmptyPage();
}
@@ -977,6 +979,10 @@
});
updateGlobalActions();
}
+
+ public TaskType getCurrentlySelectedTask() {
+ return currentlySelectedTask;
+ }
protected IEditorSite createSite(IEditorPart editor) {
return new SmooksTaskDetailsEditorSite(this.getEditor(), editor, this);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessGraphicalViewerLabelProvider.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessGraphicalViewerLabelProvider.java 2010-09-06 14:34:02 UTC (rev 24736)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessGraphicalViewerLabelProvider.java 2010-09-06 15:08:08 UTC (rev 24737)
@@ -87,7 +87,7 @@
// if(TaskTypeManager.TASK_ID_INPUT.equals(((TaskType)element).getId())){
Image image = getImage(element);
String text = getText(element);
- return new TaskNodeFigure(processEditor, image, text);
+ return new TaskNodeFigure((TaskType)element, processEditor, image, text);
// }
}
return null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/TaskNodeFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/TaskNodeFigure.java 2010-09-06 14:34:02 UTC (rev 24736)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/TaskNodeFigure.java 2010-09-06 15:08:08 UTC (rev 24737)
@@ -44,6 +44,8 @@
*
*/
public class TaskNodeFigure extends Figure {
+
+ private TaskType task;
private Label problemTooltip;
@@ -67,16 +69,22 @@
private Rectangle imageSourceRectangle = null;
- public TaskNodeFigure(SmooksProcessGraphicalEditor graph, Image image, String labelText) {
+ public TaskNodeFigure(TaskType task, SmooksProcessGraphicalEditor graph, Image image, String text) {
super();
+ this.task = task;
+ this.processGraphicalViewerEditor = graph;
this.image = image;
- this.labelText = labelText;
- this.processGraphicalViewerEditor = graph;
+ this.labelText = text;
this.problemTooltip = new Label();
+
initFigure();
hookTaskNodeFigure();
}
+ public TaskType getTask() {
+ return task;
+ }
+
public void setProblemMessage(String message){
if(message == null){
this.setToolTip(null);
@@ -192,8 +200,12 @@
((Clickable) addTaskFigure).addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
- if (!showAddFigure)
+ if (!showAddFigure) {
return;
+ }
+
+ processGraphicalViewerEditor.showTaskControl(task);
+
Graph g = processGraphicalViewerEditor.getProcessGraphViewer().getGraphControl();
processGraphicalViewerEditor.setNeedupdatewhenshow(false);
List<?> nodes = g.getNodes();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/template/SmooksFreemarkerTemplateGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/template/SmooksFreemarkerTemplateGraphicalEditor.java 2010-09-06 14:34:02 UTC (rev 24736)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/template/SmooksFreemarkerTemplateGraphicalEditor.java 2010-09-06 15:08:08 UTC (rev 24737)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.template;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
15 years, 7 months
JBoss Tools SVN: r24736 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-06 10:34:02 -0400 (Mon, 06 Sep 2010)
New Revision: 24736
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
Log:
https://jira.jboss.org/browse/JBIDE-3875
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java 2010-09-06 13:39:19 UTC (rev 24735)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java 2010-09-06 14:34:02 UTC (rev 24736)
@@ -202,15 +202,35 @@
public void resourceChanged(IResourceChangeEvent event) {
if(!isActive() || event == null || event.getDelta() == null) return;
if(!checkDelta(event.getDelta())) return;
+ IFile f = findFile(event.getDelta());
+ if(f != null && f.getName().equals(".classpath")) { //$NON-NLS-1$
+ new FileSystemsLoader().updateClassPath(this);
+ return;
+ }
fileSystemsRenameListener.checkFileSystemRename(event);
requireUpdate();
}
+
+ IFile findFile(IResourceDelta delta) {
+ IResource r = delta.getResource();
+ if(r instanceof IFile) return (IFile)r;
+ IResourceDelta[] ds = delta.getAffectedChildren();
+ for (IResourceDelta d: ds) {
+ IFile f = findFile(d);
+ if(f != null) return f;
+ }
+ return null;
+ }
+
+ private void onUpdateClassPath() {
+
+ }
UpdateRunnable currentUpdate = null;
void requireUpdate() {
- if(lock == 0) {
+ if(lock == 0 && currentUpdate == null) {
// synchronized (this) {
currentUpdate = new UpdateRunnable();
// }
@@ -271,6 +291,10 @@
ModelPlugin.getWorkspace().removeResourceChangeListener(FileSystemsImpl.this);
} else {
doUpdate();
+ if(request != 0) {
+ request = 0;
+ doUpdate();
+ }
}
if(this == currentUpdate) currentUpdate = null;
}
@@ -373,4 +397,3 @@
}
}
-
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2010-09-06 13:39:19 UTC (rev 24735)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2010-09-06 14:34:02 UTC (rev 24736)
@@ -66,11 +66,15 @@
XObjectLoader loader = XModelObjectLoaderUtil.getObjectLoader(cs[i]);
if(loader != null) b &= loader.update(cs[i]);
}
+ updateClassPath(object);
+ ((FileSystemsImpl)object).updateOverlapped();
+ return b;
+ }
+
+ public void updateClassPath(XModelObject object) {
updateLibs(object);
removeMissingJarSystems(object);
updateSrcs(object);
- ((FileSystemsImpl)object).updateOverlapped();
- return b;
}
public void load(XModelObject object) {
15 years, 7 months
JBoss Tools SVN: r24735 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test: src/org/hibernate/eclipse/console/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-09-06 09:39:19 -0400 (Mon, 06 Sep 2010)
New Revision: 24735
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6838 - fixed
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,44 +1,44 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
- <target name="generateHibernatePropeties">
- <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
-hibernate.dialect=testDialect</echo>
- </target>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2doc>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
- <hbm2hbmxml>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2hbmxml>
- <hbmtemplate>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
+ <target name="generateHibernatePropeties">
+ <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
+hibernate.connection.password=passw
+hibernate.connection.url=url
+hibernate.connection.username=username
+hibernate.dialect=testDialect</echo>
+ </target>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
+ <hbm2dao/>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,24 +1,24 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
- <target name="generateHibernatePropeties">
- <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
-hibernate.dialect=testDialect</echo>
- </target>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
+ <target name="generateHibernatePropeties">
+ <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
+hibernate.connection.password=passw
+hibernate.connection.url=url
+hibernate.connection.username=username
+hibernate.dialect=testDialect</echo>
+ </target>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,45 +1,45 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib">
- <path location="ejb3-persistence.jar"/>
- <path location="hibernate3.jar"/>
- <path location="hsqldb.jar"/>
- </path>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <jpaconfiguration namingStrategy="testNamingStrategy" persistenceUnit="testPersistenceUnit">
- <fileset dir="." id="id">
- <include name="xxx.hbm.xml"/>
- <include name="yyy.hbm.xml"/>
- </fileset>
- </jpaconfiguration>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2doc>
- <property key="ejb3" value="true"/>
- <property key="jdk5" value="true"/>
- </hbm2doc>
- <hbm2cfgxml ejb3="true">
- <property key="jdk5" value="true"/>
- </hbm2cfgxml>
- <hbm2hbmxml>
- <property key="ejb3" value="true"/>
- <property key="jdk5" value="true"/>
- </hbm2hbmxml>
- <hbmtemplate>
- <property key="ejb3" value="true"/>
- <property key="jdk5" value="true"/>
- </hbmtemplate>
- <hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
- <property key="ejb3" value="true"/>
- <property key="jdk5" value="true"/>
- </hbm2ddl>
- <hbm2dao ejb3="true" jdk5="true"/>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib">
+ <path location="ejb3-persistence.jar"/>
+ <path location="hibernate3.jar"/>
+ <path location="hsqldb.jar"/>
+ </path>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <jpaconfiguration namingStrategy="testNamingStrategy" persistenceUnit="testPersistenceUnit">
+ <fileset dir="." id="id">
+ <include name="xxx.hbm.xml"/>
+ <include name="yyy.hbm.xml"/>
+ </fileset>
+ </jpaconfiguration>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2doc>
+ <hbm2cfgxml ejb3="true">
+ <property key="jdk5" value="true"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2ddl>
+ <hbm2dao ejb3="true" jdk5="true"/>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,25 +1,25 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib">
- <path location="ejb3-persistence.jar"/>
- <path location="hibernate3.jar"/>
- <path location="hsqldb.jar"/>
- </path>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <jpaconfiguration namingStrategy="testNamingStrategy" persistenceUnit="testPersistenceUnit">
- <fileset dir="." id="id">
- <include name="xxx.hbm.xml"/>
- <include name="yyy.hbm.xml"/>
- </fileset>
- </jpaconfiguration>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib">
+ <path location="ejb3-persistence.jar"/>
+ <path location="hibernate3.jar"/>
+ <path location="hsqldb.jar"/>
+ </path>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <jpaconfiguration namingStrategy="testNamingStrategy" persistenceUnit="testPersistenceUnit">
+ <fileset dir="." id="id">
+ <include name="xxx.hbm.xml"/>
+ <include name="yyy.hbm.xml"/>
+ </fileset>
+ </jpaconfiguration>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,35 +1,35 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2doc>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
- <hbm2hbmxml>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2hbmxml>
- <hbmtemplate>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
+ <hbm2dao/>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,15 +1,15 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,5 +1,5 @@
-hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
+hibernate.connection.driver_class=driverClass
+hibernate.connection.password=passw
+hibernate.connection.url=url
+hibernate.connection.username=username
hibernate.dialect=testDialect
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,36 +1,36 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="hibernate.properties"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2doc>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
- <hbm2hbmxml>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2hbmxml>
- <hbmtemplate>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="hibernate.properties"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
+ <hbm2dao/>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,16 +1,16 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="hibernate.properties"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="hibernate.properties"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,36 +1,36 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <jdbcconfiguration configurationFile="project/src/hibernate.cfg.xml" propertyFile="project/src/hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2doc>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
- <hbm2hbmxml>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2hbmxml>
- <hbmtemplate>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <jdbcconfiguration configurationFile="project/src/hibernate.cfg.xml" propertyFile="project/src/hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
+ <hbm2dao/>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,16 +1,16 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="reslocation/test"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <jdbcconfiguration configurationFile="project/src/hibernate.cfg.xml" propertyFile="project/src/hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <jdbcconfiguration configurationFile="project/src/hibernate.cfg.xml" propertyFile="project/src/hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,38 +1,38 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="current.dir" location="project/src"/>
- <property name="workspace.dir" location="project/src"/>
- <property name="build.dir" location="12345678901234567890"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <configuration configurationFile="${current.dir}/hibernate.cfg.xml" propertyFile="${current.dir}/hibernate.properties"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2doc>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
- <hbm2hbmxml>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2hbmxml>
- <hbmtemplate>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="current.dir" location="project/src"/>
+ <property name="workspace.dir" location="project/src"/>
+ <property name="build.dir" location="12345678901234567890"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="${current.dir}/hibernate.cfg.xml" propertyFile="${current.dir}/hibernate.properties"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
+ <hbm2dao/>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-09-06 13:39:19 UTC (rev 24735)
@@ -1,18 +1,18 @@
-<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="current.dir" location="project/src"/>
- <property name="workspace.dir" location="project/src"/>
- <property name="build.dir" location="12345678901234567890"/>
- <path id="toolslib"/>
- <target name="hibernateAntCodeGeneration">
- <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
- <hibernatetool destdir="${build.dir}">
- <configuration configurationFile="${current.dir}/hibernate.cfg.xml" propertyFile="${current.dir}/hibernate.properties"/>
- <classpath>
- <path location="${build.dir}"/>
- </classpath>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- </hibernatetool>
- </target>
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="current.dir" location="project/src"/>
+ <property name="workspace.dir" location="project/src"/>
+ <property name="build.dir" location="12345678901234567890"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="${current.dir}/hibernate.cfg.xml" propertyFile="${current.dir}/hibernate.properties"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-09-06 12:00:03 UTC (rev 24734)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-09-06 13:39:19 UTC (rev 24735)
@@ -11,6 +11,7 @@
package org.hibernate.eclipse.console.test;
import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
@@ -24,12 +25,16 @@
import java.util.Map;
import java.util.Properties;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.internal.ConnectionProfile;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.hibernate.console.ConfigurationXMLFactory;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.ExtensionManager;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
@@ -196,21 +201,43 @@
}
}
+ /**
+ * Parse, i.e. adjust xml text so attributes for same xml
+ * will be in one order.
+ *
+ * @param sample
+ * @return adjusted xml
+ */
+ public String adjustXmlText(String sample) {
+ Document doc = null;
+ try {
+ doc = DocumentHelper.parseText(sample);
+ } catch (DocumentException e) {
+ // ignore
+ }
+ if (doc == null) {
+ return sample;
+ }
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ConfigurationXMLFactory.dump(baos, doc.getRootElement());
+ return baos.toString().trim();
+ }
+
public void testCodeGenXMLFactoryRevengAll() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, true, ETestCase.simple);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
- String specimen = getSample("AntCodeGenReveng_test1.xml"); //$NON-NLS-1$
- assertEquals(specimen.trim(), codeGen.replaceAll(LN_1, LN_2));
+ String sample = getSample("AntCodeGenReveng_test1.xml"); //$NON-NLS-1$
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryRevengOne() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, false, ETestCase.simple);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGenReveng_test2.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
@@ -221,10 +248,10 @@
codeGenFactory.setPlace2Generate(strPlace);
codeGenFactory.setWorkspacePath(strPlace);
//
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGen_test1.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
@@ -235,96 +262,96 @@
codeGenFactory.setPlace2Generate(strPlace);
codeGenFactory.setWorkspacePath(strPlace);
//
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGen_test2.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryJpaAll() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.jpa);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenJpa_test1.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryJpaOne() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.jpa);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenJpa_test2.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryNullableAll() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.nullable);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenNullable_test1.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryNullableOne() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.nullable);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenNullable_test2.xml"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryPropertiesAll() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.properties);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenProps_test1.xml"); //$NON-NLS-1$
String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
public void testCodeGenXMLFactoryPropertiesOne() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.properties);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenProps_test2.xml"); //$NON-NLS-1$
String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
public void testCodeGenXMLFactoryInternalPropertiesAll() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.properties);
codeGenFactory.setExternalPropFile(false);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenInternalProps_test1.xml"); //$NON-NLS-1$
String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_2, LN_1).replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
public void testCodeGenXMLFactoryInternalPropertiesOne() {
CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.properties);
codeGenFactory.setExternalPropFile(false);
- String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenInternalProps_test2.xml"); //$NON-NLS-1$
String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
- assertEquals(sample.trim(), codeGen.replaceAll(LN_2, LN_1).replaceAll(LN_1, LN_2));
+ assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
@@ -404,7 +431,7 @@
in.close();
} catch (IOException e) {
}
- return cbuf.toString();
+ return adjustXmlText(cbuf.toString());
}
protected File getResourceItem(String strResPath) throws IOException {
15 years, 7 months
JBoss Tools SVN: r24734 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-09-06 08:00:03 -0400 (Mon, 06 Sep 2010)
New Revision: 24734
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6909 - fixed
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2010-09-06 11:32:28 UTC (rev 24733)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2010-09-06 12:00:03 UTC (rev 24734)
@@ -17,7 +17,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.SWTGraphics;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.LayerConstants;
@@ -86,9 +85,6 @@
oneOf(saveDialog).getResult();
will(returnValue(resPath));
- allowing(editor).getSite();
- will(returnValue(null));
-
allowing(editor).getEditPartViewer();
will(returnValue(graphicalViewer));
@@ -98,24 +94,8 @@
allowing(scalableFreeformRootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS);
will(returnValue(figure));
- allowing(graphicalViewer).getControl();
- will(returnValue(control));
-
- allowing(control).getDisplay();
- will(returnValue(display));
-
allowing(figure).getBounds();
will(returnValue(rectangle));
-
- allowing(display).internal_new_GC(null);
- will(returnValue(0));
-
- allowing(display).internal_dispose_GC(0, null);
-
- oneOf(figure).paint(with(any(SWTGraphics.class)));
-
- allowing(display).isDisposed();
- will(returnValue(true));
}
});
final ExportImageAction exportImageAction = new ExportImageAction(editor);
15 years, 7 months
JBoss Tools SVN: r24733 - in trunk: cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-06 07:32:28 -0400 (Mon, 06 Sep 2010)
New Revision: 24733
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectSet.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.patch
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatingProjectSet.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
Log:
https://jira.jboss.org/browse/JBIDE-6950 Improved CDI injection point incremental validation for dependent projects.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -323,15 +323,10 @@
//TODO
}
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.seam.core.ISeamProject#getValidationContext()
- */
public ProjectValidationContext getValidationContext() {
if(validationContext==null) {
validationContext = new ProjectValidationContext();
}
return validationContext;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -136,7 +136,7 @@
return false;
}
- List<CDICoreNature> getProjects(IProject project) throws CoreException {
+ public static List<CDICoreNature> getProjects(IProject project) throws CoreException {
List<CDICoreNature> list = new ArrayList<CDICoreNature>();
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
@@ -150,5 +150,4 @@
}
return list;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -20,10 +20,13 @@
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.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaModelException;
@@ -42,6 +45,7 @@
import org.jboss.tools.cdi.core.IInterceptor;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -219,11 +223,34 @@
}
}
+ private Map<IProject, IJavaProject> javaProjects;
+
+ private IJavaProject getJavaProject(IResource resource) {
+ if(javaProjects == null) {
+ javaProjects = new HashMap<IProject, IJavaProject>();
+ }
+ IProject project = resource.getProject();
+ if(project.isAccessible()) {
+ IJavaProject javaProject = javaProjects.get(project);
+ if(javaProject==null) {
+ javaProject = EclipseUtil.getJavaProject(project);
+ if(javaProject!=null) {
+ javaProjects.put(project, javaProject);
+ }
+ }
+ return javaProject;
+ }
+ return null;
+ }
+
private IType getType(IFile beansXml, TypeNode node, String errorMessage) {
IType type = null;
if(node.getTypeName()!=null) {
try {
- type = EclipseJavaUtil.findType(validator.javaProject, node.getTypeName());
+ IJavaProject javaProject = getJavaProject(beansXml);
+ if(javaProject!=null) {
+ type = EclipseJavaUtil.findType(javaProject, node.getTypeName());
+ }
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
return null;
@@ -242,7 +269,7 @@
IStatus status = JavaConventions.validateJavaTypeName(typeName, CompilerOptions.VERSION_1_7, CompilerOptions.VERSION_1_7);
if(status.getSeverity()!=IStatus.ERROR) {
String packagePath = typeName.replace('.', '/');
- Set<IFolder> sources = validator.getSourceFolders();
+ Set<IFolder> sources = validator.getSourceFolders(beansXml.getProject());
for (IFolder source : sources) {
IPath path = source.getFullPath().append(packagePath + ".java"); //$NON-NLS-1$
validator.getValidationContext().addLinkedCoreResource(beansXml.getFullPath().toOSString(), path, false);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -12,7 +12,6 @@
import java.text.MessageFormat;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -90,10 +89,8 @@
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper;
-import org.jboss.tools.jst.web.kb.internal.validation.ValidatingProjectSet;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
import org.jboss.tools.jst.web.kb.validation.IValidatingProjectSet;
-import org.jboss.tools.jst.web.kb.validation.IValidationContext;
import org.jboss.tools.jst.web.kb.validation.IValidator;
import org.jboss.tools.jst.web.kb.validation.ValidationUtil;
@@ -105,10 +102,10 @@
ICDIProject cdiProject;
String projectName;
- IJavaProject javaProject;
+ CDIProjectSet projectSet;
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
- private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
+ private AnnotationValidationDelegate annptationValidator = new AnnotationValidationDelegate(this);
/*
* (non-Javadoc)
@@ -127,30 +124,8 @@
* (org.eclipse.core.resources.IProject)
*/
public IValidatingProjectSet getValidatingProjects(IProject project) {
- IValidationContext rootContext = null;
-// IProject war = null; // TODO get war ?
-// if (war != null && war.isAccessible()) {
-// IKbProject kbProject = KbProjectFactory.getKbProject(war, false);
-// if (kbProject != null) {
-// rootContext = kbProject.getValidationContext();
-// } else {
-// KbProject.checkKBBuilderInstalled(war);
-// CDICoreNature cdiProject = CDICorePlugin.getCDI(project, false);
-// if (cdiProject != null) {
-// rootContext = null; // cdiProject.getDelegate().getValidationContext();
-// }
-// }
-// }
- if (rootContext == null) {
- CDICoreNature cdiProject = CDICorePlugin.getCDI(project, false);
- if (cdiProject != null) {
- rootContext = cdiProject.getValidationContext();
- }
- }
-
- List<IProject> projects = new ArrayList<IProject>();
- projects.add(project);
- return new ValidatingProjectSet(project, projects, rootContext);
+ projectSet = new CDIProjectSet(project);
+ return projectSet;
}
/*
@@ -192,9 +167,11 @@
public void init(IProject project, ContextValidationHelper validationHelper, org.eclipse.wst.validation.internal.provisional.core.IValidator manager,
IReporter reporter) {
super.init(project, validationHelper, manager, reporter);
- cdiProject = CDICorePlugin.getCDIProject(project, false);
- projectName = project.getName();
- javaProject = EclipseUtil.getJavaProject(project);
+ if(projectSet==null) {
+ getValidatingProjects(project);
+ }
+ cdiProject = projectSet.getRootCdiProject();
+ projectName = projectSet.getRootProject().getName();
}
/*
@@ -298,18 +275,11 @@
Set<String> scopes = cdiProject.getScopeNames();
for (String scope: scopes) {
- IScope s = cdiProject.getScope(scope);
- if(s == null || isResourceFromAnotherProject(s.getResource())) {
- continue;
- }
- annotationValidator.validateScopeType(s);
+ annptationValidator.validateScopeType(cdiProject.getScope(scope));
}
List<IFile> beansXmls = getAllBeansXmls();
for (IFile beansXml : beansXmls) {
- if(isResourceFromAnotherProject(beansXml)) {
- continue;
- }
beansXmlValidator.validateBeansXml(beansXml);
}
@@ -325,9 +295,6 @@
if (reporter.isCancelled() || file == null || !file.isAccessible()) {
return;
}
- if(isResourceFromAnotherProject(file)) {
- return;
- }
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[] {file.getProject().getName(), file.getName()});
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
@@ -345,7 +312,7 @@
validateQualifier(qualifier);
IScope scope = cdiProject.getScope(file.getFullPath());
- annotationValidator.validateScopeType(scope);
+ annptationValidator.validateScopeType(scope);
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
@@ -354,25 +321,35 @@
Set<IFolder> sourceFolders = null;
- Set<IFolder> getSourceFolders() {
- if(sourceFolders==null) {
- sourceFolders = new HashSet<IFolder>();
- IPackageFragmentRoot[] roots;
- try {
- // From source folders
- roots = javaProject.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) {
- IResource source = roots[i].getCorrespondingResource();
- if(source instanceof IFolder) {
- sourceFolders.add((IFolder)source);
- }
+ static Set<IFolder> getSourceFolders(IProject project) {
+ Set<IFolder> folders = new HashSet<IFolder>();
+ IPackageFragmentRoot[] roots;
+ try {
+ // From source folders
+ IJavaProject javaProject = EclipseUtil.getJavaProject(project);
+ roots = javaProject.getPackageFragmentRoots();
+ for (int i = 0; i < roots.length; i++) {
+ if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) {
+ IResource source = roots[i].getCorrespondingResource();
+ if(source instanceof IFolder) {
+ folders.add((IFolder)source);
}
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
+ return folders;
+ }
+
+ Set<IFolder> getSourceFoldersForProjectsSet() {
+ if(sourceFolders==null) {
+ sourceFolders = new HashSet<IFolder>();
+ List<IProject> projects = projectSet.getAllProjests();
+ for (IProject project : projects) {
+ sourceFolders.addAll(getSourceFolders(project));
+ }
+ }
return sourceFolders;
}
@@ -384,7 +361,7 @@
private List<IFile> getAllBeansXmls() {
List<IFile> beansXmls = new ArrayList<IFile>();
// From source folders
- Set<IFolder> sourceFolders = getSourceFolders();
+ Set<IFolder> sourceFolders = getSourceFoldersForProjectsSet();
for (IFolder source : sourceFolders) {
IResource beansXml = source.findMember(new Path("/META-INF/beans.xml")); //$NON-NLS-1$
if(beansXml!=null && beansXml instanceof IFile) {
@@ -392,7 +369,7 @@
}
}
// From WEB-INF folder
- IVirtualComponent com = ComponentCore.createComponent(rootProject);
+ IVirtualComponent com = ComponentCore.createComponent(validatingProject);
if(com!=null) {
IVirtualFile beansXml = com.getRootFolder().getFile(new Path("/WEB-INF/beans.xml")); //$NON-NLS-1$
if(beansXml!=null && beansXml.getUnderlyingFile().isAccessible()) {
@@ -402,10 +379,6 @@
return beansXmls;
}
- private boolean isResourceFromAnotherProject(IResource resource) {
- return resource != null && !resource.getProject().getName().equals(projectName);
- }
-
/**
* Validates a bean.
*
@@ -418,9 +391,6 @@
if(bean.getBeanClass().isReadOnly()) {
return;
}
- if(isResourceFromAnotherProject(bean.getResource())) {
- return;
- }
// Collect all relations between the bean and other CDI elements.
String name = bean.getName();
if (name != null) {
@@ -1861,9 +1831,6 @@
// validate sources only
return;
}
- if(isResourceFromAnotherProject(resource)) {
- return;
- }
List<IAnnotationDeclaration> as = stereotype.getAnnotationDeclarations();
// 1. non-empty name
@@ -1909,7 +1876,7 @@
}
try {
- annotationValidator.validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
+ annptationValidator.validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
@@ -1924,9 +1891,6 @@
// validate sources only
return;
}
- if(isResourceFromAnotherProject(resource)) {
- return;
- }
/*
* 9.5.2. Interceptor binding types with members
* array-valued or annotation-valued member of an interceptor binding type is not annotated @Nonbinding (Non-Portable behavior)
@@ -1948,9 +1912,6 @@
// validate sources only
return;
}
- if(isResourceFromAnotherProject(resource)) {
- return;
- }
/*
* 5.2.5. Qualifier annotations with members
* - array-valued or annotation-valued member of a qualifier type is not annotated @Nonbinding (Non-Portable behavior)
@@ -1961,7 +1922,7 @@
* Qualifier annotation type should be annotated with @Target({METHOD, FIELD, PARAMETER, TYPE})
*/
try {
- annotationValidator.validateQualifierAnnotationTypeAnnotations(qualifier, resource);
+ annptationValidator.validateQualifierAnnotationTypeAnnotations(qualifier, resource);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectSet.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectSet.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.internal.core.validation;
+
+import java.util.ArrayList;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+import org.jboss.tools.jst.web.kb.internal.KbProject;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatingProjectSet;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIProjectSet extends ValidatingProjectSet {
+
+ private ICDIProject rootCdiProject;
+
+ /**
+ * @param project
+ */
+ public CDIProjectSet(IProject project) {
+ allProjects = new ArrayList<IProject>();
+ CDICoreNature sp = CDICorePlugin.getCDI(project, false);
+ if(sp!=null) {
+ addIncludedProjects(sp);
+ CDICoreNature rootCdiNature = addIncludingProjects(sp);
+ rootCdiProject = rootCdiNature.getDelegate();
+ rootProject = rootCdiNature.getProject();
+
+ if(rootProject!=null && rootProject.isAccessible()) {
+ IKbProject kbProject = KbProjectFactory.getKbProject(rootProject, false);
+ if(kbProject!=null) {
+ rootContext = kbProject.getValidationContext();
+ } else {
+ KbProject.checkKBBuilderInstalled(rootProject);
+ rootContext = rootCdiNature.getValidationContext();
+ }
+ }
+ }
+ }
+
+ private CDICoreNature addIncludingProjects(CDICoreNature project) {
+ Set<CDICoreNature> dependentProjects = project.getDependentProjects();
+ for (CDICoreNature nature : dependentProjects) {
+ if(allProjects.contains(nature.getProject())) {
+ return project;
+ }
+ allProjects.add(nature.getProject());
+ return addIncludingProjects(nature);
+ }
+ return project;
+ }
+
+ private void addIncludedProjects(CDICoreNature project) {
+ Set<CDICoreNature> includedCdiProjects = project.getCDIProjects();
+ for (CDICoreNature cdiCoreNature : includedCdiProjects) {
+ IProject includedProject = cdiCoreNature.getProject();
+ if(!allProjects.contains(includedProject)) {
+ allProjects.add(includedProject);
+ addIncludedProjects(cdiCoreNature);
+ }
+ }
+ }
+
+ public void setRootCdiProject(ICDIProject rootCdiProject) {
+ this.rootCdiProject = rootCdiProject;
+ }
+
+ public ICDIProject getRootCdiProject() {
+ return rootCdiProject;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectSet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -105,7 +105,7 @@
super.init(project, validationHelper, manager, reporter);
resolvers = ELResolverFactoryManager.getInstance().getResolvers(project);
mainFactory = ELParserUtil.getDefaultFactory();
- validateVars = JSFSeverityPreferences.ENABLE.equals(JSFSeverityPreferences.getInstance().getProjectPreference(rootProject, JSFSeverityPreferences.CHECK_VARS));
+ validateVars = JSFSeverityPreferences.ENABLE.equals(JSFSeverityPreferences.getInstance().getProjectPreference(validatingProject, JSFSeverityPreferences.CHECK_VARS));
}
/*
@@ -160,7 +160,7 @@
}
private void initRevalidationFlag() {
- String revalidateUnresolvedELsString = JSFSeverityPreferences.getInstance().getProjectPreference(rootProject, JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL);
+ String revalidateUnresolvedELsString = JSFSeverityPreferences.getInstance().getProjectPreference(validatingProject, JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL);
revalidateUnresolvedELs = JSFSeverityPreferences.ENABLE.equals(revalidateUnresolvedELsString);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatingProjectSet.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatingProjectSet.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatingProjectSet.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -25,6 +25,9 @@
protected List<IProject> allProjects;
protected IValidationContext rootContext;
+ protected ValidatingProjectSet() {
+ }
+
/**
* @param rootProject
* @param allProjects
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -45,7 +45,7 @@
protected IValidator validationManager;
protected ContextValidationHelper coreHelper;
protected IReporter reporter;
- protected IProject rootProject;
+ protected IProject validatingProject;
protected String markerId;
protected IValidationContext validationContext;
protected TextFileDocumentProvider documentProvider;
@@ -57,7 +57,7 @@
}
public void init(IProject project, ContextValidationHelper validationHelper, IValidator manager, IReporter reporter) {
- setRootProject(project);
+ setProject(project);
setCoreHelper(validationHelper);
setValidationManager(manager);
setReporter(reporter);
@@ -89,8 +89,8 @@
/**
* @param rootProject the rootProject to set
*/
- public void setRootProject(IProject rootProject) {
- this.rootProject = rootProject;
+ public void setProject(IProject rootProject) {
+ this.validatingProject = rootProject;
}
/**
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.patch
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.patch 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.patch 2010-09-06 11:32:28 UTC (rev 24733)
@@ -1,124 +0,0 @@
-Index: src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
-===================================================================
---- src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java (revision 22821)
-+++ src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java (working copy)
-@@ -20,6 +20,7 @@
- import org.eclipse.core.runtime.Status;
- import org.eclipse.jface.text.BadLocationException;
- import org.eclipse.jface.text.IDocument;
-+import org.eclipse.osgi.util.NLS;
- import org.eclipse.ui.editors.text.TextFileDocumentProvider;
- import org.eclipse.wst.validation.internal.TaskListUtility;
- import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
-@@ -28,6 +29,7 @@
- import org.eclipse.wst.validation.internal.provisional.core.IValidator;
- import org.jboss.tools.common.preferences.SeverityPreferences;
- import org.jboss.tools.common.text.ITextSourceReference;
-+import org.jboss.tools.jst.web.kb.KbMessages;
- import org.jboss.tools.jst.web.kb.WebKbPlugin;
- import org.jboss.tools.jst.web.kb.validation.IValidationContext;
- import org.jboss.tools.jst.web.kb.validation.IValidationErrorManager;
-@@ -159,53 +161,15 @@
- public IMarker addError(String message, String preferenceKey,
- String[] messageArguments, int length, int offset, IResource target) {
- String preferenceValue = getPreference(target.getProject(), preferenceKey);
-- boolean ignore = false;
-- int messageSeverity = IMessage.HIGH_SEVERITY;
-- if (SeverityPreferences.WARNING.equals(preferenceValue)) {
-- messageSeverity = IMessage.NORMAL_SEVERITY;
-- } else if (SeverityPreferences.IGNORE.equals(preferenceValue)) {
-- ignore = true;
-- }
--
-- if (ignore) {
-- return null;
-- }
--
-- IMessage problemMessage = new ProblemMessage(message, messageSeverity, messageArguments, target, getMarkerId());
-- problemMessage.setLength(length);
-- problemMessage.setOffset(offset);
-- try {
-- if(getDocumentProvider()!=null) {
-- getDocumentProvider().connect(target);
-- IDocument document = getDocumentProvider().getDocument(target);
-- if(document!=null) {
-- problemMessage.setLineNo(document.getLineOfOffset(offset) + 1);
-- }
-- }
-- } catch (BadLocationException e) {
-- WebKbPlugin.getDefault().logError(
-- "Exception occurred during error line number calculation",
-- e);
-- return null;
-- } catch (CoreException e) {
-- WebKbPlugin.getDefault().logError(
-- "Exception occurred during error line number calculation",
-- e);
-- return null;
-- } finally {
-- if(getDocumentProvider()!=null) {
-- getDocumentProvider().disconnect(target);
-- }
-- }
--
-- int severity = problemMessage.getSeverity();
-- try {
-- return TaskListUtility.addTask(getMarkerOwner().getName().intern(), target, "" + problemMessage.getLineNumber(), problemMessage.getText(),
-- problemMessage.getText(), severity, null, problemMessage.getGroupName(), problemMessage.getOffset(), problemMessage.getLength());
-- } catch (CoreException e) {
-- WebKbPlugin.getDefault().logError(e);
-+ IMarker marker = null;
-+ if (!SeverityPreferences.IGNORE.equals(preferenceValue)) {
-+ int severity = IMessage.HIGH_SEVERITY;
-+ if (SeverityPreferences.WARNING.equals(preferenceValue)) {
-+ severity = IMessage.NORMAL_SEVERITY;
-+ }
-+ marker = addError(message, severity, messageArguments, length, offset, target, getDocumentProvider(), getMarkerId(), getMarkerOwner());
- }
-- return null;
-+ return marker;
- }
-
- protected TextFileDocumentProvider getDocumentProvider() {
-@@ -245,6 +209,7 @@
- * @return
- */
- public static IMarker addError(String message, int severity, String[] messageArguments, int length, int offset, IResource target, TextFileDocumentProvider documentProvider, String markerId, Class markerOwner) {
-+ IMarker marker = null;
- IMessage problemMessage = new ProblemMessage(message, severity, messageArguments, target, markerId);
- problemMessage.setLength(length);
- problemMessage.setOffset(offset);
-@@ -254,27 +219,19 @@
- problemMessage.setLineNo(documentProvider.getDocument(
- target).getLineOfOffset(offset) + 1);
- }
-+ marker = TaskListUtility.addTask(markerOwner.getName().intern(), target, "" + problemMessage.getLineNumber(), problemMessage.getText(),
-+ problemMessage.getText(), severity, null, problemMessage.getGroupName(), problemMessage.getOffset(), problemMessage.getLength());
- } catch (BadLocationException e) {
- WebKbPlugin.getDefault().logError(
-- "Exception occurred during error line number calculation",
-- e);
-- return null;
-+ NLS.bind(KbMessages.EXCEPTION_DURING_CREATING_MARKER, target.getFullPath()), e);
- } catch (CoreException e) {
- WebKbPlugin.getDefault().logError(
-- "Exception occurred during error line number calculation",
-- e);
-- return null;
-+ NLS.bind(KbMessages.EXCEPTION_DURING_CREATING_MARKER, target.getFullPath()), e);
- } finally {
- documentProvider.disconnect(target);
- }
-
-- try {
-- return TaskListUtility.addTask(markerOwner.getName().intern(), target, "" + problemMessage.getLineNumber(), problemMessage.getText(),
-- problemMessage.getText(), severity, null, problemMessage.getGroupName(), problemMessage.getOffset(), problemMessage.getLength());
-- } catch (CoreException e) {
-- WebKbPlugin.getDefault().logError(e);
-- }
-- return null;
-+ return marker;
- }
-
- /*
-
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -98,7 +98,7 @@
public void init(IProject project,
ContextValidationHelper validationHelper,
IValidator manager, IReporter reporter) {
- setRootProject(project);
+ setProject(project);
setValidationManager(manager);
setReporter(reporter);
setMarkerId(SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2010-09-06 09:40:52 UTC (rev 24732)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2010-09-06 11:32:28 UTC (rev 24733)
@@ -84,7 +84,7 @@
public void init(IProject project,
ContextValidationHelper validationHelper,
org.eclipse.wst.validation.internal.provisional.core.IValidator manager, IReporter reporter) {
- setRootProject(project);
+ setProject(project);
setValidationManager(manager);
setReporter(reporter);
setMarkerId(SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
15 years, 7 months
JBoss Tools SVN: r24732 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-06 05:40:52 -0400 (Mon, 06 Sep 2010)
New Revision: 24732
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-6950
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-06 08:07:23 UTC (rev 24731)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-09-06 09:40:52 UTC (rev 24732)
@@ -108,7 +108,7 @@
IJavaProject javaProject;
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
- private AnnotationValidationDelegate annptationValidator = new AnnotationValidationDelegate(this);
+ private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
/*
* (non-Javadoc)
@@ -298,11 +298,18 @@
Set<String> scopes = cdiProject.getScopeNames();
for (String scope: scopes) {
- annptationValidator.validateScopeType(cdiProject.getScope(scope));
+ IScope s = cdiProject.getScope(scope);
+ if(s == null || isResourceFromAnotherProject(s.getResource())) {
+ continue;
+ }
+ annotationValidator.validateScopeType(s);
}
List<IFile> beansXmls = getAllBeansXmls();
for (IFile beansXml : beansXmls) {
+ if(isResourceFromAnotherProject(beansXml)) {
+ continue;
+ }
beansXmlValidator.validateBeansXml(beansXml);
}
@@ -318,6 +325,9 @@
if (reporter.isCancelled() || file == null || !file.isAccessible()) {
return;
}
+ if(isResourceFromAnotherProject(file)) {
+ return;
+ }
displaySubtask(CDIValidationMessages.VALIDATING_RESOURCE, new String[] {file.getProject().getName(), file.getName()});
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
@@ -335,7 +345,7 @@
validateQualifier(qualifier);
IScope scope = cdiProject.getScope(file.getFullPath());
- annptationValidator.validateScopeType(scope);
+ annotationValidator.validateScopeType(scope);
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
@@ -392,6 +402,10 @@
return beansXmls;
}
+ private boolean isResourceFromAnotherProject(IResource resource) {
+ return resource != null && !resource.getProject().getName().equals(projectName);
+ }
+
/**
* Validates a bean.
*
@@ -404,6 +418,9 @@
if(bean.getBeanClass().isReadOnly()) {
return;
}
+ if(isResourceFromAnotherProject(bean.getResource())) {
+ return;
+ }
// Collect all relations between the bean and other CDI elements.
String name = bean.getName();
if (name != null) {
@@ -1844,6 +1861,9 @@
// validate sources only
return;
}
+ if(isResourceFromAnotherProject(resource)) {
+ return;
+ }
List<IAnnotationDeclaration> as = stereotype.getAnnotationDeclarations();
// 1. non-empty name
@@ -1889,7 +1909,7 @@
}
try {
- annptationValidator.validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
+ annotationValidator.validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
@@ -1904,6 +1924,9 @@
// validate sources only
return;
}
+ if(isResourceFromAnotherProject(resource)) {
+ return;
+ }
/*
* 9.5.2. Interceptor binding types with members
* array-valued or annotation-valued member of an interceptor binding type is not annotated @Nonbinding (Non-Portable behavior)
@@ -1925,6 +1948,9 @@
// validate sources only
return;
}
+ if(isResourceFromAnotherProject(resource)) {
+ return;
+ }
/*
* 5.2.5. Qualifier annotations with members
* - array-valued or annotation-valued member of a qualifier type is not annotated @Nonbinding (Non-Portable behavior)
@@ -1935,7 +1961,7 @@
* Qualifier annotation type should be annotated with @Target({METHOD, FIELD, PARAMETER, TYPE})
*/
try {
- annptationValidator.validateQualifierAnnotationTypeAnnotations(qualifier, resource);
+ annotationValidator.validateQualifierAnnotationTypeAnnotations(qualifier, resource);
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
15 years, 7 months
JBoss Tools SVN: r24731 - trunk/gwt/plugins/org.jboss.tools.gwt.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-06 04:07:23 -0400 (Mon, 06 Sep 2010)
New Revision: 24731
Modified:
trunk/gwt/plugins/org.jboss.tools.gwt.core/plugin.xml
Log:
[JBIDE-6954] facet constraints requirements changed from OR to AND in Beta now (M2 previously)
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/plugin.xml
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/plugin.xml 2010-09-06 08:03:22 UTC (rev 24730)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/plugin.xml 2010-09-06 08:07:23 UTC (rev 24731)
@@ -16,7 +16,7 @@
facet="jboss.gwt"
version="1.3.3">
<constraint>
- <or>
+ <and>
<requires
facet="jst.web"
version="[2.4">
@@ -25,14 +25,14 @@
facet="jst.java"
version="5.0">
</requires>
- </or>
+ </and>
</constraint>
</project-facet-version>
<project-facet-version
facet="jboss.gwt"
version="1.4.0">
<constraint>
- <or>
+ <and>
<requires
facet="jst.web"
version="[2.4">
@@ -41,7 +41,7 @@
facet="jst.java"
version="5.0">
</requires>
- </or>
+ </and>
</constraint>
</project-facet-version>
<action
15 years, 7 months
JBoss Tools SVN: r24730 - in trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-06 04:03:22 -0400 (Mon, 06 Sep 2010)
New Revision: 24730
Modified:
trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/GWTInstallFacetDelegate.java
trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/IGoogleEclipsePluginConstants.java
trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/util/ProjectUtils.java
Log:
[JBIDE-6987] gwt-servlet.jar now gets copied to the new project WEB-INF/lib. Still missing: add it to the deployment
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/GWTInstallFacetDelegate.java
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/GWTInstallFacetDelegate.java 2010-09-06 07:17:50 UTC (rev 24729)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/GWTInstallFacetDelegate.java 2010-09-06 08:03:22 UTC (rev 24730)
@@ -11,7 +11,11 @@
package org.jboss.tools.gwt.core;
import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.text.MessageFormat;
import java.util.List;
import java.util.zip.ZipInputStream;
@@ -19,13 +23,13 @@
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
@@ -48,50 +52,56 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.log.LogHelper;
+import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.gwt.core.internal.GWTCoreActivator;
import org.jboss.tools.gwt.core.util.ProjectUtils;
import org.jboss.tools.usage.util.StatusUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Version;
import org.osgi.service.prefs.BackingStoreException;
/**
- * @author adietish
+ * @author Andre Dietisheim
*/
public class GWTInstallFacetDelegate implements IDelegate {
public void execute(IProject project, IProjectFacetVersion projectFacetVersion, Object config,
IProgressMonitor monitor) throws CoreException {
- try {
- IJavaProject javaProject = JavaCore.create(project);
+ IJavaProject javaProject = JavaCore.create(project);
- addNature(javaProject, monitor);
- addClasspathContainer(javaProject, monitor);
+ addGwtNature(javaProject, monitor);
+ addClasspathContainer(javaProject, monitor);
- IPath webContentPath = ProjectUtils.getWebContentRootPath(javaProject.getProject());
- Assert.isTrue(webContentPath != null && !webContentPath.isEmpty(),
- MessageFormat
- .format("no web content folder was found in project {0}", javaProject.getElementName()));
+ IPath webContentPath = getWebContentFolder(project, monitor);
- createWebApplicationPreferences(project, webContentPath, javaProject, monitor);
- configureOutputFolder(webContentPath, javaProject, monitor);
+ createWebApplicationPreferences(project, webContentPath, javaProject, monitor);
+ configureOutputFolder(webContentPath, javaProject, monitor);
- List<IPath> srcFolderPaths = ProjectUtils.getSourceFolders(javaProject);
- GWTInstallDataModelProvider dataModel = (GWTInstallDataModelProvider) config;
- createSample(srcFolderPaths, webContentPath, dataModel, javaProject, monitor);
+ List<IPath> srcFolderPaths = ProjectUtils.getSourceFolders(javaProject);
+ GWTInstallDataModelProvider dataModel = (GWTInstallDataModelProvider) config;
+ createSample(srcFolderPaths, webContentPath, dataModel, javaProject, monitor);
- configureWebXml(project, monitor);
- } catch (Exception e) {
- throw new CoreException(StatusUtils.getErrorStatus(GWTCoreActivator.PLUGIN_ID, "Could not create gwt facet.", e));
- }
+ configureWebXml(project, monitor);
}
- private void addNature(IJavaProject javaProject, IProgressMonitor monitor) throws CoreException {
- monitor.subTask("adding gwt nature");
+ private IPath getWebContentFolder(IProject project, IProgressMonitor monitor) throws CoreException {
+ IPath webContentPath = ProjectHome.getFirstWebContentPath(project);
+ Assert.isTrue(webContentPath != null && !webContentPath.isEmpty(),
+ MessageFormat
+ .format("No web content folder was found in project {0}", project.getName()));
+ return webContentPath;
+ }
+ private void addGwtNature(IJavaProject javaProject, IProgressMonitor monitor) throws CoreException {
+ monitor.subTask("Adding GWT nature");
+
EclipseUtil.addNatureToProject(javaProject.getProject(), IGoogleEclipsePluginConstants.GWT_NATURE);
}
private void addClasspathContainer(IJavaProject javaProject, IProgressMonitor monitor) throws CoreException {
- monitor.subTask("adding gwt container to classpath");
+ monitor.subTask("Adding gwt container to classpath");
IClasspathEntry entry = JavaCore.newContainerEntry(new Path(IGoogleEclipsePluginConstants.GWT_CONTAINER_ID),
false);
@@ -99,43 +109,55 @@
}
private void createWebApplicationPreferences(IProject project, IPath webContentPath,
- IJavaProject javaProject, IProgressMonitor monitor) throws BackingStoreException, CoreException {
- monitor.subTask("creating web application preferences");
+ IJavaProject javaProject, IProgressMonitor monitor) throws CoreException {
+ try {
+ monitor.subTask("creating web application preferences");
- IScopeContext projectScope = new ProjectScope(project);
- IEclipsePreferences preferences = projectScope.getNode(IGoogleEclipsePluginConstants.GDT_PLUGIN_ID);
+ IScopeContext projectScope = new ProjectScope(project);
+ IEclipsePreferences preferences = projectScope.getNode(IGoogleEclipsePluginConstants.GDT_PLUGIN_ID);
- preferences.put(IGoogleEclipsePluginConstants.WAR_SRCDIR_KEY,
- webContentPath.makeRelativeTo(javaProject.getPath()).toString());
- preferences.put(IGoogleEclipsePluginConstants.WAR_SRCDIR_ISOUTPUT_KEY,
- IGoogleEclipsePluginConstants.WAR_SRCDIR_ISOUTPUT_DEFAULTVALUE);
- preferences.flush();
+ preferences.put(IGoogleEclipsePluginConstants.WAR_SRCDIR_KEY,
+ webContentPath.makeRelativeTo(project.getFullPath()).toString());
+ preferences.put(IGoogleEclipsePluginConstants.WAR_SRCDIR_ISOUTPUT_KEY,
+ IGoogleEclipsePluginConstants.WAR_SRCDIR_ISOUTPUT_DEFAULTVALUE);
+ preferences.flush();
+ } catch (BackingStoreException e) {
+ throw new CoreException(StatusUtils.getErrorStatus(GWTCoreActivator.PLUGIN_ID,
+ "Could not save project preferences", e));
+ }
}
- private void configureOutputFolder(IPath webContentProjectPath, IJavaProject javaProject, IProgressMonitor monitor)
+ private void configureOutputFolder(IPath webContentProjectPath, final IJavaProject javaProject,
+ IProgressMonitor monitor)
throws CoreException, JavaModelException {
- monitor.subTask("configuring output folder");
+ IProject project = javaProject.getProject();
+ monitor.subTask("Configuring output folder");
IPath outputFolderProjectPath = webContentProjectPath.append(new Path(
IGoogleEclipsePluginConstants.OUTPUT_FOLDER_DEFAULTVALUE));
- IFolder outputWorkspaceFolder = javaProject.getProject().getWorkspace().getRoot().getFolder(
- outputFolderProjectPath);
- if (!outputWorkspaceFolder.exists()) {
- outputWorkspaceFolder.create(true, true, monitor);
- }
- javaProject.setOutputLocation(outputWorkspaceFolder.getFullPath(), new NullProgressMonitor());
+ final IFolder outputWorkspaceFolder = project.getWorkspace().getRoot().getFolder(outputFolderProjectPath);
+ project.getWorkspace().run(
+ new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ if (!outputWorkspaceFolder.exists()) {
+ ProjectUtils.create(outputWorkspaceFolder, monitor);
+ }
+ javaProject.setOutputLocation(outputWorkspaceFolder.getFullPath(), monitor);
+ }
+ }, monitor);
}
private void createSample(final List<IPath> srcPaths, final IPath webContentPath,
GWTInstallDataModelProvider dataModel, final IJavaProject javaProject, IProgressMonitor monitor)
- throws IOException, CoreException {
+ throws CoreException {
if (srcPaths.size() <= 0) {
- LogHelper.logWarning(GWTCoreActivator.PLUGIN_ID, MessageFormat.format("no source folders were found in project {0}", javaProject.getElementName()));
+ LogHelper.logWarning(GWTCoreActivator.PLUGIN_ID,
+ MessageFormat.format("No source folders were found in project {0}", javaProject.getElementName()));
return;
}
if (dataModel.isGenerateSampleCode()) {
- monitor.subTask("creating sample code");
+ monitor.subTask("Creating sample code");
javaProject.getProject().getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
@@ -147,9 +169,11 @@
*/
unzipSrc(srcPaths.get(0), javaProject);
unzipWebContent(webContentPath, javaProject);
+ copyGwtServlet(javaProject, webContentPath, monitor);
} catch (IOException e) {
- LogHelper.logError(GWTCoreActivator.PLUGIN_ID, "Could not create gwt facet", e);
+ throw new CoreException(StatusUtils.getErrorStatus(GWTCoreActivator.PLUGIN_ID,
+ "Could not unzip samples", e));
}
}
@@ -173,6 +197,51 @@
ProjectUtils.unzipToFolder(zipInputStream, ProjectUtils.getFile(webContentPath, javaProject.getProject()));
}
+ private void copyGwtServlet(IJavaProject javaProject, IPath webContentPath, IProgressMonitor monitor) throws IOException, CoreException {
+ FileUtil.copy(getGwtServletJar(), getGwtServletDestination(javaProject, webContentPath, monitor));
+ }
+
+ private FileOutputStream getGwtServletDestination(IJavaProject javaProject, IPath webContentPath, IProgressMonitor monitor)
+ throws CoreException, FileNotFoundException {
+ IPath webInfLibPath = webContentPath.append(new Path(IGoogleEclipsePluginConstants.WEB_INF_LIB));
+ IWorkspaceRoot workspaceRoot = javaProject.getProject().getWorkspace().getRoot();
+ ProjectUtils.create(workspaceRoot.getFolder(webInfLibPath), monitor);
+ IPath gwtServletFilePath = webInfLibPath.append(IGoogleEclipsePluginConstants.GWT_SERVLET_NAME);
+ File file = new File(workspaceRoot.getFile(gwtServletFilePath).getLocationURI());
+ return new FileOutputStream(file);
+ }
+
+ private InputStream getGwtServletJar() throws CoreException, IOException {
+ Bundle gwtBundle = getGwtSdkBundle(GWTCoreActivator.getDefault().getBundle().getBundleContext());
+ Assert.isTrue(gwtBundle != null,
+ MessageFormat.format("GWT SDK bundle was not found. Could not copy {0}", IGoogleEclipsePluginConstants.GWT_SERVLET_NAME));
+ String gwtSdkVersion = getGwtServletFolder(gwtBundle);
+ IPath gwtServletPath = new Path(gwtSdkVersion).append(IGoogleEclipsePluginConstants.GWT_SERVLET_NAME);
+ return gwtBundle.getEntry(gwtServletPath.toFile().toString()).openStream();
+ }
+
+ private String getGwtServletFolder(Bundle bundle) {
+ Version bundleVersion = bundle.getVersion();
+ return new StringBuilder()
+ .append("gwt")
+ .append("-")
+ .append(bundleVersion.getMajor())
+ .append(".")
+ .append(bundleVersion.getMinor())
+ .append(".")
+ .append(bundleVersion.getMicro())
+ .toString();
+ }
+
+ private Bundle getGwtSdkBundle(BundleContext bundleContext) {
+ for (Bundle bundle : bundleContext.getBundles()) {
+ if (bundle.getSymbolicName().contains(IGoogleEclipsePluginConstants.GWT_SDK_BUNDLENAME)) {
+ return bundle;
+ }
+ }
+ return null;
+ }
+
/**
* Configures the web xml. Adds the gwt servlet, servlet mapping and welcome
* page.
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/IGoogleEclipsePluginConstants.java
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/IGoogleEclipsePluginConstants.java 2010-09-06 07:17:50 UTC (rev 24729)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/IGoogleEclipsePluginConstants.java 2010-09-06 08:03:22 UTC (rev 24730)
@@ -55,4 +55,11 @@
public static final String SERVLET_MAPPING = "/gwt_jboss/greet"; //$NON-NLS-1$
public static final String WELCOME_FILE = "Gwt_jboss.html"; //$NON-NLS-1$
+
+ public static final String GWT_SDK_BUNDLENAME = "com.google.gwt.eclipse.sdkbundle"; //$NON-NLS-1$
+
+ public static final String GWT_SERVLET_NAME = "gwt-servlet.jar"; //$NON-NLS-1$
+
+ public static final String WEB_INF_LIB = "/WEB-INF/lib"; //$NON-NLS-1$;
+
}
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/util/ProjectUtils.java
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/util/ProjectUtils.java 2010-09-06 07:17:50 UTC (rev 24729)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/src/org/jboss/tools/gwt/core/util/ProjectUtils.java 2010-09-06 08:03:22 UTC (rev 24730)
@@ -24,8 +24,10 @@
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -54,7 +56,7 @@
/** Signals the end of a stream. */
private static final int EOS = -1;
- public static IPath getWebXmlPath() {
+ public static IPath getWebXmlPath() {
return new Path(WEB_INF_FOLDER).append(WEB_XML_FILE);
}
@@ -188,14 +190,16 @@
IFolder folder = project.getWorkspace().getRoot().getFolder(path);
return folder.getLocation().toFile();
}
-
+
/**
* Returns a resource as stream while checking whether the resource exists.
- *
- * @param resourceName the resource name
+ *
+ * @param resourceName
+ * the resource name
* @return the input stream
*
- * @throws AssertionFailedException if the resource's not found
+ * @throws AssertionFailedException
+ * if the resource's not found
*/
public static InputStream checkedGetResourceStream(String resourceName, Class<?> clazz) {
InputStream inputStream = clazz.getResourceAsStream(resourceName);
@@ -203,5 +207,26 @@
return inputStream;
}
+ /**
+ * Creates the given resource and all its parents (recursively)
+ *
+ * @param resource
+ * @param monitor
+ * @throws CoreException
+ */
+ public static void create(IResource resource, IProgressMonitor monitor) throws CoreException {
+ if (resource.exists())
+ return;
+ create(resource.getParent(), monitor);
+ switch (resource.getType()) {
+ case IResource.FOLDER:
+ ((IFolder) resource).create(IResource.NONE, true, null);
+ break;
+ case IResource.PROJECT:
+ ((IProject) resource).create(monitor);
+ ((IProject) resource).open(monitor);
+ break;
+ }
+ }
}
15 years, 7 months