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


Java JPDADebugger.addPropertyChangeListener方法代码示例

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


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

示例1: 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

示例2: 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

示例3: handleToolTipClose

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
@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,代码行数:24,代码来源:ToolTipAnnotation.java

示例4: getTheState

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的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

示例5: updateCurrentDebugger

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
private synchronized void updateCurrentDebugger (DebuggerEngine currentEngine) {
    JPDADebugger newDebugger;
    if (currentEngine == null) {
        newDebugger = null;
    } else {
        newDebugger = currentEngine.lookupFirst(null, JPDADebugger.class);
    }
    if (currentDebugger == newDebugger) return;
    //System.err.println("updateCurrentDebugger: "+currentDebugger+" -> "+newDebugger);
    if (currentDebugger != null)
        currentDebugger.removePropertyChangeListener (this);
    if (allThreadsAnnotator != null) {
        allThreadsAnnotator.cancel();
        allThreadsAnnotator = null;
    }
    currentSourcePath = null;
    if (newDebugger != null) {
        newDebugger.addPropertyChangeListener (this);
        allThreadsAnnotator = new AllThreadsAnnotator(newDebugger);
        currentSourcePath = getCurrentSourcePath(newDebugger);
    }
    currentDebugger = newDebugger;
    if (currentThread != null && allThreadsAnnotator != null) {
        allThreadsAnnotator.remove(currentThread);
        currentThread = null;
    }
    updateCurrentThread();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:CurrentThreadAnnotationListener.java

示例6: Listener

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
public Listener (
    CallStackTreeModel tm,
    JPDADebugger debugger
) {
    this.debugger = debugger;
    model = new WeakReference<CallStackTreeModel>(tm);
    debugger.addPropertyChangeListener (this);
    JPDAThreadImpl lastCurrentThread = (JPDAThreadImpl) debugger.getCurrentThread();
    if (lastCurrentThread != null) {
        lastCurrentThread.addPropertyChangeListener(
                WeakListeners.propertyChange(this, lastCurrentThread));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CallStackTreeModel.java

示例7: Listener

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
private Listener (
    CallStackNodeModel rm,
    JPDADebugger debugger
) {
    ref = new WeakReference (rm);
    this.debugger = debugger;
    debugger.addPropertyChangeListener (
        debugger.PROP_CURRENT_CALL_STACK_FRAME,
        this
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:CallStackNodeModel.java

示例8: Listener

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
public Listener (
    DebuggingTreeModel tm,
    JPDADebugger debugger
) {
    this.debugger = debugger;
    //this.tc = debugger.getThreadsCache();
    model = new WeakReference<DebuggingTreeModel>(tm);
    debugger.addPropertyChangeListener(this);
    //tc.addPropertyChangeListener(this);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:DebuggingTreeModel.java

示例9: Listener

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
private Listener (
    ThreadsNodeModel rm,
    JPDADebugger debugger,
    Set<Object> currentNodes
) {
    ref = new WeakReference (rm);
    this.debugger = debugger;
    this.currentNodes = currentNodes;
    debugger.addPropertyChangeListener (
        debugger.PROP_CURRENT_THREAD,
        this
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ThreadsNodeModel.java

示例10: getCurrentDebugger

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
private JPDADebugger getCurrentDebugger() {
    Session s = DebuggerManager.getDebuggerManager().getCurrentSession();
    if (s != null) {
        JPDADebugger debugger = s.lookupFirst(null, JPDADebugger.class);
        if (debugger != null) {
            debugger.addPropertyChangeListener(JPDADebugger.PROP_BREAKPOINTS_ACTIVE, this);
        }
        return debugger;
    } else {
        return null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:JSBreakpointsInfoImpl.java

示例11: engineAdded

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
@Override
public void engineAdded(DebuggerEngine engine) {
    JPDADebugger debugger = engine.lookupFirst(null, JPDADebugger.class);
    if (debugger == null) {
        return;
    }
    debugger.addPropertyChangeListener(
            JPDADebugger.PROP_STATE,
            this
            );
    debuggers.add(debugger);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:JPDAStart.java

示例12: attach

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
static void attach(JPDADebugger d, ToolTipSupport tts) {
    DebuggerStateChangeListener dscl = new DebuggerStateChangeListener(tts);
    d.addPropertyChangeListener(JPDADebugger.PROP_STATE, dscl);
    tts.addPropertyChangeListener(propListener -> {
        if (ToolTipSupport.PROP_STATUS.equals(propListener.getPropertyName()) &&
                !tts.isToolTipVisible()) {
            d.removePropertyChangeListener(JPDADebugger.PROP_STATE, dscl);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:DebuggerStateChangeListener.java

示例13: attachDebugger

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
void attachDebugger(Session s) {
    boolean complete;
    if (s == null) {
        return;
    }
    synchronized (this) {
        if (debuggerSession != null && s != debuggerSession) {
            throw new IllegalStateException("Debugger already attached");
        }
        LOG.log(Level.FINE, "Attaching debugger session {0}, current session = {1}, connectAddress = {2}", new Object[]{s, debuggerSession, connectAddress});
        if (debuggerSession == s) {
            // race between debugger and handshake
            return;
        }
        debuggerSession = s;
        JPDADebugger dbg = s.lookupFirst(null, JPDADebugger.class);
        debuggerMachine = ((JPDADebuggerImpl) dbg).getVirtualMachine();
        dbg.addPropertyChangeListener(JPDADebugger.PROP_STATE, (java.beans.PropertyChangeEvent e) -> {
            if (dbg.getState() == JPDADebugger.STATE_DISCONNECTED) {
                // destroy the agent
                ShellLaunchManager.queueTask(() -> {
                    mgr.destroyAgent(authorizationKey);
                }, 5000);
            }
        });
        complete = connectAddress != null;
    }
    if (complete) {
        LOG.log(Level.FINE, "Firing handshake complete for {0}", this);
        ShellLaunchEvent ev = new ShellLaunchEvent(mgr, this);
        mgr.fire((l) -> l.handshakeCompleted(ev));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:ShellAgent.java

示例14: run

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
public void run() {
    LOG.log(Level.FINE, "Tick at {0}", System.currentTimeMillis());
    Session session = refSession.get();
    if (stop || session == null) {
        stop();
        return;
    }
    JPDADebugger debugger = session.lookupFirst(null, JPDADebugger.class);
    if (debugger == null) {
        stop();
        return;
    }
    
    debugger.addPropertyChangeListener(JPDADebugger.PROP_STATE, this);
    if (debugger.getState() == JPDADebugger.STATE_DISCONNECTED) {
        LOG.log(Level.FINE, "debugge has disconnected: {0}", session);
        stop();
        return;
    }
    
    try {
        if (probeCounter == 0) {
            waitVirtualMachine(debugger, session);
        } else if (probeCounter >= MAX_PROBE_COUNTER) {
            LOG.log(Level.FINE, "Max probe count reached for debugger session {0}", session);
            stop();
            return;
        }
        if (probe(debugger, session)) {
            RP.schedule(this, DEBUGGER_PROBE_DELAY, TimeUnit.MILLISECONDS);
            probeCounter++;
        }
    } catch (DebuggerStartException ex) {
        // the debugger fails to start, terminate the connection
        LOG.log(Level.FINE, "Exception during debugger start: {0}", ex);
        stop();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:ShellLaunchManager.java

示例15: attachToStateChange

import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
private synchronized void attachToStateChange(DebuggerEngine engine) {
    detachFromStateChange();
    if (engine == null) {
        return ;
    }
    JPDADebugger debugger = engine.lookupFirst(null, JPDADebugger.class);
    if (debugger == null) {
        return ;
    }
    debugger.addPropertyChangeListener(JPDADebugger.PROP_STATE, this);
    lastDebugger = new WeakReference<JPDADebugger>(debugger);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ClassesCountsView.java


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