当前位置: 首页>>代码示例>>Java>>正文


Java JPDADebugger.STATE_STOPPED属性代码示例

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


在下文中一共展示了JPDADebugger.STATE_STOPPED属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSessionState

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,代码行数:22,代码来源:SessionsTableModelFilter.java

示例2: propertyChange

@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,代码行数:20,代码来源:StepThroughFiltersCheck.java

示例3: propertyChange

@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,代码行数:20,代码来源:JPDAStart.java

示例4: propertyChange

@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,代码行数:26,代码来源:RunToCursorActionProvider.java

示例5: getThreadsState

private int getThreadsState(JPDADebugger d) {
    if (d.getState() != JPDADebugger.STATE_STOPPED) {
        return d.getState();
    }
    // Verify whether really all threads are stopped
    try {
        java.lang.reflect.Method allThreadsMethod =
                d.getClass().getMethod("getAllThreads", new Class[] {});
        List<JPDAThread> threads = (List<JPDAThread>) allThreadsMethod.invoke(d, new Object[]{});
        for (JPDAThread t : threads) {
            if (!t.isSuspended()) {
                return JPDADebugger.STATE_RUNNING;
            }
        }
        return JPDADebugger.STATE_STOPPED;
    } catch (Exception ex) {
        return d.getState();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:InstancesView.java

示例6: propertyChange

@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,代码行数:18,代码来源:JPDAStart.java

示例7: checkEnabled

@Override
protected void checkEnabled (int debuggerState) {
    if (!getDebuggerImpl().canPopFrames()) {
        setEnabled (
            ActionsManager.ACTION_POP_TOPMOST_CALL,
            false
        );
        return;
    }
    JPDAThread t;
    if (debuggerState == JPDADebugger.STATE_STOPPED) {
        t = getDebuggerImpl ().getCurrentThread ();
    } else {
        t = null;
    }
    boolean enabled;
    if (t == null) {
        enabled = false;
    } else {
        enabled = t.isSuspended();
    }
    setEnabled (
        ActionsManager.ACTION_POP_TOPMOST_CALL,
        enabled
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:PopToHereActionProvider.java

示例8: checkEnabled

@Override
protected void checkEnabled (int debuggerState) {
    if (debuggerState == JPDADebugger.STATE_STOPPED) {
        JPDAThread t = getDebuggerImpl ().getCurrentThread ();
        if (t != null) {
            checkEnabledLazySingleAction(debuggerState, rp);
            return;
        }
    }
    setEnabledSingleAction(false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:MakeCalleeCurrentActionProvider.java

示例9: showTheContent

private void showTheContent(int state) {
    if (state == JPDADebugger.STATE_STOPPED) {
        ClassesCountsView cc = (ClassesCountsView) WindowManager.getDefault().findTopComponent("classes");
        HeapFragmentWalker hfw;
        if (cc != null && (hfw = cc.getCurrentFragmentWalker()) != null) {
            setHeapFragmentWalker(hfw);
            provider = null;
        } else if (provider != null) {
            setHeapFragmentWalker(provider.getHeapFragmentWalker());
        } else if (this.hfw != null) {
            setHeapFragmentWalker(this.hfw);
        } else {
            close(); // We can not show any meaningful content
        }
    } else if (state == JPDADebugger.STATE_RUNNING) {
        if (hfwPanel != null) {
            remove(hfwPanel);
        }
        this.hfw = null;
        hfwPanel = new SuspendInfoPanel();
        add(hfwPanel, "Center");
    } else {
        if (hfwPanel != null) {
            remove(hfwPanel);
            hfwPanel = null;
        }
        this.hfw = null;
        close(); // We can not show any meaningful content
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:InstancesView.java

示例10: annotate

/**
 * Annotates current thread or removes annotations.
 */
private void annotate () {
    // 1) no current thread => remove annotations
    final JPDADebugger debugger;
    final SourcePath sourcePath;
    final JPDAThread thread;
    synchronized (this) {
        debugger = currentDebugger;
        if ( (currentThread == null) ||
             (debugger.getState () != JPDADebugger.STATE_STOPPED) ) {
            synchronized (currentPCLock) {
                currentPCSet = false; // The annotation is goint to be removed
            }
            removeAnnotations ();
            return;
        }

        sourcePath = currentSourcePath;
        thread = currentThread;
    }
    Session s;
    try {
        s = (Session) debugger.getClass().getMethod("getSession").invoke(debugger);
    } catch (Exception ex) {
        Exceptions.printStackTrace(ex);
        s = null;
    }
    RequestProcessor rProcessor = null;
    if (s != null) {
        rProcessor = s.lookupFirst(null, RequestProcessor.class);
    }
    if (rProcessor == null) {
        rProcessor = this.rp;
    }
    rProcessor.post(new Runnable() {
        @Override
        public void run() {
            annotate(debugger, thread, sourcePath);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:CurrentThreadAnnotationListener.java

示例11: canEvaluate

@Override
public boolean canEvaluate() {
    return debugger.getCurrentThread() != null &&
           debugger.getState() == JPDADebugger.STATE_STOPPED;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:JPDACodeEvaluator.java

示例12: propertyChange

public void propertyChange (PropertyChangeEvent e) {
    if ( ( (e.getPropertyName () == 
             JPDADebugger.PROP_CURRENT_CALL_STACK_FRAME) ||
           //(e.getPropertyName () == debugger.PROP_CURRENT_THREAD) ||
           (e.getPropertyName () == JPDADebugger.PROP_STATE)
         ) && (debugger.getState () == JPDADebugger.STATE_STOPPED)
    ) {
        // IF state has been changed to STOPPED or
        // IF current call stack frame has been changed & state is stoped
        final LocalsTreeModel ltm = getModel ();
        if (ltm == null) return;
        if (task != null) {
            // cancel old task
            task.cancel ();
            if (verbose)
                System.out.println("LTM cancel old task " + task);
            task = null;
        }
        task = debugger.getRequestProcessor().post (new Runnable () {
            public void run () {
                if (debugger.getState () != JPDADebugger.STATE_STOPPED) {
                    if (verbose)
                        System.out.println("LTM cancel started task " + task);
                    return;
                }
                if (verbose)
                    System.out.println("LTM do task " + task);
                ltm.fireTreeChanged ();
            }
        }, 100);
        if (verbose)
            System.out.println("LTM  create task " + task);
    } else
    if ( (e.getPropertyName () == JPDADebugger.PROP_STATE) &&
         (debugger.getState () != JPDADebugger.STATE_STOPPED) &&
         (task != null)
    ) {
        // debugger has been resumed
        // =>> cancel task
        task.cancel ();
        if (verbose)
            System.out.println("LTM cancel task " + task);
        task = null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:45,代码来源:LocalsTreeModel.java


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