• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JPDADebugger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.netbeans.api.debugger.jpda.JPDADebugger的典型用法代码示例。如果您正苦于以下问题:Java JPDADebugger类的具体用法?Java JPDADebugger怎么用?Java JPDADebugger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JPDADebugger类属于org.netbeans.api.debugger.jpda包,在下文中一共展示了JPDADebugger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:SourcePath.java


示例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 ()
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:RunToCursorActionProvider.java


示例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());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:JSBreakpointsInfoImpl.java


示例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();
                }
            }
        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:JPDAStart.java


示例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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:DebuggingNodeModel.java


示例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();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:StepThroughFiltersCheck.java


示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:BreakpointAnnotationManager.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:SessionsTableModelFilter.java


示例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);
                    }
                }
            });
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:JPDAStart.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ShellDebuggerUtils.java


示例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);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ClassesCountsView.java


示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:VisualDebuggerListener.java


示例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;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:DebuggerSupport.java


示例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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:DebuggingMonitorModel.java


示例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);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:20,代码来源:EvaluationListener.java


示例16: getValueInfos

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
static Variable[] getValueInfos(JPDADebugger debugger, Variable scope, boolean all) {
    List<JPDAClassType> supportClasses = debugger.getClassesByName(DEBUGGER_SUPPORT_CLASS);
    if (supportClasses.isEmpty()) {
        return null;
    }
    JPDAClassType supportClass = supportClasses.get(0);
    Variable[] args = new Variable[2];
    try {
        args[0] = scope;
        args[1] = debugger.createMirrorVar(all, true);
        ObjectVariable infosVar = (ObjectVariable) supportClass.invokeMethod(METHOD_VALUE_INFOS, SIGNAT_VALUE_INFOS, args);
        return infosVar.getFields(0, Integer.MAX_VALUE);
    } catch (InvalidObjectException ioex) {
        return null;
    } catch (NoSuchMethodException nsmex) {
        Exceptions.printStackTrace(nsmex);
        return null;
    } catch (InvalidExpressionException iex) {
        return null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:DebuggerSupport.java


示例17: propertyChange

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void propertyChange (PropertyChangeEvent evt) {
    String url = EditorContextBridge.getContext().getCurrentURL();
    FileObject fo;
    try {
        fo = URLMapper.findFileObject(new URL(url));
    } catch (MalformedURLException muex) {
        fo = null;
    }
    setEnabled (
        ActionsManager.ACTION_TOGGLE_BREAKPOINT,
        (EditorContextBridge.getContext().getCurrentLineNumber () >= 0) && 
        (fo != null && "text/x-java".equals(fo.getMIMEType()))  // NOI18N
        //(EditorContextBridge.getCurrentURL ().endsWith (".java"))
    );
    if ( debugger != null && 
         debugger.getState () == JPDADebugger.STATE_DISCONNECTED
    ) 
        destroy ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ToggleBreakpointActionProvider.java


示例18: doAction

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
public void doAction (Object action) {
    JPDADebugger dbg = debugger;
    if (dbg == null) {
        dbg = ToggleMethodFieldBreakpointAction.getCurrentDebugger();
    }
    ActionsSynchronizer as = (dbg != null) ? ActionsSynchronizer.get(dbg) : null;
    if (as != null) {
        as.actionStarts(action);
    }
    try {
        doTheAction(action);
    } finally {
        if (as != null) {
            as.actionEnds(action);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ToggleBreakpointActionProvider.java


示例19: checkEnabled

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
@Override
protected void checkEnabled(int debuggerState) {
    setEnabled (
        ActionsManager.ACTION_RUN_TO_CURSOR,
        getActionsManager().isEnabled(ActionsManager.ACTION_CONTINUE) &&
        (debuggerState== JPDADebugger.STATE_STOPPED) &&
        (EditorContextBridge.getContext().getCurrentLineNumber () >= 0) && 
        (EditorContextBridge.getContext().getCurrentURL ().endsWith (".java") || 
         EditorContextBridge.getContext().getCurrentURL ().endsWith (".scala"))
    );
    if (debuggerState != JPDADebugger.STATE_RUNNING && breakpoint != null) {
        DebuggerManager.getDebuggerManager ().removeBreakpoint (breakpoint);
        breakpoint = null;
    }
    if (debuggerState == JPDADebugger.STATE_DISCONNECTED) {
        destroy ();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:RunToCursorActionProvider.java


示例20: init

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入依赖的package包/类
private void init() throws IOException {
    if (servers != null) {
        return;
    }
    LOG.log(Level.FINE, "Initializing");
    servers = Selector.open();
    DebuggerManager.getDebuggerManager().addDebuggerListener(new DebuggerManagerAdapter() {
        @Override
        public void sessionAdded(Session session) {
            LOG.log(Level.FINE, "Debugger: session added: {0}", session);
            Project p = ShellProjectUtils.getSessionProject(session);
            JPDADebugger debugger = session.lookupFirst(null, JPDADebugger.class);
            RP.post(new WaitForDebuggerStart(session, p));
        }
    });
    RP.post(new ShellAgentMonitor());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ShellLaunchManager.java



注:本文中的org.netbeans.api.debugger.jpda.JPDADebugger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SMTPAddressFailedException类代码示例发布时间:2022-05-22
下一篇:
Java AuthorizationServiceDiscovery类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap