mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -810,6 +810,7 @@ public class XDebugSessionImpl implements XDebugSession {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (myProject.isDisposed()) return;
|
||||
Editor editor = XDebuggerUtilImpl.createEditor(new OpenFileDescriptor(myProject, position.getFile()));
|
||||
if (editor != null) {
|
||||
JComponent component = editor.getComponent();
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<action id="NextTaskAction" class="com.jetbrains.python.edu.actions.StudyNextStudyTaskAction" text="NextTaskAction" description="Next Task"/>
|
||||
<action id="PreviousTaskAction" class="com.jetbrains.python.edu.actions.StudyPreviousStudyTaskAction" text="PreviousTaskAction"
|
||||
description="Previous Task"/>
|
||||
<action id="RefreshTaskAction" class="com.jetbrains.python.edu.actions.StudyRefreshTaskAction" text="RefreshTaskAction"
|
||||
<action id="RefreshTaskAction" class="com.jetbrains.python.edu.actions.StudyRefreshTaskFileAction" text="RefreshTaskAction"
|
||||
description="Refresh current task"/>
|
||||
<action id="WatchInputAction" class="com.jetbrains.python.edu.actions.StudyEditInputAction" text="WatchInputAction"
|
||||
description="watch input"/>
|
||||
|
||||
@@ -109,19 +109,23 @@ public class StudyTaskManager implements ProjectComponent, PersistentStateCompon
|
||||
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.PROJECT_VIEW).show(null);
|
||||
FileEditor[] editors = FileEditorManager.getInstance(myProject).getSelectedEditors();
|
||||
if (editors.length > 0) {
|
||||
final JComponent focusedComponent = editors[0].getPreferredFocusedComponent();
|
||||
if (focusedComponent != null) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true);
|
||||
ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.PROJECT_VIEW).show(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FileEditor[] editors = FileEditorManager.getInstance(myProject).getSelectedEditors();
|
||||
if (editors.length > 0) {
|
||||
final JComponent focusedComponent = editors[0].getPreferredFocusedComponent();
|
||||
if (focusedComponent != null) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
UISettings.getInstance().HIDE_TOOL_STRIPES = false;
|
||||
|
||||
@@ -15,7 +15,9 @@ import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
import com.intellij.openapi.ui.popup.Balloon;
|
||||
import com.intellij.openapi.ui.popup.BalloonBuilder;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
@@ -93,7 +95,7 @@ public class StudyCheckAction extends DumbAwareAction {
|
||||
@Override
|
||||
public void run() {
|
||||
final StudyEditor selectedEditor = StudyEditor.getSelectedStudyEditor(project);
|
||||
StudyState studyState = new StudyState(selectedEditor);
|
||||
final StudyState studyState = new StudyState(selectedEditor);
|
||||
if (!studyState.isValid()) {
|
||||
LOG.error("StudyCheckAction was invokes outside study editor");
|
||||
return;
|
||||
@@ -107,6 +109,12 @@ public class StudyCheckAction extends DumbAwareAction {
|
||||
if (runAction != null && taskFiles.size() == 1) {
|
||||
runAction.run(project);
|
||||
}
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IdeFocusManager.getInstance(project).requestFocus(studyState.getEditor().getComponent(), true);
|
||||
}
|
||||
});
|
||||
final StudyTestRunner testRunner = new StudyTestRunner(task, taskDir);
|
||||
Process testProcess = null;
|
||||
try {
|
||||
@@ -255,12 +263,7 @@ public class StudyCheckAction extends DumbAwareAction {
|
||||
assert studyEditor != null;
|
||||
JButton checkButton = studyEditor.getCheckButton();
|
||||
balloon.showInCenterOf(checkButton);
|
||||
balloon.addListener(new JBPopupAdapter() {
|
||||
@Override
|
||||
public void onClosed(LightweightWindowEvent event) {
|
||||
Disposer.dispose(balloon);
|
||||
}
|
||||
});
|
||||
Disposer.register(project, balloon);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-9
@@ -11,7 +11,9 @@ import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
import com.intellij.openapi.ui.popup.Balloon;
|
||||
import com.intellij.openapi.ui.popup.BalloonBuilder;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
@@ -23,8 +25,8 @@ import com.jetbrains.python.edu.editor.StudyEditor;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class StudyRefreshTaskAction extends DumbAwareAction {
|
||||
private static final Logger LOG = Logger.getInstance(StudyRefreshTaskAction.class.getName());
|
||||
public class StudyRefreshTaskFileAction extends DumbAwareAction {
|
||||
private static final Logger LOG = Logger.getInstance(StudyRefreshTaskFileAction.class.getName());
|
||||
|
||||
public void refresh(final Project project) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@@ -104,12 +106,7 @@ public class StudyRefreshTaskAction extends DumbAwareAction {
|
||||
StudyEditor selectedStudyEditor = StudyEditor.getSelectedStudyEditor(project);
|
||||
assert selectedStudyEditor != null;
|
||||
balloon.showInCenterOf(selectedStudyEditor.getRefreshButton());
|
||||
balloon.addListener(new JBPopupAdapter() {
|
||||
@Override
|
||||
public void onClosed(LightweightWindowEvent event) {
|
||||
Disposer.dispose(balloon);
|
||||
}
|
||||
});
|
||||
Disposer.register(project, balloon);
|
||||
}
|
||||
catch (FileNotFoundException e1) {
|
||||
LOG.error(e1);
|
||||
@@ -241,8 +241,8 @@ public class StudyEditor implements TextEditor {
|
||||
myRefreshButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
StudyRefreshTaskAction studyRefreshTaskAction =
|
||||
(StudyRefreshTaskAction)ActionManager.getInstance().getAction("RefreshTaskAction");
|
||||
StudyRefreshTaskFileAction studyRefreshTaskAction =
|
||||
(StudyRefreshTaskFileAction)ActionManager.getInstance().getAction("RefreshTaskAction");
|
||||
studyRefreshTaskAction.refresh(myProject);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user