本文整理汇总了Java中com.intellij.debugger.impl.DebuggerSession.isAttached方法的典型用法代码示例。如果您正苦于以下问题:Java DebuggerSession.isAttached方法的具体用法?Java DebuggerSession.isAttached怎么用?Java DebuggerSession.isAttached使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.debugger.impl.DebuggerSession
的用法示例。
在下文中一共展示了DebuggerSession.isAttached方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}
DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();
final DebuggerSession session = context.getDebuggerSession();
if(session != null && session.isAttached()) {
final DebugProcessImpl process = context.getDebugProcess();
if (process != null) {
process.getManagerThread().invoke(new DebuggerCommandImpl() {
protected void action() throws Exception {
final List<ThreadState> threads = ThreadDumpAction.buildThreadStates(process.getVirtualMachineProxy());
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
ExportToTextFileAction.export(project, ThreadDumpPanel.createToFileExporter(project, threads));
}
}, ModalityState.NON_MODAL);
}
});
}
}
}
示例2: findHotSwappableBlazeDebuggerSession
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Nullable
static HotSwappableDebugSession findHotSwappableBlazeDebuggerSession(Project project) {
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
if (session == null || !session.isAttached()) {
return null;
}
JavaDebugProcess process = session.getProcess().getXdebugProcess();
if (process == null) {
return null;
}
ExecutionEnvironment env = ((XDebugSessionImpl) process.getSession()).getExecutionEnvironment();
if (env == null || ClassFileManifestBuilder.getManifest(env) == null) {
return null;
}
RunProfile runProfile = env.getRunProfile();
if (!(runProfile instanceof BlazeCommandRunConfiguration)) {
return null;
}
return new HotSwappableDebugSession(session, env, (BlazeCommandRunConfiguration) runProfile);
}
示例3: compilationFinished
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void compilationFinished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
final Map<String, List<String>> generated = myGeneratedPaths.getAndSet(new HashMap<String, List<String>>());
if (myProject.isDisposed()) {
return;
}
if (errors == 0 && !aborted && myPerformHotswapAfterThisCompilation) {
for (HotSwapVetoableListener listener : myListeners) {
if (!listener.shouldHotSwap(compileContext)) {
return;
}
}
final List<DebuggerSession> sessions = new ArrayList<DebuggerSession>();
Collection<DebuggerSession> debuggerSessions = DebuggerManagerEx.getInstanceEx(myProject).getSessions();
for (final DebuggerSession debuggerSession : debuggerSessions) {
if (debuggerSession.isAttached() && debuggerSession.getProcess().canRedefineClasses()) {
sessions.add(debuggerSession);
}
}
if (!sessions.isEmpty()) {
hotSwapSessions(sessions, generated);
}
}
myPerformHotswapAfterThisCompilation = true;
}
示例4: actionPerformed
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e)
{
Project project = e.getData(CommonDataKeys.PROJECT);
if(project == null)
{
return;
}
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
if(session != null && session.isAttached())
{
HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
}
}
示例5: reloadChangedClasses
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Override
public void reloadChangedClasses(final DebuggerSession session, boolean compileBeforeHotswap)
{
dontAskHotswapAfterThisCompilation();
if(compileBeforeHotswap)
{
CompilerManager.getInstance(session.getProject()).make(null);
}
else
{
if(session.isAttached())
{
hotSwapSessions(Collections.singletonList(session), null);
}
}
}
示例6: scanForModifiedClasses
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public Map<DebuggerSession, Map<String, HotSwapFile>> scanForModifiedClasses( List<DebuggerSession> sessions, HotSwapProgress swapProgress )
{
Map<DebuggerSession, Map<String, HotSwapFile>> modifiedClasses = new HashMap<>();
MultiProcessCommand scanClassesCommand = new MultiProcessCommand();
swapProgress.setCancelWorker( scanClassesCommand::cancel );
for( final DebuggerSession debuggerSession : sessions )
{
if( debuggerSession.isAttached() )
{
scanClassesCommand.addCommand( debuggerSession.getProcess(), new DebuggerCommandImpl()
{
protected void action() throws Exception
{
swapProgress.setDebuggerSession( debuggerSession );
Map<String, HotSwapFile> sessionClasses = scanForModifiedClasses( debuggerSession, swapProgress );
if( !sessionClasses.isEmpty() )
{
modifiedClasses.put( debuggerSession, sessionClasses );
}
}
} );
}
}
swapProgress.setTitle( DebuggerBundle.message( "progress.hotswap.scanning.classes" ) );
scanClassesCommand.run();
if( swapProgress.isCancelled() )
{
for( DebuggerSession session : sessions )
{
session.setModifiedClassesScanRequired( true );
}
return new HashMap<>();
}
return modifiedClasses;
}
示例7: actionPerformed
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if(project == null) {
return;
}
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
if(session != null && session.isAttached()) {
HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
}
}
示例8: actionPerformed
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}
DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();
final DebuggerSession session = context.getDebuggerSession();
if(session != null && session.isAttached()) {
final DebugProcessImpl process = context.getDebugProcess();
process.getManagerThread().invoke(new DebuggerCommandImpl() {
protected void action() throws Exception {
final VirtualMachineProxyImpl vm = process.getVirtualMachineProxy();
vm.suspend();
try {
final List<ThreadState> threads = buildThreadStates(vm);
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
XDebugSession xSession = session.getXDebugSession();
if (xSession != null) {
DebuggerUtilsEx.addThreadDump(project, threads, xSession.getUI(), session);
}
}
}, ModalityState.NON_MODAL);
}
finally {
vm.resume();
}
}
});
}
}
示例9: reloadChangedClasses
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void reloadChangedClasses(final DebuggerSession session, boolean compileBeforeHotswap) {
dontAskHotswapAfterThisCompilation();
if (compileBeforeHotswap) {
CompilerManager.getInstance(session.getProject()).make(null);
}
else {
if (session.isAttached()) {
hotSwapSessions(Collections.singletonList(session), null);
}
}
}
示例10: actionPerformed
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
if(project == null) {
return;
}
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
if(session != null && session.isAttached()) {
HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
}
}
示例11: actionPerformed
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}
DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();
final DebuggerSession session = context.getDebuggerSession();
if(session != null && session.isAttached()) {
final DebugProcessImpl process = context.getDebugProcess();
process.getManagerThread().invoke(new DebuggerCommandImpl() {
protected void action() throws Exception {
final VirtualMachineProxyImpl vm = process.getVirtualMachineProxy();
vm.suspend();
try {
final List<ThreadState> threads = buildThreadStates(vm);
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
final DebuggerSessionTab sessionTab = DebuggerPanelsManager.getInstance(project).getSessionTab();
if (sessionTab != null) {
sessionTab.addThreadDump(threads);
}
}
}, ModalityState.NON_MODAL);
}
finally {
vm.resume();
}
}
});
}
}
示例12: compilationFinished
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Override
public void compilationFinished(boolean aborted, int errors, int warnings, CompileContext compileContext)
{
final Map<String, List<String>> generated = myGeneratedPaths.getAndSet(new HashMap<>());
if(myProject.isDisposed())
{
return;
}
HotSwapUIImpl hotSwapUI = (HotSwapUIImpl) HotSwapUI.getInstance(myProject);
if(errors == 0 && !aborted && hotSwapUI.myPerformHotswapAfterThisCompilation)
{
for(HotSwapVetoableListener listener : hotSwapUI.myListeners)
{
if(!listener.shouldHotSwap(compileContext))
{
return;
}
}
final List<DebuggerSession> sessions = new ArrayList<>();
Collection<DebuggerSession> debuggerSessions = DebuggerManagerEx.getInstanceEx(myProject).getSessions();
for(final DebuggerSession debuggerSession : debuggerSessions)
{
if(debuggerSession.isAttached() && debuggerSession.getProcess().canRedefineClasses())
{
sessions.add(debuggerSession);
}
}
if(!sessions.isEmpty())
{
hotSwapUI.hotSwapSessions(sessions, generated);
}
}
hotSwapUI.myPerformHotswapAfterThisCompilation = true;
}
示例13: canShowHint
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Override
public boolean canShowHint(@NotNull final Project project) {
DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(project).getContext().getDebuggerSession();
return debuggerSession != null && debuggerSession.isAttached();
}
示例14: canHotSwap
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public static boolean canHotSwap(@NotNull DebuggerSession debuggerSession) {
return debuggerSession.isAttached() && debuggerSession.getProcess().canRedefineClasses();
}
示例15: canShowHint
import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public boolean canShowHint(@NotNull final Project project) {
DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(project).getContext().getDebuggerSession();
return debuggerSession != null && debuggerSession.isAttached();
}