JBoss Tools SVN: r25401 - in trunk: tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-10-01 11:47:43 -0400 (Fri, 01 Oct 2010)
New Revision: 25401
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7157
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java 2010-10-01 15:33:41 UTC (rev 25400)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/JSF2RefactoringTest.java 2010-10-01 15:47:43 UTC (rev 25401)
@@ -13,6 +13,7 @@
import org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor;
import org.jboss.tools.jsf.jsf2.refactoring.JSF2RenameParticipant;
import org.jboss.tools.jsf.jsf2.refactoring.JSf2MoveParticipant;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.tests.AbstractRefactorTest;
@@ -27,6 +28,7 @@
protected void setUp() throws Exception {
project = ProjectImportTestSetup.loadProject(projectName);
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ JobUtils.waitForIdle(2000);
}
public void testRenameCompositeComponentFile() throws CoreException {
@@ -40,6 +42,7 @@
IFile sourceFile = project.getProject().getFile("/WebContent/resources/demo/input.xhtml");
RenameResourceProcessor processor = new RenameResourceProcessor(sourceFile);
+ processor.setNewResourceName("input2.xhtml");
JSF2RenameParticipant participant = new JSF2RenameParticipant();
@@ -57,6 +60,7 @@
IFolder sourceFolder = project.getProject().getFolder("/WebContent/resources/demo");
RenameResourceProcessor processor = new RenameResourceProcessor(sourceFolder);
+ processor.setNewResourceName("demo2");
JSF2RenameParticipant participant = new JSF2RenameParticipant();
@@ -67,14 +71,15 @@
ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/inputname.xhtml");
- TestTextChange change = new TestTextChange(776, 6, "input2");
+ TestTextChange change = new TestTextChange(382, 3, "new");
structure.addTextChange(change);
list.add(structure);
- IFile sourceFile = project.getProject().getFile("/WebContent/resources/demo/input.xhtml");
+ IFile sourceFile = project.getProject().getFile("/WebContent/resources/demo2/input2.xhtml");
IFolder destinationFolder = project.getProject().getFolder("/WebContent/resources/new");
MoveResourcesProcessor processor = new MoveResourcesProcessor(new IResource[]{sourceFile});
+ processor.setDestination(destinationFolder);
JSf2MoveParticipant participant = new JSf2MoveParticipant();
@@ -85,14 +90,15 @@
ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/inputname.xhtml");
- TestTextChange change = new TestTextChange(776, 6, "input2");
+ TestTextChange change = new TestTextChange(382, 9, "demo2/new");
structure.addTextChange(change);
list.add(structure);
- IFolder sourceFolder = project.getProject().getFolder("/WebContent/resources/demo");
- IFolder destinationFolder = project.getProject().getFolder("/WebContent/resources/new");
+ IFolder sourceFolder = project.getProject().getFolder("/WebContent/resources/new");
+ IFolder destinationFolder = project.getProject().getFolder("/WebContent/resources/demo2");
MoveResourcesProcessor processor = new MoveResourcesProcessor(new IResource[]{sourceFolder});
+ processor.setDestination(destinationFolder);
JSf2MoveParticipant participant = new JSf2MoveParticipant();
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2010-10-01 15:33:41 UTC (rev 25400)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractRefactorTest.java 2010-10-01 15:47:43 UTC (rev 25401)
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.MoveArguments;
@@ -21,6 +22,7 @@
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
import org.jboss.tools.test.util.JobUtils;
public class AbstractRefactorTest extends TestCase{
@@ -56,6 +58,9 @@
CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+ Change mainChange = processor.createChange(new NullProgressMonitor());
+ mainChange.perform(new NullProgressMonitor());
+
checkChanges(rootChange, changeList);
}
@@ -72,6 +77,9 @@
CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+ Change mainChange = processor.createChange(new NullProgressMonitor());
+ mainChange.perform(new NullProgressMonitor());
+
checkChanges(rootChange, changeList);
}
14 years, 1 month
JBoss Tools SVN: r25400 - 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-10-01 11:33:41 -0400 (Fri, 01 Oct 2010)
New Revision: 25400
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java
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/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
Log:
JBIDE-7210 https://jira.jboss.org/browse/JBIDE-7210 :
Disabled text editing in VPE Visual Editor
JBIDE-6229 https://jira.jboss.org/browse/JBIDE-6229 :
Implement DnD support for selected text in VPE
Commit #25094 is rolled back for the trunk. The text editing works now, but the text DnD does not.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-10-01 15:17:20 UTC (rev 25399)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-10-01 15:33:41 UTC (rev 25400)
@@ -13,9 +13,12 @@
import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.util.XulRunnerVpeUtils;
+import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMNode;
@@ -26,7 +29,7 @@
* @author Yahor Radtsevich (yradtsevich)
*/
public class DraggablePattern {
- public static final int ICON_HEIGHT = 20;
+ private static final int ICON_HEIGHT = 20;
private static final String DRAG_ICON_ID = "dragIcon"; //$NON-NLS-1$
private static final String DRAG_ICON_FILE = "dragIcon.gif"; //$NON-NLS-1$
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java 2010-10-01 15:17:20 UTC (rev 25399)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java 2010-10-01 15:33:41 UTC (rev 25400)
@@ -11,7 +11,9 @@
package org.jboss.tools.vpe.dnd;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.xulrunner.util.XulRunnerVpeUtils;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -25,18 +27,16 @@
private final nsIDOMText selectionContainer;
private final int startOffset;
private final int endOffset;
- private Point position;
/**
* NOTE: selectionContainer must contain really selected text. It will
* not work if real selection range do not math offsets.
*/
- public DraggableTextSelection(nsIDOMText selectionContainer, Point position,
+ public DraggableTextSelection(nsIDOMText selectionContainer,
int startOffset, int endOffset) {
this.selectionContainer = selectionContainer;
this.startOffset = startOffset;
this.endOffset = endOffset;
- this.position = position;
}
@@ -62,6 +62,7 @@
* @see org.jboss.tools.vpe.dnd.IDraggableFragment#getPosition()
*/
public Point getPosition() {
- return position;
+ Rectangle bounds = XulRunnerVpeUtils.getTextSelectionBounds(selectionContainer);
+ return new Point(bounds.x, bounds.y);
}
}
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-10-01 15:17:20 UTC (rev 25399)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-10-01 15:33:41 UTC (rev 25400)
@@ -69,7 +69,6 @@
import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.Mozilla;
import org.w3c.dom.Document;
-import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
@@ -123,26 +122,9 @@
public void dragStart(nsIDOMEvent domEvent) {
nsIDOMElement selectedElement = getSelectedElement();
- Point pageCoords = getPageCoords(domEvent);
-
- /* for selected text the drag icon is shown
- * when a drag action begins. */
- if (vpeController.getXulRunnerEditor().isTextSelected()) {
- nsISelection selection = vpeController.getXulRunnerEditor().getSelection();
- nsIDOMRange range = selection.getRangeAt(0);
- nsIDOMText textContainer = queryInterface(
- range.getStartContainer(), nsIDOMText.class);
-
- draggablePattern.showDragIcon(new DraggableTextSelection(
- textContainer,
- new Point(pageCoords.x - DraggablePattern.ICON_HEIGHT / 2,
- pageCoords.y + DraggablePattern.ICON_HEIGHT / 2),
- range.getStartOffset(), range.getEndOffset()));
- }
-
// start drag sessionvpe-element
- if (vpeController.getXulRunnerEditor().isTextSelected()
- || isDraggable(selectedElement)) {
+ if (isTextSelected(getVisualSelection()) || isDraggable(selectedElement)) {
+ Point pageCoords = getPageCoords(domEvent);
draggablePattern.startSession(pageCoords.x, pageCoords.y);
startDragSession(selectedElement);
domEvent.stopPropagation();
@@ -153,8 +135,8 @@
private nsIDOMElement getSelectedElement() {
return vpeController.getXulRunnerEditor().getLastSelectedElement();
}
-
- /**Draggable Text
+
+ /**
* Called when drag over event occurs
* @param event
*/
@@ -166,10 +148,8 @@
final DropResolver dropResolver;
if (isInnerDragSession()) {
- if (vpeController.getXulRunnerEditor().isTextSelected()) {
- dropResolver = getDropResolverForNode(getSourceNode(
- vpeController.getXulRunnerEditor()
- .getSelection().getFocusNode()));
+ if (isTextSelected(getVisualSelection())) {
+ dropResolver = getDropResolverForNode(getSourceNode(getVisualSelection().getFocusNode()));
} else {
dropResolver = getDropResolverForInternalDrop();
}
@@ -237,16 +217,54 @@
}
private void refreshDraggablePattern() {
- nsIDOMElement selectedElement = getSelectedElement();
+ nsISelection selection = getVisualSelection();
+ if (isTextSelected(selection)) {
+ nsIDOMRange range = selection.getRangeAt(0);
+ nsIDOMText textContainer = queryInterface(
+ range.getStartContainer(), nsIDOMText.class);
+
+ draggablePattern.showDragIcon(new DraggableTextSelection(
+ textContainer, range.getStartOffset(), range.getEndOffset()));
+ } else {
+ nsIDOMElement selectedElement = getSelectedElement();
- if (!vpeController.getXulRunnerEditor().isTextSelected() &&
- isDraggable(selectedElement)) {
- draggablePattern.showDragIcon(new DraggableElement(selectedElement));
- } else {
- draggablePattern.hideDragIcon();
+ if (isDraggable(selectedElement)) {
+ draggablePattern.showDragIcon(new DraggableElement(selectedElement));
+ } else {
+ draggablePattern.hideDragIcon();
+ }
}
}
+ private nsISelection getVisualSelection() {
+ return vpeController.getXulRunnerEditor().getWebBrowser()
+ .getContentDOMWindow().getSelection();
+ }
+
+ private boolean isTextSelected(nsISelection selection) {
+ if (selection.getRangeCount() == 0) {
+ // nothing selected
+ return false;
+ }
+
+ nsIDOMRange range = selection.getRangeAt(0);
+ nsIDOMNode container = range.getStartContainer();
+ if (!container.equals(range.getEndContainer())) {
+ // more than one node selected
+ return false;
+ }
+ if (container.getNodeType() != nsIDOMNode.TEXT_NODE) {
+ // not text node is selected
+ return false;
+ }
+ if (range.getStartOffset() == range.getEndOffset()) {
+ // no text selected
+ return false;
+ }
+
+ return true;
+ }
+
public boolean isDragIconClicked(nsIDOMMouseEvent mouseEvent) {
return draggablePattern.isDragIconClicked(mouseEvent);
}
@@ -445,19 +463,7 @@
nsISupportsArray transArray = (nsISupportsArray) getComponentManager()
.createInstanceByContractID(XPCOM.NS_SUPPORTSARRAY_CONTRACTID, null,
nsISupportsArray.NS_ISUPPORTSARRAY_IID);
-
- Node node = getSourceNode(element);
- String text;
- if (node instanceof Element && node instanceof NodeContainer) {
- text = ((NodeContainer)node).getSource();
- } else {
- StyledText textWidget = vpeController.getSourceEditor()
- .getTextViewer().getTextWidget();
- text = textWidget.getSelectionText();
- }
- String xPath = XSLTXPathHelper.calculateXPathToNode(node);
- transArray.appendElement(createTransferable(text, xPath));
-
+ transArray.appendElement(createTransferable(getSourceNode(element)));
getDragService().invokeDragSession(element, transArray, null,
nsIDragService.DRAGDROP_ACTION_MOVE
| nsIDragService.DRAGDROP_ACTION_COPY
@@ -469,17 +475,20 @@
*
* @return transferable object
*/
- private nsITransferable createTransferable(String text, String xPath) {
+ private nsITransferable createTransferable(Node node) {
nsITransferable iTransferable = (nsITransferable) getComponentManager()
.createInstanceByContractID(XPCOM.NS_TRANSFERABLE_CONTRACTID, null,
nsITransferable.NS_ITRANSFERABLE_IID);
-
- nsISupportsString nodeSourceData = createNsISupportsString(text);
- int nodeSourceDataLength = text.length() * 2;
+
+ String nodeSource = ((NodeContainer)node).getSource();
+ nsISupportsString nodeSourceData = createNsISupportsString(nodeSource);
+ int nodeSourceDataLength = nodeSource.length() * 2;
iTransferable.setTransferData(ModelTransfer.MODEL, nodeSourceData, nodeSourceDataLength);
iTransferable.setTransferData("text/html", nodeSourceData, nodeSourceDataLength); //$NON-NLS-1$
iTransferable.setTransferData("text/unicode", nodeSourceData, nodeSourceDataLength); //$NON-NLS-1$
+
+ String xPath = XSLTXPathHelper.calculateXPathToNode(node);
nsISupportsString xPathData = createNsISupportsString(xPath);
iTransferable.setTransferData(DndUtil.VPE_XPATH_FLAVOR, xPathData, xPath.length() * 2);
@@ -565,7 +574,7 @@
System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
}
- if (vpeController.getXulRunnerEditor().isTextSelected()) {
+ if (isTextSelected(getVisualSelection())) {
// it is inner Drag&Drop of text
StyledText textWidget = vpeController.getSourceEditor()
.getTextViewer().getTextWidget();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-10-01 15:17:20 UTC (rev 25399)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-10-01 15:33:41 UTC (rev 25400)
@@ -128,7 +128,6 @@
import org.jboss.tools.vpe.resref.core.RelativeFolderReferenceList;
import org.jboss.tools.vpe.resref.core.TaglibReferenceList;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
-import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMEvent;
@@ -136,7 +135,6 @@
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMMutationEvent;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMRange;
import org.mozilla.interfaces.nsISelection;
import org.mozilla.interfaces.nsISelectionListener;
import org.w3c.dom.Attr;
@@ -1204,6 +1202,8 @@
// mareshkau
if (vpeDnD.isDragIconClicked(mouseEvent)) {
vpeDnD.dragStart(mouseEvent);
+ } else {
+ selectionManager.setSelection(mouseEvent);
}
}
} finally {
@@ -1231,13 +1231,6 @@
return;
}
try {
- // if text is selected, then there is no need to select any element
- if (!xulRunnerEditor.isTextSelected() ||
- !xulRunnerEditor.getSelection().containsNode(
- queryInterface(mouseEvent.getTarget(), nsIDOMNode.class), true)) {
- selectionManager.setSelection(mouseEvent);
- };
-
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
if (visualNode != null) {
if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-10-01 15:17:20 UTC (rev 25399)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-10-01 15:33:41 UTC (rev 25400)
@@ -288,10 +288,11 @@
listener.onShowContextMenu(0, domEvent, node);
}
} else if(DRAGSTART.equals(eventType)) {
- for (MozillaDndListener listener : listeners.getListeners(
- MozillaDndListener.class)) {
- listener.dragStart(domEvent);
- }
+ // fix of JBIDE-4998: since drag events now are implemented by
+ // handling CLICKEVENTTYPE, there is no need to handle them here
+ //for (DndDomEventListener listener : dndListeners) {
+ // listener.dragGesture(domEvent);
+ //}
} else if(DRAGDROPEVENT.equals(eventType)) {
// calls when drop event occure
for (MozillaDndListener listener : listeners.getListeners(
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-10-01 15:17:20 UTC (rev 25399)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-10-01 15:33:41 UTC (rev 25400)
@@ -350,37 +350,8 @@
nsISelection selection = domWindow.getSelection();
return selection;
}
-
+
/**
- * Returns {@code true} if and only if the text selection exists and
- * it is containing in single #text node.
- */
- public boolean isTextSelected() {
- nsISelection selection = getSelection();
- if (selection.getRangeCount() == 0) {
- // nothing selected
- return false;
- }
-
- nsIDOMRange range = selection.getRangeAt(0);
- nsIDOMNode container = range.getStartContainer();
- if (!container.equals(range.getEndContainer())) {
- // more than one node selected
- return false;
- }
- if (container.getNodeType() != nsIDOMNode.TEXT_NODE) {
- // not text node is selected
- return false;
- }
- if (range.getStartOffset() == range.getEndOffset()) {
- // no text selected
- return false;
- }
-
- return true;
- }
-
- /**
* Function created to restore functionality of MozillaBrowser
*
* @return
14 years, 1 month
JBoss Tools SVN: r25399 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-10-01 11:17:20 -0400 (Fri, 01 Oct 2010)
New Revision: 25399
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
Log:
JBIDE-7169
EL proposals should not be in the beginning of proposal lists in XML editor.
Issue is fixed
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java 2010-10-01 15:12:31 UTC (rev 25398)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java 2010-10-01 15:17:20 UTC (rev 25399)
@@ -31,6 +31,7 @@
public static final int R_XML_ATTRIBUTE_NAME = 910;
public static final int R_TAG_INSERTION = 1210; // This value was changed from 500 to 1210 because it seems that according WTP's value was risen up to 1200 in 3.6
public static final int R_XML_ATTRIBUTE_VALUE_TEMPLATE = 91;
+ public static final int R_XML_TAG_INSERTION = 91;
public static final int R_CLOSE_TAG = 1550;
private static final long serialVersionUID = 3257007635692926512L;
14 years, 1 month
JBoss Tools SVN: r25398 - in branches/jbosstools-3.2.0.Beta1/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-10-01 11:12:31 -0400 (Fri, 01 Oct 2010)
New Revision: 25398
Modified:
branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java
branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
Log:
JBIDE-7210 https://jira.jboss.org/browse/JBIDE-7210 :
Disabled text editing in VPE Visual Editor
JBIDE-6229 https://jira.jboss.org/browse/JBIDE-6229 :
Implement DnD support for selected text in VPE
- Commit #25094 is rolled back for the 3.2.0.Beta1 branch. The text editing works now, but the text DnD does not.
Modified: branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-10-01 14:47:13 UTC (rev 25397)
+++ branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggablePattern.java 2010-10-01 15:12:31 UTC (rev 25398)
@@ -13,9 +13,12 @@
import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.util.XulRunnerVpeUtils;
+import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMNode;
@@ -26,7 +29,7 @@
* @author Yahor Radtsevich (yradtsevich)
*/
public class DraggablePattern {
- public static final int ICON_HEIGHT = 20;
+ private static final int ICON_HEIGHT = 20;
private static final String DRAG_ICON_ID = "dragIcon"; //$NON-NLS-1$
private static final String DRAG_ICON_FILE = "dragIcon.gif"; //$NON-NLS-1$
Modified: branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java 2010-10-01 14:47:13 UTC (rev 25397)
+++ branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DraggableTextSelection.java 2010-10-01 15:12:31 UTC (rev 25398)
@@ -11,7 +11,9 @@
package org.jboss.tools.vpe.dnd;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.xulrunner.util.XulRunnerVpeUtils;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -25,18 +27,16 @@
private final nsIDOMText selectionContainer;
private final int startOffset;
private final int endOffset;
- private Point position;
/**
* NOTE: selectionContainer must contain really selected text. It will
* not work if real selection range do not math offsets.
*/
- public DraggableTextSelection(nsIDOMText selectionContainer, Point position,
+ public DraggableTextSelection(nsIDOMText selectionContainer,
int startOffset, int endOffset) {
this.selectionContainer = selectionContainer;
this.startOffset = startOffset;
this.endOffset = endOffset;
- this.position = position;
}
@@ -62,6 +62,7 @@
* @see org.jboss.tools.vpe.dnd.IDraggableFragment#getPosition()
*/
public Point getPosition() {
- return position;
+ Rectangle bounds = XulRunnerVpeUtils.getTextSelectionBounds(selectionContainer);
+ return new Point(bounds.x, bounds.y);
}
}
Modified: branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-10-01 14:47:13 UTC (rev 25397)
+++ branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-10-01 15:12:31 UTC (rev 25398)
@@ -69,7 +69,6 @@
import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.Mozilla;
import org.w3c.dom.Document;
-import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
@@ -123,26 +122,9 @@
public void dragStart(nsIDOMEvent domEvent) {
nsIDOMElement selectedElement = getSelectedElement();
- Point pageCoords = getPageCoords(domEvent);
-
- /* for selected text the drag icon is shown
- * when a drag action begins. */
- if (vpeController.getXulRunnerEditor().isTextSelected()) {
- nsISelection selection = vpeController.getXulRunnerEditor().getSelection();
- nsIDOMRange range = selection.getRangeAt(0);
- nsIDOMText textContainer = queryInterface(
- range.getStartContainer(), nsIDOMText.class);
-
- draggablePattern.showDragIcon(new DraggableTextSelection(
- textContainer,
- new Point(pageCoords.x - DraggablePattern.ICON_HEIGHT / 2,
- pageCoords.y + DraggablePattern.ICON_HEIGHT / 2),
- range.getStartOffset(), range.getEndOffset()));
- }
-
// start drag sessionvpe-element
- if (vpeController.getXulRunnerEditor().isTextSelected()
- || isDraggable(selectedElement)) {
+ if (isTextSelected(getVisualSelection()) || isDraggable(selectedElement)) {
+ Point pageCoords = getPageCoords(domEvent);
draggablePattern.startSession(pageCoords.x, pageCoords.y);
startDragSession(selectedElement);
domEvent.stopPropagation();
@@ -153,8 +135,8 @@
private nsIDOMElement getSelectedElement() {
return vpeController.getXulRunnerEditor().getLastSelectedElement();
}
-
- /**Draggable Text
+
+ /**
* Called when drag over event occurs
* @param event
*/
@@ -166,10 +148,8 @@
final DropResolver dropResolver;
if (isInnerDragSession()) {
- if (vpeController.getXulRunnerEditor().isTextSelected()) {
- dropResolver = getDropResolverForNode(getSourceNode(
- vpeController.getXulRunnerEditor()
- .getSelection().getFocusNode()));
+ if (isTextSelected(getVisualSelection())) {
+ dropResolver = getDropResolverForNode(getSourceNode(getVisualSelection().getFocusNode()));
} else {
dropResolver = getDropResolverForInternalDrop();
}
@@ -237,16 +217,54 @@
}
private void refreshDraggablePattern() {
- nsIDOMElement selectedElement = getSelectedElement();
+ nsISelection selection = getVisualSelection();
+ if (isTextSelected(selection)) {
+ nsIDOMRange range = selection.getRangeAt(0);
+ nsIDOMText textContainer = queryInterface(
+ range.getStartContainer(), nsIDOMText.class);
+
+ draggablePattern.showDragIcon(new DraggableTextSelection(
+ textContainer, range.getStartOffset(), range.getEndOffset()));
+ } else {
+ nsIDOMElement selectedElement = getSelectedElement();
- if (!vpeController.getXulRunnerEditor().isTextSelected() &&
- isDraggable(selectedElement)) {
- draggablePattern.showDragIcon(new DraggableElement(selectedElement));
- } else {
- draggablePattern.hideDragIcon();
+ if (isDraggable(selectedElement)) {
+ draggablePattern.showDragIcon(new DraggableElement(selectedElement));
+ } else {
+ draggablePattern.hideDragIcon();
+ }
}
}
+ private nsISelection getVisualSelection() {
+ return vpeController.getXulRunnerEditor().getWebBrowser()
+ .getContentDOMWindow().getSelection();
+ }
+
+ private boolean isTextSelected(nsISelection selection) {
+ if (selection.getRangeCount() == 0) {
+ // nothing selected
+ return false;
+ }
+
+ nsIDOMRange range = selection.getRangeAt(0);
+ nsIDOMNode container = range.getStartContainer();
+ if (!container.equals(range.getEndContainer())) {
+ // more than one node selected
+ return false;
+ }
+ if (container.getNodeType() != nsIDOMNode.TEXT_NODE) {
+ // not text node is selected
+ return false;
+ }
+ if (range.getStartOffset() == range.getEndOffset()) {
+ // no text selected
+ return false;
+ }
+
+ return true;
+ }
+
public boolean isDragIconClicked(nsIDOMMouseEvent mouseEvent) {
return draggablePattern.isDragIconClicked(mouseEvent);
}
@@ -445,19 +463,7 @@
nsISupportsArray transArray = (nsISupportsArray) getComponentManager()
.createInstanceByContractID(XPCOM.NS_SUPPORTSARRAY_CONTRACTID, null,
nsISupportsArray.NS_ISUPPORTSARRAY_IID);
-
- Node node = getSourceNode(element);
- String text;
- if (node instanceof Element && node instanceof NodeContainer) {
- text = ((NodeContainer)node).getSource();
- } else {
- StyledText textWidget = vpeController.getSourceEditor()
- .getTextViewer().getTextWidget();
- text = textWidget.getSelectionText();
- }
- String xPath = XSLTXPathHelper.calculateXPathToNode(node);
- transArray.appendElement(createTransferable(text, xPath));
-
+ transArray.appendElement(createTransferable(getSourceNode(element)));
getDragService().invokeDragSession(element, transArray, null,
nsIDragService.DRAGDROP_ACTION_MOVE
| nsIDragService.DRAGDROP_ACTION_COPY
@@ -469,17 +475,20 @@
*
* @return transferable object
*/
- private nsITransferable createTransferable(String text, String xPath) {
+ private nsITransferable createTransferable(Node node) {
nsITransferable iTransferable = (nsITransferable) getComponentManager()
.createInstanceByContractID(XPCOM.NS_TRANSFERABLE_CONTRACTID, null,
nsITransferable.NS_ITRANSFERABLE_IID);
-
- nsISupportsString nodeSourceData = createNsISupportsString(text);
- int nodeSourceDataLength = text.length() * 2;
+
+ String nodeSource = ((NodeContainer)node).getSource();
+ nsISupportsString nodeSourceData = createNsISupportsString(nodeSource);
+ int nodeSourceDataLength = nodeSource.length() * 2;
iTransferable.setTransferData(ModelTransfer.MODEL, nodeSourceData, nodeSourceDataLength);
iTransferable.setTransferData("text/html", nodeSourceData, nodeSourceDataLength); //$NON-NLS-1$
iTransferable.setTransferData("text/unicode", nodeSourceData, nodeSourceDataLength); //$NON-NLS-1$
+
+ String xPath = XSLTXPathHelper.calculateXPathToNode(node);
nsISupportsString xPathData = createNsISupportsString(xPath);
iTransferable.setTransferData(DndUtil.VPE_XPATH_FLAVOR, xPathData, xPath.length() * 2);
@@ -565,7 +574,7 @@
System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
}
- if (vpeController.getXulRunnerEditor().isTextSelected()) {
+ if (isTextSelected(getVisualSelection())) {
// it is inner Drag&Drop of text
StyledText textWidget = vpeController.getSourceEditor()
.getTextViewer().getTextWidget();
Modified: branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-10-01 14:47:13 UTC (rev 25397)
+++ branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-10-01 15:12:31 UTC (rev 25398)
@@ -128,7 +128,6 @@
import org.jboss.tools.vpe.resref.core.RelativeFolderReferenceList;
import org.jboss.tools.vpe.resref.core.TaglibReferenceList;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
-import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMEvent;
@@ -136,7 +135,6 @@
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMMutationEvent;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMRange;
import org.mozilla.interfaces.nsISelection;
import org.mozilla.interfaces.nsISelectionListener;
import org.w3c.dom.Attr;
@@ -1204,6 +1202,8 @@
// mareshkau
if (vpeDnD.isDragIconClicked(mouseEvent)) {
vpeDnD.dragStart(mouseEvent);
+ } else {
+ selectionManager.setSelection(mouseEvent);
}
}
} finally {
@@ -1231,13 +1231,6 @@
return;
}
try {
- // if text is selected, then there is no need to select any element
- if (!xulRunnerEditor.isTextSelected() ||
- !xulRunnerEditor.getSelection().containsNode(
- queryInterface(mouseEvent.getTarget(), nsIDOMNode.class), true)) {
- selectionManager.setSelection(mouseEvent);
- };
-
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
if (visualNode != null) {
if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
Modified: branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-10-01 14:47:13 UTC (rev 25397)
+++ branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-10-01 15:12:31 UTC (rev 25398)
@@ -282,10 +282,11 @@
listener.onShowContextMenu(0, domEvent, node);
}
} else if(DRAGSTART.equals(eventType)) {
- for (MozillaDndListener listener : listeners.getListeners(
- MozillaDndListener.class)) {
- listener.dragStart(domEvent);
- }
+ // fix of JBIDE-4998: since drag events now are implemented by
+ // handling CLICKEVENTTYPE, there is no need to handle them here
+ //for (DndDomEventListener listener : dndListeners) {
+ // listener.dragGesture(domEvent);
+ //}
} else if(DRAGDROPEVENT.equals(eventType)) {
// calls when drop event occure
for (MozillaDndListener listener : listeners.getListeners(
Modified: branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-10-01 14:47:13 UTC (rev 25397)
+++ branches/jbosstools-3.2.0.Beta1/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-10-01 15:12:31 UTC (rev 25398)
@@ -350,37 +350,8 @@
nsISelection selection = domWindow.getSelection();
return selection;
}
-
+
/**
- * Returns {@code true} if and only if the text selection exists and
- * it is containing in single #text node.
- */
- public boolean isTextSelected() {
- nsISelection selection = getSelection();
- if (selection.getRangeCount() == 0) {
- // nothing selected
- return false;
- }
-
- nsIDOMRange range = selection.getRangeAt(0);
- nsIDOMNode container = range.getStartContainer();
- if (!container.equals(range.getEndContainer())) {
- // more than one node selected
- return false;
- }
- if (container.getNodeType() != nsIDOMNode.TEXT_NODE) {
- // not text node is selected
- return false;
- }
- if (range.getStartOffset() == range.getEndOffset()) {
- // no text selected
- return false;
- }
-
- return true;
- }
-
- /**
* Function created to restore functionality of MozillaBrowser
*
* @return
14 years, 1 month
JBoss Tools SVN: r25397 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-10-01 10:47:13 -0400 (Fri, 01 Oct 2010)
New Revision: 25397
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
Log:
JBIDE-7169
EL proposals should not be in the beginning of proposal lists in XML editor.
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2010-10-01 14:28:05 UTC (rev 25396)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2010-10-01 14:47:13 UTC (rev 25397)
@@ -155,7 +155,7 @@
if (prefix != null && prefix.isELStarted()) {
addTextELProposals(contentAssistRequest, context);
} else {
- addELPredicateProposals(contentAssistRequest, /*TextProposal.R_TAG_INSERTION*/ XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION, true);
+ addELPredicateProposals(contentAssistRequest, getTagInsertionBaseRelevance(), true);
}
}
@@ -264,4 +264,9 @@
return tagName;
}
+ @Override
+ protected int getTagInsertionBaseRelevance() {
+ return XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION;
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2010-10-01 14:28:05 UTC (rev 25396)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2010-10-01 14:47:13 UTC (rev 25397)
@@ -131,5 +131,10 @@
}
}
+ @Override
+ protected int getTagInsertionBaseRelevance() {
+ return TextProposal.R_TAG_INSERTION;
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2010-10-01 14:28:05 UTC (rev 25396)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2010-10-01 14:47:13 UTC (rev 25397)
@@ -121,7 +121,7 @@
if (prefix != null && prefix.isELStarted()) {
addTextELProposals(contentAssistRequest, context);
} else {
- addELPredicateProposals(contentAssistRequest, TextProposal.R_TAG_INSERTION, true);
+ addELPredicateProposals(contentAssistRequest, getTagInsertionBaseRelevance(), true);
}
}
@@ -1109,4 +1109,8 @@
return region;
}
+ protected int getTagInsertionBaseRelevance() {
+ return TextProposal.R_XML_TAG_INSERTION;
+ }
+
}
14 years, 1 month
JBoss Tools SVN: r25396 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-01 10:28:05 -0400 (Fri, 01 Oct 2010)
New Revision: 25396
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java
Log:
JBIDE-7235
https://jira.jboss.org/browse/JBIDE-7235
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java 2010-10-01 14:01:23 UTC (rev 25395)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/constraint/impl/XAttributeConstraintList.java 2010-10-01 14:28:05 UTC (rev 25396)
@@ -21,7 +21,22 @@
}
public String getError(String value) {
- return accepts(value) ? null : ModelMessages.CONSTRAINT_IS_NOT_IN_LIST;
+ if(accepts(value)) {
+ return null;
+ }
+ String[] vs = getValues();
+ if(vs.length < 6) {
+ String message = " should be one of ";
+ int j = 0;
+ for (int i = 0; i < vs.length; i++) {
+ if(vs[i].length() == 0 || vs[i].startsWith("Default(")) continue; //$NON-NLS-1$
+ if(j > 0) message += ", "; //$NON-NLS-1$
+ message += getValues()[i];
+ j++;
+ }
+ return message;
+ }
+ return ModelMessages.CONSTRAINT_IS_NOT_IN_LIST;
}
}
14 years, 1 month
JBoss Tools SVN: r25395 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-10-01 10:01:23 -0400 (Fri, 01 Oct 2010)
New Revision: 25395
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
Log:
https://jira.jboss.org/browse/JBIDE-7228 - fix updated
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2010-10-01 13:54:34 UTC (rev 25394)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2010-10-01 14:01:23 UTC (rev 25395)
@@ -814,9 +814,12 @@
}
}
str = ef.getProperties().get(ExporterFactoryStrings.QUERY_STRING);
- if (str != null && str.length() == 0) {
- msg = NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_query_should_have_not_empty_value, ef.getExporterDefinition().getDescription());
- break;
+ if (str != null) {
+ str = str.trim();
+ if (str.length() == 0) {
+ msg = NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_query_should_have_not_empty_value, ef.getExporterDefinition().getDescription());
+ break;
+ }
}
}
updateStatus(msg);
14 years, 1 month
JBoss Tools SVN: r25394 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-10-01 09:54:34 -0400 (Fri, 01 Oct 2010)
New Revision: 25394
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
Log:
https://jira.jboss.org/browse/JBIDE-7228 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2010-10-01 13:31:53 UTC (rev 25393)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2010-10-01 13:54:34 UTC (rev 25394)
@@ -463,6 +463,7 @@
public static String ExporterSettingsTab_has_to_be_folder_or_project;
public static String ExporterSettingsTab_must_be_file;
public static String ExporterSettingsTab_output_directory_for;
+ public static String ExporterSettingsTab_query_should_have_not_empty_value;
public static String ExporterSettingsTab_problem_when_reading_hibernate_tools_launch_configuration;
public static String ExporterSettingsTab_project_for_is_closed;
public static String ExporterSettingsTab_properties;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-10-01 13:31:53 UTC (rev 25393)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-10-01 13:54:34 UTC (rev 25394)
@@ -476,6 +476,7 @@
ExporterSettingsTab_select_all=Select all
ExporterSettingsTab_select_exporter_you_want_to_add=Select the exporter(s) you want to add
ExporterSettingsTab_template_directory_for=Template directory for
+ExporterSettingsTab_query_should_have_not_empty_value=Query for {0} should not be an empty string
ExporterSettingsTab_select_dir=Select directory
ExporterSettingsTab_select_dir2=Select directory from filesystem or workspace.
ExporterSettingsTab_select_path=Select path
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2010-10-01 13:31:53 UTC (rev 25393)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2010-10-01 13:54:34 UTC (rev 25394)
@@ -795,31 +795,31 @@
return;
}
-
+ String msg = null;
// hard-coded checks: this should be delegated to extension point that knows about the different exporters.
//Iterator iterator = observableFactoryList.getList().iterator(); // check all exporters
for (ExporterFactory ef : selectedExporters) {// check only selected exporters
String str = ef.getProperties().get(ExporterFactoryStrings.OUTPUTDIR);
- String msg = null;
- if(str!=null) {
+ if (str != null) {
msg = PathHelper.checkDirectory(str, HibernateConsoleMessages.ExporterSettingsTab_output_directory_for + " " + ef.getExporterDefinition().getDescription(), true); //$NON-NLS-1$
- if(msg!=null) {
- updateStatus(msg);
- return;
+ if (msg != null) {
+ break;
}
}
-
str = ef.getProperties().get(ExporterFactoryStrings.TEMPLATE_PATH);
- if(str!=null) {
+ if (str != null) {
msg = PathHelper.checkDirectory(str, HibernateConsoleMessages.ExporterSettingsTab_template_directory_for + " " + ef.getExporterDefinition().getDescription(), true); //$NON-NLS-1$
- if(msg!=null) {
- updateStatus(msg);
- return;
+ if (msg != null) {
+ break;
}
}
-
+ str = ef.getProperties().get(ExporterFactoryStrings.QUERY_STRING);
+ if (str != null && str.length() == 0) {
+ msg = NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_query_should_have_not_empty_value, ef.getExporterDefinition().getDescription());
+ break;
+ }
}
- updateStatus( null );
+ updateStatus(msg);
}
protected String checkDirectory(IPath path, String name) {
14 years, 1 month
JBoss Tools SVN: r25393 - trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF.
by jbosstools-commits@lists.jboss.org
Author: KrisVerlaenen
Date: 2010-10-01 09:31:53 -0400 (Fri, 01 Oct 2010)
New Revision: 25393
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF
Log:
Removed unused dependency
Modified: trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF 2010-10-01 13:30:35 UTC (rev 25392)
+++ trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF 2010-10-01 13:31:53 UTC (rev 25393)
@@ -36,7 +36,6 @@
org.eclipse.bpmn2;visibility:=reexport,
org.eclipse.bpmn2.edit;visibility:=reexport,
org.eclipse.gef;visibility:=reexport,
- org.eclipse.ocl.ecore;visibility:=reexport,
org.eclipse.jdt.ui;bundle-version="3.6.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
14 years, 1 month
JBoss Tools SVN: r25392 - trunk/bpmn/plugins/org.jboss.tools.jbpm/src/main/resources/org/jboss/tools/jbpm/wizard/project.
by jbosstools-commits@lists.jboss.org
Author: KrisVerlaenen
Date: 2010-10-01 09:30:35 -0400 (Fri, 01 Oct 2010)
New Revision: 25392
Modified:
trunk/bpmn/plugins/org.jboss.tools.jbpm/src/main/resources/org/jboss/tools/jbpm/wizard/project/ProcessLauncherSample.java.template
Log:
fixed jbpm5 example
Modified: trunk/bpmn/plugins/org.jboss.tools.jbpm/src/main/resources/org/jboss/tools/jbpm/wizard/project/ProcessLauncherSample.java.template
===================================================================
--- trunk/bpmn/plugins/org.jboss.tools.jbpm/src/main/resources/org/jboss/tools/jbpm/wizard/project/ProcessLauncherSample.java.template 2010-10-01 13:19:53 UTC (rev 25391)
+++ trunk/bpmn/plugins/org.jboss.tools.jbpm/src/main/resources/org/jboss/tools/jbpm/wizard/project/ProcessLauncherSample.java.template 2010-10-01 13:30:35 UTC (rev 25392)
@@ -47,7 +47,7 @@
ProcessRuntimeFactory.setProcessRuntimeFactoryService(new ProcessRuntimeFactoryServiceImpl());
BPMN2ProcessFactory.setBPMN2ProcessProvider(new BPMN2ProcessProviderImpl());
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
- kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2);
+ kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn2"), ResourceType.BPMN2);
return kbuilder.newKnowledgeBase();
}
14 years, 1 month