diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java index f8a321402aab..6121f993f709 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java @@ -349,7 +349,7 @@ public class JavaCompletionContributor extends CompletionContributor { if (parameters.getInvocationCount() >= 2) { JavaClassNameCompletionContributor.addAllClasses(parameters, parameters.getInvocationCount() <= 2, result.getPrefixMatcher(), element -> { if (!session.alreadyProcessed(element)) { - result.addElement(JavaClassNameCompletionContributor.highlightIfNeeded((JavaPsiClassReferenceElement)element, parameters)); + result.addElement(JavaCompletionUtil.highlightIfNeeded(null, element, element.getObject(), parameters.getPosition())); } }); } else { diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java index be53fc0cd139..151dce0520c9 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java @@ -15,11 +15,11 @@ */ package com.intellij.codeInsight.completion; +import com.intellij.codeInsight.AutoPopupController; import com.intellij.codeInsight.completion.util.MethodParenthesesHandler; import com.intellij.codeInsight.lookup.*; import com.intellij.codeInsight.lookup.impl.JavaElementLookupRenderer; -import com.intellij.codeInsight.template.Template; -import com.intellij.codeInsight.template.TemplateManager; +import com.intellij.codeInsight.template.*; import com.intellij.codeInsight.template.impl.ConstantNode; import com.intellij.codeInsight.template.impl.TemplateManagerImpl; import com.intellij.codeInsight.template.impl.TemplateState; @@ -206,7 +206,8 @@ public class JavaMethodCallElement extends LookupItem implements Type template.addTextSegment(", "); } String name = StringUtil.notNullize(parameters[i].getName()); - template.addVariable(name, new ConstantNode(name), new ConstantNode(name), true); + Expression expression = Registry.is("java.completion.argument.live.template.completion") ? new AutoPopupCompletion() : new ConstantNode(name); + template.addVariable(name, expression, new ConstantNode(name), true); } template.addTextSegment(argList.getText().substring(caretOffset - argRange.getStartOffset(), argList.getTextLength())); template.addEndVariable(); @@ -353,4 +354,24 @@ public class JavaMethodCallElement extends LookupItem implements Type } } + + private static class AutoPopupCompletion extends Expression { + @Nullable + @Override + public Result calculateResult(ExpressionContext context) { + return new InvokeActionResult(() -> AutoPopupController.getInstance(context.getProject()).scheduleAutoPopup(context.getEditor())); + } + + @Nullable + @Override + public Result calculateQuickResult(ExpressionContext context) { + return null; + } + + @Nullable + @Override + public LookupElement[] calculateLookupItems(ExpressionContext context) { + return null; + } + } } diff --git a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationTargetUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationTargetUtil.java index 7393be47a8e7..ba4f28077349 100644 --- a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationTargetUtil.java +++ b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationTargetUtil.java @@ -61,9 +61,6 @@ public class AnnotationTargetUtil { } if (owner instanceof PsiModifierList) { - if (((PsiModifierList)owner).getNextSibling() instanceof PsiErrorElement) { - return TargetType.EMPTY_ARRAY; - } PsiElement element = ((PsiModifierList)owner).getParent(); if (element instanceof PsiPackageStatement) { return PACKAGE_TARGETS; diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java index da87c3a21abd..defa0a09a4bb 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java @@ -467,8 +467,8 @@ public class PsiClassImplUtil { @NotNull LanguageLevel languageLevel, boolean isRaw, @NotNull GlobalSearchScope resolveScope) { - if (last instanceof PsiTypeParameterList || last instanceof PsiModifierList && !(last.getNextSibling() instanceof PsiErrorElement)) { - return true; + if (last instanceof PsiTypeParameterList || last instanceof PsiModifierList) { + return true; //TypeParameterList and ModifierList do not see our declarations } if (visited != null && visited.contains(aClass)) return true; diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/annotationOverIncompleteCode.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/annotationOverIncompleteCode.java deleted file mode 100644 index 2e0bf6272dc7..000000000000 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/annotations/annotationOverIncompleteCode.java +++ /dev/null @@ -1,12 +0,0 @@ -class Dummy { - - public @interface Debug { - String value() default "[no comment]"; - } - - private static final class Constants { - private static final String INPUT = "Input"; - } - - @Dummy.Debug(Constants.INPUT) -} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AnnotationsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AnnotationsHighlightingTest.java index 6cf7c1c6d20a..c0cf9a49f3e0 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AnnotationsHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/AnnotationsHighlightingTest.java @@ -49,7 +49,6 @@ public class AnnotationsHighlightingTest extends LightDaemonAnalyzerTestCase { public void testRepeatable() { doTest8(); } public void testEnumValues() { doTest8(); } public void testReceiverParameters() { doTest8(); } - public void testAnnotationOverIncompleteCode() { doTest(); } private void doTest() { setLanguageLevel(LanguageLevel.JDK_1_7); diff --git a/platform/core-api/src/com/intellij/openapi/application/TransactionGuard.java b/platform/core-api/src/com/intellij/openapi/application/TransactionGuard.java index 9e8c32b6a73b..3ee04f413f22 100644 --- a/platform/core-api/src/com/intellij/openapi/application/TransactionGuard.java +++ b/platform/core-api/src/com/intellij/openapi/application/TransactionGuard.java @@ -125,8 +125,8 @@ public abstract class TransactionGuard { public abstract void submitTransactionLater(@NotNull Disposable parentDisposable, @NotNull Runnable transaction); /** - * Schedules a transaction and waits for it to be completed. Fails if invoked on UI thread inside an incompatible transaction, - * or inside a read action on non-UI thread. + * Schedules a transaction and waits for it to be completed. Logs an error if invoked on UI thread inside an incompatible transaction, + * throws {@link IllegalStateException} inside a read action on non-UI thread. * @see #submitTransaction(Disposable, TransactionId, Runnable) * @throws ProcessCanceledException if current thread is interrupted */ diff --git a/platform/core-impl/src/com/intellij/openapi/application/TransactionGuardImpl.java b/platform/core-impl/src/com/intellij/openapi/application/TransactionGuardImpl.java index 68983767afa0..00daf6cdf38a 100644 --- a/platform/core-impl/src/com/intellij/openapi/application/TransactionGuardImpl.java +++ b/platform/core-impl/src/com/intellij/openapi/application/TransactionGuardImpl.java @@ -159,7 +159,9 @@ public class TransactionGuardImpl extends TransactionGuard { return; } - assert !app.isReadAccessAllowed() : "submitTransactionAndWait should not be invoked from a read action"; + if (app.isReadAccessAllowed()) { + throw new IllegalStateException("submitTransactionAndWait should not be invoked from a read action"); + } final Semaphore semaphore = new Semaphore(); semaphore.down(); final Throwable[] exception = {null}; diff --git a/platform/lang-api/src/com/intellij/execution/filters/Filter.java b/platform/lang-api/src/com/intellij/execution/filters/Filter.java index bf3bc4d9372b..8c18ff960e42 100644 --- a/platform/lang-api/src/com/intellij/execution/filters/Filter.java +++ b/platform/lang-api/src/com/intellij/execution/filters/Filter.java @@ -36,19 +36,8 @@ public interface Filter { Filter[] EMPTY_ARRAY = new Filter[0]; class Result extends ResultItem { - private static final Map GRAYED_BY_NORMAL_CACHE = ContainerUtil.newConcurrentMap(2); - static { - ApplicationManager.getApplication().getMessageBus().connect().subscribe(EditorColorsManager.TOPIC, new EditorColorsListener() { - @Override - public void globalSchemeChange(EditorColorsScheme scheme) { - // invalidate cache on Appearance Theme/Editor Scheme change - GRAYED_BY_NORMAL_CACHE.clear(); - } - }); - } - - protected NextAction myNextAction = NextAction.EXIT; - protected final List myResultItems; + private NextAction myNextAction = NextAction.EXIT; + private final List myResultItems; public Result(final int highlightStartOffset, final int highlightEndOffset, @Nullable final HyperlinkInfo hyperlinkInfo) { this(highlightStartOffset, highlightEndOffset, hyperlinkInfo, null); @@ -75,9 +64,7 @@ public interface Filter { final int highlightEndOffset, @Nullable final HyperlinkInfo hyperlinkInfo, final boolean grayedHyperlink) { - super(highlightStartOffset, highlightEndOffset, hyperlinkInfo, - grayedHyperlink ? getGrayedHyperlinkAttributes(CodeInsightColors.HYPERLINK_ATTRIBUTES) : null, - grayedHyperlink ? getGrayedHyperlinkAttributes(CodeInsightColors.FOLLOWED_HYPERLINK_ATTRIBUTES) : null); + super(highlightStartOffset, highlightEndOffset, hyperlinkInfo, grayedHyperlink); myResultItems = null; } @@ -154,22 +141,6 @@ public interface Filter { public void setNextAction(NextAction nextAction) { myNextAction = nextAction; } - - @Nullable - private static TextAttributes getGrayedHyperlinkAttributes(@NotNull TextAttributesKey normalHyperlinkAttrsKey) { - EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme(); - TextAttributes grayedHyperlinkAttrs = GRAYED_BY_NORMAL_CACHE.get(normalHyperlinkAttrsKey); - if (grayedHyperlinkAttrs == null) { - TextAttributes normalHyperlinkAttrs = globalScheme.getAttributes(normalHyperlinkAttrsKey); - if (normalHyperlinkAttrs != null) { - grayedHyperlinkAttrs = normalHyperlinkAttrs.clone(); - grayedHyperlinkAttrs.setForegroundColor(UIUtil.getInactiveTextColor()); - grayedHyperlinkAttrs.setEffectColor(UIUtil.getInactiveTextColor()); - GRAYED_BY_NORMAL_CACHE.put(normalHyperlinkAttrsKey, grayedHyperlinkAttrs); - } - } - return grayedHyperlinkAttrs; - } } enum NextAction { @@ -177,6 +148,17 @@ public interface Filter { } class ResultItem { + private static final Map GRAYED_BY_NORMAL_CACHE = ContainerUtil.newConcurrentMap(2); + static { + ApplicationManager.getApplication().getMessageBus().connect().subscribe(EditorColorsManager.TOPIC, new EditorColorsListener() { + @Override + public void globalSchemeChange(EditorColorsScheme scheme) { + // invalidate cache on Appearance Theme/Editor Scheme change + GRAYED_BY_NORMAL_CACHE.clear(); + } + }); + } + /** * @deprecated use getter, the visibility of this field will be decreased. */ @@ -213,6 +195,15 @@ public interface Filter { this(highlightStartOffset, highlightEndOffset, hyperlinkInfo, highlightAttributes, null); } + public ResultItem(int highlightStartOffset, + int highlightEndOffset, + @Nullable HyperlinkInfo hyperlinkInfo, + boolean grayedHyperlink) { + this(highlightStartOffset, highlightEndOffset, hyperlinkInfo, + grayedHyperlink ? getGrayedHyperlinkAttributes(CodeInsightColors.HYPERLINK_ATTRIBUTES) : null, + grayedHyperlink ? getGrayedHyperlinkAttributes(CodeInsightColors.FOLLOWED_HYPERLINK_ATTRIBUTES) : null); + } + @SuppressWarnings("deprecation") public ResultItem(final int highlightStartOffset, final int highlightEndOffset, @@ -252,6 +243,22 @@ public interface Filter { //noinspection deprecation return hyperlinkInfo; } + + @Nullable + private static TextAttributes getGrayedHyperlinkAttributes(@NotNull TextAttributesKey normalHyperlinkAttrsKey) { + EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme(); + TextAttributes grayedHyperlinkAttrs = GRAYED_BY_NORMAL_CACHE.get(normalHyperlinkAttrsKey); + if (grayedHyperlinkAttrs == null) { + TextAttributes normalHyperlinkAttrs = globalScheme.getAttributes(normalHyperlinkAttrsKey); + if (normalHyperlinkAttrs != null) { + grayedHyperlinkAttrs = normalHyperlinkAttrs.clone(); + grayedHyperlinkAttrs.setForegroundColor(UIUtil.getInactiveTextColor()); + grayedHyperlinkAttrs.setEffectColor(UIUtil.getInactiveTextColor()); + GRAYED_BY_NORMAL_CACHE.put(normalHyperlinkAttrsKey, grayedHyperlinkAttrs); + } + } + return grayedHyperlinkAttrs; + } } /** diff --git a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java index 5a1cefeae19e..9053311700aa 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java @@ -49,7 +49,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.TextRange; -import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; @@ -197,18 +196,7 @@ public class LanguageConsoleImpl extends ConsoleViewImpl implements LanguageCons private void setHistoryScrollBarVisible(boolean visible) { JScrollBar prev = myHistoryViewer.getScrollPane().getHorizontalScrollBar(); - if (Registry.is("ide.scroll.new.layout")) { - prev.setEnabled(visible); - return; - } - JScrollBar next; - if (visible) { - next = ((EmptyScrollBar)prev).original; - } - else { - next = new EmptyScrollBar(prev); - } - myHistoryViewer.getScrollPane().setHorizontalScrollBar(next); + prev.setEnabled(visible); } private void setupComponents() { diff --git a/platform/platform-api/src/com/intellij/ui/components/DefaultScrollBarUI.java b/platform/platform-api/src/com/intellij/ui/components/DefaultScrollBarUI.java index d935186d3d8f..ba8d289cbe5c 100644 --- a/platform/platform-api/src/com/intellij/ui/components/DefaultScrollBarUI.java +++ b/platform/platform-api/src/com/intellij/ui/components/DefaultScrollBarUI.java @@ -93,7 +93,7 @@ class DefaultScrollBarUI extends ScrollBarUI { } boolean isBorderNeeded(JComponent c) { - return c.isOpaque() && Registry.is("ide.scroll.track.border.paint"); + return false; } boolean isTrackClickable() { @@ -101,7 +101,7 @@ class DefaultScrollBarUI extends ScrollBarUI { } boolean isTrackExpandable() { - return Registry.is("ide.scroll.bar.expand.animation"); + return false; } boolean isTrackContains(int x, int y) { @@ -122,10 +122,6 @@ class DefaultScrollBarUI extends ScrollBarUI { void paintTrack(Graphics2D g, int x, int y, int width, int height, JComponent c) { RegionPainter p = ScrollColorProducer.isDark(c) ? ScrollPainter.Track.DARCULA : ScrollPainter.Track.DEFAULT; - if (!isTrackExpandable() && Registry.is("ide.scroll.background.wide")) { - p.paint(g, x, y, width, height, myTrackAnimator.myValue); - return; // temporary registry key for designer - } paint(p, g, x, y, width, height, c, myTrackAnimator.myValue, false); } diff --git a/platform/platform-api/src/com/intellij/ui/components/JBScrollBar.java b/platform/platform-api/src/com/intellij/ui/components/JBScrollBar.java index 049a3f33c80e..871b8505ae33 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBScrollBar.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBScrollBar.java @@ -17,8 +17,6 @@ package com.intellij.ui.components; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.SystemInfo; -import com.intellij.openapi.util.registry.Registry; -import com.intellij.util.ui.ButtonlessScrollBarUI; import com.intellij.util.ui.RegionPainter; import com.intellij.util.ui.UIUtil; import org.intellij.lang.annotations.JdkConstants; @@ -72,9 +70,6 @@ public class JBScrollBar extends JScrollBar { */ @SuppressWarnings("UnusedParameters") public static ScrollBarUI createUI(JComponent c) { - if (Registry.is("ide.scroll.new.layout")) { - return SystemInfo.isMac ? new MacScrollBarUI() : new DefaultScrollBarUI(); - } - return ButtonlessScrollBarUI.createNormal(); + return SystemInfo.isMac ? new MacScrollBarUI() : new DefaultScrollBarUI(); } } diff --git a/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java b/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java index ce2cfa95d11e..68f4f2071b9f 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java @@ -149,7 +149,7 @@ public class JBScrollPane extends JScrollPane { } private void init(boolean setupCorners) { - setLayout(Registry.is("ide.scroll.new.layout") ? new Layout() : new ScrollPaneLayout()); + setLayout(new Layout()); if (setupCorners) { setupCorners(); @@ -433,27 +433,6 @@ public class JBScrollPane extends JScrollPane { protected void paintComponent(Graphics g) { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); - - if (SystemInfo.isMac || !Registry.is("ide.scroll.track.border.paint")) return; - g.setColor(getForeground()); - - int x2 = getWidth() - 1; - int y2 = getHeight() - 1; - - if (myPos == UPPER_LEFT_CORNER || myPos == UPPER_RIGHT_CORNER) { - g.drawLine(0, y2, x2, y2); - } - if (myPos == LOWER_LEFT_CORNER || myPos == LOWER_RIGHT_CORNER) { - g.drawLine(0, 0, x2, 0); - } - - if (myPos == UPPER_LEFT_CORNER || myPos == LOWER_LEFT_CORNER) { - g.drawLine(x2, 0, x2, y2); - } - - if (myPos == UPPER_RIGHT_CORNER || myPos == LOWER_RIGHT_CORNER) { - g.drawLine(0, 0, 0, y2); - } } } diff --git a/platform/platform-api/src/com/intellij/ui/components/JBViewport.java b/platform/platform-api/src/com/intellij/ui/components/JBViewport.java index 25f6acdb898e..f491ff872639 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBViewport.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBViewport.java @@ -44,7 +44,7 @@ public class JBViewport extends JViewport implements ZoomableViewport { @Override public void layoutContainer(Container parent) { - if (parent instanceof JViewport && Registry.is("ide.scroll.new.layout")) { + if (parent instanceof JViewport) { JViewport viewport = (JViewport)parent; Component view = viewport.getView(); if (view != null) { @@ -56,38 +56,7 @@ public class JBViewport extends JViewport implements ZoomableViewport { super.layoutContainer(parent); } } - return; } - JBViewport viewport = (JBViewport)parent; - Component view = viewport.getView(); - JBScrollPane scrollPane = UIUtil.getParentOfType(JBScrollPane.class, parent); - // do not force viewport size on editor component, e.g. EditorTextField and LanguageConsole - if (view == null || scrollPane == null || view instanceof TypingTarget) { - super.layoutContainer(parent); - return; - } - - Dimension size = doSuperLayoutContainer(viewport); - - Dimension visible = viewport.getExtentSize(); - if (scrollPane.getHorizontalScrollBarPolicy() == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER) { - size.width = visible.width; - } - if (scrollPane.getVerticalScrollBarPolicy() == ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER) { - size.height = visible.height; - } - viewport.setViewSize(size); - } - - private Dimension doSuperLayoutContainer(JBViewport viewport) { - try { - viewport.mySaveTempViewSize = true; - super.layoutContainer(viewport); - } - finally { - viewport.mySaveTempViewSize = false; - } - return viewport.myTempViewSize; } }; @@ -96,8 +65,6 @@ public class JBViewport extends JViewport implements ZoomableViewport { private ZoomingDelegate myZoomer; - private Dimension myTempViewSize; - private boolean mySaveTempViewSize; private volatile boolean myBackgroundRequested; // avoid cyclic references public JBViewport() { @@ -147,18 +114,6 @@ public class JBViewport extends JViewport implements ZoomableViewport { return ourLayoutManager; } - @Override - public void setViewSize(Dimension newSize) { - // only store newSize from ViewportLayout.layoutContainer - // if we're going to fix it the next moment in our layoutContainer code - if (mySaveTempViewSize) { - myTempViewSize = newSize; - } - else { - super.setViewSize(newSize); - } - } - @Override protected Graphics getComponentGraphics(Graphics graphics) { return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics)); diff --git a/platform/platform-api/src/com/intellij/ui/components/ScrollPainter.java b/platform/platform-api/src/com/intellij/ui/components/ScrollPainter.java index 0eb212d6360b..dc55b741496b 100644 --- a/platform/platform-api/src/com/intellij/ui/components/ScrollPainter.java +++ b/platform/platform-api/src/com/intellij/ui/components/ScrollPainter.java @@ -115,15 +115,7 @@ class ScrollPainter extends RegionPainter.Alpha { } protected void draw(Graphics2D g, int x, int y, int width, int height) { - if (Registry.is("ide.scroll.thumb.border.rounded")) { - g.drawLine(x + 1, y, x + width - 2, y); - g.drawLine(x + 1, y + height - 1, x + width - 2, y + height - 1); - g.drawLine(x, y + 1, x, y + height - 2); - g.drawLine(x + width - 1, y + 1, x + width - 1, y + height - 2); - } - else { - g.drawRect(x, y, width - 1, height - 1); - } + g.drawRect(x, y, width - 1, height - 1); } private static class Round extends ScrollPainter { diff --git a/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java b/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java index b97308dc62c1..b41d7c54c6b7 100644 --- a/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java +++ b/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java @@ -52,6 +52,7 @@ public class ButtonlessScrollBarUI extends BasicScrollBarUI { * @see RegionPainter * @see UIUtil#putClientProperty */ + @Deprecated public static final Key> MAXI_THUMB = Key.create("BUTTONLESS_SCROLL_BAR_UI_MAXI_THUMB"); private static final Logger LOG = Logger.getInstance("#" + ButtonlessScrollBarUI.class.getName()); @@ -692,7 +693,7 @@ public class ButtonlessScrollBarUI extends BasicScrollBarUI { if (isMacOverlayScrollbar()) { paintMacThumb(g, thumbBounds); } - else if (Registry.is("ide.scroll.new.layout")) { + else { Rectangle bounds = new Rectangle(thumbBounds); if (isThumbTranslucent()) { Alignment alignment = Alignment.get(scrollbar); @@ -744,17 +745,6 @@ public class ButtonlessScrollBarUI extends BasicScrollBarUI { painter.paint((Graphics2D)g, bounds.x, bounds.y, bounds.width, bounds.height, value); } } - else { - RegionPainter painter = UIUtil.getClientProperty(scrollbar, MAXI_THUMB); - if (painter != null) { - painter.paint((Graphics2D)g, thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, myThumbFadeColorShift); - } - else { - g.translate(thumbBounds.x, thumbBounds.y); - paintMaxiThumb((Graphics2D)g, thumbBounds); - g.translate(-thumbBounds.x, -thumbBounds.y); - } - } } @Deprecated @@ -1071,21 +1061,6 @@ public class ButtonlessScrollBarUI extends BasicScrollBarUI { return false; } - @Override - protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { - if (!Registry.is("ide.scroll.new.layout") && !isMacOverlayScrollbar()) { - int half = getThickness() / 2; - int shiftX = isVertical() ? half - 1 : 0; - int shiftY = isVertical() ? 0 : half - 1; - g.translate(shiftX, shiftY); - super.paintThumb(g, c, thumbBounds); - g.translate(-shiftX, -shiftY); - } - else { - super.paintThumb(g, c, thumbBounds); - } - } - protected void paintMaxiThumb(Graphics2D g, Rectangle thumbBounds) { int arc = JBUI.scale(3); g.setColor(adjustColor(getGradientDarkColor())); diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaScrollBarUI.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaScrollBarUI.java index 3ae3269777b4..24e3813f900d 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaScrollBarUI.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaScrollBarUI.java @@ -16,7 +16,6 @@ package com.intellij.ide.ui.laf.darcula.ui; import com.intellij.openapi.util.SystemInfo; -import com.intellij.openapi.util.registry.Registry; import com.intellij.util.ui.ButtonlessScrollBarUI; import javax.swing.*; @@ -32,14 +31,12 @@ public class DarculaScrollBarUI extends ButtonlessScrollBarUI { @SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"}) public static ComponentUI createUI(JComponent c) { - if (Registry.is("ide.scroll.new.layout")) { - try { - return (ComponentUI)newInstance(Class.forName(SystemInfo.isMac - ? "com.intellij.ui.components.MacScrollBarUI" - : "com.intellij.ui.components.DefaultScrollBarUI")); - } - catch (Exception ignore) { - } + try { + return (ComponentUI)newInstance(Class.forName(SystemInfo.isMac + ? "com.intellij.ui.components.MacScrollBarUI" + : "com.intellij.ui.components.DefaultScrollBarUI")); + } + catch (Exception ignore) { } return new DarculaScrollBarUI(); } diff --git a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java index 50d419855806..80b6dc907612 100644 --- a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java @@ -873,9 +873,6 @@ public class NotificationsManagerImpl extends NotificationsManager { public static void configureBalloonScrollPane(@NotNull JScrollPane pane, @NotNull Color fillColor) { pane.setOpaque(false); pane.getViewport().setOpaque(false); - if (!Registry.is("ide.scroll.new.layout")) { - pane.getVerticalScrollBar().setUI(ButtonlessScrollBarUI.createTransparent()); - } pane.setBackground(fillColor); pane.getViewport().setBackground(fillColor); pane.getVerticalScrollBar().setBackground(fillColor); 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 b40ff9cacdb8..caf4c5b9facc 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 @@ -5365,20 +5365,12 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi assertIsDispatchThread(); int currentHorOffset = myScrollingModel.getHorizontalScrollOffset(); myScrollBarOrientation = type; - if (Registry.is("ide.scroll.new.layout")) { - myScrollPane.putClientProperty(JBScrollPane.Flip.class, - type == VERTICAL_SCROLLBAR_LEFT - ? JBScrollPane.Flip.HORIZONTAL - : null); - JScrollBar vsb = myScrollPane.getVerticalScrollBar(); - if (vsb != null) vsb.setOpaque(true); - } - else if (type == VERTICAL_SCROLLBAR_LEFT) { - myScrollPane.setLayout(new LeftHandScrollbarLayout()); - } - else { - myScrollPane.setLayout(new ScrollPaneLayout()); - } + myScrollPane.putClientProperty(JBScrollPane.Flip.class, + type == VERTICAL_SCROLLBAR_LEFT + ? JBScrollPane.Flip.HORIZONTAL + : null); + JScrollBar vsb = myScrollPane.getVerticalScrollBar(); + if (vsb != null) vsb.setOpaque(true); myScrollingModel.scrollHorizontally(currentHorOffset); } @@ -7118,15 +7110,6 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi return new MyScrollBar(Adjustable.VERTICAL); } - @NotNull - @Override - public JScrollBar createHorizontalScrollBar() { - if (Registry.is("ide.scroll.new.layout")) { - return super.createHorizontalScrollBar(); - } - return new MyScrollBar(Adjustable.HORIZONTAL); - } - @Override protected void setupCorners() { super.setupCorners(); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java index 29709482e141..37e1bfcb0e09 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java @@ -563,21 +563,8 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark g2d.setTransform(old); } } - else if (Registry.is("ide.scroll.new.layout")) { - super.paintThumb(g, c, thumbBounds); - } else { - int shift; - if (Registry.is("editor.full.width.scrollbar")) { - shift = isMirrored() ? -myMinMarkHeight + 1 : myMinMarkHeight; - } - else { - int half = getThickness() / 2; - shift = isMirrored() ? -half + 2 : half - 1; - } - g.translate(shift, 0); super.paintThumb(g, c, thumbBounds); - g.translate(-shift, 0); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutDialog.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutDialog.java index 6b8c088aa8b5..28aa6b96a918 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutDialog.java @@ -24,14 +24,12 @@ import com.intellij.openapi.keymap.KeyMapBundle; import com.intellij.openapi.keymap.Keymap; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; -import com.intellij.openapi.util.registry.Registry; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.SimpleColoredComponent; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.components.GradientViewport; import com.intellij.ui.components.JBPanel; import com.intellij.ui.components.panels.VerticalLayout; -import com.intellij.util.ui.ButtonlessScrollBarUI; import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.Nullable; @@ -160,9 +158,6 @@ abstract class ShortcutDialog extends DialogWrapper { JScrollPane scroll = ScrollPaneFactory.createScrollPane(null, true); scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scroll.setViewport(new GradientViewport(myConflictsContainer, JBUI.insets(5), false)); - if (!Registry.is("ide.scroll.new.layout")) { - scroll.getVerticalScrollBar().setUI(ButtonlessScrollBarUI.createTransparent()); - } scroll.getVerticalScrollBar().setOpaque(false); scroll.getViewport().setOpaque(false); scroll.setOpaque(false); diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java index 9b2a5c843ac4..46b03ed48625 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java @@ -26,10 +26,8 @@ import com.intellij.openapi.options.ex.ConfigurableWrapper; import com.intellij.openapi.options.ex.Settings; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.LoadingDecorator; -import com.intellij.openapi.ui.OnePixelDivider; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.Disposer; -import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.ui.OnePixelSplitter; @@ -191,50 +189,26 @@ final class SettingsEditor extends AbstractEditor implements DataProvider { myLoadingDecorator = new LoadingDecorator(myEditor, this, 10, true); myBanner = new Banner(myEditor.getResetAction()); mySearchPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - JComponent left = myTreeView; - JComponent right = myLoadingDecorator.getComponent(); - if (Registry.is("ide.settings.old.style")) { - myBanner.setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10)); - mySearch.setBackground(UIUtil.SIDE_PANEL_BACKGROUND); - mySearchPanel.setBackground(UIUtil.SIDE_PANEL_BACKGROUND); - mySearchPanel.addComponentListener(new ComponentAdapter() { - @Override - public void componentResized(ComponentEvent event) { - Dimension size = myBanner.getPreferredSize(); - size.height = mySearchPanel.getHeight() - 5; - myBanner.setPreferredSize(size); - myBanner.setSize(size); - myBanner.revalidate(); - myBanner.repaint(); - } - }); - left = new JPanel(new BorderLayout()); - left.add(BorderLayout.NORTH, mySearchPanel); - left.add(BorderLayout.CENTER, myTreeView); - - right = new JPanel(new BorderLayout()); - right.add(BorderLayout.NORTH, myBanner); - right.add(BorderLayout.CENTER, myLoadingDecorator.getComponent()); - } - else { - myBanner.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); - myTreeView.addComponentListener(new ComponentAdapter() { - @Override - public void componentResized(ComponentEvent event) { - Dimension size = mySearchPanel.getPreferredSize(); - size.width = myTreeView.getWidth(); - mySearchPanel.setPreferredSize(size); - mySearchPanel.setSize(size); - mySearchPanel.revalidate(); - mySearchPanel.repaint(); - } - }); - JPanel panel = new JPanel(new BorderLayout()); - panel.add(BorderLayout.WEST, mySearchPanel); - panel.add(BorderLayout.CENTER, myBanner); - panel.setBorder(JBUI.Borders.customLine(OnePixelDivider.BACKGROUND, 0, 0, 1, 0)); - add(BorderLayout.NORTH, panel); - } + myBanner.setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10)); + mySearch.setBackground(UIUtil.SIDE_PANEL_BACKGROUND); + mySearchPanel.setBackground(UIUtil.SIDE_PANEL_BACKGROUND); + mySearchPanel.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent event) { + Dimension size = myBanner.getPreferredSize(); + size.height = mySearchPanel.getHeight() - 5; + myBanner.setPreferredSize(size); + myBanner.setSize(size); + myBanner.revalidate(); + myBanner.repaint(); + } + }); + JComponent left = new JPanel(new BorderLayout()); + left.add(BorderLayout.NORTH, mySearchPanel); + left.add(BorderLayout.CENTER, myTreeView); + JComponent right = new JPanel(new BorderLayout()); + right.add(BorderLayout.NORTH, myBanner); + right.add(BorderLayout.CENTER, myLoadingDecorator.getComponent()); mySplitter = new OnePixelSplitter(false, myProperties.getFloat(SPLITTER_PROPORTION, .2f)); mySplitter.setHonorComponentsMinimumSize(true); mySplitter.setFirstComponent(left); diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java index 4ee4aa62017b..869d409f20c0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java @@ -159,9 +159,6 @@ final class SettingsTreeView extends JComponent implements Accessible, Disposabl return myHeader; } }); - if (!Registry.is("ide.scroll.new.layout")) { - myScroller.getVerticalScrollBar().setUI(ButtonlessScrollBarUI.createTransparent()); - } if (!Registry.is("ide.scroll.background.auto")) { myScroller.setBackground(UIUtil.SIDE_PANEL_BACKGROUND); myScroller.getViewport().setBackground(UIUtil.SIDE_PANEL_BACKGROUND); diff --git a/platform/platform-impl/src/com/intellij/reporting/FreezeLoggerImpl.java b/platform/platform-impl/src/com/intellij/reporting/FreezeLoggerImpl.java index 2c9214a6d238..901f8e78ee27 100644 --- a/platform/platform-impl/src/com/intellij/reporting/FreezeLoggerImpl.java +++ b/platform/platform-impl/src/com/intellij/reporting/FreezeLoggerImpl.java @@ -27,6 +27,8 @@ import com.intellij.util.Alarm; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.lang.management.ThreadInfo; + public class FreezeLoggerImpl extends FreezeLogger { private static final Logger LOG = Logger.getInstance(FreezeLoggerImpl.class); @@ -57,7 +59,8 @@ public class FreezeLoggerImpl extends FreezeLogger { return; } - final String edtTrace = ThreadDumper.dumpEdtStackTrace(); + final ThreadInfo[] infos = ThreadDumper.getThreadInfos(); + final String edtTrace = ThreadDumper.dumpEdtStackTrace(infos); if (edtTrace.contains("java.lang.ClassLoader.loadClass")) { return; } @@ -69,7 +72,7 @@ public class FreezeLoggerImpl extends FreezeLogger { + "\n\n\n"; if (Registry.is("typing.freeze.report.dumps")) { - ThreadDumpInfo info = new ThreadDumpInfo(dumps, isInDumbMode); + ThreadDumpInfo info = new ThreadDumpInfo(infos, isInDumbMode); String report = ReporterKt.createReportLine("typing-freeze-dumps", info); if (!StatsSender.INSTANCE.send(report, true)) { LOG.debug("Error while reporting thread dump"); @@ -83,15 +86,15 @@ public class FreezeLoggerImpl extends FreezeLogger { } class ThreadDumpInfo { - public final String dump; + public final ThreadInfo[] threadInfos; public final String version; public final String product; public final String buildNumber; public final boolean isEAP; public final boolean isInDumbMode; - public ThreadDumpInfo(String dump, boolean isInDumbMode) { - this.dump = dump; + public ThreadDumpInfo(ThreadInfo[] threadInfos, boolean isInDumbMode) { + this.threadInfos = threadInfos; this.product = ApplicationInfo.getInstance().getVersionName(); this.version = ApplicationInfo.getInstance().getFullVersion(); this.buildNumber = ApplicationInfo.getInstance().getBuild().toString(); diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 582cb98feab4..042e343e10c8 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -958,7 +958,7 @@ update.downloading.patch.progress=Downloading Patch File update.preparing.patch.progress=Preparing Patch Files update.cleaning.patch.progress=Cleaning Patch Files update.downloading.plugins.progress=Downloading Plugin Updates -update.downloading.patch.error=Failed to download patch file:
{0}
Download page. +update.downloading.patch.error=Failed to prepare an update:
{0}
Open download page. update.plugins.update.action=&Update update.restart.plugins.update.action=&Update and Restart update.shutdown.plugins.update.action=&Update and Shutdown diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestProxyPrinterProvider.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestProxyPrinterProvider.java index e385f2b6ac71..d66162f22810 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestProxyPrinterProvider.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestProxyPrinterProvider.java @@ -88,7 +88,7 @@ public final class TestProxyPrinterProvider { } private void printLine(@NotNull String line, @NotNull ConsoleViewContentType contentType) { - Filter.Result result = null; + Filter.Result result; try { result = myFilter.applyFilter(line, line.length()); } @@ -96,10 +96,12 @@ public final class TestProxyPrinterProvider { throw new RuntimeException("Error while applying " + myFilter + " to '"+line+"'", t); } if (result != null) { - defaultPrint(line.substring(0, result.getHighlightStartOffset()), contentType); - String linkText = line.substring(result.getHighlightStartOffset(), result.getHighlightEndOffset()); - printHyperlink(linkText, result.getHyperlinkInfo()); - defaultPrint(line.substring(result.getHighlightEndOffset()), contentType); + for (Filter.ResultItem item : result.getResultItems()) { + defaultPrint(line.substring(0, item.getHighlightStartOffset()), contentType); + String linkText = line.substring(item.getHighlightStartOffset(), item.getHighlightEndOffset()); + printHyperlink(linkText, item.getHyperlinkInfo()); + defaultPrint(line.substring(item.getHighlightEndOffset()), contentType); + } } else { defaultPrint(line, contentType); diff --git a/platform/testFramework/bootstrap/src/com/intellij/tests/ExternalClasspathClassLoader.java b/platform/testFramework/bootstrap/src/com/intellij/tests/ExternalClasspathClassLoader.java index 832386b95134..c780281b0862 100644 --- a/platform/testFramework/bootstrap/src/com/intellij/tests/ExternalClasspathClassLoader.java +++ b/platform/testFramework/bootstrap/src/com/intellij/tests/ExternalClasspathClassLoader.java @@ -29,6 +29,10 @@ import java.util.LinkedHashSet; * @author max */ public class ExternalClasspathClassLoader extends URLClassLoader { + static { + registerAsParallelCapable(); + } + private ExternalClasspathClassLoader(URL[] urls) { super(urls, Thread.currentThread().getContextClassLoader()); } diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index ba533ae2d310..2e2fde5a3546 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -36,11 +36,16 @@ actionSystem.quickAccessEnabled=false actionSystem.quickAccessModifiers= actionSystem.quickAccessShowSpotsTime=1500 actionSystem.win.suppressAlt=true + actionSystem.win.suppressAlt.new=true +actionSystem.win.suppressAlt.new.description=Enables another approach to consume Alt which may move focus to main menu (Windows L&F only). + actionSystem.mouseGesturesEnabled=true actionSystem.assertFocusAccessFromEdt=true actionSystem.enableAbbreviations=true + actionSystem.extendedKeyCode.disabled=false +actionSystem.extendedKeyCode.disabled.description=Disables our key processing that uses extended code to determine a shortcut. color.blindness.icon.filter=false color.blindness.daltonization=false @@ -51,7 +56,10 @@ ide.debugMode.description=Record additional information to make bug reports more ide.forcedShowTooltip=alt ide.forcedShowTooltip.description=Shortcut for forced show tooltip. ide.popup.dropShadow=false + ide.popup.resizable.border.sensitivity=4 +ide.popup.resizable.border.sensitivity.description=Amount of pixels from the edge of undecorated popup to listen resize events. + ide.consumeKnownToolkitBugs=true ide.highlight.match.in.selected.only=true ide.lazyIconLoading=true @@ -112,13 +120,11 @@ ide.splitter.mouseZone=6 ide.scroll.default.unit.increment=false ide.scroll.default.unit.increment.description=Use default unit increment from Java (may decrease scrolling performance). // Malenkov -ide.scroll.new.layout=true ide.scroll.align.component=true + ide.scroll.background.auto=true -ide.scroll.background.wide=false -ide.scroll.bar.expand.animation=false -ide.scroll.track.border.paint=false -ide.scroll.thumb.border.rounded=false +ide.scroll.background.auto.description=Use background color of a view to paint viewport, scroll pane, and scroll bars. + ide.scroll.thumb.small.if.opaque=true mac.scroll.horizontal.gap=false @@ -177,7 +183,10 @@ skip.untitled.windows.for.mac.messages=false skip.untitled.windows.for.mac.messages.description=Temporary key to test a fix for MacMessages ide.mac.mountain.lion.notifications.enabled=true ide.mac.inplaceDialogMnemonicsFix=false + ide.mac.alt.mnemonic.without.ctrl=true +ide.mac.alt.mnemonic.without.ctrl.description=Processes Alt-based shortcuts for mnemonics in addition to Ctrl+Alt-based shortcuts. Affect MacOS only. + ide.mac.fix.dialog.showing=false ide.mac.hide.cursor.when.typing=true ide.mac.show.native.help=true @@ -295,7 +304,9 @@ vcs.unversioned.files.in.commit=true psi.incremental.reparse.depth.limit=1000 psi.deferIconLoading=true psi.track.invalidation=true + psi.element.list.cell.renderer.focus.border.enabled=false +psi.element.list.cell.renderer.focus.border.enabled.description=Enables default focus border in a list of PSI elements. // Malenkov ide.suggest.file.when.creating.filename.like.directory=true ide.suggest.file.when.creating.filename.like.directory.description=When creating a directory named foo.txt, suggest to create a file with such a name instead @@ -329,6 +340,9 @@ java.completion.make.outer.variables.final.description=Make variables accessed f java.completion.argument.live.template=false java.completion.argument.live.template.description=When completing a method call, start a live template with all arguments +java.completion.argument.live.template.completion=false +java.completion.argument.live.template.completion.description=If java.completion.argument.live.template is enabled, show completion for method arguments immediately + java.completion.show.constructors=false java.completion.show.constructors.description=Show separate constructors when completing constructor call, instead of a single class name @@ -578,9 +592,12 @@ console.too.much.text.buffer.ratio.description=Used for disabling of console pro The ratio is used against the console cycle buffer size (idea.cycle.buffer.size/theRatio=maxTextLength). ide.settings.keymap.input.method.enabled=false +ide.settings.keymap.input.method.enabled.description=Use input method instead of simple key event to enter shortcuts. + ide.settings.configurable.loading.threshold=0 +ide.settings.configurable.loading.threshold.description=A positive number of milliseconds starts debugging of Settings loading. + ide.settings.replace.group.with.single.configurable=true -ide.settings.old.style=true commonjs.complete.required.filename.with.extension=false commonjs.complete.required.filename.with.extension.description=If checked, required filenames are completed with extension @@ -653,6 +670,8 @@ editor.bold.underline.height=2 editor.bold.underline.height.description=Underline height for EffectType.BOLD_LINE_UNDERSCORE error.stripe.enabled=true +error.stripe.enabled.description=Shows error stripes in the project view. + error.stripe.gap=1 error.stripe.gap.description=Minimal space between error stripe. diff --git a/platform/util/src/com/intellij/diagnostic/ThreadDumper.java b/platform/util/src/com/intellij/diagnostic/ThreadDumper.java index 12b3e7e09535..f5eaeb502dbf 100644 --- a/platform/util/src/com/intellij/diagnostic/ThreadDumper.java +++ b/platform/util/src/com/intellij/diagnostic/ThreadDumper.java @@ -43,17 +43,21 @@ public class ThreadDumper { } @NotNull - public static String dumpEdtStackTrace() { - ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); - ThreadInfo[] threads = sort(threadMXBean.dumpAllThreads(false, false)); + public static String dumpEdtStackTrace(ThreadInfo[] threadInfos) { StringWriter writer = new StringWriter(); - if (threads.length > 0) { - StackTraceElement[] trace = threads[0].getStackTrace(); + if (threadInfos.length > 0) { + StackTraceElement[] trace = threadInfos[0].getStackTrace(); printStackTrace(writer, trace); } return writer.toString(); } + @NotNull + public static ThreadInfo[] getThreadInfos() { + ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); + return sort(threadMXBean.dumpAllThreads(false, false)); + } + @NotNull public static ThreadDump getThreadDumpInfo(@NotNull final ThreadMXBean threadMXBean) { StringWriter writer = new StringWriter(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index 19de6eb510c9..b75d14bb19aa 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -55,7 +55,6 @@ import com.intellij.util.Alarm; import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.AbstractLayoutManager; -import com.intellij.util.ui.ButtonlessScrollBarUI; import com.intellij.util.ui.GridBag; import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NonNls; @@ -1009,10 +1008,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj JPanel mainPanel; if (myAdditionalOptionsPanel != null) { JScrollPane optionsPane = ScrollPaneFactory.createScrollPane(myAdditionalOptionsPanel, true); - if (!Registry.is("ide.scroll.new.layout")) { - optionsPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); - optionsPane.getVerticalScrollBar().setUI(ButtonlessScrollBarUI.createTransparent()); - } JPanel infoPanel = JBUI.Panels.simplePanel(optionsPane).withBorder(JBUI.Borders.emptyLeft(10)); mainPanel = new JPanel(new MyOptionsLayout(mySplitter, infoPanel, JBUI.scale(250))); diff --git a/updater/src/com/intellij/updater/UpdateZipAction.java b/updater/src/com/intellij/updater/UpdateZipAction.java index 1a1c34088e40..a076a5aadf71 100644 --- a/updater/src/com/intellij/updater/UpdateZipAction.java +++ b/updater/src/com/intellij/updater/UpdateZipAction.java @@ -171,9 +171,7 @@ public class UpdateZipAction extends BaseUpdateAction { @Override protected void doApply(final ZipFile patchFile, File backupDir, File toFile) throws IOException { File temp = Utils.createTempFile(); - try (ZipOutputWrapper out = new ZipOutputWrapper(new FileOutputStream(temp))) { - out.setCompressionLevel(0); - + try (ZipOutputWrapper out = new ZipOutputWrapper(new FileOutputStream(temp), 0)) { processZipFile(getSource(backupDir), new Processor() { @Override public void process(ZipEntry entry, InputStream in) throws IOException { diff --git a/updater/src/com/intellij/updater/ZipOutputWrapper.java b/updater/src/com/intellij/updater/ZipOutputWrapper.java index 5e21fd9ce6d1..c579fd30ba87 100644 --- a/updater/src/com/intellij/updater/ZipOutputWrapper.java +++ b/updater/src/com/intellij/updater/ZipOutputWrapper.java @@ -16,75 +16,70 @@ package com.intellij.updater; import java.io.*; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.zip.CRC32; +import java.util.zip.Checksum; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class ZipOutputWrapper implements AutoCloseable { private final ZipOutputStream myOut; - private final Set myDirs = new HashSet<>(); - private boolean isCompressed = true; + private final boolean myCompressed; + private final Set myDirs = new TreeSet<>(); public ZipOutputWrapper(OutputStream stream) { myOut = new ZipOutputStream(new BufferedOutputStream(stream)); + myCompressed = true; } - public void setCompressionLevel(int level) { - myOut.setLevel(level); - if (level == 0) { - myOut.setMethod(ZipEntry.STORED); - isCompressed = false; - } + public ZipOutputWrapper(OutputStream stream, int compressionLevel) { + myOut = new ZipOutputStream(new BufferedOutputStream(stream)); + myOut.setLevel(compressionLevel); + myCompressed = compressionLevel > 0; } - public OutputStream zipStream(final String entryPath) throws IOException { - final ByteArrayOutputStream tempOut = new ByteArrayOutputStream(); - return new BufferedOutputStream(new OutputStream() { - @Override - public void write(int b) throws IOException { - tempOut.write(b); - } - + public OutputStream zipStream(String entryPath) throws IOException { + return new OptByteArrayOutputStream() { @Override public void close() throws IOException { super.close(); - tempOut.close(); - zipBytes(entryPath, tempOut); + zipBytes(entryPath, this); } - }); + }; } public void zipEntry(ZipEntry entry, InputStream from) throws IOException { if (entry.isDirectory()) { addDirs(entry.getName(), true); - return; } - zipEntry(entry.getName(), from); + else { + zipEntry(entry.getName(), from); + } } public void zipEntry(String entryPath, InputStream from) throws IOException { - ByteArrayOutputStream tempOut = new ByteArrayOutputStream(); - try { - Utils.copyStream(from, tempOut); - } - finally { - tempOut.close(); - } + OptByteArrayOutputStream tempOut = new OptByteArrayOutputStream(); + Utils.copyStream(from, tempOut); zipBytes(entryPath, tempOut); } - public void zipBytes(String entryPath, ByteArrayOutputStream byteOut) throws IOException { + public void zipFile(String entryPath, File file) throws IOException { + if (file.isDirectory()) { + throw new IllegalArgumentException("Doesn't make sense"); + } + try (InputStream from = new BufferedInputStream(new FileInputStream(file))) { + zipEntry(new ZipEntry(entryPath), from); + } + } + + private void zipBytes(String entryPath, OptByteArrayOutputStream byteOut) throws IOException { addDirs(entryPath, false); ZipEntry entry = new ZipEntry(entryPath); - if (!isCompressed) { + if (!myCompressed) { entry.setSize(byteOut.size()); CRC32 crc = new CRC32(); - crc.update(byteOut.toByteArray()); + byteOut.updateChecksum(crc); entry.setCrc(crc.getValue()); } @@ -93,25 +88,12 @@ public class ZipOutputWrapper implements AutoCloseable { myOut.closeEntry(); } - public void zipFile(String entryPath, File file) throws IOException { - if (file.isDirectory()) { - addDirs(entryPath, true); - return; - } - - try (InputStream from = new BufferedInputStream(new FileInputStream(file))) { - zipEntry(new ZipEntry(entryPath), from); - } - } - private void addDirs(String relPath, boolean isDir) { - List temp = new ArrayList<>(); if (isDir && !relPath.endsWith("/")) relPath += "/"; int index = 0; while ((index = relPath.indexOf('/', index + 1)) != -1) { - temp.add(relPath.substring(0, index)); + myDirs.add(relPath.substring(0, index)); } - myDirs.addAll(temp); } public void finish() throws IOException { @@ -130,4 +112,10 @@ public class ZipOutputWrapper implements AutoCloseable { public void close() throws IOException { myOut.close(); } + + private static class OptByteArrayOutputStream extends ByteArrayOutputStream { + public void updateChecksum(Checksum cs) { + cs.update(buf, 0, count); + } + } } \ No newline at end of file