Merge remote-tracking branch 'origin/master'

This commit is contained in:
Alexander Lobas
2012-04-22 13:56:09 +04:00
5 changed files with 18 additions and 9 deletions
@@ -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) {
@@ -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));
}
});
@@ -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;
@@ -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() {
@@ -161,6 +161,7 @@ javaee
javascript
javax
jetbrains
jndi
jquery
json
keepduplicates