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


Java JPDADebugger.STATE_RUNNING属性代码示例

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


在下文中一共展示了JPDADebugger.STATE_RUNNING属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: checkEnabled

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

示例3: propertyChange

@Override
public void propertyChange (java.beans.PropertyChangeEvent evt) {
    if (debugger.getState () == JPDADebugger.STATE_RUNNING) {
        if (started) return;
        started = true;
        createBreakpointImpls ();
        DebuggerManager.getDebuggerManager ().addDebuggerListener (
            DebuggerManager.PROP_BREAKPOINTS,
            this
        );
    }
    if (debugger.getState () == JPDADebugger.STATE_DISCONNECTED) {
        removeBreakpointImpls ();
        started = false;
        DebuggerManager.getDebuggerManager ().removeDebuggerListener (
            DebuggerManager.PROP_BREAKPOINTS,
            this
        );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:BreakpointsEngineListener.java

示例4: handleToolTipClose

@Override
protected void handleToolTipClose(DebuggerEngine engine, ToolTipSupport tts) {
    JPDADebugger d = engine.lookupFirst(null, JPDADebugger.class);
    if (d == null) {
        return ;
    }
    PropertyChangeListener l = (PropertyChangeEvent evt) -> {
        int state = ((Integer) evt.getNewValue());
        if (JPDADebugger.STATE_DISCONNECTED == state ||
                JPDADebugger.STATE_RUNNING == state) {
            SwingUtilities.invokeLater(() ->
                    tts.setToolTipVisible(false)
            );
        }
    };
    d.addPropertyChangeListener(JPDADebugger.PROP_STATE, l);
    tts.addPropertyChangeListener(pl -> {
        if (ToolTipSupport.PROP_STATUS.equals(pl.getPropertyName()) &&
                !tts.isToolTipVisible()) {
            d.removePropertyChangeListener(JPDADebugger.PROP_STATE, l);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ToolTipAnnotation.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 (java.beans.PropertyChangeEvent evt) {
    if (debugger.getState () == JPDADebugger.STATE_RUNNING) {
        if (started) return;
        started = true;
        DebuggerManager.getDebuggerManager ().addDebuggerListener (
            DebuggerManager.PROP_BREAKPOINTS,
            this
        );
        createBreakpointImpls ();
    }
    if (debugger.getState () == JPDADebugger.STATE_DISCONNECTED) {
        DebuggerManager.getDebuggerManager ().removeDebuggerListener (
            DebuggerManager.PROP_BREAKPOINTS,
            this
        );
        removeBreakpointImpls ();
        started = false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:BreakpointsEngineListener.java

示例7: propertyChange

@Override
public void propertyChange(PropertyChangeEvent evt) {
    String propertyName = evt.getPropertyName();
    if (JPDADebugger.PROP_THREAD_STARTED.equals(propertyName)) {
        firePropertyChange(DebuggingView.DVSupport.PROP_THREAD_STARTED,
                           get((JPDAThreadImpl) evt.getOldValue()),
                           get((JPDAThreadImpl) evt.getNewValue()));
    } else
    if (JPDADebugger.PROP_THREAD_DIED.equals(propertyName)) {
        firePropertyChange(DebuggingView.DVSupport.PROP_THREAD_DIED,
                           get((JPDAThreadImpl) evt.getOldValue()),
                           get((JPDAThreadImpl) evt.getNewValue()));
    } else
    if (JPDADebugger.PROP_CURRENT_THREAD.equals(propertyName)) {
        firePropertyChange(DebuggingView.DVSupport.PROP_CURRENT_THREAD,
                           get((JPDAThreadImpl) evt.getOldValue()),
                           get((JPDAThreadImpl) evt.getNewValue()));
    } else
    if (JPDADebugger.PROP_STATE.equals(propertyName)) {
        int ds = debugger.getState();
        if (ds == JPDADebugger.STATE_RUNNING && this.state != STATE.RUNNING) {
            this.state = STATE.RUNNING;
            firePropertyChange(DebuggingView.DVSupport.PROP_STATE, STATE.DISCONNECTED, STATE.RUNNING);
        } else
        if (ds == JPDADebugger.STATE_DISCONNECTED) {
            firePropertyChange(DebuggingView.DVSupport.PROP_STATE, STATE.RUNNING, STATE.DISCONNECTED);
        }
    } else
    if (DeadlockDetector.PROP_DEADLOCK.equals(propertyName)) {
        firePropertyChange(DebuggingView.DVSupport.PROP_DEADLOCK, evt.getOldValue(), evt.getNewValue());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:DebuggingViewSupportImpl.java

示例8: propertyChange

@Override
public void propertyChange(PropertyChangeEvent evt) {
    int state = ((Integer) evt.getNewValue());
    if (JPDADebugger.STATE_DISCONNECTED == state ||
        JPDADebugger.STATE_RUNNING == state) {
        SwingUtilities.invokeLater(this);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:DebuggerStateChangeListener.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: propertyChange

@Override
public void propertyChange(PropertyChangeEvent evt) {
    if (JPDADebugger.PROP_STATE.equals(evt.getPropertyName())) {
        Object newValue = evt.getNewValue();
        if (newValue instanceof Integer &&
            JPDADebugger.STATE_RUNNING == ((Integer) newValue).intValue()) {
            synchronized (AbstractObjectVariable.this.fieldsLock) {
                AbstractObjectVariable.this.refreshFields = true;
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:AbstractObjectVariable.java

示例11: retrieveExistingSources

private void retrieveExistingSources() {
    if (debugger.getState() < JPDADebugger.STATE_RUNNING) {
        debugger.addPropertyChangeListener(JPDADebugger.PROP_STATE, new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if (Integer.valueOf(JPDADebugger.STATE_RUNNING).equals(evt.getNewValue())) {
                    retrieveExistingSources();
                    debugger.removePropertyChangeListener(JPDADebugger.PROP_STATE, this);
                }
            }
        });
        return ;
    }
    List<JPDAClassType> classesByName = debugger.getClassesByName(NASHORN_CONTEXT_CLASS);
    if (classesByName.isEmpty()) {
        return ;
    }
    JPDAClassType contextClass = classesByName.get(0);
    List<ObjectVariable> contextInstances = contextClass.getInstances(0);
    if (contextInstances.isEmpty()) {
        return ;
    }
    ObjectVariable context = contextInstances.get(0);
    final ObjectVariable classCache = (ObjectVariable) context.getField("classCache");
    if (classCache == null) {
        LOG.log(Level.CONFIG, "No classCache field in "+context.getValue());
        return ;
    }

    // We need to suspend the app to be able to invoke methods:
    final MethodBreakpoint inNashorn = MethodBreakpoint.create(NASHORN_FUNCTION_NODE_CLASS, "*");
    final AtomicBoolean retrieved = new AtomicBoolean(false);
    inNashorn.addJPDABreakpointListener(new JPDABreakpointListener() {
        @Override
        public void breakpointReached(JPDABreakpointEvent event) {
            try {
                if (!retrieved.getAndSet(true)) {
                    inNashorn.disable();
                    DebuggerManager.getDebuggerManager().removeBreakpoint(inNashorn);
                    doRetrieveExistingSources(classCache);
                }
            } finally {
                event.resume();
            }
        }
    });
    inNashorn.setSession(debugger);
    inNashorn.setHidden(true);
    DebuggerManager.getDebuggerManager().addBreakpoint(inNashorn);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:50,代码来源:JSJavaBreakpointsManager.java


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