mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+4
@@ -55,6 +55,7 @@ public class SMTRunnerConsoleView extends BaseTestsOutputConsoleView {
|
||||
mySplitterProperty = splitterProperty;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestResultsPanel createTestResultsPanel() {
|
||||
// Results View
|
||||
myResultsViewer = new SMTestRunnerResultsForm(myProperties.getConfiguration(),
|
||||
@@ -72,6 +73,7 @@ public class SMTRunnerConsoleView extends BaseTestsOutputConsoleView {
|
||||
|
||||
// Console
|
||||
myResultsViewer.addEventsListener(new TestResultsViewer.SMEventsAdapter() {
|
||||
@Override
|
||||
public void onSelected(@Nullable final SMTestProxy selectedTestProxy,
|
||||
@NotNull final TestResultsViewer viewer,
|
||||
@NotNull final TestFrameworkRunningModel model) {
|
||||
@@ -81,6 +83,7 @@ public class SMTRunnerConsoleView extends BaseTestsOutputConsoleView {
|
||||
|
||||
// print selected content
|
||||
SMRunnerUtil.runInEventDispatchThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getPrinter().updateOnTestSelected(selectedTestProxy);
|
||||
}
|
||||
@@ -102,6 +105,7 @@ public class SMTRunnerConsoleView extends BaseTestsOutputConsoleView {
|
||||
@Override
|
||||
public void print(@NotNull final String s, @NotNull final ConsoleViewContentType contentType) {
|
||||
myResultsViewer.getRoot().addLast(new Printable() {
|
||||
@Override
|
||||
public void printOn(final Printer printer) {
|
||||
printer.print(s, contentType);
|
||||
}
|
||||
|
||||
+19
@@ -59,12 +59,15 @@ public abstract class BaseTestsOutputConsoleView implements ConsoleView, Observa
|
||||
|
||||
protected abstract TestResultsPanel createTestResultsPanel();
|
||||
|
||||
@Override
|
||||
public void attachToProcess(final ProcessHandler processHandler) {
|
||||
myConsole.attachToProcess(processHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(@NotNull final String s, @NotNull final ConsoleViewContentType contentType) {
|
||||
printNew(new Printable() {
|
||||
@Override
|
||||
public void printOn(final Printer printer) {
|
||||
printer.print(s, contentType);
|
||||
}
|
||||
@@ -75,67 +78,82 @@ public abstract class BaseTestsOutputConsoleView implements ConsoleView, Observa
|
||||
public void allowHeavyFilters() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
myConsole.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollTo(final int offset) {
|
||||
myConsole.scrollTo(offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOutputPaused(final boolean value) {
|
||||
if (myPrinter != null) {
|
||||
myPrinter.pause(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOutputPaused() {
|
||||
//noinspection SimplifiableConditionalExpression
|
||||
return myPrinter == null ? true : myPrinter.isPaused();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDeferredOutput() {
|
||||
return myConsole.hasDeferredOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performWhenNoDeferredOutput(final Runnable runnable) {
|
||||
myConsole.performWhenNoDeferredOutput(runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHelpId(final String helpId) {
|
||||
myConsole.setHelpId(helpId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMessageFilter(final Filter filter) {
|
||||
myConsole.addMessageFilter(filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHyperlink(final String hyperlinkText, final HyperlinkInfo info) {
|
||||
printNew(new HyperLink(hyperlinkText, info));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContentSize() {
|
||||
return myConsole.getContentSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPause() {
|
||||
return myPrinter != null && myPrinter.canPause() && myConsole.canPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return myTestResultsPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPreferredFocusableComponent() {
|
||||
return myConsole.getPreferredFocusableComponent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
myPrinter = null;
|
||||
myProperties = null;
|
||||
myConsole = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangeListener(@NotNull final ChangeListener listener, @NotNull final Disposable parent) {
|
||||
if (myConsole instanceof ObservableConsoleView) {
|
||||
((ObservableConsoleView)myConsole).addChangeListener(listener, parent);
|
||||
@@ -144,6 +162,7 @@ public abstract class BaseTestsOutputConsoleView implements ConsoleView, Observa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public AnAction[] createConsoleActions() {
|
||||
return AnAction.EMPTY_ARRAY;
|
||||
|
||||
@@ -67,12 +67,12 @@ public class PythonConsoleView extends JPanel implements LanguageConsoleView, Ob
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(PythonConsoleView.class);
|
||||
|
||||
private Project myProject;
|
||||
private final Project myProject;
|
||||
private PydevConsoleExecuteActionHandler myExecuteActionHandler;
|
||||
private PyConsoleSourceHighlighter mySourceHighlighter;
|
||||
private boolean myIsIPythonOutput = false;
|
||||
private PyHighlighter myPyHighlighter;
|
||||
private EditorColorsScheme myScheme;
|
||||
private final PyHighlighter myPyHighlighter;
|
||||
private final EditorColorsScheme myScheme;
|
||||
private boolean myHyperlink;
|
||||
|
||||
private final LanguageConsoleViewImpl myLanguageConsoleView;
|
||||
@@ -103,6 +103,7 @@ public class PythonConsoleView extends JPanel implements LanguageConsoleView, Ob
|
||||
myExecuteActionHandler = consoleExecuteActionHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
IdeFocusManager.findInstance().requestFocus(getPythonLanguageConsole().getConsoleEditor().getContentComponent(), true);
|
||||
myLanguageConsoleView.updateUI();
|
||||
@@ -120,6 +121,7 @@ public class PythonConsoleView extends JPanel implements LanguageConsoleView, Ob
|
||||
@Override
|
||||
public void executeCode(final @NotNull String code, @Nullable final Editor editor) {
|
||||
ProgressManager.getInstance().run(new Task.Backgroundable(null, "Executing code in console...", false) {
|
||||
@Override
|
||||
public void run(@NotNull final ProgressIndicator indicator) {
|
||||
long time = System.currentTimeMillis();
|
||||
while (!myExecuteActionHandler.isEnabled() || !myExecuteActionHandler.canExecuteNow()) {
|
||||
@@ -140,7 +142,7 @@ public class PythonConsoleView extends JPanel implements LanguageConsoleView, Ob
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
if (!indicator.isCanceled()) {
|
||||
@@ -186,6 +188,7 @@ public class PythonConsoleView extends JPanel implements LanguageConsoleView, Ob
|
||||
myLanguageConsoleView.print(text, outputType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(@NotNull String text, @NotNull final ConsoleViewContentType outputType) {
|
||||
detectIPython(text, outputType);
|
||||
if (PyConsoleUtil.detectIPythonEnd(text)) {
|
||||
|
||||
@@ -242,19 +242,23 @@ public class PythonDebugLanguageConsoleView extends JPanel implements ConsoleVie
|
||||
myConsole = console;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(final AnActionEvent event) {
|
||||
return myConsole.isDebugConsole();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(final AnActionEvent event, final boolean flag) {
|
||||
myConsole.showDebugConsole(flag);
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
update(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(final AnActionEvent event) {
|
||||
super.update(event);
|
||||
final Presentation presentation = event.getPresentation();
|
||||
|
||||
Reference in New Issue
Block a user