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


Java DebuggerManager类代码示例

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


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

示例1: getDebuggerAction

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
private DebuggerAction getDebuggerAction () {
    DebuggerAction da = ref.get ();
    if (da == null) {
        DebuggerManager.getDebuggerManager ().removeDebuggerListener (
            DebuggerManager.PROP_CURRENT_ENGINE,
            this
        );
        DebuggerManager.getDebuggerManager ().getActionsManager().removeActionsManagerListener(
            ActionsManagerListener.PROP_ACTION_STATE_CHANGED,
            this
        );
        if (currentActionsManager != null)
            currentActionsManager.removeActionsManagerListener 
                (ActionsManagerListener.PROP_ACTION_STATE_CHANGED, this);
        currentActionsManager = null;
        return null;
    }
    return da;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:DebuggerAction.java

示例2: createGO_TO_SOURCE_ACTION

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
private static Action createGO_TO_SOURCE_ACTION(RequestProcessor requestProcessor) {
    return Models.createAction (
        NbBundle.getBundle(ThreadsActionsProvider.class).getString("CTL_ThreadAction_GoToSource_Label"),
        new DebuggingActionsProvider.LazyActionPerformer (requestProcessor) {
            public boolean isEnabled (Object node) {
                if (node instanceof MonitorModel.ThreadWithBordel) node = ((MonitorModel.ThreadWithBordel) node).getOriginalThread();
                return isGoToSourceSupported ((JPDAThread) node);
            }

            public void run (Object[] nodes) {
                if (nodes[0] instanceof MonitorModel.ThreadWithBordel) nodes[0] = ((MonitorModel.ThreadWithBordel) nodes[0]).getOriginalThread();
                String language = DebuggerManager.getDebuggerManager ().
                    getCurrentSession ().getCurrentLanguage ();
                SourcePath sp = DebuggerManager.getDebuggerManager().getCurrentEngine().lookupFirst(null, SourcePath.class);
                sp.showSource ((JPDAThread) nodes [0], language);
            }
        },
        Models.MULTISELECTION_TYPE_EXACTLY_ONE
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ThreadsActionsProvider.java

示例3: getChildren

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
/** 
 *
 * @return threads contained in this group of threads
 */
public Object[] getChildren (Object parent, int from, int to) 
throws UnknownTypeException {
    if (parent == ROOT) {
        Session[] ss = DebuggerManager.getDebuggerManager ().
            getSessions ();
        if (listener == null)
            listener = new Listener (this);
        to = Math.min(ss.length, to);
        from = Math.min(ss.length, from);
        Session[] fss = new Session [to - from];
        System.arraycopy (ss, from, fss, 0, to - from);
        return fss;
    } else
    throw new UnknownTypeException (parent);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:SessionsTreeModel.java

示例4: propertyChange

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
    String propertyName = evt.getPropertyName();
    int state;
    if (propertyName.equals(DebuggerManager.PROP_CURRENT_ENGINE) ||
        propertyName.equals(JPDADebugger.PROP_STATE)) {
        
        state = getTheState();
        synchronized (this) {
            if (state != lastState) {
                lastState = state;
            } else {
                return ;
            }
        }
        showContent(state);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:InstancesView.java

示例5: propertyChange

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
    if (DebuggerManager.PROP_CURRENT_ENGINE.equals(evt.getPropertyName())) {
        synchronized (currentDVSupportLock) {
            currentDVSupport = null;
            currentDVSupportSet = false;
            if (evt.getNewValue() == null) {
                // No debug engine
                if (dmListener != null) {
                    DebuggerManager.getDebuggerManager().removeDebuggerListener(DebuggerManager.PROP_CURRENT_ENGINE, dmListener);
                    dmListener = null;
                }
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:DebugTreeView.java

示例6: isEnabled

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
@Override
public boolean isEnabled (Object node) {
    BreakpointGroup bg = (BreakpointGroup) node;
    if (bg.getGroup() == BreakpointGroup.Group.CUSTOM) {
        String groupName = ((BreakpointGroup)node).getName();
        DebuggerManager dm = DebuggerManager.getDebuggerManager ();
        Breakpoint[] bs = dm.getBreakpoints ();
        int i, k = bs.length;
        for (i = 0; i < k; i++) {
            if (bs [i].getGroupName ().equals (groupName)) {
                if (bs[i].isEnabled()) {
                    return true;
                }
            }
        }
    } else {
        List<Breakpoint> breakpoints = bg.getBreakpoints();
        for (Breakpoint b : breakpoints) {
            if (b.isEnabled()) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:BreakpointsActionsProvider.java

示例7: findBreakpoint

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
private static MethodBreakpoint findBreakpoint(String className, String methodName, String methodSignature) {
    Breakpoint[] breakpoints = DebuggerManager.getDebuggerManager().getBreakpoints();
    for (int i = 0; i < breakpoints.length; i++) {
        if (!(breakpoints[i] instanceof MethodBreakpoint)) {
            continue;
        }
        MethodBreakpoint mb = (MethodBreakpoint) breakpoints[i];
        String[] classFilters = mb.getClassFilters();
        int j;
        for (j = 0; j < classFilters.length; j++) {
            if (match(className, classFilters[j])) {
                break;
            }
        }
        if (j < classFilters.length) {
            if (!mb.getMethodName().equals(methodName)) continue;
            String signature = mb.getMethodSignature();
            if (signature == null || egualMethodSignatures(signature, methodSignature)) {
                return mb;
            }
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ToggleMethodFieldBreakpointAction.java

示例8: dispose

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
private void dispose() {
    DebuggerManager.getDebuggerManager ().removeDebuggerListener (
        DebuggerManager.PROP_DEBUGGER_ENGINES,
        this
    );
    rp.post (new Runnable () {
        @Override
        public void run () {
            if (artificalBreakpoints != null) {
                for (Breakpoint b : artificalBreakpoints) {
                    DebuggerManager.getDebuggerManager().removeBreakpoint(b);
                }
            }
            if (first != null) {
                DebuggerManager.getDebuggerManager().removeBreakpoint(first);
            }
            if (listeners != null) {
                for (Entry<URL, ArtifactsUpdated> e : listeners.entrySet()) {
                    BuildArtifactMapper.removeArtifactsUpdatedListener(e.getKey(), e.getValue());
                }
            }
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:JPDAStart.java

示例9: createItems

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
@Override
public FileItem[] createItems() {
    Set<FileItem> items = new TreeSet<FileItem>();
    Breakpoint[] bs = DebuggerManager.getDebuggerManager ().getBreakpoints ();
    for (int i = 0; i < bs.length; i++) {
        GroupProperties groupProperties = bs[i].getGroupProperties();
        if (groupProperties != null) {
            FileObject[] files = groupProperties.getFiles();
            if (files != null) {
                for (FileObject fo : files) {
                    items.add(new FileItem(fo));
                }
            }
        }
    }
    return items.toArray(new FileItem[]{});
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:BreakpointsExpandableGroup.java

示例10: ok

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
/**
 * Called when "Ok" button is pressed.
 *
 * @return whether customizer can be closed
 */
public boolean ok () {
    if (!valid) {
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(errMsg));
        return false;
    }
    actionsPanel.ok ();
    String path = tfFileName.getText().trim();
    logger.fine("O.K.: path = '"+path+"'");
    URL url = getURL(path);
    logger.fine("      => URL = '"+url+"'");
    breakpoint.setURL((url != null) ? url.toString() : path);
    breakpoint.setLineNumber(Integer.parseInt(tfLineNumber.getText().trim()));
    breakpoint.setCondition (conditionsPanel.getCondition());
    breakpoint.setHitCountFilter(conditionsPanel.getHitCount(),
            conditionsPanel.getHitCountFilteringStyle());

    if (createBreakpoint)
        DebuggerManager.getDebuggerManager ().addBreakpoint (breakpoint);
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:LineBreakpointPanel.java

示例11: getTheState

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
private int getTheState() {
    int state = JPDADebugger.STATE_DISCONNECTED;
    DebuggerEngine de = DebuggerManager.getDebuggerManager().getCurrentEngine();
    if (de != null) {
        JPDADebugger d = de.lookupFirst(null, JPDADebugger.class);
        if (d != null) {
            state = getThreadsState(d);
            synchronized (this) {
                if (!attachedTo.contains(d)) {
                    attachedTo.add(d);
                    d.addPropertyChangeListener(this);
                }
            }
        }
    }
    return state;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:InstancesView.java

示例12: engineRemoved

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的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: doAction

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
/**
 * Called when the action is called (action button is pressed).
 *
 * @param action an action which has been called
 */
@Override
public void doAction (Object action) {
    Line line = getCurrentLine ();
    if (line == null) return ;
    Breakpoint[] breakpoints = DebuggerManager.getDebuggerManager ().
        getBreakpoints ();
    int i, k = breakpoints.length;
    for (i = 0; i < k; i++)
        if ( breakpoints [i] instanceof AntBreakpoint &&
             ((AntBreakpoint) breakpoints [i]).getLine ().equals (line)
        ) {
            DebuggerManager.getDebuggerManager ().removeBreakpoint
                (breakpoints [i]);
            break;
        }
    if (i == k)
        DebuggerManager.getDebuggerManager ().addBreakpoint (
            new AntBreakpoint (line)
        );
    //S ystem.out.println("toggle");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:AntBreakpointActionProvider.java

示例14: propertyChange

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
@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,代码行数:21,代码来源:BreakpointsEngineListener.java

示例15: setUp

import org.netbeans.api.debugger.DebuggerManager; //导入依赖的package包/类
@Override
protected void setUp () throws Exception {
    super.setUp ();
    JPDASupport.removeAllBreakpoints ();
    Utils.BreakPositions bp = Utils.getBreakPositions(System.getProperty ("test.dir.src")+
                              "org/netbeans/api/debugger/jpda/testapps/ConcurrencyApp.java");
    List<LineBreakpoint> lbs = bp.getLineBreakpoints();
    //lbs.get(0).setSuspend(JPDABreakpoint.SUSPEND_ALL);
    lbs.get(1).setCondition("i == Math.round(Math.max(Math.PI, Math.sin(10.0)))");
    for (LineBreakpoint lb : lbs) {
        DebuggerManager.getDebuggerManager ().addBreakpoint (lb);
    }
    support = JPDASupport.attach (
        "org.netbeans.api.debugger.jpda.testapps.ConcurrencyApp"
    );
    support.waitState (JPDADebugger.STATE_STOPPED);
    // We're stopped on the 0th breakpoint in some thread.
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ConcurrencyTest.java


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