JBoss Tools SVN: r21265 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-04-05 10:52:52 -0400 (Mon, 05 Apr 2010)
New Revision: 21265
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5927
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2010-04-05 14:42:59 UTC (rev 21264)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2010-04-05 14:52:52 UTC (rev 21265)
@@ -29,4 +29,8 @@
public static String CDI_RENAME_PROCESSOR_OUT_OF_SYNC_FILE;
public static String CDI_RENAME_PROCESSOR_ERROR_PHANTOM_FILE;
public static String CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE;
+ public static String RENAME_NAMED_BEAN_PROCESSOR_TITLE;
+ public static String RENAME_NAMED_BEAN_PROCESSOR_ERROR;
+ public static String CDI_RENAME_PROCESSOR_BEAN_HAS_NO_FILE;
+ public static String CDI_RENAME_PROCESSOR_BEAN_HAS_NO_NAME_LOCATION;
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties 2010-04-05 14:42:59 UTC (rev 21264)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties 2010-04-05 14:52:52 UTC (rev 21265)
@@ -1,3 +1,10 @@
CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR=Error
CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED=Error occured during installing CDI facet
-CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW=Check Errors View for details
\ No newline at end of file
+CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW=Check Errors View for details
+CDI_RENAME_PROCESSOR_OUT_OF_SYNC_FILE=Cannot change file. File ''{0}'' is not in sync.
+CDI_RENAME_PROCESSOR_ERROR_PHANTOM_FILE=Cannot change phantom file: ''{0}''.
+CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
+RENAME_NAMED_BEAN_PROCESSOR_TITLE=Rename @Named Bean
+RENAME_NAMED_BEAN_PROCESSOR_ERROR=This is not a @Named Bean
+CDI_RENAME_PROCESSOR_BEAN_HAS_NO_FILE=Named Bean does not have a file
+CDI_RENAME_PROCESSOR_BEAN_HAS_NO_NAME_LOCATION=Named Bean does not have a name location
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java 2010-04-05 14:42:59 UTC (rev 21264)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java 2010-04-05 14:52:52 UTC (rev 21265)
@@ -11,7 +11,6 @@
package org.jboss.tools.cdi.internal.core.refactoring;
import java.util.ArrayList;
-import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -30,24 +29,17 @@
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
import org.jboss.tools.cdi.core.CDICoreMessages;
-import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.model.project.ProjectHome;
import org.jboss.tools.common.text.ITextSourceReference;
-import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
/**
* @author Daniel Azarov
*/
public abstract class CDIRenameProcessor extends RenameProcessor {
- protected static final String JAVA_EXT = "java"; //$NON-NLS-1$
- protected static final String XML_EXT = "xml"; //$NON-NLS-1$
- protected static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
- protected static final String JSP_EXT = "jsp"; //$NON-NLS-1$
- protected static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
-
protected static final RefactoringParticipant[] EMPTY_REF_PARTICIPANT = new RefactoringParticipant[0];
protected RefactoringStatus status;
@@ -110,96 +102,26 @@
}
- private boolean isBadLocation(ITextSourceReference location, IFile file){
- boolean flag=false;
- return flag;
- }
-
- private void changeXMLNode(ITextSourceReference location, IFile file){
- if(isBadLocation(location, file))
- return;
+ private void changeDeclarations(IBean bean) throws CoreException{
+ declarationFile = (IFile)bean.getResource();
- if(!isFileCorrect(file))
+ if(declarationFile == null){
+ status.addFatalError(CDICoreMessages.CDI_RENAME_PROCESSOR_BEAN_HAS_NO_FILE);
return;
-
- String content = null;
- try {
- content = FileUtil.readStream(file);
- } catch (CoreException e) {
- CDICorePlugin.getDefault().logError(e);
}
-
- String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
- if(text.startsWith("<")){ //$NON-NLS-1$
- int position = text.lastIndexOf("/>"); //$NON-NLS-1$
- if(position < 0){
- position = text.lastIndexOf(">"); //$NON-NLS-1$
- }
- change(file, location.getStartPosition()+position, 0, " name=\""+getNewName()+"\""); //$NON-NLS-1$ //$NON-NLS-2$
- }else{
- change(file, location.getStartPosition(), location.getLength(), getNewName());
- }
- }
-
- private void changeAnnotation(ITextSourceReference location, IFile file){
- if(isBadLocation(location, file))
- return;
- if(!isFileCorrect(file))
+ ITextSourceReference nameLocation = bean.getNameLocation();
+
+ if(nameLocation == null){
+ status.addFatalError(CDICoreMessages.CDI_RENAME_PROCESSOR_BEAN_HAS_NO_NAME_LOCATION);
return;
-
- String content = null;
- try {
- content = FileUtil.readStream(file);
- } catch (CoreException e) {
- CDICorePlugin.getDefault().logError(e);
}
-
- String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
- int openBracket = text.indexOf("("); //$NON-NLS-1$
- int openQuote = text.indexOf("\""); //$NON-NLS-1$
- if(openBracket >= 0){
- int closeBracket = text.indexOf(")", openBracket); //$NON-NLS-1$
-
- int equals = text.indexOf("=", openBracket); //$NON-NLS-1$
- int value = text.indexOf("value", openBracket); //$NON-NLS-1$
-
- if(closeBracket == openBracket+1){ // empty brackets
- String newText = "\""+getNewName()+"\""; //$NON-NLS-1$ //$NON-NLS-2$
- change(file, location.getStartPosition()+openBracket+1, 0, newText);
- }else if(value > 0){ // construction value="name" found so change name
- String newText = text.replace(getOldName(), getNewName());
- change(file, location.getStartPosition(), location.getLength(), newText);
- }else if(equals > 0){ // other parameters are found
- String newText = "value=\""+getNewName()+"\","; //$NON-NLS-1$ //$NON-NLS-2$
- change(file, location.getStartPosition()+openBracket+1, 0, newText);
- }else{ // other cases
- String newText = text.replace(getOldName(), getNewName());
- change(file, location.getStartPosition(), location.getLength(), newText);
- }
- }else if(openQuote >= 0){
- int closeQuota = text.indexOf("\"", openQuote); //$NON-NLS-1$
-
- if(closeQuota == openQuote+1){ // empty quotas
- String newText = "\""+getNewName()+"\""; //$NON-NLS-1$ //$NON-NLS-2$
- change(file, location.getStartPosition()+openQuote+1, 0, newText);
- }else{ // the other cases
- String newText = text.replace(getOldName(), getNewName());
- change(file, location.getStartPosition(), location.getLength(), newText);
- }
- }else{
- String newText = "(\""+getNewName()+"\")"; //$NON-NLS-1$ //$NON-NLS-2$
- change(file, location.getStartPosition()+location.getLength(), 0, newText);
- }
+
+ String newText = "@Named(\""+getNewName()+"\")"; //$NON-NLS-1$ //$NON-NLS-2$
+ change(declarationFile, nameLocation.getStartPosition(), nameLocation.getLength(), newText);
}
-
- private void changeDeclarations(IBean bean) throws CoreException{
- }
- protected void checkDeclarations(IBean bean) throws CoreException{
- }
-
protected boolean isFileCorrect(IFile file){
if(!file.isSynchronized(IResource.DEPTH_ZERO)){
status.addFatalError(Messages.format(CDICoreMessages.CDI_RENAME_PROCESSOR_OUT_OF_SYNC_FILE, file.getFullPath().toString()));
@@ -220,6 +142,8 @@
clearChanges();
+ this.bean = bean;
+
findDeclarations(bean);
if(status.hasFatalError())
@@ -251,7 +175,7 @@
class CDISearcher extends RefactorSearcher{
public CDISearcher(IFile declarationFile, String oldName){
- super(declarationFile, oldName);
+ super(declarationFile, oldName, bean.getBeanClass());
}
@Override
@@ -285,11 +209,16 @@
@Override
protected IProject[] getProjects() {
- return null;
+ return new IProject[]{baseFile.getProject()};
}
-
+
@Override
protected IContainer getViewFolder(IProject project) {
+ IPath path = ProjectHome.getFirstWebContentPath(baseFile.getProject());
+
+ if(path != null)
+ return project.getFolder(path.removeFirstSegments(1));
+
return null;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java 2010-04-05 14:42:59 UTC (rev 21264)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java 2010-04-05 14:52:52 UTC (rev 21265)
@@ -18,8 +18,8 @@
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.jboss.tools.cdi.core.CDICoreMessages;
import org.jboss.tools.cdi.core.IBean;
/**
@@ -56,13 +56,8 @@
OperationCanceledException {
status = new RefactoringStatus();
if(bean != null){
- checkDeclarations(bean);
+ rootChange = new CompositeChange(CDICoreMessages.RENAME_NAMED_BEAN_PROCESSOR_TITLE);
- if(status.hasFatalError())
- return status;
-
- rootChange = new CompositeChange("Rename @Named Bean");
-
renameBean(pm, bean);
}
return status;
@@ -77,7 +72,7 @@
throws CoreException, OperationCanceledException {
RefactoringStatus result = new RefactoringStatus();
if(bean==null) {
- result.addFatalError("This is not a @Named Bean");
+ result.addFatalError(CDICoreMessages.RENAME_NAMED_BEAN_PROCESSOR_ERROR);
}
return result;
}
@@ -118,7 +113,7 @@
*/
@Override
public String getProcessorName() {
- return "Rename @Named Bean";
+ return CDICoreMessages.RENAME_NAMED_BEAN_PROCESSOR_TITLE;
}
/*
14 years, 9 months
JBoss Tools SVN: r21264 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-05 10:42:59 -0400 (Mon, 05 Apr 2010)
New Revision: 21264
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDropInfo.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDropInfo.java
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
VPE Refactoring in progress.
- Classes renamed: VpeVisualInnerDropInfo->VpeVisualDropInfo, VpeSourceInnerDropInfo->VpeSourceDropInfo .
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -34,12 +34,12 @@
import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.dnd.DndUtil.DragTransferData;
import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.VpeSourceDropInfo;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
-import org.jboss.tools.vpe.editor.VpeSourceInnerDropInfo;
import org.jboss.tools.vpe.editor.VpeVisualCaretInfo;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.vpe.editor.VpeVisualDropInfo;
import org.jboss.tools.vpe.editor.VpeVisualInnerDragInfo;
-import org.jboss.tools.vpe.editor.VpeVisualInnerDropInfo;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
@@ -386,7 +386,7 @@
nsIDOMNode caretParent = null;
long caretOffset = 0;
if (innerDragInfo != null) {
- VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(event);
+ VpeVisualDropInfo visualDropInfo = getDropInfo(event);
if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print(" container: " //$NON-NLS-1$
@@ -403,13 +403,13 @@
}
VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
.getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo
- = getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ VpeSourceDropInfo sourceDropInfo
+ = getSourceDropInfo(sourceInnerDragInfo.getNode(),
visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo
- = getInnerDropInfo(sourceDropInfo.getContainer(),
+ VpeVisualDropInfo newVisualDropInfo
+ = getDropInfo(sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
correctVisualDropPosition(event,
@@ -434,7 +434,7 @@
System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
}
if (innerDragInfo != null) {
- VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(event);
+ VpeVisualDropInfo visualDropInfo = getDropInfo(event);
if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out
@@ -447,12 +447,12 @@
VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
.getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo
- = getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ VpeSourceDropInfo sourceDropInfo
+ = getSourceDropInfo(sourceInnerDragInfo.getNode(),
visualDropInfo, true);
if (sourceDropInfo.canDrop()) {
- VpeVisualInnerDropInfo newVisualDropInfo
- = getInnerDropInfo(sourceDropInfo.getContainer(),
+ VpeVisualDropInfo newVisualDropInfo
+ = getDropInfo(sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
correctVisualDropPosition(event,
@@ -473,8 +473,8 @@
}
private void correctVisualDropPosition(nsIDOMMouseEvent mouseEvent,
- VpeVisualInnerDropInfo newVisualDropInfo,
- VpeVisualInnerDropInfo oldVisualDropInfo) {
+ VpeVisualDropInfo newVisualDropInfo,
+ VpeVisualDropInfo oldVisualDropInfo) {
nsIDOMNode newVisualDropContainer = newVisualDropInfo
.getDropContainer();
nsIDOMNode oldVisualDropContainer = oldVisualDropInfo
@@ -506,8 +506,8 @@
}
}
- private VpeSourceInnerDropInfo getSourceInnerDropInfo(Node sourceDragNode,
- VpeVisualInnerDropInfo visualDropInfo, boolean checkParentTemplates) {
+ private VpeSourceDropInfo getSourceDropInfo(Node sourceDragNode,
+ VpeVisualDropInfo visualDropInfo, boolean checkParentTemplates) {
nsIDOMNode visualDropContainer = visualDropInfo.getDropContainer();
long visualDropOffset = visualDropInfo.getDropOffset();
Node sourceDropContainer = null;
@@ -588,14 +588,14 @@
// break;
}
if (sourceDropContainer != null) {
- return getSourceInnerDropInfo(sourceDragNode, sourceDropContainer,
+ return getSourceDropInfo(sourceDragNode, sourceDropContainer,
sourceDropOffset, checkParentTemplates);
} else {
- return new VpeSourceInnerDropInfo(null, 0, false);
+ return new VpeSourceDropInfo(null, 0, false);
}
}
- private VpeSourceInnerDropInfo getSourceInnerDropInfo(Node dragNode,
+ private VpeSourceDropInfo getSourceDropInfo(Node dragNode,
Node container, int offset, boolean checkParentsTemplates) {
// Thread.dumpStack();
boolean canDrop = false;
@@ -609,16 +609,16 @@
}
if (!canDrop) {
if (!checkParentsTemplates)
- return new VpeSourceInnerDropInfo(container, offset,
+ return new VpeSourceDropInfo(container, offset,
canDrop);
// offset = ((NodeImpl)container).getIndex();
// container = container.getParentNode();
// TODO Max Areshkau unclear logic , if we can drop on element
// why we trying to drop
// this on parent
- // return getSourceInnerDropInfo(dragNode, container, offset,
+ // return getSourceDropInfo(dragNode, container, offset,
// false);
- return new VpeSourceInnerDropInfo(container, offset, canDrop);
+ return new VpeSourceDropInfo(container, offset, canDrop);
}
break;
case Node.TEXT_NODE:
@@ -630,9 +630,9 @@
break;
}
if (canDrop) {
- return new VpeSourceInnerDropInfo(container, offset, canDrop);
+ return new VpeSourceDropInfo(container, offset, canDrop);
} else {
- return new VpeSourceInnerDropInfo(null, 0, canDrop);
+ return new VpeSourceDropInfo(null, 0, canDrop);
}
}
@@ -646,7 +646,7 @@
private void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
vpeController.onHideTooltip();
- VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(mouseEvent);
+ VpeVisualDropInfo visualDropInfo = getDropInfo(mouseEvent);
Point range = vpeController.getSelectionBuilder().getSourceSelectionRangeAtVisualNode(
visualDropInfo.getDropContainer(), (int) visualDropInfo
.getDropOffset());
@@ -700,7 +700,7 @@
// Node sourceDragNode = ((Document) getModel().getAdapter(
// Document.class)).createElement(tagname);
// if (visualDropInfo.getDropContainer() != null) {
- // sourceDropInfo = vpeController.getVisualBuilder().getSourceInnerDropInfo(
+ // sourceDropInfo = vpeController.getVisualBuilder().getSourceDropInfo(
// sourceDragNode, visualDropInfo, true);
// range = vpeController.getSelectionBuilder().getSourceSelectionRange(
// sourceDropInfo.getContainer(), sourceDropInfo
@@ -770,7 +770,7 @@
&& !TLDUtil.isTaglib(object)) {
IFile f = (IFile) EclipseResourceUtil.getResource(object);
canDrop = f != null;
- VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(mouseEvent);
+ VpeVisualDropInfo visualDropInfo = getDropInfo(mouseEvent);
caretParent = visualDropInfo.getDropContainer();
caretOffset = visualDropInfo.getDropOffset();
} else {
@@ -778,15 +778,15 @@
if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(
Document.class)).createElement(tagname);
- VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(mouseEvent);
+ VpeVisualDropInfo visualDropInfo = getDropInfo(mouseEvent);
if (visualDropInfo.getDropContainer() != null) {
- VpeSourceInnerDropInfo sourceDropInfo
- = getSourceInnerDropInfo(
+ VpeSourceDropInfo sourceDropInfo
+ = getSourceDropInfo(
sourceDragNode, visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo
- = getInnerDropInfo(
+ VpeVisualDropInfo newVisualDropInfo
+ = getDropInfo(
sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
@@ -801,7 +801,7 @@
}
} else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
|| XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
- VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(mouseEvent);
+ VpeVisualDropInfo visualDropInfo = getDropInfo(mouseEvent);
caretParent = visualDropInfo.getDropContainer();
caretOffset = visualDropInfo.getDropOffset();
canDrop = true;
@@ -934,7 +934,7 @@
// return null;
}
- private VpeVisualInnerDropInfo getInnerDropInfo(nsIDOMEvent event) {
+ private VpeVisualDropInfo getDropInfo(nsIDOMEvent event) {
nsIDOMNSUIEvent nsuiEvent = (nsIDOMNSUIEvent)
event.queryInterface(nsIDOMNSUIEvent.NS_IDOMNSUIEVENT_IID);
nsIDOMNode dropContainer = null;
@@ -961,7 +961,7 @@
if (originalNode == null || originalNode.getParentNode() == null ||
originalNode.getParentNode().getNodeType() == Node.DOCUMENT_NODE) {
- return new VpeVisualInnerDropInfo(null, 0);
+ return new VpeVisualDropInfo(null, 0);
}
if (originalNode.getNodeType() == Node.TEXT_NODE) {
dropContainer = nsuiEvent.getRangeParent();
@@ -1055,11 +1055,11 @@
}
}
}
- VpeVisualInnerDropInfo info = new VpeVisualInnerDropInfo(dropContainer, dropOffset);
+ VpeVisualDropInfo info = new VpeVisualDropInfo(dropContainer, dropOffset);
return info;
}
- private VpeVisualInnerDropInfo getInnerDropInfo(Node sourceDropContainer,
+ private VpeVisualDropInfo getDropInfo(Node sourceDropContainer,
int sourceDropOffset) {
nsIDOMNode visualDropContainer = null;
long visualDropOffset = 0;
@@ -1111,7 +1111,7 @@
if (visualDropContainer == null) {
return null;
}
- return new VpeVisualInnerDropInfo(visualDropContainer, visualDropOffset);
+ return new VpeVisualDropInfo(visualDropContainer, visualDropOffset);
}
private nsIDOMNode getNearChild(nsIDOMNode container, int x, int y) {
@@ -1164,11 +1164,11 @@
return closestNode;
}
// this method is never used
-// public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object, Node parentNode, int offset) {
+// public VpeSourceDropInfo canExternalDropMacro(XModelObject object, Node parentNode, int offset) {
// String tagname = vpeController.getTagName(object);
// Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(Document.class))
// .createElement(tagname);
-// return vpeController.getVisualBuilder().getSourceInnerDropInfo(sourceDragNode, parentNode,
+// return vpeController.getVisualBuilder().getSourceDropInfo(sourceDragNode, parentNode,
// offset, false);
// }
Copied: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDropInfo.java (from rev 21263, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java)
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDropInfo.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDropInfo.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor;
+
+import org.w3c.dom.Node;
+
+public class VpeSourceDropInfo {
+ private Node container;
+ private int offset;
+ private boolean canDrop;
+
+ public VpeSourceDropInfo(Node container, int offset, boolean canDrop) {
+ this.container = container;
+ this.offset = offset;
+ this.canDrop = canDrop;
+ }
+
+ public Node getContainer() {
+ return container;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public boolean canDrop() {
+ return canDrop;
+ }
+
+ public void setContainer(Node container) {
+ this.container = container;
+ }
+
+
+}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor;
-
-import org.w3c.dom.Node;
-
-public class VpeSourceInnerDropInfo {
- private Node container;
- private int offset;
- private boolean canDrop;
-
- public VpeSourceInnerDropInfo(Node container, int offset, boolean canDrop) {
- this.container = container;
- this.offset = offset;
- this.canDrop = canDrop;
- }
-
- public Node getContainer() {
- return container;
- }
-
- public int getOffset() {
- return offset;
- }
-
- public boolean canDrop() {
- return canDrop;
- }
-
- public void setContainer(Node container) {
- this.container = container;
- }
-
-
-}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -1599,13 +1599,13 @@
((VpeElementMapping) mapping).getTemplate().innerDrop(
pageContext,
new VpeSourceInnerDragInfo(dragNode, 0, 0),
- new VpeSourceInnerDropInfo(container, offset, true));
+ new VpeSourceDropInfo(container, offset, true));
} else {
if (oldMapping instanceof VpeElementMapping) {
((VpeElementMapping) oldMapping).getTemplate().innerDrop(
pageContext,
new VpeSourceInnerDragInfo(dragNode, 0, 0),
- new VpeSourceInnerDropInfo(container, offset, true));
+ new VpeSourceDropInfo(container, offset, true));
} else {
/* TODO: implement this case or completely
* remove this method?
@@ -1622,7 +1622,7 @@
}
public void innerDrop(VpeSourceInnerDragInfo dragInfo,
- VpeSourceInnerDropInfo dropInfo) {
+ VpeSourceDropInfo dropInfo) {
dropper.drop(pageContext, dragInfo, dropInfo);
}
Copied: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDropInfo.java (from rev 21263, trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java)
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDropInfo.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDropInfo.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor;
+
+import org.mozilla.interfaces.nsIDOMNode;
+
+public class VpeVisualDropInfo {
+ private nsIDOMNode dropContainer;
+ private long dropOffset;
+
+ public VpeVisualDropInfo(nsIDOMNode dropContainer, long dropOffset) {
+ this.dropContainer = dropContainer;
+ this.dropOffset = dropOffset;
+ }
+
+ public nsIDOMNode getDropContainer() {
+ return dropContainer;
+ }
+
+ public long getDropOffset() {
+ return dropOffset;
+ }
+ public void setDropOffset(long dropOffset) {
+ this.dropOffset = dropOffset;
+ }
+
+ public void release() {
+ dropContainer = null;
+ }
+}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor;
-
-import org.mozilla.interfaces.nsIDOMNode;
-
-public class VpeVisualInnerDropInfo {
- private nsIDOMNode dropContainer;
- private long dropOffset;
-
- public VpeVisualInnerDropInfo(nsIDOMNode dropContainer, long dropOffset) {
- this.dropContainer = dropContainer;
- this.dropOffset = dropOffset;
- }
-
- public nsIDOMNode getDropContainer() {
- return dropContainer;
- }
-
- public long getDropOffset() {
- return dropOffset;
- }
- public void setDropOffset(long dropOffset) {
- this.dropOffset = dropOffset;
- }
-
- public void release() {
- dropContainer = null;
- }
-}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -24,7 +24,7 @@
import org.jboss.tools.jst.jsp.editor.ITextFormatter;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
-import org.jboss.tools.vpe.editor.VpeSourceInnerDropInfo;
+import org.jboss.tools.vpe.editor.VpeSourceDropInfo;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.NodeData;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -957,7 +957,7 @@
* @param dragInfo The information on the dragged element
*/
public void innerDrop(VpePageContext pageContext,
- VpeSourceInnerDragInfo dragInfo, VpeSourceInnerDropInfo dropInfo) {
+ VpeSourceInnerDragInfo dragInfo, VpeSourceDropInfo dropInfo) {
// TODO Max Areshkau add DnD support
// if (dragger != null) {
// dragger.drop(pageContext, dragInfo, dropInfo);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -13,7 +13,7 @@
import org.eclipse.jface.text.IRegion;
import org.jboss.tools.jst.jsp.editor.ITextFormatter;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
-import org.jboss.tools.vpe.editor.VpeSourceInnerDropInfo;
+import org.jboss.tools.vpe.editor.VpeSourceDropInfo;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.NodeData;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -256,7 +256,7 @@
* The information on the drop container
*/
void innerDrop(VpePageContext pageContext, VpeSourceInnerDragInfo dragInfo,
- VpeSourceInnerDropInfo dropInfo);
+ VpeSourceDropInfo dropInfo);
/**
* Returns <code>VpeTagDescription</code>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java 2010-04-05 13:49:06 UTC (rev 21263)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java 2010-04-05 14:42:59 UTC (rev 21264)
@@ -13,7 +13,7 @@
import java.util.HashSet;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
-import org.jboss.tools.vpe.editor.VpeSourceInnerDropInfo;
+import org.jboss.tools.vpe.editor.VpeSourceDropInfo;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.w3c.dom.Document;
@@ -182,7 +182,7 @@
}
}
- public void drop(VpePageContext pageContext, VpeSourceInnerDragInfo dragInfo, VpeSourceInnerDropInfo dropInfo){
+ public void drop(VpePageContext pageContext, VpeSourceInnerDragInfo dragInfo, VpeSourceDropInfo dropInfo){
Node container = dropInfo.getContainer();
int offset = dropInfo.getOffset();
Node node = dragInfo.getNode();
14 years, 9 months
JBoss Tools SVN: r21263 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-05 09:49:06 -0400 (Mon, 05 Apr 2010)
New Revision: 21263
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
VPE Refactoring in progress.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-04-05 03:42:02 UTC (rev 21262)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-04-05 13:49:06 UTC (rev 21263)
@@ -75,9 +75,11 @@
import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
+import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* @author Max Areshkau
@@ -387,11 +389,7 @@
VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(event);
if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print(" x: " //$NON-NLS-1$
- + visualDropInfo.getMouseX()
- + " y: " //$NON-NLS-1$
- + visualDropInfo.getMouseY()
- + " container: " //$NON-NLS-1$
+ System.out.print(" container: " //$NON-NLS-1$
+ visualDropInfo.getDropContainer().getNodeName()
+ "(" //$NON-NLS-1$
+ visualDropInfo.getDropContainer()
@@ -410,11 +408,11 @@
visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(sourceDropInfo.getContainer(),
+ VpeVisualInnerDropInfo newVisualDropInfo
+ = getInnerDropInfo(sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
- correctVisualDropPosition(
+ correctVisualDropPosition(event,
newVisualDropInfo, visualDropInfo);
caretParent = newVisualDropInfo.getDropContainer();
caretOffset = newVisualDropInfo.getDropOffset();
@@ -453,14 +451,12 @@
= getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
visualDropInfo, true);
if (sourceDropInfo.canDrop()) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(sourceDropInfo.getContainer(),
+ VpeVisualInnerDropInfo newVisualDropInfo
+ = getInnerDropInfo(sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
- correctVisualDropPosition(
+ correctVisualDropPosition(event,
newVisualDropInfo, visualDropInfo);
- sourceDropInfo.setTop(visualDropInfo.getMouseY());
- sourceDropInfo.setLeft(visualDropInfo.getMouseX());
vpeController.getVisualBuilder().innerDrop(sourceInnerDragInfo,
sourceDropInfo);
if (innerDragInfo != null) {
@@ -476,7 +472,8 @@
}
}
- private void correctVisualDropPosition(VpeVisualInnerDropInfo newVisualDropInfo,
+ private void correctVisualDropPosition(nsIDOMMouseEvent mouseEvent,
+ VpeVisualInnerDropInfo newVisualDropInfo,
VpeVisualInnerDropInfo oldVisualDropInfo) {
nsIDOMNode newVisualDropContainer = newVisualDropInfo
.getDropContainer();
@@ -494,8 +491,13 @@
if (newVisualDropContainer.equals(parent)) {
long offset = VisualDomUtil.getOffset(child);
Rectangle rect = XulRunnerVpeUtils.getElementBounds(child);
- if (canInsertAfter(oldVisualDropInfo.getMouseX(),
- oldVisualDropInfo.getMouseY(), rect)) {
+
+ nsIDOMNSUIEvent nsuiEvent = (nsIDOMNSUIEvent)
+ mouseEvent.queryInterface(nsIDOMNSUIEvent.NS_IDOMNSUIEVENT_IID);
+ int mouseX = nsuiEvent.getPageX();
+ int mouseY = nsuiEvent.getPageY();
+
+ if (canInsertAfter(mouseX, mouseY, rect)) {
offset++;
}
newVisualDropInfo.setDropOffset(offset);
@@ -783,12 +785,12 @@
sourceDragNode, visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(
+ VpeVisualInnerDropInfo newVisualDropInfo
+ = getInnerDropInfo(
sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
- correctVisualDropPosition(
+ correctVisualDropPosition(mouseEvent,
newVisualDropInfo, visualDropInfo);
caretParent = newVisualDropInfo.getDropContainer();
caretOffset = newVisualDropInfo.getDropOffset();
@@ -959,7 +961,7 @@
if (originalNode == null || originalNode.getParentNode() == null ||
originalNode.getParentNode().getNodeType() == Node.DOCUMENT_NODE) {
- return new VpeVisualInnerDropInfo(null, 0, mouseX, mouseY);
+ return new VpeVisualInnerDropInfo(null, 0);
}
if (originalNode.getNodeType() == Node.TEXT_NODE) {
dropContainer = nsuiEvent.getRangeParent();
@@ -1053,10 +1055,65 @@
}
}
}
- VpeVisualInnerDropInfo info = new VpeVisualInnerDropInfo(dropContainer, dropOffset, mouseX, mouseY);
+ VpeVisualInnerDropInfo info = new VpeVisualInnerDropInfo(dropContainer, dropOffset);
return info;
}
+ private VpeVisualInnerDropInfo getInnerDropInfo(Node sourceDropContainer,
+ int sourceDropOffset) {
+ nsIDOMNode visualDropContainer = null;
+ long visualDropOffset = 0;
+
+ switch (sourceDropContainer.getNodeType()) {
+ case Node.TEXT_NODE:
+ visualDropContainer = vpeController.getDomMapping().getVisualNode(sourceDropContainer);
+ visualDropOffset = TextUtil.visualInnerPosition(sourceDropContainer
+ .getNodeValue(), sourceDropOffset);
+ break;
+ case Node.ELEMENT_NODE:
+ case Node.DOCUMENT_NODE:
+ NodeList sourceChildren = sourceDropContainer.getChildNodes();
+ if (sourceDropOffset < sourceChildren.getLength()) {
+ Node sourceChild = sourceChildren.item(sourceDropOffset);
+ nsIDOMNode visualChild = vpeController.getDomMapping().getVisualNode(sourceChild);
+ if (visualChild != null) {
+ visualDropContainer = visualChild.getParentNode();
+
+ visualDropOffset = VisualDomUtil.getOffset(visualChild);
+ }
+ }
+ if (visualDropContainer == null) {
+ visualDropContainer = vpeController.getDomMapping()
+ .getNearVisualNode(sourceDropContainer);
+ nsIDOMNode visualChild = VpeVisualDomBuilder.getLastAppreciableVisualChild(visualDropContainer);
+ if (visualChild != null) {
+ visualDropOffset = VisualDomUtil.getOffset(visualChild) + 1;
+ } else {
+ visualDropOffset = 0;
+ }
+ }
+ break;
+ case Node.ATTRIBUTE_NODE:
+ Element sourceElement = ((Attr) sourceDropContainer)
+ .getOwnerElement();
+ VpeElementMapping elementMapping = vpeController.getDomMapping()
+ .getNearElementMapping(sourceElement);
+ nsIDOMNode textNode = elementMapping.getTemplate()
+ .getOutputTextNode(vpeController.getPageContext(), sourceElement,
+ elementMapping.getData());
+ if (textNode != null) {
+ visualDropContainer = textNode;
+ visualDropOffset = TextUtil.visualInnerPosition(
+ sourceDropContainer.getNodeValue(), sourceDropOffset);
+ }
+ break;
+ }
+ if (visualDropContainer == null) {
+ return null;
+ }
+ return new VpeVisualInnerDropInfo(visualDropContainer, visualDropOffset);
+ }
+
private nsIDOMNode getNearChild(nsIDOMNode container, int x, int y) {
int closestXDistance = HUGE_DISTANCE;
int closestYDistance = HUGE_DISTANCE;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java 2010-04-05 03:42:02 UTC (rev 21262)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceInnerDropInfo.java 2010-04-05 13:49:06 UTC (rev 21263)
@@ -16,8 +16,6 @@
private Node container;
private int offset;
private boolean canDrop;
- private int top;
- private int left;
public VpeSourceInnerDropInfo(Node container, int offset, boolean canDrop) {
this.container = container;
@@ -37,22 +35,6 @@
return canDrop;
}
- public int getTop() {
- return top;
- }
-
- public void setTop(int top) {
- this.top = top;
- }
-
- public int getLeft() {
- return left;
- }
-
- public void setLeft(int left) {
- this.left = left;
- }
-
public void setContainer(Node container) {
this.container = container;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-04-05 03:42:02 UTC (rev 21262)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-04-05 13:49:06 UTC (rev 21263)
@@ -1681,62 +1681,6 @@
return true;
}
- public VpeVisualInnerDropInfo getInnerDropInfo(Node sourceDropContainer,
- int sourceDropOffset) {
- nsIDOMNode visualDropContainer = null;
- long visualDropOffset = 0;
-
- switch (sourceDropContainer.getNodeType()) {
- case Node.TEXT_NODE:
- visualDropContainer = domMapping.getVisualNode(sourceDropContainer);
- visualDropOffset = TextUtil.visualInnerPosition(sourceDropContainer
- .getNodeValue(), sourceDropOffset);
- break;
- case Node.ELEMENT_NODE:
- case Node.DOCUMENT_NODE:
- NodeList sourceChildren = sourceDropContainer.getChildNodes();
- if (sourceDropOffset < sourceChildren.getLength()) {
- Node sourceChild = sourceChildren.item(sourceDropOffset);
- nsIDOMNode visualChild = domMapping.getVisualNode(sourceChild);
- if (visualChild != null) {
- visualDropContainer = visualChild.getParentNode();
-
- visualDropOffset = VisualDomUtil.getOffset(visualChild);
- }
- }
- if (visualDropContainer == null) {
- visualDropContainer = domMapping
- .getNearVisualNode(sourceDropContainer);
- nsIDOMNode visualChild = getLastAppreciableVisualChild(visualDropContainer);
- if (visualChild != null) {
- visualDropOffset = VisualDomUtil.getOffset(visualChild) + 1;
- } else {
- visualDropOffset = 0;
- }
- }
- break;
- case Node.ATTRIBUTE_NODE:
- Element sourceElement = ((Attr) sourceDropContainer)
- .getOwnerElement();
- VpeElementMapping elementMapping = domMapping
- .getNearElementMapping(sourceElement);
- nsIDOMNode textNode = elementMapping.getTemplate()
- .getOutputTextNode(pageContext, sourceElement,
- elementMapping.getData());
- if (textNode != null) {
- visualDropContainer = textNode;
- visualDropOffset = TextUtil.visualInnerPosition(
- sourceDropContainer.getNodeValue(), sourceDropOffset);
- }
- break;
- }
- if (visualDropContainer == null) {
- return null;
- }
- return new VpeVisualInnerDropInfo(visualDropContainer,
- visualDropOffset, 0, 0);
- }
-
protected void setTooltip(Element sourceElement, nsIDOMElement visualElement) {
if (visualElement != null && sourceElement != null
&& !((IDOMElement) sourceElement).isJSPTag()) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java 2010-04-05 03:42:02 UTC (rev 21262)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualInnerDropInfo.java 2010-04-05 13:49:06 UTC (rev 21263)
@@ -15,15 +15,10 @@
public class VpeVisualInnerDropInfo {
private nsIDOMNode dropContainer;
private long dropOffset;
- private int mouseX;
- private int mouseY;
- public VpeVisualInnerDropInfo(nsIDOMNode dropContainer, long dropOffset, int mouseX, int mouseY) {
+ public VpeVisualInnerDropInfo(nsIDOMNode dropContainer, long dropOffset) {
this.dropContainer = dropContainer;
this.dropOffset = dropOffset;
- this.mouseX = mouseX;
- this.mouseY = mouseY;
-
}
public nsIDOMNode getDropContainer() {
@@ -36,15 +31,7 @@
public void setDropOffset(long dropOffset) {
this.dropOffset = dropOffset;
}
-
- public int getMouseX() {
- return mouseX;
- }
-
- public int getMouseY() {
- return mouseY;
- }
-
+
public void release() {
dropContainer = null;
}
14 years, 9 months
JBoss Tools SVN: r21262 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-04 23:42:02 -0400 (Sun, 04 Apr 2010)
New Revision: 21262
Modified:
branches/modular_build/genpom.xml
Log:
remove todo marker
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-04 23:10:03 UTC (rev 21261)
+++ branches/modular_build/genpom.xml 2010-04-05 03:42:02 UTC (rev 21262)
@@ -1,4 +1,3 @@
-<!-- INCOMPLETE - see TODO markers -->
<project default="run" basedir=".">
<!-- Configuration Start -->
<property name="projectName" value="org.jboss.tools" />
14 years, 9 months
JBoss Tools SVN: r21261 - in trunk: examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-04-04 19:10:03 -0400 (Sun, 04 Apr 2010)
New Revision: 21261
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5950 Need additional runtime checks for ESB & BPEL project examples
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2010-04-04 22:40:47 UTC (rev 21260)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2010-04-04 23:10:03 UTC (rev 21261)
@@ -28,7 +28,8 @@
org.jboss.tools.common,
org.eclipse.equinox.p2.ui,
org.eclipse.equinox.p2.ui.sdk,
- org.eclipse.equinox.p2.metadata
+ org.eclipse.equinox.p2.metadata,
+ org.jboss.tools.portlet.core
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.jboss.tools.project.examples,
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-04-04 22:40:47 UTC (rev 21260)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-04-04 23:10:03 UTC (rev 21261)
@@ -1,10 +1,17 @@
package org.jboss.tools.project.examples.fixes;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
import java.util.StringTokenizer;
import org.eclipse.core.resources.IProject;
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.Platform;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -12,6 +19,10 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.tools.portlet.core.IPortletConstants;
+import org.jboss.tools.portlet.core.internal.PortletRuntimeComponentProvider;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
@@ -19,6 +30,13 @@
public class WTPRuntimeFix implements ProjectExamplesFix {
+ private static final String BPEL = "bpel";
+ private static final String JBOSSESB_SAR = "jbossesb.sar";
+ private static final String JBOSSESB_ESB = "jbossesb.esb";
+ private static final String ESB = "esb";
+ private static final String PORTLET = "portlet";
+ private static final String REQUIRED_COMPONENTS = "required-components";
+
public boolean canFix(Project project, ProjectFix fix) {
if (!ProjectFix.WTP_RUNTIME.equals(fix.getType())) {
return false;
@@ -77,19 +95,90 @@
IRuntime[] runtimes = ServerCore.getRuntimes();
if (runtimes.length > 0
&& ProjectFix.ANY.equals(allowedType)) {
- return runtimes[0];
+ return isComponentPresent(fix, runtimes[0]);
}
for (int i = 0; i < runtimes.length; i++) {
IRuntime runtime = runtimes[i];
IRuntimeType runtimeType = runtime.getRuntimeType();
if (runtimeType.getId().equals(allowedType)) {
- return runtime;
+ return isComponentPresent(fix, runtime);
}
}
}
return null;
}
+ private IRuntime isComponentPresent(ProjectFix fix, IRuntime runtime) {
+ String required_components = fix.getProperties().get(REQUIRED_COMPONENTS);
+ List<String> components = tokenize(required_components);
+ if (components == null) {
+ return runtime;
+ }
+ File location = null;
+ if (runtime != null && runtime.getLocation() != null) {
+ location = runtime.getLocation().toFile();
+ } else {
+ return null;
+ }
+ for (String component:components) {
+ if (PORTLET.equals(component)) {
+ if (!PortletRuntimeComponentProvider.isPortalPresent(location, runtime, PortletRuntimeComponentProvider.IS_PORTLET_RUNTIME)) {
+ return null;
+ }
+ }
+ if (ESB.equals(component)) {
+ if (!isEsbPresent(location, runtime)) {
+ return null;
+ }
+ }
+ if (BPEL.equals(component)) {
+ if (!isBpelPresent(location, runtime)) {
+ return null;
+ }
+ }
+ return runtime;
+ }
+ return null;
+ }
+
+ private boolean isBpelPresent(File location, IRuntime runtime) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ private List<String> tokenize(String requiredComponents) {
+ StringTokenizer tokenizer = new StringTokenizer(requiredComponents, ",");
+ List<String> components = new ArrayList<String>();
+ while (tokenizer.hasMoreTokens()) {
+ components.add(tokenizer.nextToken().trim());
+ }
+ return components;
+ }
+
+ public static boolean isEsbPresent(final File location,
+ IRuntime runtime) {
+ IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)runtime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ if (jbossRuntime != null) {
+ IPath jbossLocation = runtime.getLocation();
+ IPath configPath = jbossLocation.append(IJBossServerConstants.SERVER).append(jbossRuntime.getJBossConfiguration());
+ File configFile = configPath.toFile();
+ return exists(configFile, JBOSSESB_ESB) && exists(configFile, JBOSSESB_SAR);
+ }
+ return false;
+ }
+
+ private static boolean exists(final File location,String esbDir) {
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ esbDir = esbDir.replace("/", "\\"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ File deployFile = new File(location,IJBossServerConstants.DEPLOY);
+ if (!deployFile.exists() && !deployFile.isDirectory()) {
+ return false;
+ }
+ File file = new File(deployFile,esbDir);
+ return file.exists();
+ }
+
private static IRuntime getRuntime(
org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime) {
if (runtime == null)
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-04-04 22:40:47 UTC (rev 21260)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-04-04 23:10:03 UTC (rev 21261)
@@ -295,11 +295,9 @@
includedProjects, ","); //$NON-NLS-1$
List<String> projectList = new ArrayList<String>();
while (tokenizer.hasMoreTokens()) {
- projectList.add(tokenizer
- .nextToken());
+ projectList.add(tokenizer.nextToken().trim());
}
- project
- .setIncludedProjects(projectList);
+ project.setIncludedProjects(projectList);
}
}
if (nodeName.equals("welcome")) { //$NON-NLS-1$
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java 2010-04-04 22:40:47 UTC (rev 21260)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java 2010-04-04 23:10:03 UTC (rev 21261)
@@ -23,7 +23,7 @@
public class PortletRuntimeComponentProvider extends
RuntimeFacetComponentProviderDelegate {
- private static final String IS_PORTLET_RUNTIME = "isPortletRuntime"; //$NON-NLS-1$
+ public static final String IS_PORTLET_RUNTIME = "isPortletRuntime"; //$NON-NLS-1$
private static final IRuntimeComponentType PORTAL_TYPE = RuntimeManager
.getRuntimeComponentType("org.jboss.tools.portlet.core.runtime.component"); //$NON-NLS-1$
14 years, 9 months
JBoss Tools SVN: r21260 - workspace/snjeza/esbexamples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-04-04 18:40:47 -0400 (Sun, 04 Apr 2010)
New Revision: 21260
Modified:
workspace/snjeza/esbexamples/project-examples-test-esb.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5950 Need additional runtime checks for ESB & BPEL project examples
Modified: workspace/snjeza/esbexamples/project-examples-test-esb.xml
===================================================================
--- workspace/snjeza/esbexamples/project-examples-test-esb.xml 2010-04-04 16:37:00 UTC (rev 21259)
+++ workspace/snjeza/esbexamples/project-examples-test-esb.xml 2010-04-04 22:40:47 UTC (rev 21260)
@@ -16,7 +16,7 @@
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43</property>
<property name="eclipse-projects">helloworld</property>
- <property name="required-component">esb</property>
+ <property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA 4.3</property>
</fix>
</fixes>
14 years, 9 months
JBoss Tools SVN: r21259 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-04 12:37:00 -0400 (Sun, 04 Apr 2010)
New Revision: 21259
Modified:
branches/modular_build/genpom.xml
Log:
tweak console output
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-04 16:28:42 UTC (rev 21258)
+++ branches/modular_build/genpom.xml 2010-04-04 16:37:00 UTC (rev 21259)
@@ -113,7 +113,7 @@
casesensitive="true"
override="true"
/>
- <debug> Agg dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
+ <debug> Agg dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
<!-- <echo>Write Agg @{dir}/pom.xml</echo> -->
<echo file="@{dir}/pom.xml"><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
@@ -190,7 +190,7 @@
casesensitive="true"
override="true"
/>
- <debug> Mod dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
+ <debug> Mod dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
<echo file="@{dir}/pom.xml"><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -254,7 +254,7 @@
<dirset dir="@{dir}" excludes="${dirsToExclude}" includes="*" />
</path>
<sequential>
- <!-- <debug> @{subdir}</debug> -->
+ <!-- <debug> @{subdir}</debug> -->
<var name="aggregate" value="false" />
<if>
<or>
@@ -301,13 +301,14 @@
<istrue value="${aggregate}" />
<else>
<basename property="artifactIdAgg" file="@{subdir}" />
- <echo>Generate Agg for: ${artifactIdAgg}</echo>
<writeAggregatePom dir="@{subdir}"
parentpom="../${pathToParentPom}parent-pom.xml"
artifactId="${artifactIdAgg}.all"
artifactVersion="@{artifactVersion}"
/>
+ <echo>Aggregated: ${artifactIdAgg}</echo>
+
<var name="artifactIdAgg" unset="true" />
</else>
</if>
14 years, 9 months
JBoss Tools SVN: r21258 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-04 12:28:42 -0400 (Sun, 04 Apr 2010)
New Revision: 21258
Added:
branches/modular_build/jbosstools-modular_build build.xml.launch
Modified:
branches/modular_build/build.xml
Log:
JBDS-486 build.xml + launcher now support genpom.xml for individual components; can run from Eclipse or cmdline
Modified: branches/modular_build/build.xml
===================================================================
--- branches/modular_build/build.xml 2010-04-04 16:14:18 UTC (rev 21257)
+++ branches/modular_build/build.xml 2010-04-04 16:28:42 UTC (rev 21258)
@@ -1,11 +1,25 @@
<!-- Run a given ${COMPONENT} build -->
-<project default="run" xmlns:artifact="antlib:org.apache.maven.artifact.ant" basedir=".">
+<project default="run" basedir=".">
+ <!-- Configuration Start -->
+ <!-- must set name of component to build/test -->
+ <property name="COMPONENT" value="tests" />
+ <!-- Configuration Ends -->
+
+ <!-- To run this script in Eclipse:
+ Run As > Ant Build
+ -->
+ <!-- To run this script via commandline (build default module, tests):
+ cd /home/nboldt/workspace36/jbosstools-modular_build; ant -q
+ or, to build a specific module:
+ cd /home/nboldt/workspace36/jbosstools-modular_build; ant -q -DCOMPONENT=jbpm
+ -->
+
<target name="run" depends="init, genpom, install, deploy" />
<!-- override for local build -->
<available file="/qa/tools/opt" type="dir" property="isJBossQA" />
- <target name="local" unless="jbossQAConfig">
+ <target name="local" unless="isJBossQA">
<property name="WORKINGDIR" value="${basedir}" />
<property name="COMMON_TOOLS" value="${java.io.tmpdir}" />
</target>
@@ -28,28 +42,16 @@
src="${COMMON_TOOLS}/apache-maven-3.0-alpha-7-bin.tar.gz"
/>
<chmod perm="755" file="${COMMON_TOOLS}/apache-maven-3.0-alpha-7/bin/mvn"/>
-
- <!-- maven ant tasks -->
- <!--<get usetimestamp="true"
- dest="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar"
- src="${MAVEN_MIRROR}/maven-ant-tasks-2.1.0.jar"
- />
- <path id="maven-ant-tasks.classpath" path="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar" />
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
- uri="antlib:org.apache.maven.artifact.ant"
- classpathref="maven-ant-tasks.classpath"
- /> -->
</target>
- <!-- TODO: replace this with ant script for better portability -->
<target name="genpom">
- <exec executable="scala" dir="${WORKINGDIR}">
- <arg line="${WORKINGDIR}/genpom.scala" />
- </exec>
+ <ant antfile="genpom.xml" target="run">
+ <property name="WORKINGDIR" value="${WORKINGDIR}/${COMPONENT}" />
+ <property name="pathToParentPom" value="../" />
+ </ant>
</target>
<target name="install">
- <property name="COMPONENT" value="tests" />
<echo>Run pom file: ${WORKINGDIR}/${COMPONENT}/pom.xml</echo>
<exec executable="${COMMON_TOOLS}/apache-maven-3.0-alpha-7/bin/mvn" dir="${WORKINGDIR}/${COMPONENT}">
@@ -60,14 +62,22 @@
<target name="deploy">
<!-- TODO enable publishing to download.jboss.org or porkchop.jboss.com
- <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
-
- <artifact:deploy file="target/my-project-1.0.jar">
+ <get usetimestamp="true"
+ dest="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar"
+ src="${MAVEN_MIRROR}/maven-ant-tasks-2.1.0.jar"
+ />
+ <taskdef resource="org/apache/maven/artifact/ant/antlib.xml">
+ <classpath>
+ <pathelement location="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar" />
+ </classpath>
+ </taskdef>
+ <install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
+ <deploy file="target/my-project-1.0.jar">
<remoteRepository url="scp://localhost/www/repository">
<authentication username="${repository.username}" privateKey="${user.home}/.ssh/id_dsa" />
</remoteRepository>
<pom refid="mypom" />
- </artifact:deploy>
+ </deploy>
-->
</target>
</project>
Added: branches/modular_build/jbosstools-modular_build build.xml.launch
===================================================================
--- branches/modular_build/jbosstools-modular_build build.xml.launch (rev 0)
+++ branches/modular_build/jbosstools-modular_build build.xml.launch 2010-04-04 16:28:42 UTC (rev 21258)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.ATTR_REFRESH_RECURSIVE" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${container}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/jbosstools-modular_build/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="${workspace_loc:/jbosstools-modular_build}/buildlog.latest.txt"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-1.6.0-openjdk-1.6.0.0"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jbosstools-modular_build"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/jbosstools-modular_build/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-v"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
14 years, 9 months
JBoss Tools SVN: r21257 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-04 12:14:18 -0400 (Sun, 04 Apr 2010)
New Revision: 21257
Modified:
branches/modular_build/genpom.xml
Log:
JBDS-486: support running from within a component; clean up counter variables; reuse exclude filters
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-04 15:14:14 UTC (rev 21256)
+++ branches/modular_build/genpom.xml 2010-04-04 16:14:18 UTC (rev 21257)
@@ -1,8 +1,26 @@
<!-- INCOMPLETE - see TODO markers -->
<project default="run" basedir=".">
-
+ <!-- Configuration Start -->
+ <property name="projectName" value="org.jboss.tools" />
+ <property name="pathToParentPom" value="" />
+ <property name="pomVersion" value="0.0.1-SNAPSHOT" />
<property name="debug" value="false" />
+ <property name="dirsToExclude"
+ value="**/*.sdk.*, **/doc*, **/download.jboss.org, **/util, **/test, **/builders, **/releng, ."
+ />
+ <!-- Configuration Ends -->
+ <!-- To run this script in Eclipse:
+ Run As > Ant Build
+ -->
+ <!-- To run this script via commandline:
+ cd /home/nboldt/workspace36/jbosstools-modular_build; ant -f genpom.xml -q
+ or, to build a specific module only:
+ cd /home/nboldt/workspace36/jbosstools-modular_build; \
+ ant -f genpom.xml -q -DWORKINGDIR=/home/nboldt/workspace36/jbosstools-modular_build/jbpm \
+ -DpathToParentPom=../
+ -->
+
<target name="get.ant-contrib" unless="ant-contrib.jar.exists">
<property name="ANTCONTRIB_MIRROR" value="http://downloads.sourceforge.net/ant-contrib/" />
<get usetimestamp="true"
@@ -62,15 +80,6 @@
<attribute name="artifactId" default="" />
<attribute name="artifactVersion" default="" />
<sequential>
- <propertyregex property="activeDir"
- input="@{dir}"
- defaultvalue="@{dir}"
- regexp="${WORKINGDIR}/"
- replace=""
- casesensitive="true"
- override="true"
- />
- <debug> Agg dir: ${activeDir}, artifactId: @{artifactId}, artifactVersion: @{artifactVersion}, parentpom: @{parentpom}</debug>
<if>
<equals arg1="@{artifactId}" arg2="" />
<then>
@@ -95,6 +104,16 @@
<var name="artifactVersion" value="@{artifactVersion}" />
</else>
</if>
+ <var name="artifactType" value="pom" />
+ <propertyregex property="activeDir"
+ input="@{dir}"
+ defaultvalue="@{dir}"
+ regexp="${WORKINGDIR}/"
+ replace=""
+ casesensitive="true"
+ override="true"
+ />
+ <debug> Agg dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
<!-- <echo>Write Agg @{dir}/pom.xml</echo> -->
<echo file="@{dir}/pom.xml"><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
@@ -110,7 +129,7 @@
<groupId>${projectName}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${artifactVersion}</version>
- <packaging>pom</packaging>
+ <packaging>${artifactType}</packaging>
<modules>
</echo>
<var name="artifactId" unset="true" />
@@ -118,7 +137,7 @@
<for param="subdir" delimiter=",
">
<path>
- <dirset dir="@{dir}" excludes="**/*.sdk.*, ., **/doc*, **/download.jboss.org" includes="*" />
+ <dirset dir="@{dir}" excludes="${dirsToExclude}" includes="*" />
</path>
<sequential>
<basename property="subdirSuffix" file="@{subdir}" />
@@ -145,7 +164,7 @@
<property name="dir" value="@{dir}" />
</antcallback>
<if>
- <!-- cannot calculate id and version so just set them to defaults -->
+ <!-- cannot calculate id and version for an update site so just set them to defaults -->
<equals arg1="${artifactType}" arg2="eclipse-update-site" />
<then>
<var name="artifactId" unset="true" />
@@ -153,7 +172,6 @@
<var name="artifactVersion" value="0.0.0" />
</then>
<else>
-
<var name="artifactId" unset="true" />
<antcallback target="getArtifactId" return="artifactId">
<property name="dir" value="@{dir}" />
@@ -172,7 +190,7 @@
casesensitive="true"
override="true"
/>
- <debug> Mod dir: ${activeDir}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
+ <debug> Mod dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</debug>
<echo file="@{dir}/pom.xml"><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -190,6 +208,7 @@
<var name="artifactId" unset="true" />
<var name="artifactVersion" unset="true" />
<var name="artifactType" unset="true" />
+ <var name="modulecountstring" value="${modulecountstring}1" />
</sequential>
</macrodef>
@@ -197,7 +216,7 @@
macrodef: generateAggregator
= = = = = = = = = = = = = = = = = -->
<macrodef name="generateAggregator">
- <attribute name="dir" default="." />
+ <attribute name="dir" default="${WORKINGDIR}" />
<attribute name="parentPom" default="${pathToParentPom}parent-pom.xml" />
<attribute name="artifactId" default="" />
<attribute name="artifactVersion" default="" />
@@ -207,13 +226,13 @@
artifactId="@{artifactId}"
artifactVersion="@{artifactVersion}"
/>
- <var name="aggregatorcountstring" value="${aggregatorcountstring}1" />
<dump dir="@{dir}"
parentpom="@{parentpom}"
artifactId="@{artifactId}"
artifactVersion="@{artifactVersion}"
/>
+ <var name="aggregatorcountstring" value="${aggregatorcountstring}1" />
</sequential>
</macrodef>
@@ -232,12 +251,10 @@
<for param="subdir" delimiter=",
">
<path>
- <dirset dir="@{dir}"
- excludes="*.sdk.*, ., **/doc*, **/download.jboss.org, **/util"
- includes="*"
- />
+ <dirset dir="@{dir}" excludes="${dirsToExclude}" includes="*" />
</path>
<sequential>
+ <!-- <debug> @{subdir}</debug> -->
<var name="aggregate" value="false" />
<if>
<or>
@@ -249,25 +266,34 @@
<then>
<!-- valid place to create a pom -->
<writeModulePom dir="@{subdir}" parentpom="../@{parentpom}" />
- <var name="modulecountstring" value="${modulecountstring}1" />
</then>
<else>
- <for list="plugins tests features site" param="type" delimiter=" ">
+ <for list="plugins tests features" param="type" delimiter=" ">
<sequential>
+ <basename property="artifactIdAgg" file="@{subdir}" />
<if>
<available file="@{subdir}/@{type}" type="dir" />
<then>
<var name="aggregate" value="true" />
- <basename property="artifactIdAgg" file="@{subdir}" />
<generateAggregator dir="@{subdir}/@{type}"
parentpom="../../@{parentpom}"
artifactId="${artifactIdAgg}.@{type}"
artifactVersion="@{artifactVersion}"
/>
- <var name="artifactIdAgg" unset="true" />
- <var name="aggregatorcountstring" value="${aggregatorcountstring}1" />
</then>
+ <elseif>
+ <equals arg1="@{type}" arg2="${artifactIdAgg}" />
+ <then>
+ <var name="aggregate" value="true" />
+ <generateAggregator dir="@{subdir}"
+ parentpom="../@{parentpom}"
+ artifactId="${artifactIdAgg}.@{type}"
+ artifactVersion="@{artifactVersion}"
+ />
+ </then>
+ </elseif>
</if>
+ <var name="artifactIdAgg" unset="true" />
</sequential>
</for>
@@ -275,14 +301,14 @@
<istrue value="${aggregate}" />
<else>
<basename property="artifactIdAgg" file="@{subdir}" />
- <echo>Generate Agg for ${artifactIdAgg}</echo>
+ <echo>Generate Agg for: ${artifactIdAgg}</echo>
<writeAggregatePom dir="@{subdir}"
parentpom="../${pathToParentPom}parent-pom.xml"
artifactId="${artifactIdAgg}.all"
artifactVersion="@{artifactVersion}"
/>
+
<var name="artifactIdAgg" unset="true" />
- <var name="aggregatorcountstring" value="${aggregatorcountstring}1" />
</else>
</if>
</else>
@@ -321,25 +347,19 @@
<target name="run" depends="init">
<if>
<not>
- <available file="${WORKINGDIR}/parent-pom.xml" type="file" />
+ <available file="${WORKINGDIR}/${pathToParentPom}parent-pom.xml" type="file" />
</not>
<then>
- <fail>Error: no parent-pom.xml found in ${WORKINGDIR}</fail>
+ <fail>Error: no parent-pom.xml found in ${WORKINGDIR}/${pathToParentPom}</fail>
</then>
</if>
- <!-- Configuration Start -->
- <var name="projectName" value="org.jboss.tools" />
- <var name="pathToParentPom" value="" />
- <var name="pomVersion" value="0.0.1-SNAPSHOT" />
- <!-- Configuration Ends -->
-
<!-- counter variables -->
<var name="aggregatorcountstring" value="" />
<var name="modulecountstring" value="" />
<!-- call generateAggregator for overall -->
- <generateAggregator dir="."
+ <generateAggregator dir="${WORKINGDIR}"
parentpom="${pathToParentPom}parent-pom.xml"
artifactId="trunk"
artifactVersion="${pomVersion}"
@@ -359,7 +379,10 @@
<var name="artifactType" value="eclipse-feature" />
</then>
<elseif>
- <matches string="${dir}" pattern=".+/.+site" />
+ <or>
+ <matches string="${dir}" pattern=".+/site" />
+ <matches string="${dir}" pattern=".+site" />
+ </or>
<then>
<var name="artifactType" value="eclipse-update-site" />
</then>
14 years, 9 months
JBoss Tools SVN: r21256 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-04 11:14:14 -0400 (Sun, 04 Apr 2010)
New Revision: 21256
Modified:
branches/modular_build/genpom.xml
Log:
JBDS-486: replace manual tests w/ automated <assert/>s
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-04 14:27:57 UTC (rev 21255)
+++ branches/modular_build/genpom.xml 2010-04-04 15:14:14 UTC (rev 21256)
@@ -140,14 +140,30 @@
<attribute name="dir" default="." />
<attribute name="parentpom" />
<sequential>
- <var name="artifactId" unset="true" />
- <antcallback target="getArtifactId" return="artifactId">
+ <var name="artifactType" unset="true" />
+ <antcallback target="getArtifactType" return="artifactType">
<property name="dir" value="@{dir}" />
</antcallback>
- <var name="artifactVersion" unset="true" />
- <antcallback target="getArtifactVersion" return="artifactVersion">
- <property name="dir" value="@{dir}" />
- </antcallback>
+ <if>
+ <!-- cannot calculate id and version so just set them to defaults -->
+ <equals arg1="${artifactType}" arg2="eclipse-update-site" />
+ <then>
+ <var name="artifactId" unset="true" />
+ <basename property="artifactId" file="@{dir}" />
+ <var name="artifactVersion" value="0.0.0" />
+ </then>
+ <else>
+
+ <var name="artifactId" unset="true" />
+ <antcallback target="getArtifactId" return="artifactId">
+ <property name="dir" value="@{dir}" />
+ </antcallback>
+ <var name="artifactVersion" unset="true" />
+ <antcallback target="getArtifactVersion" return="artifactVersion">
+ <property name="dir" value="@{dir}" />
+ </antcallback>
+ </else>
+ </if>
<propertyregex property="activeDir"
input="@{dir}"
defaultvalue="@{dir}"
@@ -168,41 +184,12 @@
<groupId>${projectName}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${artifactVersion}</version>
- <packaging></echo>
+ <packaging>${artifactType}</packaging>
+</project>
+ </echo>
<var name="artifactId" unset="true" />
<var name="artifactVersion" unset="true" />
- <if>
- <matches string="@{dir}" pattern=".+/features/.+" />
- <then>
- <echo file="@{dir}/pom.xml" append="true">eclipse-feature</echo>
- </then>
- <elseif>
- <matches string="@{dir}" pattern=".+/.+site" />
- <then>
- <echo file="@{dir}/pom.xml" append="true">eclipse-update-site</echo>
- </then>
- </elseif>
- <elseif>
- <and>
- <not>
- <matches string="@{dir}" pattern=".+/plugins/.+" />
- </not>
- <matches string="@{dir}" pattern=".+/tests/.+" />
- </and>
- <then>
- <echo>@{dir} is a test plugin</echo>
- <echo file="@{dir}/pom.xml" append="true">eclipse-test-plugin</echo>
- </then>
- </elseif>
- <else>
- <echo file="@{dir}/pom.xml" append="true">eclipse-plugin</echo>
- </else>
-
- </if>
- <echo file="@{dir}/pom.xml" append="true">
- </packaging>
-</project>
- </echo>
+ <var name="artifactType" unset="true" />
</sequential>
</macrodef>
@@ -364,6 +351,36 @@
</target>
+ <target name="getArtifactType">
+ <property name="dir" value="." />
+ <if>
+ <matches string="${dir}" pattern=".+/features/.+" />
+ <then>
+ <var name="artifactType" value="eclipse-feature" />
+ </then>
+ <elseif>
+ <matches string="${dir}" pattern=".+/.+site" />
+ <then>
+ <var name="artifactType" value="eclipse-update-site" />
+ </then>
+ </elseif>
+ <elseif>
+ <and>
+ <not>
+ <matches string="${dir}" pattern=".+/plugins/.+" />
+ </not>
+ <matches string="${dir}" pattern=".+/tests/.+" />
+ </and>
+ <then>
+ <var name="artifactType" value="eclipse-test-plugin" />
+ </then>
+ </elseif>
+ <else>
+ <var name="artifactType" value="eclipse-plugin" />
+ </else>
+ </if>
+ </target>
+
<target name="getArtifactVersion">
<property name="dir" value="." />
<!-- echo>${dir}</echo -->
@@ -401,6 +418,14 @@
<!-- get <feature version=""> -->
<xmlproperty file="${dir}/feature.xml" collapseAttributes="true" />
<var name="artifactVersion" value="${feature.version}" />
+ <propertyregex property="artifactVersion"
+ input="${artifactVersion}"
+ defaultvalue="${artifactVersion}"
+ regexp="(.+).qualifier"
+ replace="\1-SNAPSHOT"
+ casesensitive="true"
+ override="true"
+ />
<var name="feature.version" unset="true" />
</then>
</elseif>
@@ -453,13 +478,70 @@
</elseif>
<else>
<echo>Warning! artifactId not found for ${dir}!</echo>
- <basename file="${dir}" property="artifactId" />
+ <basename property="artifactId" file="${dir}" />
</else>
</if>
</target>
- <!-- tests -->
+ <!-- ************************************ TESTS ************************************ -->
+
+ <target name="test.expected.values">
+ <property name="ant.enable.asserts" value="true" />
+
+ <!-- expected values for artifactVersion tests -->
+ <property name="artifactVersion.esb/features/org.jboss.tools.esb.feature" value="1.0.0" />
+ <property name="artifactVersion.as/tests/org.jboss.ide.eclipse.as.archives.integration.test" value="1.0.0" />
+ <property name="artifactVersion.esb/plugins/org.jboss.tools.esb.core" value="2.0.0" />
+ <property name="artifactVersion.bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui" value="0.5.0-SNAPSHOT" />
+ <property name="artifactVersion.bpel/features/org.jboss.tools.bpel.sdk.feature" value="1.0.0-SNAPSHOT" />
+ <property name="artifactVersion.bpel/plugins/org.eclipse.bpel.xpath10" value="0.5.0-SNAPSHOT" />
+ <property name="artifactVersion.vpe/plugins/org.jboss.tools.vpe.ui.palette" value="2.1.0" />
+ <property name="artifactVersion.tests/features/org.jboss.tools.test.feature" value="2.0.0" />
+ <property name="artifactVersion.portlet/features/org.jboss.tools.portlet.test.feature" value="1.0.0" />
+ <property name="artifactVersion.jst/features/org.jboss.tools.jst.feature" value="2.0.0" />
+ <property name="artifactVersion.jst/features/org.jboss.tools.jst.web.tiles.feature" value="2.0.0" />
+
+ <!-- expected values for artifactId tests -->
+ <property name="artifactId.esb/features/org.jboss.tools.esb.feature" value="org.jboss.tools.esb.feature" />
+ <property name="artifactId.as/tests/org.jboss.ide.eclipse.as.archives.integration.test"
+ value="org.jboss.ide.eclipse.as.archives.integration.test"
+ />
+ <property name="artifactId.esb/plugins/org.jboss.tools.esb.core" value="org.jboss.tools.esb.core" />
+ <property name="artifactId.bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui"
+ value="org.eclipse.bpel.apache.ode.deploy.ui"
+ />
+ <property name="artifactId.bpel/features/org.jboss.tools.bpel.sdk.feature"
+ value="org.jboss.tools.bpel.sdk.feature"
+ />
+ <property name="artifactId.bpel/plugins/org.eclipse.bpel.xpath10" value="org.eclipse.bpel.xpath10" />
+ <property name="artifactId.vpe/plugins/org.jboss.tools.vpe.ui.palette" value="org.jboss.tools.vpe.ui.palette" />
+ <property name="artifactId.tests/features/org.jboss.tools.test.feature" value="org.jboss.tools.test.feature" />
+ <property name="artifactId.portlet/features/org.jboss.tools.portlet.test.feature"
+ value="org.jboss.tools.portlet.test.feature"
+ />
+ <property name="artifactId.jst/features/org.jboss.tools.jst.feature" value="org.jboss.tools.jst.feature" />
+ <property name="artifactId.jst/features/org.jboss.tools.jst.web.tiles.feature"
+ value="org.jboss.tools.jst.web.tiles.feature"
+ />
+
+ <!-- expected values for artifactType tests -->
+ <property name="artifactType.esb/features/org.jboss.tools.esb.feature" value="eclipse-feature" />
+ <property name="artifactType.as/tests/org.jboss.ide.eclipse.as.archives.integration.test"
+ value="eclipse-test-plugin"
+ />
+ <property name="artifactType.esb/plugins/org.jboss.tools.esb.core" value="eclipse-plugin" />
+ <property name="artifactType.bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui" value="eclipse-plugin" />
+ <property name="artifactType.bpel/features/org.jboss.tools.bpel.sdk.feature" value="eclipse-feature" />
+ <property name="artifactType.bpel/plugins/org.eclipse.bpel.xpath10" value="eclipse-plugin" />
+ <property name="artifactType.vpe/plugins/org.jboss.tools.vpe.ui.palette" value="eclipse-plugin" />
+ <property name="artifactType.tests/features/org.jboss.tools.test.feature" value="eclipse-feature" />
+ <property name="artifactType.portlet/features/org.jboss.tools.portlet.test.feature" value="eclipse-feature" />
+ <property name="artifactType.jst/features/org.jboss.tools.jst.feature" value="eclipse-feature" />
+ <property name="artifactType.jst/features/org.jboss.tools.jst.web.tiles.feature" value="eclipse-feature" />
+ </target>
+
<target name="test.all">
+
<property name="dirs"
value="
${WORKINGDIR}/esb/features/org.jboss.tools.esb.feature
@@ -473,14 +555,14 @@
${WORKINGDIR}/portlet/features/org.jboss.tools.portlet.test.feature
${WORKINGDIR}/jst/features/org.jboss.tools.jst.feature
${WORKINGDIR}/jst/features/org.jboss.tools.jst.web.tiles.feature
- ${WORKINGDIR}/xulrunner/site/org.mozilla.xulrunner.site
"
/>
<antcall target="test.getArtifactVersion" />
<antcall target="test.getArtifactId" />
+ <antcall target="test.getArtifactType" />
</target>
- <target name="test.getArtifactVersion" depends="init">
+ <target name="test.getArtifactVersion" depends="init, test.expected.values">
<property name="dirs"
value="
${WORKINGDIR}/esb/features/org.jboss.tools.esb.feature
@@ -491,7 +573,6 @@
${WORKINGDIR}/portlet/features/org.jboss.tools.portlet.test.feature
${WORKINGDIR}/jst/features/org.jboss.tools.jst.feature
${WORKINGDIR}/jst/features/org.jboss.tools.jst.web.tiles.feature
- ${WORKINGDIR}/xulrunner/site/org.mozilla.xulrunner.site
"
/>
<for param="dir" list="${dirs}" delimiter=",
@@ -500,19 +581,34 @@
<antcallback target="getArtifactVersion" return="artifactVersion">
<property name="dir" value="@{dir}" />
</antcallback>
- <echo>artifactVersion = ${artifactVersion} for @{dir}</echo>
+ <propertyregex property="activeDir"
+ input="@{dir}"
+ defaultvalue="@{dir}"
+ regexp="${WORKINGDIR}/"
+ replace=""
+ casesensitive="true"
+ override="true"
+ />
+ <propertycopy name="expected.value" from="artifactVersion.${activeDir}" />
+ <assert failonerror="false"
+ message="For ${activeDir}, artifactVersion = ${artifactVersion}; expected ${expected.value}"
+ >
+ <bool>
+ <equals arg1="${expected.value}" arg2="${artifactVersion}" />
+ </bool>
+ </assert>
+ <var name="expected.value" unset="true" />
<var name="artifactVersion" unset="true" />
</sequential>
</for>
</target>
- <target name="test.getArtifactId" depends="init">
+ <target name="test.getArtifactId" depends="init, test.expected.values">
<property name="dirs"
value="
${WORKINGDIR}/esb/features/org.jboss.tools.esb.feature
${WORKINGDIR}/as/tests/org.jboss.ide.eclipse.as.archives.integration.test
${WORKINGDIR}/esb/plugins/org.jboss.tools.esb.core
- ${WORKINGDIR}/xulrunner/site/org.mozilla.xulrunner.site
"
/>
<for param="dir" list="${dirs}" delimiter=",
@@ -521,10 +617,62 @@
<antcallback target="getArtifactId" return="artifactId">
<property name="dir" value="@{dir}" />
</antcallback>
- <echo>artifactId = ${artifactId} for @{dir}</echo>
+ <propertyregex property="activeDir"
+ input="@{dir}"
+ defaultvalue="@{dir}"
+ regexp="${WORKINGDIR}/"
+ replace=""
+ casesensitive="true"
+ override="true"
+ />
+ <propertycopy name="expected.value" from="artifactId.${activeDir}" />
+ <assert failonerror="false"
+ message="For ${activeDir}, artifactId = ${artifactId}; expected ${expected.value}"
+ >
+ <bool>
+ <equals arg1="${expected.value}" arg2="${artifactId}" />
+ </bool>
+ </assert>
+ <var name="expected.value" unset="true" />
<var name="artifactId" unset="true" />
</sequential>
</for>
</target>
+ <target name="test.getArtifactType" depends="init, test.expected.values">
+ <property name="dirs"
+ value="
+ ${WORKINGDIR}/esb/features/org.jboss.tools.esb.feature
+ ${WORKINGDIR}/as/tests/org.jboss.ide.eclipse.as.archives.integration.test
+ ${WORKINGDIR}/esb/plugins/org.jboss.tools.esb.core
+ "
+ />
+ <for param="dir" list="${dirs}" delimiter=",
+ ">
+ <sequential>
+ <antcallback target="getArtifactType" return="artifactType">
+ <property name="dir" value="@{dir}" />
+ </antcallback>
+ <propertyregex property="activeDir"
+ input="@{dir}"
+ defaultvalue="@{dir}"
+ regexp="${WORKINGDIR}/"
+ replace=""
+ casesensitive="true"
+ override="true"
+ />
+ <propertycopy name="expected.value" from="artifactType.${activeDir}" />
+ <assert failonerror="false"
+ message="For ${activeDir}, artifactType = ${artifactType}; expected ${expected.value}"
+ >
+ <bool>
+ <equals arg1="${expected.value}" arg2="${artifactType}" />
+ </bool>
+ </assert>
+ <var name="expected.value" unset="true" />
+ <var name="artifactType" unset="true" />
+ </sequential>
+ </for>
+ </target>
+
</project>
14 years, 9 months