diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java b/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java index c03f11b94e97..ac5eef43e7cf 100644 --- a/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java +++ b/platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java @@ -37,15 +37,13 @@ import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.SimpleToolWindowPanel; -import com.intellij.openapi.util.AsyncResult; -import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.Disposer; -import com.intellij.openapi.util.Key; +import com.intellij.openapi.util.*; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.pom.Navigatable; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiManager; +import com.intellij.psi.StubBasedPsiElement; +import com.intellij.psi.impl.source.tree.CompositeElement; import com.intellij.psi.util.PsiUtilCore; import com.intellij.ui.*; import com.intellij.ui.treeStructure.actions.CollapseAllAction; @@ -826,7 +824,15 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre modificationCountForChildren = ourSettingsModificationCount; } - final long currentStamp = myProject != null ? PsiManager.getInstance(myProject).getModificationTracker().getModificationCount() : -1; + final Object o = unwrapValue(getValue()); + long currentStamp = -1; + if (o instanceof StubBasedPsiElement && ((StubBasedPsiElement)o).getStub() != null) { + currentStamp = ((StubBasedPsiElement)o).getContainingFile().getModificationStamp(); + } else if (o instanceof PsiElement && ((PsiElement)o).getNode() instanceof CompositeElement) { + currentStamp = ((CompositeElement)((PsiElement)o).getNode()).getModificationCount(); + } else if (o instanceof ModificationTracker) { + currentStamp = ((ModificationTracker)o).getModificationCount(); + } if (childrenStamp != currentStamp) { resetChildren(); childrenStamp = currentStamp; diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java index 61394c9cf856..d59cd1a1fda8 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java @@ -81,7 +81,7 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable public static final String DISPLAY_NAME = "Inspections"; private static final String HEADER_TITLE = "Profile:"; - private static final Logger LOG = Logger.getInstance("#" + InspectionToolsConfigurable.class.getName()); + private static final Logger LOG = Logger.getInstance(InspectionToolsConfigurable.class); protected final InspectionProfileManager myProfileManager; protected final InspectionProjectProfileManager myProjectProfileManager; private final CardLayout myLayout = new CardLayout(); @@ -111,7 +111,12 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable myProfiles = new ProfilesConfigurableComboBox(new ListCellRendererWrapper() { @Override public void customize(final JList list, final Profile value, final int index, final boolean selected, final boolean hasFocus) { - final SingleInspectionProfilePanel singleInspectionProfilePanel = myPanels.get(value); + final SingleInspectionProfilePanel singleInspectionProfilePanel = getProfilePanel(value); + LOG.assertTrue(singleInspectionProfilePanel != null, + String.format("No panel for profile (name = %s, manager class = %s, is modified = %s) found", + value.getName(), + value.getProfileManager().getClass(), + ((InspectionProfileImpl) value).isChanged())); final boolean isShared = singleInspectionProfilePanel.isProfileShared(); setIcon(isShared ? AllIcons.General.ProjectSettings : AllIcons.General.Settings); setText(singleInspectionProfilePanel.getCurrentProfileName()); diff --git a/platform/platform-api/src/com/intellij/ui/AbstractCollectionComboBoxModel.java b/platform/platform-api/src/com/intellij/ui/AbstractCollectionComboBoxModel.java index c5413ccdf6e0..4eea91dcb2e5 100644 --- a/platform/platform-api/src/com/intellij/ui/AbstractCollectionComboBoxModel.java +++ b/platform/platform-api/src/com/intellij/ui/AbstractCollectionComboBoxModel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,7 @@ public abstract class AbstractCollectionComboBoxModel extends AbstractListMod public void setSelectedItem(@Nullable Object anItem) { //noinspection unchecked mySelection = (T)anItem; + update(); } @Override 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 31860b3d197f..240644d0e7b6 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 @@ -2332,8 +2332,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi UIUtil.drawLine(g, end.x, y1, end.x + charWidth - 1, y1); } else if (attributes.getEffectType() == EffectType.BOLD_LINE_UNDERSCORE) { - UIUtil.drawLine(g, end.x, y - 1, end.x + charWidth - 1, y - 1); - UIUtil.drawLine(g, end.x, y, end.x + charWidth - 1, y); + drawBoldLineUnderScore(g, end.x, y - 1, charWidth - 1); } else if (attributes.getEffectType() != EffectType.BOXED) { UIUtil.drawLine(g, end.x, y, end.x + charWidth - 1, y); @@ -2342,6 +2341,11 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi } } + private static void drawBoldLineUnderScore(Graphics g, int x, int y, int width) { + int height = JBUI.scale(Registry.intValue("editor.bold.underline.height", 2)); + g.fillRect(x, y, width, height); + } + @Override public int getMaxWidthInRange(int startOffset, int endOffset) { if (myUseNewRendering) return myView.getMaxWidthInRange(startOffset, endOffset); @@ -3423,8 +3427,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi } else if (effectType == EffectType.BOLD_LINE_UNDERSCORE) { g.setColor(effectColor); - UIUtil.drawLine(g, xStart, y, xEnd, y); - UIUtil.drawLine(g, xStart, y + 1, xEnd, y + 1); + drawBoldLineUnderScore(g, xStart, y, xEnd-xStart); g.setColor(savedColor); } else if (effectType == EffectType.STRIKEOUT) { diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java index 9a35af12118c..82bcff9b52a6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java @@ -91,7 +91,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent "*.hprof;*.pyc;*.pyo;*.rbc;*~;.DS_Store;.bundle;.git;.hg;.svn;CVS;RCS;SCCS;__pycache__;.tox;_svn;rcs;vssver.scc;vssver2.scc;"; private static boolean RE_DETECT_ASYNC = !ApplicationManager.getApplication().isUnitTestMode(); - private final Collection myDefaultTypes = new THashSet(); + private final Set myDefaultTypes = new THashSet(); private final List mySpecialFileTypes = new ArrayList(); private FileTypeAssocTable myPatternsTable = new FileTypeAssocTable(); @@ -1007,7 +1007,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent List notExternalizableFileTypes = new ArrayList(); for (FileType type : mySchemesManager.getAllSchemes()) { - if (!(type instanceof AbstractFileType)) { + if (!(type instanceof AbstractFileType) || myDefaultTypes.contains(type)) { notExternalizableFileTypes.add(type); } } diff --git a/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java b/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java index 6743d619518d..1edd09b443c2 100644 --- a/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java +++ b/platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java @@ -81,8 +81,9 @@ public class KeyStrokeAdapter implements KeyListener { * @see KeyStroke#getKeyStrokeForEvent(KeyEvent) */ public static KeyStroke getDefaultKeyStroke(KeyEvent event) { + if (event == null || event.isConsumed()) return null; // On Windows and Mac it is preferable to use normal key code here - boolean extendedKeyCodeFirst = !SystemInfo.isWindows && !SystemInfo.isMac; + boolean extendedKeyCodeFirst = !SystemInfo.isWindows && !SystemInfo.isMac && event.getModifiers() == 0; KeyStroke stroke = getKeyStroke(event, extendedKeyCodeFirst); return stroke != null ? stroke : getKeyStroke(event, !extendedKeyCodeFirst); } diff --git a/platform/platform-impl/src/com/intellij/ui/SpeedSearchBase.java b/platform/platform-impl/src/com/intellij/ui/SpeedSearchBase.java index 51fa97249359..754c6219b11d 100644 --- a/platform/platform-impl/src/com/intellij/ui/SpeedSearchBase.java +++ b/platform/platform-impl/src/com/intellij/ui/SpeedSearchBase.java @@ -46,10 +46,7 @@ import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; import java.awt.*; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; +import java.awt.event.*; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ListIterator; @@ -72,6 +69,22 @@ public abstract class SpeedSearchBase extends SpeedSear public SpeedSearchBase(Comp component) { myComponent = component; + myComponent.addComponentListener(new ComponentAdapter() { + @Override + public void componentHidden(ComponentEvent event) { + manageSearchPopup(null); + } + + @Override + public void componentMoved(ComponentEvent event) { + moveSearchPopup(); + } + + @Override + public void componentResized(ComponentEvent event) { + moveSearchPopup(); + } + }); myComponent.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { @@ -568,7 +581,11 @@ public abstract class SpeedSearchBase extends SpeedSear return; } myPopupLayeredPane.add(mySearchPopup, JLayeredPane.POPUP_LAYER); - if (myPopupLayeredPane == null) return; // See # 27482. Somewho it does happen... + moveSearchPopup(); + } + + private void moveSearchPopup() { + if (myComponent == null || mySearchPopup == null || myPopupLayeredPane == null) return; Point lPaneP = myPopupLayeredPane.getLocationOnScreen(); Point componentP = getComponentLocationOnScreen(); Rectangle r = getComponentVisibleRect(); diff --git a/platform/platform-resources/src/DefaultColorSchemesManager.xml b/platform/platform-resources/src/DefaultColorSchemesManager.xml index 84b4538bdbdf..cec4d4fcb8b6 100644 --- a/platform/platform-resources/src/DefaultColorSchemesManager.xml +++ b/platform/platform-resources/src/DefaultColorSchemesManager.xml @@ -306,9 +306,11 @@