diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/CommitNode.java b/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/CommitNode.java index 4e2701ad6ac0..df2850399e6f 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/CommitNode.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/CommitNode.java @@ -42,9 +42,8 @@ public class CommitNode extends DefaultMutableTreeNode implements CustomRendered @Override public void render(@NotNull ColoredTreeCellRenderer renderer) { - new IssueLinkRenderer(myProject, renderer).appendTextWithLinks(getUserObject().getSubject(), - new SimpleTextAttributes(SimpleTextAttributes.STYLE_SMALLER, - renderer.getForeground())); + renderer.append(" "); + new IssueLinkRenderer(myProject, renderer).appendTextWithLinks(getUserObject().getSubject(), SimpleTextAttributes.REGULAR_ATTRIBUTES); } public String getTooltip() { diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/PushLog.java b/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/PushLog.java index a833365a118f..6cb7e3792388 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/PushLog.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/push/ui/PushLog.java @@ -39,6 +39,7 @@ import com.intellij.util.ui.tree.TreeUtil; import org.jetbrains.annotations.NotNull; import javax.swing.*; +import javax.swing.border.EmptyBorder; import javax.swing.event.CellEditorListener; import javax.swing.event.ChangeEvent; import javax.swing.event.TreeSelectionEvent; @@ -116,7 +117,9 @@ public class PushLog extends JPanel implements TypeSafeDataProvider { } } }; + myTree.setBorder(new EmptyBorder(2, 0, 0, 0)); //additional vertical indent myTree.setEditable(true); + myTree.setHorizontalAutoScrollingEnabled(false); myTree.setShowsRootHandles(root.getChildCount() > 1); MyTreeCellEditor treeCellEditor = new MyTreeCellEditor(); myTree.setCellEditor(treeCellEditor); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java index 3cb63404963b..69f29fedd836 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java @@ -458,6 +458,9 @@ public class BraceHighlightingHandler { } } + + + if (!scopeHighlighting) { showScopeHint(lBrace.getStartOffset(), lBrace.getEndOffset()); } diff --git a/platform/lang-impl/src/com/intellij/execution/console/ConsoleHistoryController.java b/platform/lang-impl/src/com/intellij/execution/console/ConsoleHistoryController.java index efb56f449d26..8a9ac7fd548f 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/ConsoleHistoryController.java +++ b/platform/lang-impl/src/com/intellij/execution/console/ConsoleHistoryController.java @@ -57,8 +57,11 @@ import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlSerializer; import javax.swing.*; +import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.io.*; +import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.ListIterator; @@ -72,11 +75,10 @@ public class ConsoleHistoryController { private static final Logger LOG = Logger.getInstance("com.intellij.execution.console.ConsoleHistoryController"); private final LanguageConsoleImpl myConsole; - private final AnAction myHistoryNext = new MyAction(true); - private final AnAction myHistoryPrev = new MyAction(false); + private final AnAction myHistoryNext = new MyAction(true, getKeystrokesUpDown(true)); + private final AnAction myHistoryPrev = new MyAction(false, getKeystrokesUpDown(false)); private final AnAction myBrowseHistory = new MyBrowseAction(); private boolean myMultiline; - private boolean isStandardUpDownUsed = false; private final ModelHelper myHelper; private long myLastSaveStamp; @@ -117,7 +119,6 @@ public class ConsoleHistoryController { loadHistory(myHelper.getId()); } configureActions(); - isStandardUpDownUsed = checkIfStandardUpDownUsed(); myLastSaveStamp = getCurrentTimeStamp(); } @@ -125,18 +126,13 @@ public class ConsoleHistoryController { return getModel().getModificationCount() + myConsole.getEditorDocument().getModificationStamp(); } - private boolean checkIfStandardUpDownUsed() { - return isShortcutSetsIntersect(myHistoryNext.getShortcutSet(), getShortcutUpDown(true)) - || isShortcutSetsIntersect(myHistoryPrev.getShortcutSet(), getShortcutUpDown(false)); - } - - protected void configureActions() { + private void configureActions() { EmptyAction.setupAction(myHistoryNext, "Console.History.Next", null); EmptyAction.setupAction(myHistoryPrev, "Console.History.Previous", null); EmptyAction.setupAction(myBrowseHistory, "Console.History.Browse", null); if (!myMultiline) { - myHistoryNext.registerCustomShortcutSet(getShortcutUpDown(true), null); - myHistoryPrev.registerCustomShortcutSet(getShortcutUpDown(false), null); + addShortcuts(myHistoryNext, getShortcutUpDown(true)); + addShortcuts(myHistoryPrev, getShortcutUpDown(false)); } myHistoryNext.registerCustomShortcutSet(myHistoryNext.getShortcutSet(), myConsole.getCurrentEditor().getComponent()); myHistoryPrev.registerCustomShortcutSet(myHistoryPrev.getShortcutSet(), myConsole.getCurrentEditor().getComponent()); @@ -241,8 +237,12 @@ public class ConsoleHistoryController { private class MyAction extends AnAction { private final boolean myNext; - public MyAction(final boolean next) { + @NotNull + private final Collection myUpDownKeystrokes; + + public MyAction(final boolean next, @NotNull Collection upDownKeystrokes) { myNext = next; + myUpDownKeystrokes = upDownKeystrokes; getTemplatePresentation().setVisible(false); } @@ -263,7 +263,16 @@ public class ConsoleHistoryController { @Override public void update(final AnActionEvent e) { super.update(e); - e.getPresentation().setEnabled(!isStandardUpDownUsed || canMoveInEditor(myNext)); + e.getPresentation().setEnabled(myMultiline || !isUpDownKey(e) || canMoveInEditor(myNext)); + } + + private boolean isUpDownKey(AnActionEvent e) { + final InputEvent event = e.getInputEvent(); + if (!(event instanceof KeyEvent)) { + return false; + } + final KeyStroke keyStroke = KeyStroke.getKeyStrokeForEvent((KeyEvent)event); + return myUpDownKeystrokes.contains(keyStroke); } } @@ -344,7 +353,7 @@ public class ConsoleHistoryController { chooser.setSplitterOrientation(false); chooser.setSelectedIndex(Math.max(getModel().getHistoryCursor(), 0)); chooser.show(); - if (chooser.isOK()) { + if (chooser.isOK() && myConsole.getCurrentEditor().getComponent().isShowing()) { setConsoleText(chooser.getSelectedText(), false, true); } } @@ -516,18 +525,26 @@ public class ConsoleHistoryController { return new CustomShortcutSet(KeyStroke.getKeyStroke(isUp ? KeyEvent.VK_UP : KeyEvent.VK_DOWN, 0)); } - private static boolean isShortcutSetsIntersect(ShortcutSet set1, ShortcutSet set2) { - final Shortcut[] shortcuts1 = set1.getShortcuts(); - final Shortcut[] shortcuts2 = set2.getShortcuts(); + private static void addShortcuts(@NotNull AnAction action, @NotNull ShortcutSet newShortcuts) { + if (action.getShortcutSet().getShortcuts().length == 0) { + action.registerCustomShortcutSet(newShortcuts, null); + } + else { + action.registerCustomShortcutSet(new CompositeShortcutSet(action.getShortcutSet(), newShortcuts), null); + } + } - for (Shortcut s1 : shortcuts1) { - for (Shortcut s2 : shortcuts2) { - if (s1.equals(s2)) { - return true; - } + private static Collection getKeystrokesUpDown(boolean isUp) { + Collection result = new ArrayList(); + + final ShortcutSet shortcutSet = getShortcutUpDown(isUp); + for (Shortcut shortcut : shortcutSet.getShortcuts()) { + if (shortcut.isKeyboard() && ((KeyboardShortcut)shortcut).getSecondKeyStroke() == null) { + result.add(((KeyboardShortcut)shortcut).getFirstKeyStroke()); } } - return false; + + return result; } } diff --git a/platform/lang-impl/src/com/intellij/execution/console/DuplexConsoleView.java b/platform/lang-impl/src/com/intellij/execution/console/DuplexConsoleView.java index 87e1323fe607..3c7ab3eedeff 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/DuplexConsoleView.java +++ b/platform/lang-impl/src/com/intellij/execution/console/DuplexConsoleView.java @@ -198,12 +198,15 @@ public class DuplexConsoleView ext public AnAction[] createConsoleActions() { List actions = Lists.newArrayList(); actions.addAll(Arrays.asList(myPrimaryConsoleView.createConsoleActions())); - actions.add(mySwitchConsoleAction); + addExtraActions(actions); return ArrayUtil.toObjectArray(actions, AnAction.class); } + protected void addExtraActions(List actions) { + } + @Override public void allowHeavyFilters() { myPrimaryConsoleView.allowHeavyFilters(); diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java index fedc619dddb4..aa18eb08c52b 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java @@ -1810,7 +1810,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo pane.installComparator(); } - private class ManualOrderAction extends ToggleAction { + private class ManualOrderAction extends ToggleAction implements DumbAware { private ManualOrderAction() { super(IdeBundle.message("action.manual.order"), IdeBundle.message("action.manual.order"), AllIcons.ObjectBrowser.Sorted); } @@ -1834,7 +1834,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo } } - private class SortByTypeAction extends ToggleAction { + private class SortByTypeAction extends ToggleAction implements DumbAware { private SortByTypeAction() { super(IdeBundle.message("action.sort.by.type"), IdeBundle.message("action.sort.by.type"), AllIcons.ObjectBrowser.SortByType); } @@ -1857,7 +1857,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo } } - private class FoldersAlwaysOnTopAction extends ToggleAction { + private class FoldersAlwaysOnTopAction extends ToggleAction implements DumbAware { private FoldersAlwaysOnTopAction() { super("Folders Always on Top"); } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 5cb16670e19b..861287d8558b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -2562,7 +2562,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi } - private VisualPosition getSelectionStartPosition() { + private VisualPosition getSelectionStartPositionForPaint() { if (mySelectionStartPosition == null) { // We cache the value to avoid repeated invocations of Editor.logicalPositionToOffset which is currently slow for long lines mySelectionStartPosition = getSelectionModel().getSelectionStartPosition(); @@ -2570,7 +2570,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi return mySelectionStartPosition; } - private VisualPosition getSelectionEndPosition() { + private VisualPosition getSelectionEndPositionForPaint() { if (mySelectionEndPosition == null) { // We cache the value to avoid repeated invocations of Editor.logicalPositionToOffset which is currently slow for long lines mySelectionEndPosition = getSelectionModel().getSelectionEndPosition(); @@ -2599,8 +2599,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi @JdkConstants.FontStyle int fontType) { // There is a possible case that the user performed selection at soft wrap virtual space. We need to paint corresponding background // there then. - VisualPosition selectionStartPosition = getSelectionStartPosition(); - VisualPosition selectionEndPosition = getSelectionEndPosition(); + VisualPosition selectionStartPosition = getSelectionStartPositionForPaint(); + VisualPosition selectionEndPosition = getSelectionEndPositionForPaint(); if (selectionStartPosition.equals(selectionEndPosition)) { return; } @@ -2660,8 +2660,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi @NotNull SoftWrap softWrap) { // There is a possible case that the user performed selection at soft wrap virtual space. We need to paint corresponding background // there then. - VisualPosition selectionStartPosition = getSelectionStartPosition(); - VisualPosition selectionEndPosition = getSelectionEndPosition(); + VisualPosition selectionStartPosition = getSelectionStartPositionForPaint(); + VisualPosition selectionEndPosition = getSelectionEndPositionForPaint(); if (selectionStartPosition.equals(selectionEndPosition)) { return; } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java index 88d83ffb63c1..765efe35e7a8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java @@ -33,7 +33,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; import com.intellij.openapi.vfs.*; import com.intellij.openapi.wm.ToolWindowManager; -import com.intellij.util.xmlb.annotations.Transient; import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -145,11 +144,7 @@ public class IdeDocumentHistoryImpl extends IdeDocumentHistory implements Projec } public static class RecentlyChangedFilesState { - @Transient private final List CHANGED_PATHS = new ArrayList(); - - public List getChangedFiles() { - return CHANGED_PATHS; - } + public List CHANGED_PATHS = new ArrayList(); public void register(VirtualFile file) { final String path = file.getPath(); @@ -296,7 +291,7 @@ public class IdeDocumentHistoryImpl extends IdeDocumentHistory implements Projec List files = new ArrayList(); final LocalFileSystem lfs = LocalFileSystem.getInstance(); - final List paths = myRecentlyChangedFiles.getChangedFiles(); + final List paths = myRecentlyChangedFiles.CHANGED_PATHS; for (String path : paths) { final VirtualFile file = lfs.findFileByPath(path); if (file != null) { diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java index d7a386a5fd3b..87a6f52eeb80 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java @@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.application.ApplicationInfo; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; @@ -36,7 +37,7 @@ import java.awt.event.ActionListener; /** * @author pti */ -public class UpdateSettingsConfigurable extends BaseConfigurable implements SearchableConfigurable { +public class UpdateSettingsConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { private UpdatesSettingsPanel myUpdatesSettingsPanel; private boolean myCheckNowEnabled = true; diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form index fbdf7d099cb8..35f47c9eb6de 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form @@ -1,6 +1,6 @@
- + @@ -8,133 +8,105 @@ - + - - - - - + - - + + + + + + - - - - - - - + - + - + - + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index a06676140b95..8dbf428793f1 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -928,7 +928,7 @@ updates.settings.caption.1=$FULLNAME$ can automatically check for new and updates.settings.check.now.button=&Check Now updates.settings.checkbox=Check for updates in channel updates.settings.build.number= Build number: -updates.settings.current.version=Current $FULLNAME$ version\: +updates.settings.current.version=Current version\: updates.settings.last.check=Last checked for updates: hierarchy.method.next.occurence.name=Go to next method diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultilinePopupBuilder.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultilinePopupBuilder.java index 5dce04d9668c..ea50d33a7509 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultilinePopupBuilder.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/MultilinePopupBuilder.java @@ -76,7 +76,7 @@ class MultilinePopupBuilder { ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, myTextField) .setCancelOnClickOutside(true) .setAdText(KeymapUtil.getShortcutsText(CommonShortcuts.CTRL_ENTER.getShortcuts()) + " to finish") - .setMovable(true) + .setMayBeParent(true) .setRequestFocus(true) .setResizable(true) .setMayBeParent(true); diff --git a/plugins/git4idea/src/git4idea/validators/GitRefNameValidator.java b/plugins/git4idea/src/git4idea/validators/GitRefNameValidator.java index 5f2331028046..2e641c3390fa 100644 --- a/plugins/git4idea/src/git4idea/validators/GitRefNameValidator.java +++ b/plugins/git4idea/src/git4idea/validators/GitRefNameValidator.java @@ -16,6 +16,7 @@ package git4idea.validators; import com.intellij.openapi.ui.InputValidator; +import com.intellij.openapi.util.text.StringUtil; import java.util.regex.Pattern; @@ -58,7 +59,7 @@ public final class GitRefNameValidator implements InputValidator { @Override public boolean checkInput(String inputString) { - return !ILLEGAL.matcher(inputString).find(); + return !StringUtil.isEmptyOrSpaces(inputString) && !ILLEGAL.matcher(inputString).find(); } @Override diff --git a/plugins/git4idea/tests/git4idea/validators/GitRefNameValidatorTest.java b/plugins/git4idea/tests/git4idea/validators/GitRefNameValidatorTest.java index c7da36abec88..a441b17b2904 100644 --- a/plugins/git4idea/tests/git4idea/validators/GitRefNameValidatorTest.java +++ b/plugins/git4idea/tests/git4idea/validators/GitRefNameValidatorTest.java @@ -57,7 +57,8 @@ public class GitRefNameValidatorTest { { "HIERARCHY", "user/branch" }, { "HIERARCHY_2", "user/branch/sub_branch" }, { "BEGINS_WITH_SLASH", "/branch" }, // actual branch name will be with trimmed slash - { "NON_CONS_DOTS", "complex.branch.name" } + { "NON_CONS_DOTS", "complex.branch.name" }, + { "GERRIT_PATTERN", "refs/for/master%topic=my-cool-feature,r=some-reviewer"} }; } @@ -70,7 +71,9 @@ public class GitRefNameValidatorTest { { "ENDS_WITH_LOCK", "branch.lock" }, { "TWO_DOTS_1", "branch..name" }, { "TWO_DOTS_2", "..name" }, - { "TWO_DOTS_3", "..branch" } + { "TWO_DOTS_3", "..branch" }, + { "EMPTY", ""}, + { "SPACES", " "} }; }