JBoss Tools SVN: r4071 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2007-10-09 03:16:52 -0400 (Tue, 09 Oct 2007)
New Revision: 4071
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.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/VpeSelectionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1034
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2007-10-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -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: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2007-10-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -82,7 +82,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: 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-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -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) {
@@ -412,7 +412,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) {
@@ -427,7 +427,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) {
@@ -441,7 +441,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) {
@@ -451,7 +451,7 @@
}
public void widgetDefaultSelected(SelectionEvent event) {
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(">>>>>>>>>>>>>> widgetDefaultSelected"); //$NON-NLS-1$
}
}
@@ -485,7 +485,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$
@@ -551,7 +551,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$
@@ -598,7 +598,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);
@@ -621,7 +621,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -631,7 +631,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
Node targetNode = mutationEvent.getTargetNode();
@@ -648,7 +648,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
Node targetNode = mutationEvent.getTargetNode();
@@ -665,7 +665,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -675,7 +675,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -685,7 +685,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
switcher.stopActiveEditor();
@@ -696,7 +696,7 @@
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
- if (VpeDebug.printVisualMutationEvent) {
+ if (VpeDebug.PRINT_VISUAL_MUTATION_EVENT) {
printVisualEvent(mutationEvent);
}
Node targetNode = mutationEvent.getTargetNode();
@@ -710,7 +710,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);
@@ -740,7 +740,7 @@
return;
}
Element visualDragElement = selectionBuilder.getDragElement(mouseEvent);
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
Node visualNode = mouseEvent.getTargetNode();
System.out.println("<<< mouseDown targetNode: " + visualNode.getNodeName() + " (" + MozillaSupports.getAddress(visualNode) + ") selectedElement: " + (visualDragElement != null ? visualDragElement.getNodeName() + " (" + MozillaSupports.getAddress(visualDragElement) + ")" : null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
@@ -758,7 +758,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 @@
Node visualNode = mouseEvent.getTargetNode();
if (visualNode != null) {
if (!mouseUpSelectionReasonFlag) {
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseClick visualNode: " + visualNode.getNodeName() + " (" + MozillaSupports.getAddress(visualNode) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
if (visualBuilder.isContentArea(visualNode)) {
@@ -807,7 +807,7 @@
if (!sourceBuilder.openBundleEditors(visualNode)) {
sourceBuilder.openIncludeEditor(visualNode);
}
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseDblClick visualNode: " + visualNode.getNodeName() + " (" + MozillaSupports.getAddress(visualNode) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
@@ -820,7 +820,7 @@
}
Node visualNode = mouseEvent.getTargetNode();
if (visualNode != null) {
- if (VpeDebug.printVisualMouseEvent) {
+ if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
System.out.println("<<< mouseMove visualNode: " + visualNode.getNodeName() + " (" + MozillaSupports.getAddress(visualNode) + ")");
}
visualBuilder.setMoveCursor(mouseEvent);
@@ -829,7 +829,7 @@
}
public void _keyPress(nsIDOMKeyEvent keyEvent) {
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println("<<< keyPress type: " + keyEvent.getType() + " Ctrl: " + keyEvent.isCtrlKey() + " Shift: " + keyEvent.isShiftKey() + " CharCode: " + keyEvent.getCharCode() + " KeyCode: " + keyEvent.getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
@@ -852,7 +852,7 @@
}
public void keyPress(nsIDOMKeyEvent keyEvent) {
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println("<<< keyPress type: " + keyEvent.getType() + " Ctrl: " + keyEvent.isCtrlKey() + " Shift: " + keyEvent.isShiftKey() + " CharCode: " + keyEvent.getCharCode() + " KeyCode: " + keyEvent.getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
@@ -1117,7 +1117,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();
@@ -1126,7 +1126,7 @@
});
}
- if (VpeDebug.visualContextMenuDumpMapping) {
+ if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_MAPPING) {
manager.add(new Action("Dump Mapping") { //$NON-NLS-1$
public void run() {
printMapping();
@@ -1134,7 +1134,7 @@
});
}
- if (VpeDebug.visualContextMenuTest) {
+ if (VpeDebug.VISUAL_CONTEXTMENU_TEST) {
manager.add(new VpeAction("Test", node) { //$NON-NLS-1$
public void run() {
test(actionNode);
@@ -1784,13 +1784,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$
}
browser.hideDragCaret();
@@ -1805,7 +1805,7 @@
// isFlavor = dragSession.isDataFlavorSupported(nsITransferable.kUnicodeMime);
// isFlavor = dragSession.isDataFlavorSupported(nsITransferable.kNativeHTMLMime);
- if (VpeDebug.printVisualDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
System.out.println("<<< outerDragOver isFlavor: " + isFlavor); //$NON-NLS-1$
}
@@ -1847,7 +1847,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$
}
@@ -1878,14 +1878,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 = !browser.isMozillaDragFlaver();
@@ -1903,7 +1903,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));
@@ -1922,7 +1922,7 @@
// }
onHideTooltip();
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
}
@@ -1937,7 +1937,7 @@
if (dragInfo != null) {
Node dragNode = dragInfo.getNode();
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print(" dragNode: " + dragNode.getNodeName() + "(" + MozillaSupports.getAddress(dragNode) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -1974,7 +1974,7 @@
}
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
}
@@ -2011,7 +2011,7 @@
return null;
}
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
}
boolean canDrop = false;;
@@ -2020,7 +2020,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$
"(" + MozillaSupports.getAddress(visualDropInfo.getDropContainer()) + ")" + //$NON-NLS-1$ //$NON-NLS-2$
@@ -2042,7 +2042,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);
@@ -2051,13 +2051,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$
"(" + MozillaSupports.getAddress(visualDropInfo.getDropContainer()) + ")" + //$NON-NLS-1$ //$NON-NLS-2$
" offset: " + visualDropInfo.getDropOffset()); //$NON-NLS-1$
@@ -2086,7 +2086,7 @@
}
//visualDropInfo.Release();
}
- if (VpeDebug.printVisualInnerDragDropEvent) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.println();
}
}
@@ -2174,7 +2174,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);
@@ -2250,7 +2250,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());
@@ -2435,7 +2435,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();
@@ -2461,7 +2461,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: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-10-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -86,7 +86,7 @@
if (visualSelectedNode == null) {
visualSelectedNode = visualNode;
}
- if (VpeDebug.printVisualSelectionEvent) {
+ if (VpeDebug.PRINT_VISUAL_SELECTION_EVENT) {
System.out.println(" visualNode: " + visualSelectedNode.getNodeName() + "(" + MozillaSupports.getAddress(visualSelectedNode) + ")(" + MozillaSupports.getRefCount(visualSelectedNode) + ") sourceNode: " + (sourceNode == null ? null : sourceNode.getNodeName()) + " node: " + node);
}
if (sourceNode != null) {
@@ -343,7 +343,7 @@
}
Node setContextMenuSelection(Node visualNode) {
- if (VpeDebug.printVisualContextMenuEvent) {
+ if (VpeDebug.PRINT_VISUAL_CONTEXTMENU_EVENT) {
System.out.println(">>>>>>>>>>>>>> onShowContextMenu visualNode: " + visualNode.getNodeName() + "(" + MozillaSupports.getAddress(visualNode) + ")");
}
visualSelectionController.setCaretEnabled(false);
@@ -674,7 +674,7 @@
visualAnchorOffset = MozillaSupports.getOffset(visualAnchorNode);
if (!anchorStartFlag) visualAnchorOffset++;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println("setVisualSelection");
System.out.println(" visualAnchorNode: " + visualAnchorNode.getNodeName() + "(" + MozillaSupports.getAddress(visualAnchorNode) + ") visualAnchorContainer: " + visualAnchorContainer.getNodeName() + "(" + MozillaSupports.getAddress(visualAnchorContainer) + ") visualAnchorOffset: " + visualAnchorOffset + " anchorStartFlag: " + anchorStartFlag);
}
@@ -717,7 +717,7 @@
visualFocusOffset = MozillaSupports.getOffset(visualFocusNode);
if (!focusStartFlag) visualFocusOffset++;
}
- if (VpeDebug.printSourceSelectionEvent) {
+ if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
System.out.println(" visualFocusNode: " +
(visualFocusNode != null ?
visualFocusNode.getNodeName() + "(" + MozillaSupports.getAddress(visualFocusNode) + ")" : null) +
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-10-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -636,7 +636,7 @@
private void addPseudoElementImpl(Node visualParent) {
if (!templateManager.isWithoutPseudoElementContainer(visualParent.getNodeName())) {
- if (VpeDebug.visualAddPseudoElement) {
+ if (VpeDebug.VISUAL_ADD_PSEUDO_ELEMENT) {
System.out.println("-------------------- addPseudoElement: " + visualParent.getNodeName());
}
Element visualPseudoElement = visualDocument.createElement(PSEUDO_ELEMENT);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2007-10-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -90,7 +90,7 @@
} else {
handled = nonctrlKeyPressHandler(keyEvent);
}
- if (VpeDebug.printVisualKeyEvent) {
+ if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
System.out.println(" handled: " + handled);
}
if (handled) {
@@ -249,7 +249,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) {
@@ -518,7 +518,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: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2007-10-09 00:56:31 UTC (rev 4070)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2007-10-09 07:16:52 UTC (rev 4071)
@@ -366,7 +366,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++) {
17 years, 3 months
JBoss Tools SVN: r4070 - in trunk/documentation/qa: reports and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-10-08 20:56:31 -0400 (Mon, 08 Oct 2007)
New Revision: 4070
Added:
trunk/documentation/qa/reports/
trunk/documentation/qa/reports/Regression_report10082007.zip
trunk/documentation/qa/reports/smoke-04.10.2007-linux.doc
trunk/documentation/qa/reports/smoke-04.10.2007-windows.doc
trunk/documentation/qa/reports/smoke-13.09.2007.zip
trunk/documentation/qa/reports/smoke-24.09.2007.zip
Log:
Reports renamed to reports to keep folders namin in the same style
Added: trunk/documentation/qa/reports/Regression_report10082007.zip
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/reports/Regression_report10082007.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/reports/smoke-04.10.2007-linux.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/reports/smoke-04.10.2007-linux.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/reports/smoke-04.10.2007-windows.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/reports/smoke-04.10.2007-windows.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/reports/smoke-13.09.2007.zip
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/reports/smoke-13.09.2007.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/reports/smoke-24.09.2007.zip
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/reports/smoke-24.09.2007.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months
JBoss Tools SVN: r4069 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-10-08 20:55:55 -0400 (Mon, 08 Oct 2007)
New Revision: 4069
Added:
trunk/documentation/qa/Reports1/
Log:
Reports renamed to reports to keep folders namin in the same style
Copied: trunk/documentation/qa/Reports1 (from rev 4067, trunk/documentation/qa/Reports)
17 years, 3 months
JBoss Tools SVN: r4067 - in trunk/seam/plugins/org.jboss.tools.seam.text.ext: src/org/jboss/tools/seam/text/ext/hyperlink and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-10-08 14:30:55 -0400 (Mon, 08 Oct 2007)
New Revision: 4067
Added:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.properties
trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml
Log:
http://jira.jboss.org/jira/browse/JBIDE-1038 Ctrl click navigation for #{} EL expressions in Java Strings
Seam EL hyperlink and detector are added for Java strings
Detector registration is done over plugin.xml
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.properties 2007-10-08 16:55:53 UTC (rev 4066)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.properties 2007-10-08 18:30:55 UTC (rev 4067)
@@ -1 +1,2 @@
providerName=Red Hat, Inc.
+SeamELInJavaStringHyperlinkDetector= Seam EL in Java String
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml 2007-10-08 16:55:53 UTC (rev 4066)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml 2007-10-08 18:30:55 UTC (rev 4067)
@@ -61,4 +61,14 @@
</hyperlink>
</extension>
+ <extension
+ point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
+ <hyperlinkDetector
+ class="org.jboss.tools.seam.text.ext.hyperlink.SeamELInJavaStringHyperlinkDetector"
+ id="org.jboss.tools.seam.text.ext.hyperlink.SeamELInJavaStringHyperlinkDetector"
+ name="%SeamELInJavaStringHyperlinkDetector"
+ targetId="org.eclipse.jdt.ui.javaCode">
+ </hyperlinkDetector>
+ </extension>
+
</plugin>
Added: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2007-10-08 18:30:55 UTC (rev 4067)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.text.ext.hyperlink;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.jboss.tools.seam.text.ext.SeamExtPlugin;
+
+public class SeamELInJavaStringHyperlink implements IHyperlink {
+
+ private final IRegion fRegion;
+ private final IJavaElement[] fElements;
+
+ /**
+ * Creates a new Seam EL in Java string hyperlink.
+ */
+ SeamELInJavaStringHyperlink(IRegion region, IJavaElement[] elements) {
+ Assert.isNotNull(region);
+ Assert.isNotNull(elements);
+
+ fRegion = region;
+ fElements = elements;
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkRegion()
+ * @since 3.1
+ */
+ public IRegion getHyperlinkRegion() {
+ return fRegion;
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#open()
+ * @since 3.1
+ */
+ public void open() {
+ try {
+ IEditorPart part = null;
+ for (int i = 0; fElements != null && i < fElements.length; i++) {
+ part = JavaUI.openInEditor(fElements[i]);
+ if (part != null) {
+ if (fElements[i] != null)
+ JavaUI.revealInEditor(part, fElements[i]);
+ break;
+ }
+ }
+
+ } catch (PartInitException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ } catch (JavaModelException e) {
+ // Ignore. It is probably because of Java element is not found
+ }
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getTypeLabel()
+ * @since 3.1
+ */
+ public String getTypeLabel() {
+ return null;
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
+ * @since 3.1
+ */
+ public String getHyperlinkText() {
+ return null;
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2007-10-08 18:30:55 UTC (rev 4067)
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.text.ext.hyperlink;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlink;
+import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.jboss.tools.seam.text.ext.SeamExtPlugin;
+
+public class SeamELInJavaStringHyperlinkDetector extends
+ AbstractHyperlinkDetector {
+
+ public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
+ IRegion region, boolean canShowMultipleHyperlinks) {
+ ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
+ if (region == null || canShowMultipleHyperlinks || !(textEditor instanceof JavaEditor))
+ return null;
+
+ int offset= region.getOffset();
+
+ IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, false);
+ if (input == null)
+ return null;
+
+ IDocument document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ IRegion wordRegion = JavaWordFinder.findWord(document, offset);
+
+ if (wordRegion == null)
+ return null;
+
+ if (!checkStartPosition(document, offset))
+ return null;
+
+ IFile file = null;
+
+ try {
+ IResource resource = input.getCorrespondingResource();
+ if (resource instanceof IFile)
+ file = (IFile) resource;
+ } catch (JavaModelException e) {
+ // Ignore. It is probably because of Java element's resource is not found
+ }
+
+ IJavaElement[] elements = findJavaElements(document, file, wordRegion);
+ if (elements != null && elements.length > 0)
+ return new IHyperlink[] {new SeamELInJavaStringHyperlink(wordRegion, elements)};
+
+ return null;
+ }
+
+ public static IJavaElement[] findJavaElements(IDocument document, IFile file, IRegion region) {
+
+ IProject project = (file == null ? null : file.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return null;
+
+ SeamELCompletionEngine engine= new SeamELCompletionEngine();
+
+ String prefix= engine.getJavaElementExpression(document.get(), region.getOffset(), region);
+ prefix = (prefix == null ? "" : prefix);
+
+ List<IJavaElement> javaElements = null;
+
+ try {
+ javaElements = engine.getJavaElementsForExpression(
+ seamProject, file, prefix);
+ } catch (StringIndexOutOfBoundsException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ } catch (BadLocationException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ }
+
+ return javaElements == null ? new IJavaElement[0] : javaElements.toArray(new IJavaElement[0]);
+ }
+
+ /*
+ * Checks if the EL start starting characters are present
+ * @param viewer
+ * @param offset
+ * @return
+ * @throws BadLocationException
+ */
+ private boolean checkStartPosition(IDocument document, int offset) {
+ try {
+ while (--offset >= 0) {
+ if ('}' == document.getChar(offset))
+ return false;
+
+
+ if ('"' == document.getChar(offset) &&
+ (offset - 1) >= 0 && '\\' != document.getChar(offset - 1)) {
+ return false;
+ }
+
+
+ if ('{' == document.getChar(offset) &&
+ (offset - 1) >= 0 &&
+ ('#' == document.getChar(offset - 1) ||
+ '$' == document.getChar(offset - 1))) {
+ return true;
+ }
+ }
+ } catch (BadLocationException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ }
+ return false;
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
JBoss Tools SVN: r4066 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-08 12:55:53 -0400 (Mon, 08 Oct 2007)
New Revision: 4066
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta11.html
Log:
minor updates
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta11.html
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta11.html 2007-10-08 16:55:30 UTC (rev 4065)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta11.html 2007-10-08 16:55:53 UTC (rev 4066)
@@ -9,7 +9,7 @@
<h1>Hibernate Tools 3.2.0.beta11 - New and Noteworthy</h1>
- <p>Previous <a href="hibernate-eclipse-news-3.2.0.beta11.html">new and noteworthy for 3.2.0.beta11</a></p>
+ <p>Previous <a href="hibernate-eclipse-news-3.2.0.beta10.html">new and noteworthy for 3.2.0.beta10</a></p>
<p><a href="http://opensource.atlassian.com/projects/hibernate/secure/IssueNavigator....">Release notes</a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
<tr>
@@ -73,21 +73,6 @@
<tr>
- <td valign="top" align="left">
- <p align="right"><b></b></td>
- <td valign="top">
- <p>This release brings a "port" of Exadel Studio's entity diagram to Hibernate Tools. Right-Click on an entity and you get an option for "Open Mapping Diagram".</p>
-
-<p>This diagram shows your entities with relationships to its entities and how it is mapped to the database.</p>
-
-<p><img src="entitymappingdiagram.png"/></p>
-
-<p>Be warned that for large sets of classes the diagram might get too crowded! You can collapse/expand entities/tables and relationships as you want to get a better overview.</p>
-
-<p> </p>
- </td>
- </tr>
- <tr>
<td colspan="2">
<hr>
</td>
17 years, 3 months
JBoss Tools SVN: r4065 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-08 12:55:30 -0400 (Mon, 08 Oct 2007)
New Revision: 4065
Modified:
trunk/documentation/whatsnew/index.html
Log:
forgot about hibernate tools link
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2007-10-08 16:21:21 UTC (rev 4064)
+++ trunk/documentation/whatsnew/index.html 2007-10-08 16:55:30 UTC (rev 4065)
@@ -26,6 +26,7 @@
<p><a href="as/as-news-1.0.0.beta4.html">JBoss AS Tools</a></p>
<p><a href="seam/seam-news-1.0.0.beta2.html">Seam Tools</a></p>
<p><a href="jst/jst-news-1.0.0.beta2.html">JST Tools</a></p>
+ <p><a href="http://www.hibernate.org/hib_docs/tools/eclipse/newandnoteworthy/hibernat...">Hibernate Tools</a></p>
</td>
</tr>
<tr>
17 years, 3 months
JBoss Tools SVN: r4064 - trunk/documentation/qa/Reports.
by jbosstools-commits@lists.jboss.org
Author: anis
Date: 2007-10-08 12:21:21 -0400 (Mon, 08 Oct 2007)
New Revision: 4064
Added:
trunk/documentation/qa/Reports/Regression_report10082007.zip
Log:
Added a file remotely
Added: trunk/documentation/qa/Reports/Regression_report10082007.zip
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/Reports/Regression_report10082007.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months
JBoss Tools SVN: r4063 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-10-08 12:02:55 -0400 (Mon, 08 Oct 2007)
New Revision: 4063
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HTConstants.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java
Log:
JBIDE-983: Objects on diagram must have context menu
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2007-10-08 14:59:55 UTC (rev 4062)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2007-10-08 16:02:55 UTC (rev 4063)
@@ -12,6 +12,7 @@
import org.eclipse.ui.PartInitException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.VisualEditorPlugin;
import org.jboss.tools.hibernate.ui.veditor.editors.VisualEditor;
@@ -60,6 +61,9 @@
Table table = (Table)selectedElement;
resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, doc, configXMLFile, table);
+ } else if (selectedElement instanceof Subclass) {
+ Subclass rootClass = (Subclass)selectedElement;
+ resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, doc, configXMLFile, rootClass);
}
if (resource != null) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java 2007-10-08 14:59:55 UTC (rev 4062)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java 2007-10-08 16:02:55 UTC (rev 4063)
@@ -11,6 +11,7 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.RootClass;
import org.jboss.tools.hibernate.ui.veditor.VisualEditorPlugin;
import org.jboss.tools.hibernate.ui.veditor.editors.VisualEditor;
@@ -38,10 +39,13 @@
Iterator iterator = selectedElements.iterator();
while (iterator.hasNext()) {
- RootClass rootClass = (RootClass) iterator.next();
+ PersistentClass rootClass = (PersistentClass) iterator.next();
IResource resource = null;
String fullyQualifiedName = rootClass.getClassName();
+ if (fullyQualifiedName.indexOf("$") > 0) {
+ fullyQualifiedName = fullyQualifiedName.substring(0, fullyQualifiedName.indexOf("$"));
+ }
try {
resource = proj.findType(fullyQualifiedName).getResource();
} catch (JavaModelException e) {
@@ -64,7 +68,7 @@
Iterator iterator = selectedElements.iterator();
while (iterator.hasNext()) {
Object elem = iterator.next();
- if (elem instanceof RootClass) return true;
+ if (elem instanceof PersistentClass) return true;
}
return false;
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HTConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HTConstants.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HTConstants.java 2007-10-08 16:02:55 UTC (rev 4063)
@@ -0,0 +1,11 @@
+package org.jboss.tools.hibernate.ui.view.views;
+
+public class HTConstants {
+ public static String HIBERNATE_TAG_CLASS = "class";
+ public static String HIBERNATE_TAG_TABLE = "table";
+ public static String HIBERNATE_TAG_SUBCLASS = "subclass";
+ public static String HIBERNATE_TAG_NAME = "name";
+ public static String HIBERNATE_TAG_SESSION_FACTORY = "session-factory";
+ public static String HIBERNATE_TAG_MAPPING = "mapping";
+ public static String HIBERNATE_TAG_RESOURCE = "resource";
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java 2007-10-08 14:59:55 UTC (rev 4062)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java 2007-10-08 16:02:55 UTC (rev 4063)
@@ -33,7 +33,9 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.hibernate.util.StringHelper;
import org.hibernate.util.XMLHelper;
@@ -70,7 +72,9 @@
private static boolean elementInResource(ConsoleConfiguration consoleConfiguration, IResource resource, Object element) {
if (element instanceof RootClass) {
- return classInResource(consoleConfiguration, resource, (RootClass)element);
+ return rootClassInResource(consoleConfiguration, resource, (RootClass)element);
+ } else if (element instanceof Subclass) {
+ return subclassInResource(consoleConfiguration, resource, (Subclass)element);
} else if (element instanceof Table) {
return tableInResource(consoleConfiguration, resource, (Table)element);
} else {
@@ -78,48 +82,31 @@
}
}
- public static boolean classInResource(ConsoleConfiguration consoleConfiguration, IResource resource, RootClass rootClass) {
+ public static boolean rootClassInResource(ConsoleConfiguration consoleConfiguration, IResource resource, RootClass persistentClass) {
Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
- Element hmNode = doc.getRootElement();
+ return getElements(doc, HTConstants.HIBERNATE_TAG_CLASS, HTConstants.HIBERNATE_TAG_NAME, StringHelper.unqualify(persistentClass.getClassName())).hasNext() ||
+ getElements(doc, HTConstants.HIBERNATE_TAG_CLASS, HTConstants.HIBERNATE_TAG_NAME, persistentClass.getClassName()).hasNext() ||
+ getElements(doc, HTConstants.HIBERNATE_TAG_CLASS, StringHelper.unqualify(persistentClass.getClassName())).hasNext() ||
+ getElements(doc, HTConstants.HIBERNATE_TAG_CLASS, persistentClass.getClassName()).hasNext();
+ }
- Iterator rootChildren = hmNode.elementIterator();
- while ( rootChildren.hasNext() ) {
- Element element = (Element) rootChildren.next();
- String elementName = element.getName();
-
- if ( "class".equals( elementName ) ) {
- Attribute classAttr = element.attribute( "name" );
- if (classAttr != null) {
- if (classAttr.getValue().equals(rootClass.getClassName())) {
- return true;
- } else {
- Attribute packNode = hmNode.attribute( "package" );
- String packageName = null;
- if ( packNode != null ) {
- packageName = packNode.getValue();
- String className = packageName + "." + classAttr.getValue();
- if (className.equals(rootClass.getClassName())) {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
+ public static boolean subclassInResource(ConsoleConfiguration consoleConfiguration, IResource resource, Subclass persistentClass) {
+ Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
+ return getElements(doc, HTConstants.HIBERNATE_TAG_SUBCLASS, HTConstants.HIBERNATE_TAG_NAME, StringHelper.unqualify(persistentClass.getClassName())).hasNext() ||
+ getElements(doc, HTConstants.HIBERNATE_TAG_SUBCLASS, HTConstants.HIBERNATE_TAG_NAME, persistentClass.getClassName()).hasNext();
}
public static boolean tableInResource(ConsoleConfiguration consoleConfiguration, IResource resource, Table table) {
Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
- if (getElements(doc, "table", HibernateUtils.getTableName(table)).hasNext()) {
+ if (getElements(doc, HTConstants.HIBERNATE_TAG_TABLE, HibernateUtils.getTableName(table)).hasNext()) {
return true;
}
- Iterator classes = getElements(doc, "class");
+ Iterator classes = getElements(doc, HTConstants.HIBERNATE_TAG_CLASS);
while (classes.hasNext()) {
Element element = (Element) classes.next();
- Attribute classNameAttr = element.attribute( "name" );
+ Attribute classNameAttr = element.attribute( HTConstants.HIBERNATE_TAG_NAME );
String physicalTableName = consoleConfiguration.getConfiguration().getNamingStrategy().classToTableName(classNameAttr.getValue());
if (table.getName().equals(physicalTableName)) {
return true;
@@ -139,7 +126,7 @@
private static Iterator getElements(Document doc, String elementName, String attrName, String attrValue) {
LVS visitor = new LVS(elementName, attrName, attrValue);
- doc.accept( visitor );
+ doc.accept( visitor );
return visitor.iterator();
}
@@ -177,19 +164,19 @@
}
- private boolean attrIsCorrect(Element element, String attrName, String attrValue) {
- Attribute attr = element.attribute(attrName);
- if (attr != null && attrValue.equals(attr.getValue())) {
- return attrValue.equals(attr.getValue());
- }
- return false;
- }
-
public Iterator iterator() {
return ret.iterator();
}
}
+ private static boolean attrIsCorrect(Element element, String attrName, String attrValue) {
+ Attribute attr = element.attribute(attrName);
+ if (attr != null && attrValue.equals(attr.getValue())) {
+ return attrValue.equals(attr.getValue());
+ }
+ return false;
+ }
+
public static Document getDocument(ConsoleConfiguration consoleConfiguration, java.io.File configXMLFile) {
Document doc = null;
if (consoleConfiguration != null && configXMLFile != null) {
@@ -225,20 +212,18 @@
public static IResource getResource(ConsoleConfiguration consoleConfiguration, IJavaProject proj, Document doc, java.io.File configXMLFile, Object element) {
IResource resource = null;
if (consoleConfiguration != null && proj != null && doc != null) {
- Element sfNode = doc.getRootElement().element( "session-factory" );
- Iterator elements = sfNode.elementIterator();
+ Element sfNode = doc.getRootElement().element( HTConstants.HIBERNATE_TAG_SESSION_FACTORY );
+ Iterator elements = sfNode.elements(HTConstants.HIBERNATE_TAG_MAPPING).iterator();
while ( elements.hasNext() ) {
Element subelement = (Element) elements.next();
- String subelementName = subelement.getName();
- if ( "mapping".equals( subelementName ) ) {
- Attribute file = subelement.attribute( "resource" );
- if (file != null) {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(configXMLFile.getParent()).append(file.getValue()));
- if (elementInResource(consoleConfiguration, resource, element)) return resource;
- }
- }
+ Attribute file = subelement.attribute( HTConstants.HIBERNATE_TAG_RESOURCE );
+ if (file != null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(configXMLFile.getParent()).append(file.getValue()));
+ if (elementInResource(consoleConfiguration, resource, element)) return resource;
+ }
}
- java.io.File[] files = consoleConfiguration.getPreferences().getMappingFiles();
+
+ java.io.File[] files = consoleConfiguration.getPreferences().getMappingFiles();
for (int i = 0; i < files.length; i++) {
java.io.File file = files[i];
if (file != null) {
17 years, 3 months