Author: mareshkau
Date: 2007-10-18 14:16:39 -0400 (Thu, 18 Oct 2007)
New Revision: 4347
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/util/HTML.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1097
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 2007-10-18
16:10:54 UTC (rev 4346)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-10-18
18:16:39 UTC (rev 4347)
@@ -120,6 +120,7 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateListener;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.toolbar.format.FormatControllerManager;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
@@ -744,8 +745,17 @@
System.out.println("<<< mouseDown targetNode: " +
visualNode.getNodeName() + " (" + visualNode + ") selectedElement: "
+ (visualDragElement != null ? visualDragElement.getNodeName() + " (" +
visualDragElement + ")" : null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$ //$NON-NLS-5$
}
mouseDownSelectionFlag = false;
+
if (visualDragElement != null) {
- selectionBuilder.setVisualElementSelection(visualDragElement);
+
+ //we shouldn't change selection when we click on <input type="text"
/> element,
+ //because if we change after resizing the input element lost selection
+ if(HTML.TAG_INPUT.equalsIgnoreCase(visualDragElement.getNodeName())&&
+ !HTML.ATTR_TEXT.equalsIgnoreCase(visualDragElement.getAttribute(HTML.ATTR_TYPE))
+ &&visualDragElement.getAttribute(HTML.ATTR_TYPE)!=null) {
+
+ selectionBuilder.setVisualElementSelection(visualDragElement);
+ }
mouseDownSelectionFlag = true;
} else {
selectionBuilder.setCaretAtMouse(mouseEvent);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2007-10-18
16:10:54 UTC (rev 4346)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2007-10-18
18:16:39 UTC (rev 4347)
@@ -51,4 +51,6 @@
public static final String ATTR_ID = "ID";
+ public static final String ATTR_TYPE ="TYPE";
+ public static final String ATTR_TEXT ="TEXT";
}
\ No newline at end of file