Author: yradtsevich
Date: 2011-02-03 13:05:50 -0500 (Thu, 03 Feb 2011)
New Revision: 28982
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://issues.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual
part
- XulRunnerEditor code refactoring
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 2011-02-03
17:28:37 UTC (rev 28981)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-02-03
18:05:50 UTC (rev 28982)
@@ -97,10 +97,6 @@
// private nsIDOMElement lastSelectedElement;
private nsIDOMNode lastSelectedNode;
private int lastResizerConstrains;
- /**
- * Scroll selection into view flag
- */
- private boolean scrollRegtangleFlag = false;
private Listener eventListenet = new Listener() {
@@ -282,35 +278,14 @@
if (getFlasher() == null) {
return;
}
+ setLastSelectedNode(node);
- nsIDOMElement element = getSelectedElementForNode(node);
-
+ nsIDOMElement element = getLastSelectedElement();
if (element != null) {
repaint();
-
- scrollToElement(element);
- scrollRegtangleFlag = true;
-
- if (isVisible(element)) {
- if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
- || (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
- .equals(Boolean.TRUE.toString()))) {
- getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
- } else {
- getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
- }
-
- drawElementOutline(element);
- } else {
- getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
- nsIDOMElement domElement = findVisibleParentElement(element);
-
- if (domElement != null) {
- drawElementOutline(domElement);
- }
- }
-
+ scrollToElement(element);
}
+ showSelectionRectangle();
if (xulRunnerVpeResizer != null) {
if (element != null && resizerConstrains != 0) {
@@ -320,8 +295,6 @@
}
}
- // setLastSelectedElement(element);
- setLastSelectedNode(node);
lastResizerConstrains = resizerConstrains;
fireSelectionListeners();
@@ -450,11 +423,6 @@
public void showSelectionRectangle() {
nsIDOMElement element = getLastSelectedElement();
if (element != null) {
- if (scrollRegtangleFlag) {
- scrollToElement(element);
- scrollRegtangleFlag = false;
- }
-
if (isVisible(element)) {
if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
|| (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
@@ -468,7 +436,7 @@
} else {
getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
nsIDOMElement domElement = findVisibleParentElement(element);
-
+
if (domElement != null) {
drawElementOutline(domElement);
}