From fada6f1910dd1d73b7de2c030f877b14e5e361f7 Mon Sep 17 00:00:00 2001 From: Alexey Ushakov Date: Fri, 23 May 2014 11:18:37 +0400 Subject: [PATCH] Add temporary api to allow custom initialization of debug session data --- .../XDebugProcessConfiguratorStarter.java | 26 +++++++++++++++++++ .../xdebugger/impl/XDebuggerManagerImpl.java | 8 ++++++ 2 files changed, 34 insertions(+) create mode 100644 platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugProcessConfiguratorStarter.java diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugProcessConfiguratorStarter.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugProcessConfiguratorStarter.java new file mode 100644 index 000000000000..276814caf569 --- /dev/null +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugProcessConfiguratorStarter.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.xdebugger.impl; + +import com.intellij.xdebugger.XDebugProcessStarter; +import com.intellij.xdebugger.impl.ui.XDebugSessionData; + +/** + * Created by avu on 22/05/14. + */ +public abstract class XDebugProcessConfiguratorStarter extends XDebugProcessStarter { + public abstract void configure(XDebugSessionData data); +} diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java index 04ab04f10600..3afd27f7f60f 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java @@ -201,7 +201,15 @@ public class XDebuggerManagerImpl extends XDebuggerManager if (oldSessionData == null) { oldSessionData = new XDebugSessionData(); } + + // Perform custom configuration of session data for XDebugProcessConfiguratorStarter classes + if (processStarter instanceof XDebugProcessConfiguratorStarter) { + session.activateSession(); + ((XDebugProcessConfiguratorStarter)processStarter).configure(oldSessionData); + } + session.init(process, oldSessionData); + mySessions.put(session.getDebugProcess().getProcessHandler(), session); return session;