Author: svasilyev
Date: 2007-10-10 10:09:31 -0400 (Wed, 10 Oct 2007)
New Revision: 4095
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCopyCreator.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1034
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -10,27 +10,52 @@
******************************************************************************/
package org.jboss.tools.vpe;
+import org.eclipse.core.runtime.Platform;
+
public class VpeDebug {
- public static final boolean printSourceMutationEvent = false;
- public static final boolean printSourceSelectionEvent = false;
- public static final boolean printSourceModelLifecycleEvent = false;
+ public static final boolean PRINT_SOURCE_MUTATION_EVENT;
+ public static final boolean PRINT_SOURCE_SELECTION_EVENT;
+ public static final boolean PRINT_SOURCE_MODEL_LIFECYCLE_EVENT;
- public static final boolean printVisualMutationEvent = false;
- public static final boolean printVisualSelectionEvent = false;
- public static final boolean printVisualContextMenuEvent = false;
- public static final boolean printVisualMouseEvent = false;
- public static final boolean printVisualDragDropEvent = false;
- public static final boolean printVisualKeyEvent = false;
- public static final boolean printVisualInnerDragDropEvent = false;
+ public static final boolean PRINT_VISUAL_MUTATION_EVENT;
+ public static final boolean PRINT_VISUAL_SELECTION_EVENT;
+ public static final boolean PRINT_VISUAL_CONTEXTMENU_EVENT;
+ public static final boolean PRINT_VISUAL_MOUSE_EVENT;
+ public static final boolean PRINT_VISUAL_DRAGDROP_EVENT;
+ public static final boolean PRINT_VISUAL_KEY_EVENT;
+ public static final boolean PRINT_VISUAL_INNER_DRAGDROP_EVENT;
- public static final boolean visualAddPseudoElement = false;
+ public static final boolean VISUAL_ADD_PSEUDO_ELEMENT;
- public static final boolean visualContextMenuDumpSource = false;
- public static final boolean visualContextMenuDumpMapping = false;
+ public static final boolean VISUAL_CONTEXTMENU_DUMP_SOURCE;
+ public static final boolean VISUAL_CONTEXTMENU_DUMP_MAPPING;
- public static final boolean visualContextMenuTest = false;
+ public static final boolean VISUAL_CONTEXTMENU_TEST;
// usePrintStackTrace = false - The exception is sent on our site
// usePrintStackTrace = true - The exception is printed through printStackTrace
- public static final boolean usePrintStackTrace = false;
+ public static final boolean USE_PRINT_STACK_TRACE;
+
+ static {
+ PRINT_SOURCE_MUTATION_EVENT =
"true".equals(Platform.getDebugOption("/debug/source/mutation_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_SOURCE_SELECTION_EVENT =
"true".equals(Platform.getDebugOption("/debug/source/selection_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_SOURCE_MODEL_LIFECYCLE_EVENT =
"true".equals(Platform.getDebugOption("/debug/source/model_lifecycle_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+
+ PRINT_VISUAL_MUTATION_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/mutation_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_VISUAL_SELECTION_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/selection_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_VISUAL_CONTEXTMENU_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/contextmenu_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_VISUAL_MOUSE_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/mouse_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_VISUAL_DRAGDROP_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/dragdrop_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+ PRINT_VISUAL_KEY_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/key_event")); //
$NON-NSL-1$ // $NON-NSL-1$
+ PRINT_VISUAL_INNER_DRAGDROP_EVENT =
"true".equals(Platform.getDebugOption("/debug/visual/inner_dragdrop_event"));
// $NON-NSL-1$ // $NON-NSL-1$
+
+ VISUAL_ADD_PSEUDO_ELEMENT =
"true".equals(Platform.getDebugOption("/debug/visual/add_pseudo_element"));
// $NON-NSL-1$ // $NON-NSL-1$
+
+ VISUAL_CONTEXTMENU_DUMP_SOURCE =
"true".equals(Platform.getDebugOption("/debug/visual/contextmenu/dump_source"));
// $NON-NSL-1$ // $NON-NSL-1$
+ VISUAL_CONTEXTMENU_DUMP_MAPPING =
"true".equals(Platform.getDebugOption("/debug/visual/contextmenu/dump_mapping"));
// $NON-NSL-1$ // $NON-NSL-1$
+
+ VISUAL_CONTEXTMENU_TEST =
"true".equals(Platform.getDebugOption("/debug/visual/contextmenu/show_test"));
// $NON-NSL-1$ // $NON-NSL-1$
+
+ USE_PRINT_STACK_TRACE =
"true".equals(Platform.getDebugOption("/debug/use_PrintStackTrace"));
// $NON-NSL-1$ // $NON-NSL-1$
+ }
}
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -95,7 +95,7 @@
// }
public static void reportProblem(Exception throwable) {
- if (VpeDebug.usePrintStackTrace) {
+ if (VpeDebug.USE_PRINT_STACK_TRACE) {
throwable.printStackTrace();
} else {
ProblemReportingHelper.reportProblem(PLUGIN_ID, throwable);
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -327,7 +327,7 @@
// if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
// return;
// }
- if (VpeDebug.printSourceMutationEvent) {
+ if (VpeDebug.PRINT_SOURCE_MUTATION_EVENT) {
printSourceEvent(notifier, eventType, feature, oldValue, newValue, pos);
}
if(visualBuilder==null) {
@@ -416,7 +416,7 @@
List<?> nodes = event.getSelectedNodes();
if (nodes != null && nodes.size() > 0) {
Node sourceNode = (Node)nodes.get(0);
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(">>>>>>>>>>>>>>
nodeSelectionChanged sourceNode: " + sourceNode.getNodeName() + " " +
event.getCaretPosition()); //$NON-NLS-1$ //$NON-NLS-2$
}
if (event.getSource() instanceof IContentOutlinePage) {
@@ -432,7 +432,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(">>>>>>>>>>>>>>
textSelectionChanged " + event.getSource()); //$NON-NLS-1$
}
// if (event.getSource() instanceof StyledText) {
@@ -446,7 +446,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(">>>>>>>>>>>>>>
widgetSelected"); //$NON-NLS-1$
}
if (event.getSource() instanceof StyledText) {
@@ -456,7 +456,7 @@
}
public void widgetDefaultSelected(SelectionEvent event) {
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(">>>>>>>>>>>>>>
widgetDefaultSelected"); //$NON-NLS-1$
}
}
@@ -490,7 +490,7 @@
anchorOffset = focusOffset;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println("sourceSelectionChanged"); //$NON-NLS-1$
System.out.println(" anchorNode: " + anchorNode.getNodeName()
+ " anchorOffset: " + anchorOffset); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(" focusNode: " + focusNode.getNodeName() +
" focusOffset: " + focusOffset + " focusPosition: " +
focusPosition); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -556,7 +556,7 @@
anchorOffset = focusOffset;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println("sourceSelectionChanged1"); //$NON-NLS-1$
System.out.println(" anchorNode: " + anchorNode.getNodeName()
+ " anchorOffset: " + anchorOffset); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(" focusNode: " + focusNode.getNodeName() +
" focusOffset: " + focusOffset + " focusPosition: " +
focusPosition); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -603,7 +603,7 @@
return;
}
if (event.getType() == ModelLifecycleEvent.MODEL_RELEASED) {
- if (VpeDebug.printSourceModelLifecycleEvent) {
+ if (VpeDebug.PRINT_SOURCE_MODEL_LIFECYCLE_EVENT) {
System.out.println(">>> processPostModelEvent: " +
event.toString()); //$NON-NLS-1$
}
visualBuilder.setSelectionRectangle(null);
@@ -626,7 +626,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -636,7 +636,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
nsIDOMNode targetNode = mutationEvent.getRelatedNode();
@@ -651,7 +651,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
nsIDOMNode targetNode = VisualDomUtil.getTargetNode(mutationEvent);
@@ -667,7 +667,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -677,7 +677,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -687,7 +687,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -698,7 +698,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
nsIDOMNode targetNode = VisualDomUtil.getTargetNode(mutationEvent);
@@ -711,7 +711,7 @@
if (switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
mouseUpSelectionReasonFlag = (reason & nsISelectionListener.MOUSEUP_REASON) >
0;
if (mouseUpSelectionReasonFlag || reason == nsISelectionListener.NO_REASON || reason
== nsISelectionListener.KEYPRESS_REASON || reason == nsISelectionListener.SELECTALL_REASON
|| (reason & nsISelectionListener.MOUSEDOWN_REASON) > 0) {
- if (VpeDebug.printVisualSelectionEvent) {
+ if (VpeDebug.PRINT_VISUAL_SELECTION_EVENT) {
System.out.println("<<< notifySelectionChanged: " + reason);
//$NON-NLS-1$
}
selectionBuilder.setSelection(selection);
@@ -739,7 +739,7 @@
return;
}
nsIDOMElement visualDragElement = selectionBuilder.getDragElement(mouseEvent);
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
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$
}
@@ -757,7 +757,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseUp"); //$NON-NLS-1$
}
if (mouseDownSelectionFlag) {
@@ -776,7 +776,7 @@
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
if (visualNode != null) {
if (!mouseUpSelectionReasonFlag) {
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseClick visualNode: " +
visualNode.getNodeName() + " (" + visualNode + ")"); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
}
if (visualBuilder.isContentArea(visualNode)) {
@@ -805,7 +805,7 @@
if (!sourceBuilder.openBundleEditors(visualNode)) {
sourceBuilder.openIncludeEditor(visualNode);
}
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseDblClick visualNode: " +
visualNode.getNodeName() + " (" + visualNode + ")"); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
}
}
@@ -818,7 +818,7 @@
}
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
if (visualNode != null) {
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseMove visualNode: " +
visualNode.getNodeName() + " (" + visualNode + ")");
}
visualBuilder.setMoveCursor(mouseEvent);
@@ -827,7 +827,7 @@
}
public void keyPress(nsIDOMKeyEvent keyEvent) {
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println("<<< keyPress type: " + keyEvent.getType() +
" Ctrl: " + keyEvent.getCtrlKey() + " Shift: " +
keyEvent.getShiftKey() + " CharCode: " + keyEvent.getCharCode() + "
KeyCode: " + keyEvent.getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$ //$NON-NLS-5$
}
@@ -1054,7 +1054,7 @@
});
}
- if (VpeDebug.visualContextMenuDumpSource) {
+ if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_SOURCE) {
manager.add(new Action("Dump Source") { //$NON-NLS-1$
public void run() {
DOMTreeDumper dumper = new DOMTreeDumper();
@@ -1063,7 +1063,7 @@
});
}
- if (VpeDebug.visualContextMenuDumpMapping) {
+ if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_MAPPING) {
manager.add(new Action("Dump Mapping") { //$NON-NLS-1$
public void run() {
printMapping();
@@ -1071,7 +1071,7 @@
});
}
- if (VpeDebug.visualContextMenuTest) {
+ if (VpeDebug.VISUAL_CONTEXTMENU_TEST) {
manager.add(new VpeAction("Test", node) { //$NON-NLS-1$
public void run() {
test(actionNode);
@@ -1729,13 +1729,13 @@
}
public void dragEnter(nsIDOMEvent event) {
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println("<<<<<<<<<<<<<<<<<<<<
DragEnter"); //$NON-NLS-1$
}
}
public void dragExit(nsIDOMEvent event) {
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println("<<<<<<<<<<<<<<<<<<<<
dragExit"); //$NON-NLS-1$
}
// TODO Sergey Vasilyev figure out with drag caret
@@ -1752,7 +1752,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println("<<<<<<<<<<<<<<<<<<<<
dragOver"); //$NON-NLS-1$
}
@@ -1783,14 +1783,14 @@
}
public void drop(nsIDOMEvent event) {
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println("<<< outerDrop"); //$NON-NLS-1$
}
event.preventDefault();
}
public void _drop(nsIDOMEvent event) {
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println("<<<<<<<<<<<<<<<<<<<<
dragDrop"); //$NON-NLS-1$
}
boolean canDrop = !xulRunnerEditor.isMozillaDragFlavor();
@@ -1808,7 +1808,7 @@
caretInfo.showCaret();
caretInfo.hideCaret();
Point range = caretInfo.getSourceSelectionRange();
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println(" Drop Position: " + range.x +
" " + range.y); //$NON-NLS-1$ //$NON-NLS-2$
}
VpeDndUtil.drop((IModelObjectEditorInput)sourceEditor.getEditorInput(),
(ISourceViewer)sourceEditor.getAdapter(ISourceViewer.class), new
VpeSelectionProvider(range.x, range.y));
@@ -1824,7 +1824,7 @@
public boolean canInnerDrag(nsIDOMMouseEvent event) {
onHideTooltip();
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
}
if (innerDragInfo != null) {
@@ -1835,7 +1835,7 @@
VpeVisualInnerDragInfo dragInfo = selectionBuilder.getInnerDragInfo(event);
if (dragInfo != null) {
nsIDOMNode dragNode = dragInfo.getNode();
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print(" dragNode: " + dragNode.getNodeName() + "(" +
dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
switch (dragNode.getNodeType()) {
@@ -1862,7 +1862,7 @@
dragInfo.Release();
}
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
}
return canDrag;
@@ -1893,7 +1893,7 @@
return null;
}
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
}
boolean canDrop = false;;
@@ -1902,7 +1902,7 @@
if (innerDragInfo != null) {
VpeVisualInnerDropInfo visualDropInfo = selectionBuilder.getInnerDropInfo(event);
if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print(" x: " + visualDropInfo.getMouseX() + " y: "
+ visualDropInfo.getMouseY() + //$NON-NLS-1$ //$NON-NLS-2$
" container: " + visualDropInfo.getDropContainer().getNodeName() +
//$NON-NLS-1$
"(" + visualDropInfo.getDropContainer() + ")" + //$NON-NLS-1$
//$NON-NLS-2$
@@ -1924,7 +1924,7 @@
}
visualDropInfo.Release();
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
}
return new MozillaDropInfo(canDrop, caretParent, caretOffset);
@@ -1933,13 +1933,13 @@
public void innerDrop(nsIDOMMouseEvent event) {
onHideTooltip();
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
}
if (innerDragInfo != null) {
VpeVisualInnerDropInfo visualDropInfo = selectionBuilder.getInnerDropInfo(event);
if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print(" container: " +
visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
"(" + visualDropInfo.getDropContainer() + ")" + //$NON-NLS-1$
//$NON-NLS-2$
" offset: " + visualDropInfo.getDropOffset()); //$NON-NLS-1$
@@ -1962,7 +1962,7 @@
}
}
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println();
}
}
@@ -2040,7 +2040,7 @@
VpePlugin.reportProblem(ex);
}
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println(" canDrop: " + canDrop + (canDrop ? " container:
" + caretParent.getNodeName() + " offset: " + caretOffset :
"")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
return new MozillaDropInfo(canDrop, caretParent, caretOffset);
@@ -2116,7 +2116,7 @@
}
if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println(" drop! container: " +
visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
externalDropAny(flavor, data, range, sourceDropInfo ==
null?null:sourceDropInfo.getContainer());
@@ -2299,7 +2299,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(">>>>>>>>>>>>>>
selectionChanged " + event.getSource()); //$NON-NLS-1$
}
sourceSelectionChanged();
@@ -2325,7 +2325,7 @@
}
if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println(" drop! container: " +
visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
final String finalFlavor = flavor;
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -83,7 +83,7 @@
if (visualSelectedNode == null) {
visualSelectedNode = visualNode;
}
- if (VpeDebug.printVisualSelectionEvent) {
+ if (VpeDebug.PRINT_VISUAL_SELECTION_EVENT) {
System.out.println(" visualNode: " + visualSelectedNode.getNodeName()
+ "(" + visualSelectedNode + ") sourceNode: " + (sourceNode == null ?
null : sourceNode.getNodeName()) + " node: " + node);
}
if (sourceNode != null) {
@@ -335,7 +335,7 @@
}
Node setContextMenuSelection(nsIDOMNode visualNode) {
- if (VpeDebug.printVisualContextMenuEvent) {
+ if (VpeDebug.PRINT_VISUAL_CONTEXTMENU_EVENT) {
System.out.println(">>>>>>>>>>>>>>
onShowContextMenu visualNode: " + visualNode.getNodeName() + "(" +
visualNode + ")");
}
visualSelectionController.setCaretEnabled(false);
@@ -647,7 +647,7 @@
visualAnchorOffset = VisualDomUtil.getOffset(visualAnchorNode);
if (!anchorStartFlag) visualAnchorOffset++;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println("setVisualSelection");
System.out.println(" visualAnchorNode: " +
visualAnchorNode.getNodeName() + "(" + visualAnchorNode + ")
visualAnchorContainer: " + visualAnchorContainer.getNodeName() + "(" +
visualAnchorContainer + ") visualAnchorOffset: " + visualAnchorOffset + "
anchorStartFlag: " + anchorStartFlag);
}
@@ -689,7 +689,7 @@
visualFocusOffset = VisualDomUtil.getOffset(visualFocusNode);
if (!focusStartFlag) visualFocusOffset++;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(" visualFocusNode: " +
(visualFocusNode != null ?
visualFocusNode.getNodeName() + "(" + visualFocusNode + ")" :
null) +
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -652,7 +652,7 @@
private void addPseudoElementImpl(nsIDOMNode visualParent) {
if (!templateManager.isWithoutPseudoElementContainer(visualParent
.getNodeName())) {
- if (VpeDebug.visualAddPseudoElement) {
+ if (VpeDebug.VISUAL_ADD_PSEUDO_ELEMENT) {
System.out.println("-------------------- addPseudoElement: "
+ visualParent.getNodeName());
}
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -96,7 +96,7 @@
} else {
handled = nonctrlKeyPressHandler(keyEvent);
}
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println(" handled: " + handled);
}
if (handled) {
@@ -255,7 +255,7 @@
}
Node focusNode = selection.getFocusNode();
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println(">>> 1. VpeVisualKeyHandler.deleteRight():
focusNode = " + focusNode + " | focusOffset = " +
selection.getFocusOffset());
}
if (focusNode != null) {
@@ -523,7 +523,7 @@
}
Node focusNode = selection.getFocusNode();
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println(">>> 1. VpeVisualKeyHandler.deleteLeft():
focusNode = " + focusNode + " | focusOffset = " +
selection.getFocusOffset());
}
if (focusNode != null) {
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -367,7 +367,7 @@
List newTaglibs = getTagLibs();
List delTaglibs = new ArrayList();
if (buildTaglibsDifferences(newTaglibs, delTaglibs)) {
- if (VpeDebug.printSourceMutationEvent) {
+ if (VpeDebug.PRINT_SOURCE_MUTATION_EVENT) {
System.out.println(">>> TaglibsChanged");
}
for (int i = 0; i < taglibListeners.length; i++) {
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCopyCreator.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCopyCreator.java 2007-10-10
14:00:39 UTC (rev 4094)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCopyCreator.java 2007-10-10
14:09:31 UTC (rev 4095)
@@ -17,7 +17,6 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilder;
-import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -113,7 +112,7 @@
public void setAttribute(VpePageContext pageContext, Element sourceElement,
Map visualNodeMap, String name, String value) {
if (isAttribute(name)) {
- Element visualElement = (Element) visualNodeMap.get(this);
+ nsIDOMElement visualElement = (nsIDOMElement) visualNodeMap.get(this);
visualElement.setAttribute(name, value);
}
}