Author: yradtsevich
Date: 2011-02-07 09:25:37 -0500 (Mon, 07 Feb 2011)
New Revision: 29048
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/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.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
Log:
https://issues.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual
part
- removed the clearSelection call from
SelectionManager.setSelectionsetSelection(nsIDOMNode visualNode, int rangeOffset)
- minor methods renaming/removing
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 2011-02-07
13:39:49 UTC (rev 29047)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-02-07
14:25:37 UTC (rev 29048)
@@ -2355,7 +2355,7 @@
Display.getDefault().asyncExec(new Thread() {
public void run() {
if (getXulRunnerEditor() != null)
- getXulRunnerEditor().showSelectionRectangle();
+ getXulRunnerEditor().redrawSelectionRectangle();
}
});
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2011-02-07
13:39:49 UTC (rev 29047)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2011-02-07
14:25:37 UTC (rev 29048)
@@ -89,10 +89,8 @@
selectionLength = NodesManagingUtil.getNodeLength(selectionData.getSourceNode());
}
/*************** Apply selection to views *****************************/
- // set source selection
SelectionUtil.setSourceSelection(getPageContext(), selectionData.getSourceNode(),
selectionOffset, selectionLength);
- // paint visual selection
getPageContext().getVisualBuilder().setSelectionRectangle(
selectionData.getVisualNode());
}
@@ -113,11 +111,9 @@
selectionLength = NodesManagingUtil.getNodeLength(selectionData.getSourceNode());
}
/*************** Apply selection to views *****************************/
- SelectionUtil.clearSelection(selectionController);
SelectionUtil.setSourceSelection(getPageContext(),
selectionData.getSourceNode(),
selectionOffset, selectionLength);
- // paint selection rectangle
getPageContext().getVisualBuilder().setSelectionRectangle(
selectionData.getVisualNode());
}
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 2011-02-07
13:39:49 UTC (rev 29047)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2011-02-07
14:25:37 UTC (rev 29048)
@@ -1405,36 +1405,6 @@
* org.mozilla.interfaces.nsIDOMNode,
* org.jboss.tools.vpe.editor.mapping.VpeElementMapping)
*/
- /**
- * Open bundle.
- *
- * @param visualNode the visual node
- * @param pageContext the page context
- * @param elementMapping the element mapping
- *
- * @return true, if open bundle
- */
- public boolean openBundle(VpePageContext pageContext,
- nsIDOMNode visualNode, VpeElementMapping elementMapping) {
-
- nsIDOMNode lastSelectedNode = SelectionUtil
- .getLastSelectedNode(pageContext);
-
- if (elementMapping == null)
- return false;
-
- NodeData nodeData = getNodeData(lastSelectedNode, elementMapping
- .getElementData(), pageContext.getDomMapping());
-
- if (nodeData != null && nodeData.getSourceNode() != null
- && nodeData.getSourceNode().getNodeValue() != null)
- return pageContext.getBundle().openBundle(
- nodeData.getSourceNode().getNodeValue(),
- VpeNodesManagingUtil.getPageLocale(pageContext, nodeData
- .getSourceNode()));
-
- return false;
- }
public boolean isInvisible() {
return invisible;
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 2011-02-07
13:39:49 UTC (rev 29047)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2011-02-07
14:25:37 UTC (rev 29048)
@@ -432,16 +432,6 @@
public boolean canModify();
public void setModify(boolean modify);
-
- /**
- * open bundle
- *
- * @param pageContext
- * @param visualNod
- * @return
- */
- public boolean openBundle(VpePageContext pageContext,
- nsIDOMNode visualNode, VpeElementMapping elementMapping);
/**
*
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-07
13:39:49 UTC (rev 29047)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-02-07
14:25:37 UTC (rev 29048)
@@ -112,7 +112,7 @@
*/
if (getBrowser() != null && !getBrowser().isDisposed()) {
showResizer();
- showSelectionRectangle();
+ redrawSelectionRectangle();
}
}
});
@@ -255,18 +255,6 @@
return lastSelectedNode;
}
- // /**
- // * Function created to restore functionality of MozillaBrowser
- // * @return
- // */
- // private void setLastSelectedElement(nsIDOMElement lastSelectedElement) {
- // this.lastSelectedElement = lastSelectedElement;
- // }
-
- private void setLastSelectedNode(nsIDOMNode lastSelectedNode) {
- this.lastSelectedNode = lastSelectedNode;
- }
-
/**
* Draws rectangle around the element.
*
@@ -278,14 +266,14 @@
if (getFlasher() == null) {
return;
}
- setLastSelectedNode(node);
+ this.lastSelectedNode = node;
nsIDOMElement element = getLastSelectedElement();
if (element != null) {
repaint();
scrollToElement(element);
}
- showSelectionRectangle();
+ redrawSelectionRectangle();
if (xulRunnerVpeResizer != null) {
if (element != null && resizerConstrains != 0) {
@@ -420,7 +408,7 @@
}
}
- public void showSelectionRectangle() {
+ public void redrawSelectionRectangle() {
nsIDOMElement element = getLastSelectedElement();
if (element != null) {
if (isVisible(element)) {
@@ -515,7 +503,7 @@
private class VisualPaintListener implements PaintListener {
public void paintControl(PaintEvent e) {
- showSelectionRectangle();
+ redrawSelectionRectangle();
}
}