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:
@@ -181,7 +181,7 @@ libraryLicense(name: "Apache Commons HTTPCore", libraryName: "httpcore-4.1.jar",
|
||||
url: "http://hc.apache.org/httpcomponents-core-ga/", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
|
||||
libraryLicense(name: "Antlr", libraryName: "antlr.jar", version: "3.1.3", license: "BSD", url: "http://www.antlr.org",
|
||||
licenseUrl: "http://www.antlr.org/license.html")
|
||||
libraryLicense(name: "Guava", version: "R8", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
|
||||
libraryLicense(name: "Guava", version: "12.0", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
|
||||
libraryLicense(name: "Groovy", version: "1.7.3", license: "Apache 2.0", url: "http://groovy.codehaus.org/")
|
||||
libraryLicense(name: "Gson", libraryName: "gson", license: "Apache 2.0", url: "http://code.google.com/p/google-gson/")
|
||||
libraryLicense(name: "ini4j", libraryName: "ini4j-0.5.2-patched", version: "0.5.2 (with a patch by JetBrains)", license: "Apache 2.0", url: "http://ini4j.sourceforge.net/", attachedTo: "git4idea")
|
||||
|
||||
+9
-7
@@ -369,18 +369,20 @@ public abstract class BreakpointPropertiesPanel {
|
||||
insert(myClassFiltersFieldPanel, myClassFiltersField);
|
||||
|
||||
DebuggerUIUtil.enableEditorOnCheck(myLogExpressionCheckBox, myLogExpressionCombo);
|
||||
ActionListener listener = new ActionListener() {
|
||||
ActionListener updateListener = new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
updateCheckboxes();
|
||||
}
|
||||
};
|
||||
myPassCountCheckbox.addActionListener(listener);
|
||||
myInstanceFiltersCheckBox.addActionListener(listener);
|
||||
myClassFiltersCheckBox.addActionListener(listener);
|
||||
myPassCountCheckbox.addActionListener(updateListener);
|
||||
myInstanceFiltersCheckBox.addActionListener(updateListener);
|
||||
myClassFiltersCheckBox.addActionListener(updateListener);
|
||||
myConditionCheckbox.addActionListener(updateListener);
|
||||
DebuggerUIUtil.focusEditorOnCheck(myPassCountCheckbox, myPassCountField);
|
||||
DebuggerUIUtil.focusEditorOnCheck(myLogExpressionCheckBox, myLogExpressionCombo);
|
||||
DebuggerUIUtil.focusEditorOnCheck(myInstanceFiltersCheckBox, myInstanceFiltersField.getTextField());
|
||||
DebuggerUIUtil.focusEditorOnCheck(myClassFiltersCheckBox, myClassFiltersField.getTextField());
|
||||
DebuggerUIUtil.focusEditorOnCheck(myConditionCheckbox, myConditionCombo);
|
||||
|
||||
IJSwingUtilities.adjustComponentsOnMac(mySuspendJBCheckBox);
|
||||
IJSwingUtilities.adjustComponentsOnMac(myLogExpressionCheckBox);
|
||||
@@ -873,7 +875,7 @@ public abstract class BreakpointPropertiesPanel {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(selected != null || !myConditionCombo.getText().isEmpty()){
|
||||
if(selected != null || !myConditionCheckbox.isSelected()){
|
||||
myPassCountCheckbox.setEnabled(false);
|
||||
} else {
|
||||
myPassCountCheckbox.setEnabled(true);
|
||||
@@ -886,8 +888,8 @@ public abstract class BreakpointPropertiesPanel {
|
||||
myPassCountField.setEditable(myPassCountCheckbox.isSelected());
|
||||
myPassCountField.setEnabled (myPassCountCheckbox.isSelected());
|
||||
|
||||
myConditionCombo.setEnabled(true);
|
||||
myConditionMagnifierButton.setEnabled(true);
|
||||
myConditionCombo.setEnabled(myConditionCheckbox.isSelected());
|
||||
myConditionMagnifierButton.setEnabled(myConditionCheckbox.isSelected());
|
||||
|
||||
myInstanceFiltersField.setEnabled(myInstanceFiltersCheckBox.isSelected());
|
||||
myInstanceFiltersField.getTextField().setEditable(myInstanceFiltersCheckBox.isSelected());
|
||||
|
||||
@@ -136,7 +136,7 @@ public class ExpectedTypesProvider {
|
||||
|
||||
public static PsiType[] processExpectedTypes(@NotNull ExpectedTypeInfo[] infos,
|
||||
@NotNull PsiTypeVisitor<PsiType> visitor, @NotNull Project project) {
|
||||
Set<PsiType> set = new LinkedHashSet<PsiType>();
|
||||
LinkedHashSet<PsiType> set = new LinkedHashSet<PsiType>();
|
||||
for (ExpectedTypeInfo info : infos) {
|
||||
ExpectedTypeInfoImpl infoImpl = (ExpectedTypeInfoImpl)info;
|
||||
|
||||
|
||||
+7
@@ -29,10 +29,13 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author Mike
|
||||
*/
|
||||
public class CreateFieldFromUsageFix extends CreateVarFromUsageFix {
|
||||
public static boolean DEBUG = false;
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.quickfix.CreateFieldFromUsageFix");
|
||||
|
||||
public CreateFieldFromUsageFix(PsiReferenceExpression referenceElement) {
|
||||
@@ -71,6 +74,10 @@ public class CreateFieldFromUsageFix extends CreateVarFromUsageFix {
|
||||
final PsiFile targetFile = targetClass.getContainingFile();
|
||||
|
||||
ExpectedTypeInfo[] expectedTypes = CreateFromUsageUtils.guessExpectedTypes(myReferenceExpression, false);
|
||||
if (DEBUG) {
|
||||
System.out.println("CreateFieldFromUsageFix.invokeImpl");
|
||||
System.out.println("expectedTypes = " + Arrays.toString(expectedTypes));
|
||||
}
|
||||
|
||||
String fieldName = myReferenceExpression.getReferenceName();
|
||||
assert fieldName != null;
|
||||
|
||||
+12
@@ -622,6 +622,13 @@ public class CreateFromUsageUtils {
|
||||
List<String> expectedFieldNames = new ArrayList<String>();
|
||||
|
||||
getExpectedInformation(expression, typesList, expectedMethodNames, expectedFieldNames);
|
||||
if (CreateFieldFromUsageFix.DEBUG) {
|
||||
System.out.println("CreateFromUsageUtils.guessExpectedTypes");
|
||||
for (ExpectedTypeInfo[] infos : typesList) {
|
||||
System.out.println("Arrays.toString(infos) = " + Arrays.toString(infos));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (typesList.size() == 1 && (!expectedFieldNames.isEmpty() || !expectedMethodNames.isEmpty())) {
|
||||
ExpectedTypeInfo[] infos = typesList.get(0);
|
||||
@@ -797,6 +804,11 @@ public class CreateFromUsageUtils {
|
||||
ProgressManager.checkCanceled();
|
||||
PsiClass aClass = member.getContainingClass();
|
||||
if (aClass instanceof PsiAnonymousClass || aClass == null) continue;
|
||||
if (CreateFieldFromUsageFix.DEBUG) {
|
||||
System.out.println("CreateFromUsageUtils.addMemberInfo");
|
||||
System.out.println("member = " + member);
|
||||
System.out.println("aClass = " + aClass);
|
||||
}
|
||||
|
||||
if (facade.getResolveHelper().isAccessible(member, expression, null)) {
|
||||
PsiClassType type;
|
||||
|
||||
+3
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.intention.impl;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -38,7 +39,6 @@ public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionA
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
|
||||
final PsiReference reference = file.findReferenceAt(editor.getCaretModel().getOffset());
|
||||
final FileReference fileReference = reference == null ? null : findFileReference(reference);
|
||||
|
||||
@@ -81,6 +81,8 @@ public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionA
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
|
||||
final PsiReference reference = file.findReferenceAt(editor.getCaretModel().getOffset());
|
||||
final FileReference fileReference = reference == null ? null : findFileReference(reference);
|
||||
if (fileReference != null) {
|
||||
|
||||
@@ -28,10 +28,9 @@ import com.intellij.psi.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class TypeExpression extends Expression {
|
||||
private final Set<SmartTypePointer> myItems;
|
||||
private final LinkedHashSet<SmartTypePointer> myItems;
|
||||
|
||||
public TypeExpression(final Project project, PsiType[] types) {
|
||||
final SmartTypePointerManager manager = SmartTypePointerManager.getInstance(project);
|
||||
|
||||
+8
@@ -1,5 +1,6 @@
|
||||
package com.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.quickfix.CreateFieldFromUsageFix;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -22,7 +23,14 @@ public class CreateFieldFromUsageTest extends LightQuickFixTestCase{
|
||||
public void testCreateFromEquals() throws Exception { doSingleTest(); }
|
||||
public void testCreateFromEqualsToPrimitiveType() throws Exception { doSingleTest(); }
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
CreateFieldFromUsageFix.DEBUG = false;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public void testSortByRelevance() throws Exception {
|
||||
CreateFieldFromUsageFix.DEBUG = true;
|
||||
new WriteCommandAction(getProject()) {
|
||||
@Override
|
||||
protected void run(Result result) throws Exception {
|
||||
|
||||
+2
-1
@@ -35,6 +35,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public abstract class PsiElementBaseIntentionAction extends BaseIntentionAction {
|
||||
@Override
|
||||
public final void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!file.getManager().isInProject(file)) return;
|
||||
final PsiElement element = getElement(editor, file);
|
||||
if (element != null) {
|
||||
invoke(project, editor, element);
|
||||
@@ -54,6 +55,7 @@ public abstract class PsiElementBaseIntentionAction extends BaseIntentionAction
|
||||
|
||||
@Override
|
||||
public final boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
if (!file.getManager().isInProject(file)) return false;
|
||||
final PsiElement element = getElement(editor, file);
|
||||
return element != null && isAvailable(project, editor, element);
|
||||
}
|
||||
@@ -71,7 +73,6 @@ public abstract class PsiElementBaseIntentionAction extends BaseIntentionAction
|
||||
|
||||
@Nullable
|
||||
protected static PsiElement getElement(Editor editor, @NotNull PsiFile file) {
|
||||
if (!file.getManager().isInProject(file)) return null;
|
||||
CaretModel caretModel = editor.getCaretModel();
|
||||
int position = caretModel.getOffset();
|
||||
return file.findElementAt(position);
|
||||
|
||||
@@ -675,6 +675,9 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable {
|
||||
|
||||
protected void processMouseEvent(MouseEvent e) {
|
||||
super.processMouseEvent(e);
|
||||
if (!isShowing()) {
|
||||
return;
|
||||
}
|
||||
switch (e.getID()) {
|
||||
case MouseEvent.MOUSE_ENTERED:
|
||||
setCursor(getResizeCursor());
|
||||
|
||||
@@ -59,19 +59,6 @@ public class CommonProcessors {
|
||||
return myCollection;
|
||||
}
|
||||
|
||||
public static class Sync<T> extends CollectProcessor<T> {
|
||||
public Sync(final Collection<T> collection) {
|
||||
super(collection);
|
||||
}
|
||||
|
||||
public Sync() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean process(final T t) {
|
||||
return super.process(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import static Util.doSomething
|
||||
|
||||
class Util {
|
||||
static doSomething(){}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user