mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
package com.intellij.ide.util;
|
||||
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.psi.JavaRecursiveElementWalkingVisitor;
|
||||
import com.intellij.psi.PsiAnonymousClass;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
@@ -49,6 +47,19 @@ public class JavaAnonymousClassesHelper {
|
||||
|
||||
@Override
|
||||
public void visitAnonymousClass(PsiAnonymousClass aClass) {
|
||||
final PsiExpressionList arguments = aClass.getArgumentList();
|
||||
if (arguments != null) {
|
||||
for (PsiExpression expression : arguments.getExpressions()) {
|
||||
expression.acceptChildren(new JavaRecursiveElementVisitor() {
|
||||
@Override
|
||||
public void visitAnonymousClass(PsiAnonymousClass aClass) {
|
||||
index++;
|
||||
map.put(aClass, "$" + String.valueOf(index));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
index++;
|
||||
map.put(aClass, "$" + String.valueOf(index));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -37,6 +37,12 @@ public class JavaAnonymousClassesProvider implements AnonymousElementProvider {
|
||||
element.accept(new JavaRecursiveElementWalkingVisitor() {
|
||||
@Override
|
||||
public void visitAnonymousClass(PsiAnonymousClass aClass) {
|
||||
final PsiExpressionList arguments = aClass.getArgumentList();
|
||||
if (arguments != null) {
|
||||
for (PsiExpression expression : arguments.getExpressions()) {
|
||||
visitExpression(expression);
|
||||
}
|
||||
}
|
||||
elements.add(aClass);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
+19
-10
@@ -23,6 +23,7 @@ import com.intellij.openapi.options.SearchableConfigurable;
|
||||
import com.intellij.openapi.ui.DetailsComponent;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
import com.intellij.util.Alarm;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -41,19 +42,27 @@ public class IntentionSettingsPanel implements MasterDetails {
|
||||
private JPanel myTreePanel;
|
||||
private JPanel myDescriptionPanel;
|
||||
private DetailsComponent myDetailsComponent;
|
||||
|
||||
private Alarm myResetAlarm = new Alarm();
|
||||
|
||||
public IntentionSettingsPanel() {
|
||||
myIntentionSettingsTree = new IntentionSettingsTree() {
|
||||
protected void selectionChanged(Object selected) {
|
||||
if (selected instanceof IntentionActionMetaData) {
|
||||
IntentionActionMetaData actionMetaData = (IntentionActionMetaData)selected;
|
||||
intentionSelected(actionMetaData);
|
||||
if (myDetailsComponent != null) {
|
||||
String[] text = new String[actionMetaData.myCategory.length + 1];
|
||||
System.arraycopy(actionMetaData.myCategory, 0, text,0,actionMetaData.myCategory.length);
|
||||
text[text.length - 1] = actionMetaData.getFamily();
|
||||
myDetailsComponent.setText(text);
|
||||
}
|
||||
final IntentionActionMetaData actionMetaData = (IntentionActionMetaData)selected;
|
||||
final Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
intentionSelected(actionMetaData);
|
||||
if (myDetailsComponent != null) {
|
||||
String[] text = new String[actionMetaData.myCategory.length + 1];
|
||||
System.arraycopy(actionMetaData.myCategory, 0, text,0,actionMetaData.myCategory.length);
|
||||
text[text.length - 1] = actionMetaData.getFamily();
|
||||
myDetailsComponent.setText(text);
|
||||
}
|
||||
}
|
||||
};
|
||||
myResetAlarm.cancelAllRequests();
|
||||
myResetAlarm.addRequest(runnable, 100);
|
||||
}
|
||||
else {
|
||||
categorySelected((String)selected);
|
||||
@@ -102,9 +111,9 @@ public class IntentionSettingsPanel implements MasterDetails {
|
||||
|
||||
public void reset() {
|
||||
myIntentionSettingsTree.reset();
|
||||
SwingUtilities.invokeLater(new Runnable(){
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
myIntentionDescriptionPanel.init(myPanel.getWidth()/2);
|
||||
myIntentionDescriptionPanel.init(myPanel.getWidth() / 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public final class ShowFilesAction extends ToggleAction {
|
||||
|
||||
public ShowFilesAction(final Runnable update) {
|
||||
super(IdeBundle.message("action.show.files"),
|
||||
IdeBundle.message("action.description.show.files"), IconLoader.getIcon("/fileTypes/unknown.png"));
|
||||
IdeBundle.message("action.description.show.files"), IconLoader.getIcon("/fileTypes/any_type.png"));
|
||||
myUpdate = update;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,26 +32,23 @@ public class FontInfo {
|
||||
|
||||
private final TIntHashSet mySymbolsToBreakDrawingIteration = new TIntHashSet();
|
||||
|
||||
private final String myFamilyName;
|
||||
private final Font myFont;
|
||||
private final int mySize;
|
||||
@JdkConstants.FontStyle private final int myStyle;
|
||||
private final TIntHashSet mySafeCharacters = new TIntHashSet();
|
||||
private FontMetrics myFontMetrics = null;
|
||||
private final int[] charWidth = new int[128];
|
||||
private final boolean myHasGlyphsToBreakDrawingIteration;
|
||||
private boolean myHasGlyphsToBreakDrawingIteration;
|
||||
private boolean myCheckedForProblemGlyphs;
|
||||
|
||||
public FontInfo(final String familyName, final int size, @JdkConstants.FontStyle int style) {
|
||||
myFamilyName = familyName;
|
||||
mySize = size;
|
||||
myStyle = style;
|
||||
myFont = new Font(familyName, style, size);
|
||||
|
||||
parseProblemGlyphs();
|
||||
myHasGlyphsToBreakDrawingIteration = !mySymbolsToBreakDrawingIteration.isEmpty();
|
||||
}
|
||||
|
||||
private void parseProblemGlyphs() {
|
||||
myCheckedForProblemGlyphs = true;
|
||||
BufferedImage buffer = new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
|
||||
final Graphics graphics = buffer.getGraphics();
|
||||
if (!(graphics instanceof Graphics2D)) {
|
||||
@@ -70,6 +67,7 @@ public class FontInfo {
|
||||
mySymbolsToBreakDrawingIteration.add(c);
|
||||
}
|
||||
}
|
||||
myHasGlyphsToBreakDrawingIteration = !mySymbolsToBreakDrawingIteration.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,6 +84,9 @@ public class FontInfo {
|
||||
* @return true if the {@link #getFont() target font} has problem glyphs; <code>false</code> otherwise
|
||||
*/
|
||||
public boolean hasGlyphsToBreakDrawingIteration() {
|
||||
if (!myCheckedForProblemGlyphs) {
|
||||
parseProblemGlyphs();
|
||||
}
|
||||
return myHasGlyphsToBreakDrawingIteration;
|
||||
}
|
||||
|
||||
@@ -95,6 +96,9 @@ public class FontInfo {
|
||||
*/
|
||||
@NotNull
|
||||
public TIntHashSet getSymbolsToBreakDrawingIteration() {
|
||||
if (!myCheckedForProblemGlyphs) {
|
||||
parseProblemGlyphs();
|
||||
}
|
||||
return mySymbolsToBreakDrawingIteration;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,14 +136,16 @@ public class MacMainFrameDecorator implements UISettingsListener, Disposable {
|
||||
final ID pool = invoke("NSAutoreleasePool", "new");
|
||||
|
||||
int v = UNIQUE_COUNTER.incrementAndGet();
|
||||
frame.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent e) {
|
||||
if (e.getWindow() == frame && frame.getState() == Frame.ICONIFIED) {
|
||||
frame.setState(Frame.NORMAL);
|
||||
if (Patches.APPLE_BUG_ID_10514018) {
|
||||
frame.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent e) {
|
||||
if (e.getWindow() == frame && frame.getState() == Frame.ICONIFIED) {
|
||||
frame.setState(Frame.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
try {
|
||||
if (SystemInfo.isMacOSLion) {
|
||||
if (!FULL_SCREEN_AVAILABLE) return;
|
||||
|
||||
@@ -110,6 +110,11 @@ public class Patches {
|
||||
public static final boolean APPLE_BUG_ID_10207064 =
|
||||
SystemInfo.isMac && (!SystemInfo.isMacOSLeopard || !SystemInfo.isJavaVersionAtLeast("1.6.0_30"));
|
||||
|
||||
/**
|
||||
* Minimizing and restoring application via View | Minimize leads to visual artifacts
|
||||
*/
|
||||
public static final boolean APPLE_BUG_ID_10514018 = SystemInfo.isMac && !SystemInfo.isJavaVersionAtLeast("1.6.0_31");
|
||||
|
||||
/**
|
||||
* Index out of bounds at apple.laf.AquaTabbedPaneUI.tabForCoordinate
|
||||
* http://www.jetbrains.net/jira/browse/IDEADEV-15769
|
||||
|
||||
Reference in New Issue
Block a user