From 5adf12b6400e36d50371c39d2c12c8c9225fe998 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Sat, 21 Apr 2012 18:24:09 +0400 Subject: [PATCH 1/3] When building stub indices, do not create new stub tree from bytes but use stub tree we used for serialization --- .../src/com/intellij/psi/stubs/SerializedStubTree.java | 8 ++++++-- .../src/com/intellij/psi/stubs/StubUpdatingIndex.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/SerializedStubTree.java b/platform/lang-impl/src/com/intellij/psi/stubs/SerializedStubTree.java index d7423c8420b2..7641d78d2afb 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/SerializedStubTree.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/SerializedStubTree.java @@ -28,15 +28,18 @@ import java.io.IOException; public class SerializedStubTree { private final byte[] myBytes; private final int myLength; + private final StubElement myStubElement; - public SerializedStubTree(final byte[] bytes, int length) { + public SerializedStubTree(final byte[] bytes, int length, StubElement stubElement) { myBytes = bytes; myLength = length; + myStubElement = stubElement; } public SerializedStubTree(DataInput in) throws IOException { myLength = in.readInt(); myBytes = new byte[myLength]; + myStubElement = null; in.readFully(myBytes); } @@ -46,7 +49,8 @@ public class SerializedStubTree { } public StubElement getStub() { - return SerializationManager.getInstance().deserialize(new UnsyncByteArrayInputStream(myBytes)); + return myStubElement != null ? + myStubElement : SerializationManager.getInstance().deserialize(new UnsyncByteArrayInputStream(myBytes)); } public boolean equals(final Object that) { diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java index 6812876cb35c..bf13b83a1b8e 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java @@ -121,7 +121,7 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi SerializationManager.getInstance().serialize(rootStub, bytes); final int key = Math.abs(FileBasedIndex.getFileId(inputData.getFile())); - result.put(key, new SerializedStubTree(bytes.getInternalBuffer(), bytes.size())); + result.put(key, new SerializedStubTree(bytes.getInternalBuffer(), bytes.size(), rootStub)); } }); From 775bd9467c0efa82646555d069c186e6547cb889 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 18 Apr 2012 11:12:49 +0200 Subject: [PATCH 2/3] To JB dic --- plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic b/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic index e9ffe334960b..27e5ca7d262b 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic +++ b/plugins/spellchecker/src/com/intellij/spellchecker/jetbrains.dic @@ -161,6 +161,7 @@ javaee javascript javax jetbrains +jndi jquery json keepduplicates From d34583b90db5bb89984a1be080b35cf01a0be4f5 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Sat, 21 Apr 2012 23:00:01 +0200 Subject: [PATCH 3/3] IDEA-84759 (hard-code GTK+ Ambiance menu colors) --- .../openapi/actionSystem/impl/ActionMenu.java | 13 +++++++------ platform/util/src/com/intellij/util/ui/UIUtil.java | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionMenu.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionMenu.java index c4f77a784ae0..939e65112e77 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionMenu.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionMenu.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -117,6 +117,11 @@ public final class ActionMenu extends JMenu { public void updateUI() { if (UIUtil.isStandardMenuLAF()) { super.updateUI(); + + if (myTopLevel && UIUtil.isUnderGTKLookAndFeel() && "Ambiance".equalsIgnoreCase(UIUtil.getGtkThemeName())) { + setForeground(UIUtil.GTK_AMBIANCE_TEXT_COLOR); + setBackground(UIUtil.GTK_AMBIANCE_BACKGROUND_COLOR); + } } else { setUI(IdeaMenuUI.createUI(this)); @@ -131,14 +136,10 @@ public final class ActionMenu extends JMenu { @Override public void setUI(final MenuItemUI ui) { - final MenuItemUI newUi = !isTopLevel() && UIUtil.isUnderGTKLookAndFeel() && GtkMenuUI.isUiAcceptable(ui) ? new GtkMenuUI(ui) : ui; + final MenuItemUI newUi = !myTopLevel && UIUtil.isUnderGTKLookAndFeel() && GtkMenuUI.isUiAcceptable(ui) ? new GtkMenuUI(ui) : ui; super.setUI(newUi); } - private boolean isTopLevel() { - return myTopLevel; - } - private void init() { boolean macSystemMenu = SystemInfo.isMacSystemMenu && myPlace == ActionPlaces.MAIN_MENU; diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 255ba36442ad..e3dae97e2e1b 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -828,6 +828,9 @@ public class UIUtil { return UIManager.getLookAndFeel().getName().contains("GTK"); } + public static final Color GTK_AMBIANCE_TEXT_COLOR = new Color(223, 219, 210); + public static final Color GTK_AMBIANCE_BACKGROUND_COLOR = new Color(67, 66, 63); + @SuppressWarnings({"HardCodedStringLiteral"}) @Nullable public static String getGtkThemeName() {