mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
restore old pycharm "show py prompt" button appearance
This commit is contained in:
@@ -19,6 +19,7 @@ import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -29,15 +30,18 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
|
||||
private final static String PRIMARY_CONSOLE_PANEL = "PRIMARY_CONSOLE_PANEL";
|
||||
private final static String SECONDARY_CONSOLE_PANEL = "SECONDARY_CONSOLE_PANEL";
|
||||
|
||||
@NotNull
|
||||
private final S myPrimaryConsoleView;
|
||||
|
||||
@NotNull
|
||||
private final T mySecondaryConsoleView;
|
||||
|
||||
private boolean myPrimary;
|
||||
|
||||
@Nullable
|
||||
private ProcessHandler myProcessHandler;
|
||||
@NotNull
|
||||
private final SwitchDuplexConsoleViewAction mySwitchConsoleAction;
|
||||
|
||||
public DuplexConsoleView(S primaryConsoleView, T secondaryConsoleView) {
|
||||
public DuplexConsoleView(@NotNull S primaryConsoleView, @NotNull T secondaryConsoleView) {
|
||||
super(new CardLayout());
|
||||
myPrimaryConsoleView = primaryConsoleView;
|
||||
mySecondaryConsoleView = secondaryConsoleView;
|
||||
@@ -45,6 +49,8 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
|
||||
add(myPrimaryConsoleView.getComponent(), PRIMARY_CONSOLE_PANEL);
|
||||
add(mySecondaryConsoleView.getComponent(), SECONDARY_CONSOLE_PANEL);
|
||||
|
||||
mySwitchConsoleAction = new SwitchDuplexConsoleViewAction(this);
|
||||
|
||||
myPrimary = true;
|
||||
enableConsole(false);
|
||||
|
||||
@@ -74,10 +80,12 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
|
||||
return myPrimary;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public S getPrimaryConsoleView() {
|
||||
return myPrimaryConsoleView;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public T getSecondaryConsoleView() {
|
||||
return mySecondaryConsoleView;
|
||||
}
|
||||
@@ -166,13 +174,8 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
|
||||
public AnAction[] createConsoleActions() {
|
||||
List<AnAction> actions = Lists.newArrayList();
|
||||
actions.addAll(Arrays.asList(myPrimaryConsoleView.createConsoleActions()));
|
||||
//for (AnAction action : mySecondaryConsoleView.createConsoleActions()) {
|
||||
// if (!actions.contains(action)) {
|
||||
// actions.add(action);
|
||||
// }
|
||||
//}
|
||||
|
||||
actions.add(new SwitchDuplexConsoleViewAction(this));
|
||||
actions.add(mySwitchConsoleAction);
|
||||
|
||||
return ArrayUtil.toObjectArray(actions, AnAction.class);
|
||||
}
|
||||
@@ -207,6 +210,11 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Presentation getSwitchConsoleActionPresentation() {
|
||||
return mySwitchConsoleAction.getTemplatePresentation();
|
||||
}
|
||||
|
||||
private static class SwitchDuplexConsoleViewAction extends ToggleAction implements DumbAware {
|
||||
private final DuplexConsoleView myConsole;
|
||||
|
||||
|
||||
@@ -789,6 +789,7 @@ runcfg.unittest.dlg.test_function_title=Function
|
||||
runcfg.unittest.dlg.keywords=Keywords:
|
||||
run.configuration.remote.debug.name=Python Remote Debug
|
||||
run.configuration.type.description=Starts server for remote debug
|
||||
run.configuration.show.command.line.action.name=Show Python Prompt
|
||||
|
||||
unable.to.stop=Currently running process can't be stopped. Kill it manually first.
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import icons.PythonIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -36,6 +38,9 @@ public class PythonDebugLanguageConsoleView extends DuplexConsoleView<ConsoleVie
|
||||
super(consoleView, new PythonConsoleView(project, "Python Console", sdk));
|
||||
|
||||
enableConsole(!PyConsoleOptions.getInstance(project).isShowDebugConsoleByDefault());
|
||||
|
||||
getSwitchConsoleActionPresentation().setIcon(PythonIcons.Python.Debug.CommandLine);
|
||||
getSwitchConsoleActionPresentation().setText(PyBundle.message("run.configuration.show.command.line.action.name"));
|
||||
}
|
||||
|
||||
public PythonDebugLanguageConsoleView(final Project project, Sdk sdk) {
|
||||
|
||||
Reference in New Issue
Block a user