Author: mareshkau
Date: 2008-11-28 08:32:25 -0500 (Fri, 28 Nov 2008)
New Revision: 12115
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
JBIDE-3163
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java 2008-11-28
10:33:17 UTC (rev 12114)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java 2008-11-28
13:32:25 UTC (rev 12115)
@@ -166,7 +166,7 @@
final Node elementNode = nodeList.item(0);
- SelectionUtil.setSourceSelection(controller.getPageContext(), elementNode, 0,
0);
+ SelectionUtil.setSourceSelection(controller.getPageContext(), elementNode, 1,
0);
nsIDOMNode node =
SelectionUtil.getLastSelectedNode(controller.getPageContext());
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-11-28
10:33:17 UTC (rev 12114)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-11-28
13:32:25 UTC (rev 12115)
@@ -295,7 +295,7 @@
styledText.setCaretOffset(951);
styledText.insert("<a"); //$NON-NLS-1$
styledText.setCaretOffset(953);
- for(int i=0;i<100;i++) {
+ for(int i=0;i<10;i++) {
styledText.insert(""+i); //$NON-NLS-1$
TestUtil.delay(30);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2008-11-28
10:33:17 UTC (rev 12114)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2008-11-28
13:32:25 UTC (rev 12115)
@@ -171,12 +171,18 @@
// get source node by position
//see jbide-3163
IndexedRegion node = model.getIndexedRegion(position);
+ IndexedRegion possbleNode = position>=1?model.getIndexedRegion(position-1):null;
if(node==null && position>=1) {
- node = model.getIndexedRegion(position-1);
+ node = possbleNode;
}else if((node!=null) &&(((Node)node).getNodeType()!=Node.TEXT_NODE)
&& (node.getStartOffset()==position)
&& (position>=1)) {
- node = model.getIndexedRegion(position-1);
+ //check for such situation #text<h1></h1>
+ node = possbleNode;
+ }else if((node!=null) &&(((Node)node).getNodeType()!=Node.TEXT_NODE)
+ && (possbleNode!=null)
+ && ((Node)possbleNode).getNodeType()==Node.TEXT_NODE){
+ node = possbleNode;
}
return (Node)node;
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-11-28
10:33:17 UTC (rev 12114)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-11-28
13:32:25 UTC (rev 12115)
@@ -340,7 +340,7 @@
&& (nodeMapping.getVisualNode() != null)) {
SelectionUtil.setSourceSelection(controller.getPageContext(),
- nodeMapping.getSourceNode(), 0, 0);
+ nodeMapping.getSourceNode(), 1, 0);
TestUtil.delay(50);
Show replies by date