diff --git a/spi.debugger.ui/manifest.mf b/spi.debugger.ui/manifest.mf
--- a/spi.debugger.ui/manifest.mf
+++ b/spi.debugger.ui/manifest.mf
@@ -2,6 +2,6 @@
OpenIDE-Module: org.netbeans.spi.debugger.ui/1
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/ui/Bundle.properties
OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml
-OpenIDE-Module-Specification-Version: 2.41
+OpenIDE-Module-Specification-Version: 2.42
OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui
OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class
diff --git a/spi.debugger.ui/nbproject/project.xml b/spi.debugger.ui/nbproject/project.xml
--- a/spi.debugger.ui/nbproject/project.xml
+++ b/spi.debugger.ui/nbproject/project.xml
@@ -137,6 +137,14 @@
+ org.openide.explorer
+
+
+
+ 6.55
+
+
+
org.openide.filesystems
diff --git a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/registry/DebuggerProcessor.java b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/registry/DebuggerProcessor.java
--- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/registry/DebuggerProcessor.java
+++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/registry/DebuggerProcessor.java
@@ -67,6 +67,7 @@
import org.netbeans.spi.debugger.ui.BreakpointType;
import org.netbeans.spi.debugger.ui.ColumnModelRegistration;
import org.netbeans.spi.debugger.ui.ColumnModelRegistrations;
+import org.netbeans.spi.debugger.ui.DebuggingView;
import org.netbeans.spi.viewmodel.ColumnModel;
import org.openide.filesystems.annotations.LayerBuilder;
@@ -86,7 +87,9 @@
return new HashSet(Arrays.asList(
AttachType.Registration.class.getCanonicalName(),
BreakpointType.Registration.class.getCanonicalName(),
- ColumnModelRegistration.class.getCanonicalName()
+ ColumnModelRegistration.class.getCanonicalName(),
+ ColumnModelRegistrations.class.getCanonicalName(),
+ DebuggingView.DVSupport.Registration.class.getCanonicalName()
));
}
@@ -137,6 +140,13 @@
}
cnt++;
}
+ for (Element e : env.getElementsAnnotatedWith(DebuggingView.DVSupport.Registration.class)) {
+ DebuggingView.DVSupport.Registration reg = e.getAnnotation(DebuggingView.DVSupport.Registration.class);
+ final String path = reg.path();
+ final int position = reg.position();
+ handleProviderRegistration(e, DebuggingView.DVSupport.class, path, position);
+ cnt++;
+ }
return cnt == annotations.size();
}
diff --git a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/Bundle.properties b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/Bundle.properties
new file mode 100644
--- /dev/null
+++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/Bundle.properties
@@ -0,0 +1,110 @@
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+#
+# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+# Other names may be trademarks of their respective owners.
+#
+# The contents of this file are subject to the terms of either the GNU
+# General Public License Version 2 only ("GPL") or the Common
+# Development and Distribution License("CDDL") (collectively, the
+# "License"). You may not use this file except in compliance with the
+# License. You can obtain a copy of the License at
+# http://www.netbeans.org/cddl-gplv2.html
+# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+# specific language governing permissions and limitations under the
+# License. When distributing the software, include this License Header
+# Notice in each file and include the License file at
+# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the GPL Version 2 section of the License file that
+# accompanied this code. If applicable, add the following below the
+# License Header, with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# Contributor(s):
+#
+# The Original Software is NetBeans. The Initial Developer of the Original
+# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
+# Microsystems, Inc. All Rights Reserved.
+#
+# If you wish your version of this file to be governed by only the CDDL
+# or only the GPL Version 2, indicate your decision by adding
+# "[Contributor] elects to include this software in this distribution
+# under the [CDDL or GPL Version 2] license." If you do not indicate a
+# single choice of license, a recipient has the option to distribute
+# your version of this file under either the CDDL, the GPL Version 2 or
+# to extend the choice of license to its licensees as provided above.
+# However, if you add GPL Version 2 code and therefore, elected the GPL
+# Version 2 license, then the option applies only if the new code is
+# made subject to such option by the copyright holder.
+
+#DebuggingView
+CTL_Debugging_view=Debugging
+CTL_Debugging_tooltip=Debugging View
+LBL_No_Session_Running=no session running
+
+LBL_THREAD_GROUPS_TIP=Show thread groups
+LBL_SUSPEND_TABLE_TIP=Show suspend/resume table
+LBL_SYSTEM_THREADS_TIP=Show system threads
+LBL_SUPSENDED_THREADS_ONLY_TIP=Show Less (suspended and current threads only)
+LBL_MONITORS_TIP=Show monitors
+LBL_QUALIFIED_NAMES_TIP=Show qualified names
+LBL_SUSPEND_SORT_TIP=Sort by suspended/resumed state
+LBL_ALPHABETIC_SORT_TIP=Sort by name
+LBL_NATURAL_SORT_TIP=Sort by default
+
+LBL_THREAD_GROUPS=Show Thread &Groups
+LBL_SUSPEND_TABLE=Show Suspend/Resume &Table
+LBL_SYSTEM_THREADS=Show &System Threads
+LBL_SUPSENDED_THREADS_ONLY=Show &Less
+LBL_MONITORS=Show &Monitors
+LBL_QUALIFIED_NAMES=Show Qualified &Names
+LBL_SUSPEND_SORT=Sort by S&tate
+LBL_ALPHABETIC_SORT=Sort by &Name
+LBL_NATURAL_SORT=&Default Sorting
+
+LBL_FilterSubmenu=&Options
+
+LBL_CURRENT_BAR_TIP=Current thread (selected for stepping and evaluation)
+LBL_CURRENT_DEADLOCKED_TIP=Current thread in deadlock
+LBL_BREAKPOINT_HIT_TIP=New breakpoint hit
+LBL_DEADLOCKED_THREAD_TIP=Thread in deadlock
+
+LBL_SUSPEND_THREAD=Suspend thread {0}
+LBL_RESUME_THREAD=Resume thread {0}
+
+#InfoPanel
+LBL_OneNewHit=New Breakpoint Hit
+LBL_NewHits=New Breakpoint Hits ({0})
+
+#Threads History action
+CTL_ThreadsHistoryAction=Threads History
+CTL_THREADS_CHOOSER=Current Thread Chooser
+
+InfoPanel.hitsLabel.text=New Breakpoint Hit
+InfoPanel.infoIcon.text=
+InfoPanel.infoIcon1.text=
+InfoPanel.deadlocksLabel.text=Deadlock detected
+InfoPanel.infoIcon2.text=
+InfoPanel.debuggerDeadlocksLabelThread.text=Step is blocked by suspended thread ''{0}''.
+InfoPanel.debuggerDeadlocksLabel.Method.text=Method invocation is blocked by other suspended threads.
+InfoPanel.debuggerDeadlocksLabelThread.Method.text=Method invocation is blocked by suspended thread ''{0}''.
+InfoPanel.debuggerDeadlocksLabel.text=Step is blocked by other suspended threads.
+InfoPanel.debuggerDeadlocksLabel.tooltip=Blocking threads are: {0}.
+InfoPanel.resumeDebuggerDeadlockLabelThread.text=Resume this thread to proceed?
+InfoPanel.resumeDebuggerDeadlockLabel.text=Resume these threads to proceed?
+InfoPanel.resumeDebuggerDeadlockButton.text=Resume
+InfoPanel.resumeDebuggerDeadlockButton.tooltip=Resume threads {0} to complete the step.
+InfoPanel.resumeDebuggerDeadlockButton.Method.tooltip=Resume threads {0} to complete the method evaluation.
+InfoPanel.resumeDebuggerDeadlockButtonThread.tooltip=Resume thread ''{0}'' to complete the step.
+InfoPanel.resumeDebuggerDeadlockButtonThread.Method.tooltip=Resume thread ''{0}'' to complete the method evaluation.
+DebuggingView.sessionComboBox.AccessibleContext.accessibleName=Sessions
+DebuggingView.sessionComboBox.AccessibleContext.accessibleDescription=List of running sessions.
+DebuggingView.treeView.AccessibleContext.accessibleName=Debugging Tree
+DebuggingView.treeView.AccessibleContext.accessibleDescription=Tree structure of threads in debugged VM.
+InfoPanel.infoIcon3.text=
+InfoPanel.stepBrkpLabel.text=Step interrupted by a breakpoint in another thread ''{0}''.
+InfoPanel.stepBrkpIgnoreButton.text=Ignore Breakpoint
+InfoPanel.stepBrkpIgnoreButton.tooltip=Ignore this breakpoint and complete the step.
diff --git a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/ClickableIcon.java b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/ClickableIcon.java
copy from debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/ClickableIcon.java
copy to spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/ClickableIcon.java
--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/ClickableIcon.java
+++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/ClickableIcon.java
@@ -40,7 +40,7 @@
* Portions Copyrighted 2008 Sun Microsystems, Inc.
*/
-package org.netbeans.modules.debugger.jpda.ui.debugging;
+package org.netbeans.modules.debugger.ui.views.debugging;
import java.awt.Container;
import java.awt.Dimension;
@@ -51,8 +51,7 @@
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import org.netbeans.api.debugger.Session;
-import org.netbeans.api.debugger.jpda.JPDADebugger;
-import org.netbeans.api.debugger.jpda.JPDAThread;
+import org.netbeans.spi.debugger.ui.DebuggingView.DVThread;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor;
@@ -79,11 +78,11 @@
private int state;
private boolean isThreadSupended;
- private JPDAThread jpdaThread;
+ private DVThread dvThread;
private DebugTreeView tree;
ClickableIcon(ImageIcon normalR, ImageIcon focusedR, ImageIcon pressedR,
- ImageIcon normalS, ImageIcon focusedS, ImageIcon pressedS, JPDAThread jpdaThread, DebugTreeView tree) {
+ ImageIcon normalS, ImageIcon focusedS, ImageIcon pressedS, DVThread dvThread, DebugTreeView tree) {
this.tree = tree;
this.resumeIcon = normalR;
this.focusedResumeIcon = focusedR;
@@ -93,8 +92,8 @@
this.focusedSuspendIcon = focusedS;
this.pressedSuspendIcon = pressedS;
- isThreadSupended = jpdaThread.isSuspended();
- this.jpdaThread = jpdaThread;
+ isThreadSupended = dvThread.isSuspended();
+ this.dvThread = dvThread;
setHorizontalAlignment(SwingConstants.CENTER);
setVerticalAlignment(SwingConstants.CENTER);
@@ -115,13 +114,13 @@
addMouseListener(this);
}
- void changeThread(JPDAThread newThread, Container container, int sx, int sy, int width, int height) {
+ void changeThread(DVThread newThread, Container container, int sx, int sy, int width, int height) {
boolean suspended = newThread.isSuspended();
- if (jpdaThread == newThread && suspended == isThreadSupended) {
+ if (dvThread == newThread && suspended == isThreadSupended) {
return;
}
isThreadSupended = newThread.isSuspended();
- this.jpdaThread = newThread;
+ this.dvThread = newThread;
Point point = container.getMousePosition(true);
state = point != null && sx <= point.x && point.x < sx + width && sy <= point.y && point.y < sy + height
? STATE_FOCUSED : STATE_NORMAL;
@@ -131,11 +130,11 @@
private void setFocusedThread() {
if (state != STATE_NORMAL) {
- if (tree != null && tree.threadFocuseGained(jpdaThread)) {
+ if (tree != null && tree.threadFocuseGained(dvThread)) {
getParent().repaint();
}
} else {
- if (tree != null && tree.threadFocuseLost(jpdaThread)) {
+ if (tree != null && tree.threadFocuseLost(dvThread)) {
getParent().repaint();
}
}
@@ -160,7 +159,7 @@
private void changeIcon() {
setIcon(computeIcon());
String key = isThreadSupended ? "LBL_RESUME_THREAD" : "LBL_SUSPEND_THREAD"; // NOI18N
- String text = NbBundle.getMessage(ClickableIcon.class, key, jpdaThread.getName());
+ String text = NbBundle.getMessage(ClickableIcon.class, key, dvThread.getName());
setToolTipText(text);
}
@@ -168,8 +167,7 @@
final boolean suspended = isThreadSupended;
RequestProcessor rp;
try {
- JPDADebugger debugger = (JPDADebugger) jpdaThread.getClass().getMethod("getDebugger").invoke(jpdaThread);
- Session s = (Session) debugger.getClass().getMethod("getSession").invoke(debugger);
+ Session s = dvThread.getDVSupport().getSession();
rp = s.lookupFirst(null, RequestProcessor.class);
} catch (Exception e) {
Exceptions.printStackTrace(e);
@@ -182,9 +180,9 @@
rp.post(new Runnable() {
public void run() {
if (suspended) {
- jpdaThread.resume();
+ dvThread.resume();
} else {
- jpdaThread.suspend();
+ dvThread.suspend();
}
}
});
diff --git a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebugTreeView.java b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebugTreeView.java
copy from debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebugTreeView.java
copy to spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebugTreeView.java
--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebugTreeView.java
+++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebugTreeView.java
@@ -40,7 +40,7 @@
* Portions Copyrighted 2008 Sun Microsystems, Inc.
*/
-package org.netbeans.modules.debugger.jpda.ui.debugging;
+package org.netbeans.modules.debugger.ui.views.debugging;
import java.awt.Color;
import java.awt.Component;
@@ -63,11 +63,12 @@
import javax.swing.tree.RowMapper;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
+import org.netbeans.api.debugger.DebuggerEngine;
+import org.netbeans.api.debugger.DebuggerManager;
-import org.netbeans.api.debugger.jpda.JPDADebugger;
-import org.netbeans.api.debugger.jpda.JPDAThread;
-import org.netbeans.api.debugger.jpda.JPDAThreadGroup;
-import org.netbeans.modules.debugger.jpda.ui.models.DebuggingTreeModel;
+import org.netbeans.spi.debugger.ui.DebuggingView;
+import org.netbeans.spi.debugger.ui.DebuggingView.DVThread;
+import org.netbeans.spi.debugger.ui.DebuggingView.DVThreadGroup;
import org.netbeans.spi.viewmodel.TreeExpansionModel;
import org.openide.explorer.view.BeanTreeView;
@@ -88,7 +89,7 @@
private final Color highlightColor;
private final Color currentThreadColor;
- private JPDAThread focusedThread;
+ private DVThread focusedThread;
DebugTreeView() {
super();
@@ -96,7 +97,7 @@
if (c == null) {
c = new Color(233, 255, 230);
Color tbc = tree.getBackground();
- int dl = Math.abs(DebuggingView.luminance(c) - DebuggingView.luminance(tbc));
+ int dl = Math.abs(DebuggingViewComponent.luminance(c) - DebuggingViewComponent.luminance(tbc));
if (dl > 125) {
c = new Color(30, 80, 28);
}
@@ -106,7 +107,7 @@
if (c == null) {
c = new Color(233, 239, 248);
Color tbc = tree.getBackground();
- int dl = Math.abs(DebuggingView.luminance(c) - DebuggingView.luminance(tbc));
+ int dl = Math.abs(DebuggingViewComponent.luminance(c) - DebuggingViewComponent.luminance(tbc));
if (dl > 125) {
c = new Color(40, 60, 38);
}
@@ -191,13 +192,18 @@
}
}
- public Object getJPDAObject(TreePath path) {
+ /**
+ * Get the DVThread or DVThreadGroup instance on the given path.
+ * @param path
+ * @return an instance of DVThread or DVThreadGroup
+ */
+ public Object getThreadObject(TreePath path) {
Node node = Visualizer.findNode(path.getLastPathComponent());
- JPDAThread jpdaThread = node.getLookup().lookup(JPDAThread.class);
+ DVThread jpdaThread = node.getLookup().lookup(DVThread.class);
if (jpdaThread != null) {
return jpdaThread;
}
- JPDAThreadGroup jpdaThreadGroup = node.getLookup().lookup(JPDAThreadGroup.class);
+ DVThreadGroup jpdaThreadGroup = node.getLookup().lookup(DVThreadGroup.class);
return jpdaThreadGroup;
}
@@ -273,20 +279,14 @@
}
Color origColor = g.getColor();
- ThreadsListener threadsListener = ThreadsListener.getDefault();
- JPDADebugger debugger = threadsListener != null ? threadsListener.getDebugger() : null;
- JPDAThread currentThread = (debugger != null) ? debugger.getCurrentThread() : null;
- if (currentThread != null && !currentThread.isSuspended() &&
- !DebuggingTreeModel.isMethodInvoking(currentThread)) {
- currentThread = null;
- }
+ DVThread currentThread = getCurrentThread();
boolean isHighlighted = false;
boolean isCurrent = false;
Iterator iter = paths.iterator();
int firstGroupNumber = clipY / rowHeight;
for (int x = 0; x <= firstGroupNumber && iter.hasNext(); x++) {
Node node = Visualizer.findNode(iter.next().getLastPathComponent());
- JPDAThread thread = node.getLookup().lookup(JPDAThread.class);
+ DVThread thread = node.getLookup().lookup(DVThread.class);
isHighlighted = focusedThread != null && thread == focusedThread;
if (thread != null) {
isCurrent = currentThread == thread;
@@ -306,7 +306,7 @@
sy += rowHeight;
if (iter.hasNext()) {
Node node = Visualizer.findNode(iter.next().getLastPathComponent());
- JPDAThread thread = node.getLookup().lookup(JPDAThread.class);
+ DVThread thread = node.getLookup().lookup(DVThread.class);
isHighlighted = focusedThread != null && thread == focusedThread;
if (thread != null) {
isCurrent = currentThread == thread;
@@ -322,8 +322,20 @@
// }
g.setColor(origColor);
}
+
+ private DVThread getCurrentThread() {
+ DVThread currentThread = null;
+ DebuggerEngine currentEngine = DebuggerManager.getDebuggerManager().getCurrentEngine();
+ if (currentEngine != null) {
+ DebuggingView.DVSupport dvSupport = currentEngine.lookupFirst(null, DebuggingView.DVSupport.class);
+ if (dvSupport != null) {
+ currentThread = dvSupport.getCurrentThread();
+ }
+ }
+ return currentThread;
+ }
- boolean threadFocuseGained(JPDAThread jpdaThread) {
+ boolean threadFocuseGained(DVThread jpdaThread) {
if (jpdaThread != null && focusedThread != jpdaThread) {
focusedThread = jpdaThread;
repaint();
@@ -332,7 +344,7 @@
return false;
}
- boolean threadFocuseLost(JPDAThread jpdaThread) {
+ boolean threadFocuseLost(DVThread jpdaThread) {
if (jpdaThread != null && focusedThread == jpdaThread) {
focusedThread = null;
repaint();
@@ -357,21 +369,15 @@
}
if (value instanceof Node) {
Node node = (Node) value;
- JPDAThread thread;
+ DVThread thread;
do {
- thread = node.getLookup().lookup(JPDAThread.class);
+ thread = node.getLookup().lookup(DVThread.class);
if (thread == null) {
node = node.getParentNode();
}
} while (thread == null && node != null);
if (thread != null) {
- ThreadsListener threadsListener = ThreadsListener.getDefault();
- JPDADebugger debugger = threadsListener != null ? threadsListener.getDebugger() : null;
- JPDAThread currentThread = (debugger != null) ? debugger.getCurrentThread() : null;
- if (currentThread != null && !currentThread.isSuspended() &&
- !DebuggingTreeModel.isMethodInvoking(currentThread)) {
- currentThread = null;
- }
+ DVThread currentThread = getCurrentThread();
boolean isHighlighted = focusedThread != null && thread == focusedThread && node == value;
boolean isCurrent = currentThread == thread;
if (isHighlighted || isCurrent) {
diff --git a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.form b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.form
copy from debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.form
copy to spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.form
--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/debugging/DebuggingView.form
+++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.form
@@ -1,4 +1,4 @@
-
+