本文整理汇总了Java中org.netbeans.api.debugger.jpda.JPDADebugger类的典型用法代码示例。如果您正苦于以下问题:Java JPDADebugger类的具体用法?Java JPDADebugger怎么用?Java JPDADebugger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JPDADebugger类属于org.netbeans.api.debugger.jpda包,在下文中一共展示了JPDADebugger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAnnotation
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
private static Object createAnnotation(JPDADebugger debugger, String url,
Operation operation, String type,
boolean method) {
int startOffset;
int endOffset;
if (method && operation.getMethodName() != null) {
startOffset = operation.getMethodStartPosition().getOffset();
endOffset = operation.getMethodEndPosition().getOffset();
} else {
startOffset = operation.getStartPosition().getOffset();
endOffset = operation.getEndPosition().getOffset();
}
return EditorContextBridge.getContext().annotate (
url,
startOffset,
endOffset,
type,
debugger
);
}
示例2: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange (PropertyChangeEvent e) {
if (e.getPropertyName () == JPDADebugger.PROP_STATE) {
int state = ((Integer) e.getNewValue ()).intValue ();
if ( (state == JPDADebugger.STATE_DISCONNECTED) ||
(state == JPDADebugger.STATE_STOPPED)
) {
JPDADebugger debugger = (JPDADebugger) e.getSource();
Pair<LineBreakpoint, Project> lbp;
synchronized (debuggerBreakpoints) {
lbp = debuggerBreakpoints.remove(debugger);
}
if (lbp != null) {
removeBreakpoint(lbp.first());
synchronized (projectBreakpoints) {
projectBreakpoints.put(lbp.second(), null);
}
}
}
return;
}
setEnabled (
ActionsManager.ACTION_RUN_TO_CURSOR,
shouldBeEnabled ()
);
}
示例3: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if (DebuggerManager.PROP_CURRENT_SESSION.equals(propertyName)) {
JPDADebugger newDebugger = getCurrentDebugger();
synchronized (this) {
if (currentDebugger != null) {
currentDebugger.removePropertyChangeListener(JPDADebugger.PROP_BREAKPOINTS_ACTIVE, this);
}
currentDebugger = newDebugger;
}
if (newDebugger != null) {
setActive(newDebugger.getBreakpointsActive());
} else {
setActive(true);
}
}
if (JPDADebugger.PROP_BREAKPOINTS_ACTIVE.equals(propertyName)) {
setActive(((JPDADebugger) evt.getSource()).getBreakpointsActive());
}
}
示例4: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent e) {
if (JPDADebugger.PROP_STATE.equals(e.getPropertyName())) {
int state = ((Integer) e.getNewValue()).intValue();
if ( (state == JPDADebugger.STATE_DISCONNECTED) ||
(state == JPDADebugger.STATE_STOPPED)
) {
// RequestProcessor.getDefault ().post (new Runnable () {
// public void run () {
if (breakpoint != null) {
DebuggerManager.getDebuggerManager().
removeBreakpoint(breakpoint);
breakpoint = null;
}
// }
// });
dispose();
}
}
}
示例5: DebuggingNodeModel
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
public DebuggingNodeModel(ContextProvider lookupProvider) {
debugger = lookupProvider.lookupFirst(null, JPDADebugger.class);
dvSupport = (DebuggingViewSupportImpl) lookupProvider.lookupFirst(null, DebuggingView.DVSupport.class);
currentThreadListener = new CurrentThreadListener();
debugger.addPropertyChangeListener(WeakListeners.propertyChange(currentThreadListener, debugger));
deadlockDetector = debugger.getThreadsCollector().getDeadlockDetector();
deadlockDetector.addPropertyChangeListener(new DeadlockListener());
rp = lookupProvider.lookupFirst(null, RequestProcessor.class);
sourcePath = lookupProvider.lookupFirst(null, SourcePath.class);
session = lookupProvider.lookupFirst(null, Session.class);
sessionLanguageListener = new SessionLanguageListener();
session.addPropertyChangeListener(Session.PROP_CURRENT_LANGUAGE,
WeakListeners.propertyChange(sessionLanguageListener,
new ListenerDetaching(Session.PROP_CURRENT_LANGUAGE, session)));
prefListener = new DebuggingPreferenceChangeListener();
preferences.addPreferenceChangeListener(WeakListeners.create(PreferenceChangeListener.class, prefListener, preferences));
}
示例6: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("actionToBeRun".equals(evt.getPropertyName())) {
Object action = evt.getNewValue();
if (ActionsManager.ACTION_STEP_INTO.equals(action)) {
// We need to step through the filters to get to the target function
boolean stepThroughFilters = p.getBoolean(STEP_THROUGH_FILTERS_PROP, false);
stepThroughFiltersWasNotSet = !stepThroughFilters && p.getBoolean(STEP_THROUGH_FILTERS_PROP, true);
if (!stepThroughFilters) {
p.setBoolean(STEP_THROUGH_FILTERS_PROP, true);
stepThroughFiltersTurnedOn = true;
}
}
} else if (JPDADebugger.PROP_STATE.equals(evt.getPropertyName())) {
Object nv = evt.getNewValue();
if ((nv instanceof Integer) && JPDADebugger.STATE_STOPPED == (Integer) nv) {
unsetStepThrough();
}
}
}
示例7: setCurrentDebugger
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
private void setCurrentDebugger(DebuggerEngine engine) {
JPDADebugger oldDebugger = currentDebugger;
if (oldDebugger != null) {
oldDebugger.removePropertyChangeListener(JPDADebugger.PROP_BREAKPOINTS_ACTIVE, this);
}
boolean active = true;
JPDADebugger debugger = null;
if (engine != null) {
debugger = engine.lookupFirst(null, JPDADebugger.class);
if (debugger != null) {
debugger.addPropertyChangeListener(JPDADebugger.PROP_BREAKPOINTS_ACTIVE, this);
active = debugger.getBreakpointsActive();
}
}
currentDebugger = debugger;
getAnnotationProvider().setBreakpointsActive(active);
}
示例8: getSessionState
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
private String getSessionState (Session s) {
DebuggerEngine e = s.getCurrentEngine ();
if (e == null)
return loc ("MSG_Session_State_Starting");
JPDADebugger d = e.lookupFirst(null, JPDADebugger.class);
synchronized (this) {
if (!addedAsListener) {
d.addPropertyChangeListener (JPDADebugger.PROP_STATE, this);
}
}
switch (d.getState ()) {
case JPDADebugger.STATE_DISCONNECTED:
return loc ("MSG_Session_State_Disconnected");
case JPDADebugger.STATE_RUNNING:
return loc ("MSG_Session_State_Running");
case JPDADebugger.STATE_STARTING:
return loc ("MSG_Session_State_Starting");
case JPDADebugger.STATE_STOPPED:
return loc ("MSG_Session_State_Stopped");
}
return null;
}
示例9: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange (final PropertyChangeEvent e) {
if (JPDADebugger.PROP_STATE.equals(e.getPropertyName ())) {
int state = ((Integer) e.getNewValue ()).intValue ();
if (state == JPDADebugger.STATE_STOPPED || state == JPDADebugger.STATE_DISCONNECTED) {
rp.post(new Runnable() {
@Override
public void run() {
if (first != null) {
DebuggerManager.getDebuggerManager().removeBreakpoint(first);
first = null;
((JPDADebugger) e.getSource()).removePropertyChangeListener(JPDADebugger.PROP_STATE, pcl);
}
}
});
}
}
}
示例10: getAgentKey
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
static String getAgentKey(Session debuggerSession) {
JPDADebugger debugger = debuggerSession.lookupFirst(null, JPDADebugger.class);
if (debugger == null) {
return null;
}
List<JPDAClassType> classes = debugger.getClassesByName("org.netbeans.lib.jshell.agent.NbJShellAgent"); // NOI18N
if (classes == null || classes.size() != 1) {
return null;
}
JPDAClassType ct = classes.get(0);
for (Field ff : ct.staticFields()) {
if ("debuggerKey".equals(ff.getName())) { // NOI18N
String s = ff.getValue();
if (s.charAt(0) != '"' || s.charAt(s.length() - 1) != '"') { // NOI18N
return ""; // NOI18N
}
return s.substring(1, s.length() -1);
}
}
return null;
}
示例11: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange (PropertyChangeEvent e) {
if (e.getSource() instanceof JPDADebugger) {
int state = ((JPDADebugger) e.getSource()).getState();
if (state == JPDADebugger.STATE_DISCONNECTED) {
detachFromStateChange();
} else if (state != JPDADebugger.STATE_STARTING) {
getRefreshContentTask().schedule(10);
}
return ;
}
DebuggerEngine engine = (DebuggerEngine) e.getNewValue();
attachToStateChange(engine);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
setContent();
getRefreshContentTask().schedule(10);
}
});
}
示例12: engineRemoved
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void engineRemoved(DebuggerEngine engine) {
ScreenshotComponent.closeScreenshots(engine);
JPDADebugger debugger = engine.lookupFirst(null, JPDADebugger.class);
if (debugger == null) {
return ;
}
logger.log(Level.FINE, "engineRemoved({0}), debugger = {1}", new Object[]{engine, debugger});
stopDebuggerRemoteService(debugger);
Collection<Breakpoint> helperComponentBreakpoints;
synchronized (helperComponentBreakpointsMap) {
helperComponentBreakpoints = helperComponentBreakpointsMap.remove(engine);
}
if (helperComponentBreakpoints != null && !helperComponentBreakpoints.isEmpty()) {
Iterator<Breakpoint> it = helperComponentBreakpoints.iterator();
while (it.hasNext()) {
DebuggerManager.getDebuggerManager().removeBreakpoint(it.next());
}
helperComponentBreakpoints.clear();
}
synchronized (componentsAndStackTraces) {
componentsAndStackTraces.remove(debugger);
}
}
示例13: getVarStringValueAsVar
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
public static Variable getVarStringValueAsVar(JPDADebugger debugger, ObjectVariable ov) {
List<JPDAClassType> supportClasses = debugger.getClassesByName(DEBUGGER_SUPPORT_CLASS);
if (supportClasses.isEmpty()) {
return ov;
}
JPDAClassType supportClass = supportClasses.get(0);
Variable[] args = new Variable[1];
try {
args[0] = ov;
Variable strVar = supportClass.invokeMethod(METHOD_VALUE_AS_STRING, SIGNAT_VALUE_AS_STRING, args);
// This method returns quoted value. :-(
if (String.class.getName().equals(strVar.getType())) {
return adjustQuotes(debugger, (ObjectVariable) strVar);
} else {
return strVar;
}
} catch (NoSuchMethodException ex) {
Exceptions.printStackTrace(ex);
return ov;
} catch (InvalidExpressionException iex) {
return ov;
}
}
示例14: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
Set<Deadlock> deadlocks = deadlockDetector.getDeadlocks();
boolean isDeadlock = deadlocks.size() > 0;
if (isDeadlock) {
boolean areMonitors = preferences.getBoolean(SHOW_MONITORS, false);
if (!areMonitors) {
// Show the monitors temporarily
preferences.putBoolean(SHOW_MONITORS, true);
final RevertShowMonitorsListener revertShowMonitorsListener = new RevertShowMonitorsListener();
debugger.addPropertyChangeListener(JPDADebugger.PROP_STATE, revertShowMonitorsListener);
// Set revertShowMonitorsListener later, so that lazy preferenceChange does not remove it right away.
RequestProcessor.getDefault().post(new Runnable() {
@Override
public void run() {
Children.this.revertShowMonitorsListener = revertShowMonitorsListener;
}
}, 1000);
}
}
}
示例15: callStringMethod
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
/**
* Call some method in the debuggee that is without parameters and returns a
* string.
*/
protected final String callStringMethod(JPDADebugger debugger, This thisVar, JPDAThread thread, String methodName) throws NoSuchMethodException, InvalidExpressionException {
// Signature for parameterless method returning string
String signature = "()Ljava/lang/String;";
// REMEMBER TO SET CURRENT BACK!!
JPDAThread oldThread = debugger.getCurrentThread();
setCurrentThread(debugger, thread);
Variable res = thisVar.invokeMethod(methodName, signature, new Variable[0]);
// set current thread back
setCurrentThread(debugger, oldThread);
String resultString = res.getValue();
return resultString.substring(1, resultString.length() - 1);
}