From eacdb9fa668ced6d0f4c0d95ccb7c8889a9e28a4 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 14:57:15 +0200 Subject: [PATCH 01/23] @TestOnly UpdateRequestsQueue.waitUntilRefreshed (IDEA-CR-4267) --- .../com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java index 9b064f67b38c..bdc806669ae0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java @@ -28,6 +28,7 @@ import com.intellij.util.Consumer; import com.intellij.util.concurrency.Semaphore; import com.intellij.util.io.storage.HeavyProcessLatch; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.TestOnly; import javax.swing.*; import java.util.ArrayList; @@ -150,6 +151,7 @@ public class UpdateRequestsQueue { LOG.debug("Stop finished for project: " + myProject.getName()); } + @TestOnly public void waitUntilRefreshed() { while (true) { final Semaphore semaphore = new Semaphore(); From 7812538433ed429d9c8516c336370e57e005a793 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 10 Aug 2015 16:04:11 +0200 Subject: [PATCH 02/23] Idea sets default scaling on Linux to 1.25f, which is wrong. --- platform/util/src/com/intellij/util/ui/JBUI.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/util/src/com/intellij/util/ui/JBUI.java b/platform/util/src/com/intellij/util/ui/JBUI.java index 1684f553268f..91dd0dd296d2 100644 --- a/platform/util/src/com/intellij/util/ui/JBUI.java +++ b/platform/util/src/com/intellij/util/ui/JBUI.java @@ -85,6 +85,10 @@ public class JBUI { else if (scale < 2f) scale = 1.75f; else scale = 2.0f; + if (SystemInfo.isLinux && scale == 1.25f) { + //Default UI font size for Unity and Gnome is 15. Scaling factor 1.25f works badly on Linux + scale = 1f; + } SCALE_FACTOR = scale; IconLoader.setScale(scale); } From 8c61dbb2e7e595d54c6c404d3ac8662f28f0a6fb Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 10 Aug 2015 17:22:06 +0300 Subject: [PATCH 03/23] EA-71679 - NPE: XDebuggerEvaluateActionHandler.showDialog --- .../handlers/XDebuggerEvaluateActionHandler.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerEvaluateActionHandler.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerEvaluateActionHandler.java index 92e353b9346c..9afff78ef6e5 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerEvaluateActionHandler.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerEvaluateActionHandler.java @@ -79,12 +79,14 @@ public class XDebuggerEvaluateActionHandler extends XDebuggerActionHandler { value.calculateEvaluationExpression().done(new Consumer() { @Override public void consume(final XExpression expression) { - AppUIUtil.invokeOnEdt(new Runnable() { - @Override - public void run() { - showDialog(session, file, editorsProvider, stackFrame, evaluator, expression); - } - }); + if (expression != null) { + AppUIUtil.invokeOnEdt(new Runnable() { + @Override + public void run() { + showDialog(session, file, editorsProvider, stackFrame, evaluator, expression); + } + }); + } } }); return; @@ -100,7 +102,7 @@ public class XDebuggerEvaluateActionHandler extends XDebuggerActionHandler { XDebuggerEditorsProvider editorsProvider, XStackFrame stackFrame, XDebuggerEvaluator evaluator, - XExpression expression) { + @NotNull XExpression expression) { if (expression.getLanguage() == null) { Language language = null; if (stackFrame != null) { From 614a2c07b9232c644dda5e9741f7fbf0cf10cc15 Mon Sep 17 00:00:00 2001 From: Sergey Savenko Date: Mon, 10 Aug 2015 17:29:44 +0300 Subject: [PATCH 04/23] Remove tabbed pane wrapper is null assertion Adding a new tabbed component in com.intellij.openapi.fileEditor.impl.EditorComposite.addEditor can cause actions update, which requires a currently selected editor. The removed assertion failed in this case. --- .../openapi/fileEditor/impl/EditorWithProviderComposite.java | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWithProviderComposite.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWithProviderComposite.java index 63677ed684c1..a11827777575 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWithProviderComposite.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorWithProviderComposite.java @@ -62,7 +62,6 @@ public class EditorWithProviderComposite extends EditorComposite { public Pair getSelectedEditorWithProvider() { LOG.assertTrue(myEditors.length > 0, myEditors.length); if (myEditors.length == 1) { - LOG.assertTrue(myTabbedPaneWrapper == null); return Pair.create(myEditors[0], myProviders[0]); } else { // we have to get myEditor from tabbed pane From e8b2c686f4e8678e78a5c245996e5524e6f4a4e5 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Sun, 9 Aug 2015 21:03:11 +0300 Subject: [PATCH 05/23] fixed button size in new project study panel --- .../com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java index 7fff347c61a6..6aac2ca5c52a 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java @@ -16,14 +16,15 @@ import com.intellij.util.Consumer; import com.jetbrains.edu.courseFormat.Course; import com.jetbrains.edu.learning.StudyUtils; import com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator; -import com.jetbrains.edu.stepic.StudySettings; import com.jetbrains.edu.stepic.CourseInfo; import com.jetbrains.edu.stepic.EduStepicConnector; +import com.jetbrains.edu.stepic.StudySettings; import icons.InteractiveLearningIcons; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -51,6 +52,8 @@ public class StudyNewProjectPanel{ public StudyNewProjectPanel(StudyProjectGenerator generator) { myGenerator = generator; myAvailableCourses = myGenerator.getCourses(false); + myBrowseButton.setPreferredSize(new Dimension(28, 28)); + myRefreshButton.setPreferredSize(new Dimension(28, 28)); if (myAvailableCourses.isEmpty()) { setError(CONNECTION_ERROR); } From f47356801a51480129edd926b7d77361edb1ae12 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 16:43:29 +0300 Subject: [PATCH 06/23] update toolwindow buttons and task text --- .../jetbrains/edu/learning/StudyUtils.java | 10 ++---- .../learning/actions/StudyCheckAction.java | 7 +++- .../actions/StudyRefreshTaskFileAction.java | 6 ++-- .../actions/StudyTaskNavigationAction.java | 5 +++ .../edu/learning/ui/StudyToolWindow.java | 33 +++++++++++++------ 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/StudyUtils.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/StudyUtils.java index 73ba099fbc2e..1d129c8c8a3d 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/StudyUtils.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/StudyUtils.java @@ -106,15 +106,11 @@ public class StudyUtils { public static void updateAction(@NotNull final AnActionEvent e) { final Presentation presentation = e.getPresentation(); presentation.setEnabled(false); - presentation.setVisible(false); final Project project = e.getProject(); if (project != null) { - final FileEditor[] editors = FileEditorManager.getInstance(project).getAllEditors(); - for (FileEditor editor : editors) { - if (editor instanceof StudyEditor) { - presentation.setEnabled(true); - presentation.setVisible(true); - } + final StudyEditor studyEditor = getSelectedStudyEditor(project); + if (studyEditor != null) { + presentation.setEnabled(true); } } } diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyCheckAction.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyCheckAction.java index 88ea6492ec32..596446f3daaa 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyCheckAction.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyCheckAction.java @@ -7,6 +7,7 @@ import com.intellij.ide.projectView.ProjectView; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.KeyboardShortcut; +import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.diagnostic.Logger; @@ -396,6 +397,10 @@ public class StudyCheckAction extends DumbAwareAction { @Override public void update(AnActionEvent e) { - e.getPresentation().setEnabled(!checkInProgress); + final Presentation presentation = e.getPresentation(); + StudyUtils.updateAction(e); + if (presentation.isEnabled()) { + presentation.setEnabled(!checkInProgress); + } } } diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyRefreshTaskFileAction.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyRefreshTaskFileAction.java index f36e544c1e4f..bca245a7e9ca 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyRefreshTaskFileAction.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyRefreshTaskFileAction.java @@ -175,13 +175,13 @@ public class StudyRefreshTaskFileAction extends DumbAwareAction { @Override public void update(AnActionEvent event) { - EduUtils.enableAction(event, false); + StudyUtils.updateAction(event); final Project project = event.getProject(); if (project != null) { StudyEditor studyEditor = StudyUtils.getSelectedStudyEditor(project); StudyState studyState = new StudyState(studyEditor); - if (studyState.isValid()) { - EduUtils.enableAction(event, true); + if (!studyState.isValid()) { + event.getPresentation().setEnabled(false); } } } diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyTaskNavigationAction.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyTaskNavigationAction.java index fca1daadea3e..25111e7b52c5 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyTaskNavigationAction.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/actions/StudyTaskNavigationAction.java @@ -115,4 +115,9 @@ abstract public class StudyTaskNavigationAction extends DumbAwareAction { protected abstract String getNavigationFinishedMessage(); protected abstract Task getTargetTask(@NotNull final Task sourceTask); + + @Override + public void update(AnActionEvent e) { + StudyUtils.updateAction(e); + } } diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java index 9703f587c109..a55a6f321869 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java @@ -43,13 +43,23 @@ import javax.swing.border.EmptyBorder; public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvider, Disposable { + private static final String EMPTY_TASK_TEXT = "Please, open any task to see task description"; + public StudyToolWindow(final Project project) { super(true, true); JPanel toolbarPanel = createToolbarPanel(); setToolbar(toolbarPanel); final StudyEditor studyEditor = StudyUtils.getSelectedStudyEditor(project); - if (studyEditor == null) return; + if (studyEditor == null) { + final JTextPane taskTextPane = new JTextPane(); + taskTextPane.setEditable(false); + taskTextPane.setText(EMPTY_TASK_TEXT); + taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground()); + taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100)); + setContent(taskTextPane); + return; + } Task task = studyEditor.getTaskFile().getTask(); if (task != null) { @@ -92,22 +102,24 @@ public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvid private Project myProject; private JTextPane myTaskTextPane; - StudyFileEditorManagerListener(@NotNull final Project project, JTextPane taskTextPane){ + StudyFileEditorManagerListener(@NotNull final Project project, JTextPane taskTextPane) { myProject = project; myTaskTextPane = taskTextPane; } - @Override - public void fileOpened (@NotNull FileEditorManager source, @NotNull VirtualFile file){ + + @Override + public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) { Task task = getTask(file); setTaskText(task); } - @Override - public void fileClosed (@NotNull FileEditorManager source, @NotNull VirtualFile file){ + @Override + public void fileClosed(@NotNull FileEditorManager source, @NotNull VirtualFile file) { + myTaskTextPane.setText(EMPTY_TASK_TEXT); } - @Override - public void selectionChanged (@NotNull FileEditorManagerEvent event){ + @Override + public void selectionChanged(@NotNull FileEditorManagerEvent event) { VirtualFile file = event.getNewFile(); if (file != null) { Task task = getTask(file); @@ -115,8 +127,8 @@ public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvid } } - @Nullable - private Task getTask (@NotNull VirtualFile file){ + @Nullable + private Task getTask(@NotNull VirtualFile file) { TaskFile taskFile = StudyUtils.getTaskFile(myProject, file); if (taskFile != null) { return taskFile.getTask(); @@ -128,6 +140,7 @@ public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvid private void setTaskText(@Nullable final Task task) { if (task == null) { + myTaskTextPane.setText(EMPTY_TASK_TEXT); return; } String text = task.getText(); From 3a9160f5be5352128ae4f7157b2497fa37116327 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 17:22:51 +0300 Subject: [PATCH 07/23] fixed EDU-276 Pycharm education - how to change font size of task description area in lessons --- .../edu/learning/ui/StudyToolWindow.java | 36 +++++++++++++------ .../learning/ui/StudyToolWindowFactory.java | 1 - 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java index a55a6f321869..841162e1dadf 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindow.java @@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.ActionToolbar; import com.intellij.openapi.actionSystem.DataProvider; import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.editor.colors.EditorColorsManager; +import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.FileEditorManagerEvent; import com.intellij.openapi.fileEditor.FileEditorManagerListener; @@ -40,6 +41,9 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.border.EmptyBorder; +import javax.swing.text.html.HTMLDocument; +import javax.swing.text.html.HTMLEditorKit; +import java.awt.*; public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvider, Disposable { @@ -51,28 +55,21 @@ public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvid setToolbar(toolbarPanel); final StudyEditor studyEditor = StudyUtils.getSelectedStudyEditor(project); + final JTextPane taskTextPane = createTaskTextPane(); + if (studyEditor == null) { - final JTextPane taskTextPane = new JTextPane(); - taskTextPane.setEditable(false); taskTextPane.setText(EMPTY_TASK_TEXT); - taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground()); - taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100)); setContent(taskTextPane); return; } - Task task = studyEditor.getTaskFile().getTask(); + final Task task = studyEditor.getTaskFile().getTask(); if (task != null) { final String taskText = task.getText(); - - final JTextPane taskTextPane = new JTextPane(); JBScrollPane scrollPane = new JBScrollPane(taskTextPane); - taskTextPane.setContentType("text/html"); - taskTextPane.setEditable(false); taskTextPane.setText(taskText); taskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE); - taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground()); - taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100)); + setContent(scrollPane); final FileEditorManagerListener listener = new StudyFileEditorManagerListener(project, taskTextPane); @@ -80,6 +77,23 @@ public class StudyToolWindow extends SimpleToolWindowPanel implements DataProvid } } + @NotNull + private JTextPane createTaskTextPane() { + final JTextPane taskTextPane = new JTextPane(); + taskTextPane.setContentType(new HTMLEditorKit().getContentType()); + final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme(); + int fontSize = editorColorsScheme.getEditorFontSize(); + final String fontName = editorColorsScheme.getEditorFontName(); + final Font font = new Font(fontName, Font.PLAIN, fontSize); + String bodyRule = "body { font-family: " + font.getFamily() + "; " + + "font-size: " + font.getSize() + "pt; }"; + ((HTMLDocument)taskTextPane.getDocument()).getStyleSheet().addRule(bodyRule); + taskTextPane.setEditable(false); + taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground()); + taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100)); + return taskTextPane; + } + public void dispose() { } diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindowFactory.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindowFactory.java index 4522064be221..d847b4606468 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindowFactory.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyToolWindowFactory.java @@ -25,7 +25,6 @@ public class StudyToolWindowFactory implements ToolWindowFactory, DumbAware { final Content content = contentManager.getFactory().createContent(studyToolWindow, null, false); contentManager.addContent(content); Disposer.register(project, studyToolWindow); - } } From f5658cd0feb2c9996e247b881a7992544aaa2be9 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 18:18:47 +0300 Subject: [PATCH 08/23] do not show empty author label --- .../com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java index 6aac2ca5c52a..a32674311844 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java @@ -62,7 +62,8 @@ public class StudyNewProjectPanel{ myCoursesComboBox.addItem(courseInfo); } final CourseInfo selectedCourse = StudyUtils.getFirst(myAvailableCourses); - myAuthorLabel.setText("Author: " + Course.getAuthorsString(selectedCourse.getAuthors())); + final String authorsString = Course.getAuthorsString(selectedCourse.getAuthors()); + myAuthorLabel.setText(!StringUtil.isEmptyOrSpaces(authorsString) ? "Author: " + authorsString : ""); myDescriptionLabel.setText(selectedCourse.getDescription()); //setting the first course in list as selected myGenerator.setSelectedCourse(selectedCourse); @@ -212,7 +213,8 @@ public class StudyNewProjectPanel{ myDescriptionLabel.setText(""); return; } - myAuthorLabel.setText("Author: " + Course.getAuthorsString(selectedCourse.getAuthors())); + final String authorsString = Course.getAuthorsString(selectedCourse.getAuthors()); + myAuthorLabel.setText(!StringUtil.isEmptyOrSpaces(authorsString) ?"Author: " + authorsString : ""); myCoursesComboBox.removeItem(CourseInfo.INVALID_COURSE); myDescriptionLabel.setText(selectedCourse.getDescription()); myGenerator.setSelectedCourse(selectedCourse); From 4636648258e29a89c37c93cbd91c1d9d0b0e2518 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 10 Aug 2015 19:04:00 +0300 Subject: [PATCH 09/23] vcs: codereview --- .../history/integration/ui/FileHistoryDialogTest.java | 4 ++-- .../history/integration/ui/LocalHistoryUITestCase.java | 2 +- .../integration/ui/SelectionHistoryDialogTest.java | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java index 8a138b961877..19680575a3b6 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java @@ -110,8 +110,8 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { DiffContent left = getLeftDiffContent(m); DiffContent right = getRightDiffContent(m); - assertEquals(leftContent, left); - assertEquals(rightContent, right); + assertContent(leftContent, left); + assertContent(rightContent, right); } private DiffContent getLeftDiffContent(FileHistoryDialogModel m) { diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java index 36dcb951c1b0..3de6a99e6dbd 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java @@ -23,7 +23,7 @@ import com.intellij.testFramework.SkipInHeadlessEnvironment; @SkipInHeadlessEnvironment public abstract class LocalHistoryUITestCase extends IntegrationTestCase { - protected void assertEquals(String expected, DiffContent actual) { + protected void assertContent(String expected, DiffContent actual) { actual.onAssigned(true); try { assertEquals(expected, ((DocumentContent)actual).getDocument().getText()); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java index 008a9bb166a9..b97af0ef8787 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java @@ -90,8 +90,8 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { DiffContent left = dm.getLeftDiffContent(new NullRevisionsProgress()); DiffContent right = dm.getRightDiffContent(new NullRevisionsProgress()); - assertEquals("b", left); - assertEquals("bc", right); + assertContent("b", left); + assertContent("bc", right); } public void testDiffContentsAndTitleForCurrentRevision() throws IOException { @@ -101,7 +101,7 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { DiffContent right = dm.getRightDiffContent(new NullRevisionsProgress()); - assertEquals("bcd", right); + assertContent("bcd", right); assertTrue(right instanceof DocumentFragmentContent); } @@ -114,8 +114,8 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { initModelOnSecondLineAndSelectRevisions(3, 3); - assertEquals("b", dm.getLeftDiffContent(new NullRevisionsProgress())); - assertEquals("bcd", dm.getRightDiffContent(new NullRevisionsProgress())); + assertContent("b", dm.getLeftDiffContent(new NullRevisionsProgress())); + assertContent("bcd", dm.getRightDiffContent(new NullRevisionsProgress())); } public void testRevert() throws IOException { From 87ef5021e664fcbb44150812065bf9a0ea225e56 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 19:07:13 +0300 Subject: [PATCH 10/23] do not use fake last lesson --- .../jetbrains/edu/learning/navigation/StudyNavigator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/navigation/StudyNavigator.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/navigation/StudyNavigator.java index 1476fd0ba372..4121c84445f1 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/navigation/StudyNavigator.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/navigation/StudyNavigator.java @@ -3,6 +3,7 @@ package com.jetbrains.edu.learning.navigation; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.LogicalPosition; import com.intellij.openapi.project.Project; +import com.jetbrains.edu.EduNames; import com.jetbrains.edu.courseFormat.AnswerPlaceholder; import com.jetbrains.edu.courseFormat.Lesson; import com.jetbrains.edu.courseFormat.Task; @@ -52,7 +53,10 @@ public class StudyNavigator { if (nextLessonIndex >= lessons.size()) { return null; } - return lessons.get(nextLessonIndex); + final Lesson nextLesson = lessons.get(nextLessonIndex); + if (EduNames.PYCHARM_ADDITIONAL.equals(nextLesson.getName())) + return null; + return nextLesson; } public static Lesson previousLesson(@NotNull final Lesson lesson) { From c480f36be62a2830be063c0d82ded82e2ec52623 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Mon, 10 Aug 2015 18:54:03 +0300 Subject: [PATCH 11/23] Cleanup --- .../psi/codeStyle/LanguageCodeStyleSettingsProvider.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/LanguageCodeStyleSettingsProvider.java b/platform/lang-api/src/com/intellij/psi/codeStyle/LanguageCodeStyleSettingsProvider.java index 95f2f3bec0eb..0942308dec2b 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/LanguageCodeStyleSettingsProvider.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/LanguageCodeStyleSettingsProvider.java @@ -17,20 +17,16 @@ package com.intellij.psi.codeStyle; import com.intellij.application.options.IndentOptionsEditor; import com.intellij.lang.Language; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; -import com.intellij.util.ArrayUtil; import com.intellij.util.containers.HashSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import java.util.Set; /** @@ -189,6 +185,7 @@ public abstract class LanguageCodeStyleSettingsProvider { return null; } + @SuppressWarnings("unused") public static DisplayPriority getDisplayPriority(Language language) { LanguageCodeStyleSettingsProvider langProvider = forLanguage(language); if (langProvider == null) return DisplayPriority.LANGUAGE_SETTINGS; From 0c776d4202c002222049818dff66cd447c295e10 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Mon, 10 Aug 2015 18:32:01 +0200 Subject: [PATCH 12/23] IDEA-142768 Failed to report IDE errors with internal error reporting system --- .../src/com/intellij/errorreport/itn/ITNProxy.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java b/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java index eefe2b90ee21..8a93072e2bbe 100644 --- a/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java +++ b/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java @@ -63,8 +63,10 @@ import java.util.Set; * @since Aug 4, 2003 */ public class ITNProxy { - private static final String NEW_THREAD_VIEW_URL = "https://ea.jetbrains.com/browser/ea_reports/"; - private static final String NEW_THREAD_POST_URL = "https://ea-report.jetbrains.com/trackerRpc/idea/createScr"; + private static final String NEW_THREAD_VIEW_URL_SECURE = "https://ea.jetbrains.com/browser/ea_reports/"; + private static final String NEW_THREAD_VIEW_URL = "http://ea.jetbrains.com/browser/ea_reports/"; + private static final String NEW_THREAD_POST_URL_SECURE = "https://ea-report.jetbrains.com/trackerRpc/idea/createScr"; + private static final String NEW_THREAD_POST_URL = "http://ea-report.jetbrains.com/trackerRpc/idea/createScr"; private static final String ENCODING = "UTF8"; public static void sendError(Project project, @@ -99,7 +101,7 @@ public class ITNProxy { } public static String getBrowseUrl(int threadId) { - return NEW_THREAD_VIEW_URL + threadId; + return (UpdateSettings.getInstance().canUseSecureConnection() ? NEW_THREAD_VIEW_URL_SECURE : NEW_THREAD_VIEW_URL) + threadId; } private static SSLContext ourSslContext; @@ -110,7 +112,8 @@ public class ITNProxy { } Map params = createParameters(login, password, error); - HttpURLConnection connection = post(new URL(NEW_THREAD_POST_URL), join(params)); + String newThreadPostUrl = UpdateSettings.getInstance().canUseSecureConnection() ? NEW_THREAD_POST_URL_SECURE : NEW_THREAD_POST_URL; + HttpURLConnection connection = post(new URL(newThreadPostUrl), join(params)); int responseCode = connection.getResponseCode(); if (responseCode != HttpURLConnection.HTTP_OK) { throw new InternalEAPException(DiagnosticBundle.message("error.http.result.code", responseCode)); From 631a2e682e8e4ca200d9dda0eeba3fd516e79e97 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Mon, 10 Aug 2015 18:41:31 +0200 Subject: [PATCH 13/23] check sni availability before posting to our https service --- .../src/com/intellij/errorreport/itn/ITNProxy.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java b/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java index 8a93072e2bbe..d86caed913a5 100644 --- a/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java +++ b/platform/platform-impl/src/com/intellij/errorreport/itn/ITNProxy.java @@ -63,8 +63,7 @@ import java.util.Set; * @since Aug 4, 2003 */ public class ITNProxy { - private static final String NEW_THREAD_VIEW_URL_SECURE = "https://ea.jetbrains.com/browser/ea_reports/"; - private static final String NEW_THREAD_VIEW_URL = "http://ea.jetbrains.com/browser/ea_reports/"; + private static final String NEW_THREAD_VIEW_URL = "https://ea.jetbrains.com/browser/ea_reports/"; private static final String NEW_THREAD_POST_URL_SECURE = "https://ea-report.jetbrains.com/trackerRpc/idea/createScr"; private static final String NEW_THREAD_POST_URL = "http://ea-report.jetbrains.com/trackerRpc/idea/createScr"; private static final String ENCODING = "UTF8"; @@ -101,7 +100,7 @@ public class ITNProxy { } public static String getBrowseUrl(int threadId) { - return (UpdateSettings.getInstance().canUseSecureConnection() ? NEW_THREAD_VIEW_URL_SECURE : NEW_THREAD_VIEW_URL) + threadId; + return NEW_THREAD_VIEW_URL + threadId; } private static SSLContext ourSslContext; @@ -112,7 +111,7 @@ public class ITNProxy { } Map params = createParameters(login, password, error); - String newThreadPostUrl = UpdateSettings.getInstance().canUseSecureConnection() ? NEW_THREAD_POST_URL_SECURE : NEW_THREAD_POST_URL; + String newThreadPostUrl = NetUtils.isSniEnabled() ? NEW_THREAD_POST_URL_SECURE : NEW_THREAD_POST_URL; HttpURLConnection connection = post(new URL(newThreadPostUrl), join(params)); int responseCode = connection.getResponseCode(); if (responseCode != HttpURLConnection.HTTP_OK) { From fe8c5e10a3c5885a1ca6428a8946734e82189b73 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 17:42:01 +0200 Subject: [PATCH 14/23] IDEA-143496 Creating file with "Create Directory" dialog fails --- .../ide/actions/CreateDirectoryOrPackageHandler.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/CreateDirectoryOrPackageHandler.java b/platform/lang-impl/src/com/intellij/ide/actions/CreateDirectoryOrPackageHandler.java index ec89d0930e1b..ff616e497f5c 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/CreateDirectoryOrPackageHandler.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/CreateDirectoryOrPackageHandler.java @@ -207,15 +207,13 @@ public class CreateDirectoryOrPackageHandler implements InputValidatorEx { final Runnable run = new Runnable() { @Override public void run() { - LocalHistoryAction action = LocalHistoryAction.NULL; + String dirPath = myDirectory.getVirtualFile().getPresentableUrl(); + String actionName = IdeBundle.message("progress.creating.directory", dirPath, File.separator, subDirName); + LocalHistoryAction action = LocalHistory.getInstance().startAction(actionName); try { - String actionName; - String dirPath = myDirectory.getVirtualFile().getPresentableUrl(); - actionName = IdeBundle.message("progress.creating.directory", dirPath, File.separator, subDirName); - action = LocalHistory.getInstance().startAction(actionName); - if (createFile) { - myCreatedElement = myDirectory.createFile(subDirName); + CreateFileAction.MkDirs mkdirs = new CreateFileAction.MkDirs(subDirName, myDirectory); + myCreatedElement = mkdirs.directory.createFile(mkdirs.newName); } else { createDirectories(subDirName); } From 2ee2baaff800e041e4e23aa1505f4c66f8ac17c7 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 18:15:47 +0200 Subject: [PATCH 15/23] bring back right arrows for Import Class sub-popups --- .../daemon/impl/actions/AddImportAction.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/AddImportAction.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/AddImportAction.java index f01b5b7d08bd..b9bb43c0abcc 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/AddImportAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/AddImportAction.java @@ -42,12 +42,14 @@ import com.intellij.psi.PsiReference; import com.intellij.psi.statistics.JavaStatisticsManager; import com.intellij.psi.statistics.StatisticsManager; import com.intellij.ui.popup.list.ListPopupImpl; +import com.intellij.ui.popup.list.PopupListElementRenderer; import com.intellij.util.IncorrectOperationException; import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import javax.swing.*; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -161,7 +163,18 @@ public class AddImportAction implements QuestionAction { ListPopupImpl popup = new ListPopupImpl(step) { @Override protected ListCellRenderer getListElementRenderer() { - return new DefaultPsiElementCellRenderer(); + final PopupListElementRenderer baseRenderer = (PopupListElementRenderer)super.getListElementRenderer(); + final DefaultPsiElementCellRenderer psiRenderer = new DefaultPsiElementCellRenderer(); + return new ListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + JPanel panel = new JPanel(new BorderLayout()); + baseRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + panel.add(baseRenderer.getNextStepLabel(), BorderLayout.EAST); + panel.add(psiRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus)); + return panel; + } + }; } }; popup.showInBestPositionFor(myEditor); From 2d7619d1061d17d275df5a458fc933b526719fa1 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 18:45:24 +0200 Subject: [PATCH 16/23] IDEA-143735 FileChooser.chooseFiles doesn't call callback anymore then dialog is shown from another dialog --- .../src/com/intellij/ui/mac/MacFileChooserDialogImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java b/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java index 623fe0e2ba1e..ba54fd98bab4 100644 --- a/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java +++ b/platform/platform-impl/src/com/intellij/ui/mac/MacFileChooserDialogImpl.java @@ -17,6 +17,7 @@ package com.intellij.ui.mac; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationNamesInfo; +import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileChooser.FileChooser; import com.intellij.openapi.fileChooser.FileChooserDescriptor; @@ -62,6 +63,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { private final FileChooserDescriptor myChooserDescriptor; private final Project myProject; + private ModalityState myModalityState; private Consumer> myCallback; private static final Callback SHOULD_ENABLE_CALLBACK = new Callback() { @@ -160,14 +162,14 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { } }); } - }); + }, impl.myModalityState); } else if (impl.myCallback instanceof FileChooser.FileChooserConsumer) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { ((FileChooser.FileChooserConsumer)impl.myCallback).cancelled(); } - }); + }, impl.myModalityState); } } finally { @@ -324,6 +326,7 @@ public class MacFileChooserDialogImpl implements PathChooserDialog { ExtensionsInitializer.initialize(); myCallback = callback; + myModalityState = ModalityState.current(); final VirtualFile lastOpenedFile = FileChooserUtil.getLastOpenedFile(myProject); final VirtualFile selectFile = FileChooserUtil.getFileToSelect(myChooserDescriptor, myProject, toSelect, lastOpenedFile); From 9bceeebf3cca4c7bbbe21fc6f043c6a1f09751ee Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 18:48:41 +0200 Subject: [PATCH 17/23] AbstractVcsTestCase.refreshVfs: process only the current project --- .../com/intellij/testFramework/vcs/AbstractVcsTestCase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/AbstractVcsTestCase.java b/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/AbstractVcsTestCase.java index c4468ae8cb14..d459e971b910 100644 --- a/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/AbstractVcsTestCase.java +++ b/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/AbstractVcsTestCase.java @@ -77,11 +77,11 @@ public abstract class AbstractVcsTestCase { ChangeListManagerImpl.getInstanceImpl(myProject).waitUntilRefreshed(); } - protected static void refreshVfs() { + protected void refreshVfs() { UsefulTestCase.edt(new Runnable() { @Override public void run() { - LocalFileSystem.getInstance().refresh(false); + myWorkingCopyDir.refresh(false, true); } }); } From 94ccfed45015391024b44aaa51a21a451689c051 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 19:49:25 +0300 Subject: [PATCH 18/23] log error in creating user file --- python/educational/src/com/jetbrains/edu/EduUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/educational/src/com/jetbrains/edu/EduUtils.java b/python/educational/src/com/jetbrains/edu/EduUtils.java index 7808ad2d21f9..c4b305d11d47 100644 --- a/python/educational/src/com/jetbrains/edu/EduUtils.java +++ b/python/educational/src/com/jetbrains/edu/EduUtils.java @@ -200,6 +200,10 @@ public class EduUtils { taskFile.sortAnswerPlaceholders(); for (int i = taskFile.getAnswerPlaceholders().size() - 1; i >= 0; i--) { final AnswerPlaceholder answerPlaceholder = taskFile.getAnswerPlaceholders().get(i); + if (answerPlaceholder.getRealStartOffset(document) > document.getTextLength() || answerPlaceholder.getRealStartOffset(document) + answerPlaceholder.getPossibleAnswerLength() > document.getTextLength()) { + LOG.error("Wrong startOffset: " + answerPlaceholder.getRealStartOffset(document) + "; document: " + file.getPath()); + return; + } replaceAnswerPlaceholder(project, document, answerPlaceholder); } CommandProcessor.getInstance().executeCommand(project, new Runnable() { From a86ea20208cdc0933ed8b0e1d69a5d837d6f6e39 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 19:50:29 +0300 Subject: [PATCH 19/23] fixed tooltip for refresh courses action --- .../src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.form | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.form b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.form index 8d60f3ad7ce4..c13bc229b973 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.form +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.form @@ -93,7 +93,7 @@ - + From 7fe8772304eba3ba6ed52c90feeae6a33c6f3307 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 20:04:56 +0300 Subject: [PATCH 20/23] fixed EDU-193 New Task Window dialog is not resizable --- .../edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/educational/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java b/python/educational/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java index 1b0b2804290d..cc55b58ec101 100644 --- a/python/educational/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java +++ b/python/educational/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java @@ -16,6 +16,8 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel { super(new BorderLayout()); add(myPanel, BorderLayout.CENTER); enableHint(false); + myHintText.setLineWrap(true); + myHintText.setWrapStyleWord(true); myCreateHintCheckBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { From de098014f17efed384778aa46ac9fbd6f5d5723c Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 10 Aug 2015 20:13:50 +0300 Subject: [PATCH 21/23] fixed EDU-388 Throwable at com.intellij.openapi.project.DumbServiceImpl.scheduleCacheUpdate(DumbServiceImpl.java:159) --- .../StudyProjectGenerator.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java index 7bd9054b647b..18b01f4c7c01 100644 --- a/python/educational/interactive-learning/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java +++ b/python/educational/interactive-learning/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java @@ -8,6 +8,8 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.FileEditorManager; +import com.intellij.openapi.project.DumbModePermission; +import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.io.FileUtil; @@ -66,17 +68,21 @@ public class StudyProjectGenerator { new Runnable() { @Override public void run() { - ApplicationManager.getApplication().runWriteAction(new Runnable() { + DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() { @Override public void run() { - course.initCourse(false); - final File courseDirectory = new File(ourCoursesDir, course.getName()); - StudyGenerator.createCourse(course, baseDir, courseDirectory, project); - course.setCourseDirectory(new File(ourCoursesDir, mySelectedCourseInfo.getName()).getAbsolutePath()); - VirtualFileManager.getInstance().refreshWithoutFileWatcher(true); - StudyProjectComponent.getInstance(project).registerStudyToolwindow(course); - openFirstTask(course, project); - + ApplicationManager.getApplication().runWriteAction(new Runnable() { + @Override + public void run() { + course.initCourse(false); + final File courseDirectory = new File(ourCoursesDir, course.getName()); + StudyGenerator.createCourse(course, baseDir, courseDirectory, project); + course.setCourseDirectory(new File(ourCoursesDir, mySelectedCourseInfo.getName()).getAbsolutePath()); + VirtualFileManager.getInstance().refreshWithoutFileWatcher(true); + StudyProjectComponent.getInstance(project).registerStudyToolwindow(course); + openFirstTask(course, project); + } + }); } }); } From edf430a9891e280a56462287eae5aa2ac1692838 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 19:44:59 +0200 Subject: [PATCH 22/23] don't run pushers on changes in .idea (EA-71691 - Throwable: DumbServiceImpl.a) --- .../roots/impl/PushedFilePropertiesUpdaterImpl.java | 7 ++----- .../openapi/options/newEditor/SettingsDialog.java | 9 +-------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java index 4f27cb072c8d..804bf10d41ea 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java @@ -29,10 +29,7 @@ import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.progress.util.ProgressWrapper; -import com.intellij.openapi.project.DumbModeTask; -import com.intellij.openapi.project.DumbService; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectManager; +import com.intellij.openapi.project.*; import com.intellij.openapi.roots.*; import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.util.Computable; @@ -114,7 +111,7 @@ public class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesUpdater // avoid dumb mode for just one file doPushRecursively(file, pushers, ProjectRootManager.getInstance(myProject).getFileIndex()); } - else { + else if (!ProjectCoreUtil.isProjectOrWorkspaceFile(file)) { ContainerUtil.addIfNotNull(delayedTasks, createRecursivePushTask(file, pushers)); } } else if (event instanceof VFileMoveEvent) { diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsDialog.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsDialog.java index 17264b5cfc42..915cd2d85031 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsDialog.java @@ -21,8 +21,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.help.HelpManager; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurableGroup; -import com.intellij.openapi.project.DumbModePermission; -import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import org.jetbrains.annotations.NonNls; @@ -143,12 +141,7 @@ public class SettingsDialog extends DialogWrapper implements DataProvider { @Override public void doOKAction() { if (myEditor.apply()) { - DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() { - @Override - public void run() { - ApplicationManager.getApplication().saveAll(); - } - }); + ApplicationManager.getApplication().saveAll(); super.doOKAction(); } } From 8ab0b5c4d1d1163858feda257443a497dbbb7d1f Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Aug 2015 19:48:28 +0200 Subject: [PATCH 23/23] don't fold our testFramework calls in console because it contains useful information quite often (IDEA-143693) --- plugins/devkit/resources/META-INF/plugin.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/devkit/resources/META-INF/plugin.xml b/plugins/devkit/resources/META-INF/plugin.xml index 4692132964e0..131ebeddc940 100644 --- a/plugins/devkit/resources/META-INF/plugin.xml +++ b/plugins/devkit/resources/META-INF/plugin.xml @@ -136,7 +136,6 @@ -