Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman Shevchenko
2015-08-18 18:41:47 +02:00
27 changed files with 74 additions and 82 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="pty4j">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/pty4j-0.4.21.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/pty4j-0.4.22.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/src/pty4j-0.4.21-src.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/src/pty4j-0.4.22-src.jar!/" />
</SOURCES>
</library>
</component>
@@ -148,10 +148,6 @@ public class VariablesPanel extends DebuggerTreePanel implements DataProvider {
}
}
@Override
protected void clear() {
}
@Override
public void processSessionEvent(@NotNull SessionEvent event) {
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable → Regular
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
View File
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -55,7 +55,7 @@ oromatcher.jar
picocontainer.jar
protobuf-2.5.0.jar
proxy-vole_20131209.jar
pty4j-0.4.21.jar
pty4j-0.4.22.jar
purejavacomm.jar
resolver.jar
rhino-js-1_7R4.jar
@@ -45,22 +45,13 @@ public abstract class WriteAction<T> extends BaseActionRunnable<T> {
application.runWriteAction(new Runnable() {
@Override
public void run() {
try {
result.run();
}
catch (RuntimeException e) {
result.setThrowable(e);
}
result.run();
}
});
}
}, ModalityState.defaultModalityState());
final Throwable throwable = result.getThrowable();
if (throwable != null && !isSilentExecution()) {
throw (RuntimeException)throwable;
}
result.throwException();
return result;
}
@@ -15,15 +15,16 @@
*/
package com.intellij.internal;
import com.intellij.notification.*;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.Alarm;
import com.intellij.util.SingleAlarm;
import com.intellij.util.net.NetUtils;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.Socket;
/**
* @author egor
@@ -31,7 +32,7 @@ import java.net.Socket;
public class DebugAttachDetector {
private static final Logger LOG = Logger.getInstance(DebugAttachDetector.class);
private String myHost;
private String myHost = null;
private int myPort = -1;
private SingleAlarm myAlarm;
private boolean myAttached;
@@ -48,7 +49,6 @@ public class DebugAttachDetector {
try {
String[] address = param.split("=")[1].split(":");
if (address.length == 1) {
myHost = "127.0.0.1";
myPort = Integer.parseInt(address[0]);
}
else {
@@ -72,7 +72,7 @@ public class DebugAttachDetector {
myAlarm = new SingleAlarm(new Runnable() {
@Override
public void run() {
boolean attached = checkAttached();
boolean attached = !NetUtils.canConnectToRemoteSocket(myHost, myPort);
if (!myReady) {
myAttached = attached;
myReady = true;
@@ -89,15 +89,4 @@ public class DebugAttachDetector {
}, 5000, Alarm.ThreadToUse.POOLED_THREAD, null);
myAlarm.request();
}
private boolean checkAttached() {
try {
Socket socket = new Socket(myHost, myPort);
socket.close();
return false;
}
catch (IOException e) {
return true;
}
}
}
@@ -190,10 +190,8 @@ class ProgressDialog implements Disposable {
public void dispose() {
UIUtil.disposeProgress(myProgressBar);
UIUtil.dispose(myTitlePanel);
final ActionListener[] listeners = myCancelButton.getActionListeners();
for (ActionListener listener : listeners) {
myCancelButton.removeActionListener(listener);
}
UIUtil.dispose(myBackgroundButton);
UIUtil.dispose(myCancelButton);
}
JPanel getPanel() {
@@ -139,12 +139,12 @@ public class SwingHelper {
}
public static void setPreferredWidthToFitText(@NotNull TextFieldWithHistoryWithBrowseButton component) {
int childWidth = calcWidthToFitText(component.getChildComponent().getTextEditor(), 35);
int childWidth = calcWidthToFitText(component.getChildComponent().getTextEditor(), JBUI.scale(32));
setPreferredWidthForComponentWithBrowseButton(component, childWidth);
}
public static void setPreferredWidthToFitText(@NotNull TextFieldWithBrowseButton component) {
int childWidth = calcWidthToFitText(component.getChildComponent(), 20);
int childWidth = calcWidthToFitText(component.getChildComponent(), JBUI.scale(20));
setPreferredWidthForComponentWithBrowseButton(component, childWidth);
}
@@ -155,7 +155,7 @@ public class SwingHelper {
}
public static void setPreferredWidthToFitText(@NotNull JTextField textField) {
setPreferredWidthToFitText(textField, 15);
setPreferredWidthToFitText(textField, JBUI.scale(15));
}
public static void setPreferredWidthToFitText(@NotNull JTextField textField, int additionalWidth) {
@@ -163,7 +163,7 @@ public class SwingHelper {
}
public static void setPreferredWidthToFitText(@NotNull JTextField textField, @NotNull String text) {
setPreferredSizeToFitText(textField, text, 15);
setPreferredSizeToFitText(textField, text, JBUI.scale(15));
}
private static void setPreferredSizeToFitText(@NotNull JTextField textField, @NotNull String text, int additionalWidth) {
@@ -2054,6 +2054,13 @@ public class UIUtil {
for (MouseWheelListener each : mouseWheelListeners) {
c.removeMouseWheelListener(each);
}
if (c instanceof AbstractButton) {
final ActionListener[] listeners = ((AbstractButton)c).getActionListeners();
for (ActionListener listener : listeners) {
((AbstractButton)c).removeActionListener(listener);
}
}
}
public static void disposeProgress(final JProgressBar progress) {
@@ -2563,7 +2570,7 @@ public class UIUtil {
* @param parent parent component
* @return true if parent if a top parent of child, false otherwise
*
* @see javax.swing.SwingUtilities#isDescendingFrom(java.awt.Component, java.awt.Component)
* @see SwingUtilities#isDescendingFrom(Component, Component)
*/
public static boolean isDescendingFrom(@Nullable Component child, @NotNull Component parent) {
while (child != null && child != parent) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -46,8 +46,4 @@ public class XStandaloneVariablesView extends XVariablesViewBase {
@Override
public void processSessionEvent(@NotNull SessionEvent event) {
}
@Override
protected void clear() {
}
}
@@ -103,6 +103,7 @@ public class XVariablesView extends XVariablesViewBase {
node = createInfoMessage(tree, debugProcess.getCurrentStateMessage(), debugProcess.getCurrentStateHyperlinkListener());
}
tree.setRoot(node, true);
super.clear();
}
public static class InlineVariablesInfo {
@@ -112,6 +112,11 @@ public abstract class XVariablesViewBase extends XDebugView {
}
}
@Override
protected void clear() {
removeSelectionListener();
}
private void disposeTreeRestorer() {
if (myTreeRestorer != null) {
myTreeRestorer.dispose();
+2 -28
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -72,7 +72,7 @@ public interface Group extends Actions {
* @return the value of the class child.
*/
@NotNull
@com.intellij.util.xml.Attribute ("class")
@Attribute ("class")
@ExtendClass(value = "com.intellij.openapi.actionSystem.ActionGroup",
instantiatable = true, allowAbstract = false, allowInterface = false)
@Convert(PluginPsiClassConverter.class)
@@ -103,19 +103,6 @@ public interface Group extends Actions {
//@NotNull
//GenericAttributeValue<Boolean> getOverrides();
/**
* Returns the list of reference children.
* @return the list of reference children.
*/
@NotNull
List<Reference> getReferences();
/**
* Adds new child to the list of reference children.
* @return created child
*/
Reference addReference();
/**
* Returns the value of the separator child.
* @return the value of the separator child.
@@ -124,19 +111,6 @@ public interface Group extends Actions {
List<GenericDomValue<String>> getSeparators();
/**
* Returns the list of action children.
* @return the list of action children.
*/
@NotNull
List<Action> getActions();
/**
* Adds new child to the list of action children.
* @return created child
*/
Action addAction();
/**
* Returns the list of add-to-group children.
* @return the list of add-to-group children.
@@ -160,15 +160,28 @@ public interface PyClass extends PsiNameIdentifierOwner, PyStatement, NameDefine
*/
boolean visitMethods(Processor<PyFunction> processor, boolean inherited);
boolean visitClassAttributes(Processor<PyTargetExpression> processor, boolean inherited);
boolean visitClassAttributes(Processor<PyTargetExpression> processor, boolean inherited, TypeEvalContext context);
/**
* Effectively collects assignments inside the class body.
* <p/>
* This method does not access AST if underlying PSI is stub based.
* Note that only <strong>own</strong> attrs are fetched, not parent attrs.
* If you need parent attributes, consider using {@link #getClassAttributesInherited(TypeEvalContext)}
* @see #getClassAttributesInherited(TypeEvalContext)
*/
List<PyTargetExpression> getClassAttributes();
/**
* Returns all class attributes this class class contains, including inherited one.
* Process may be heavy, depending or your context.
* @param context context to use for this process
* @return list of attrs.
*/
@NotNull
List<PyTargetExpression> getClassAttributesInherited(@NotNull TypeEvalContext context);
@Nullable
PyTargetExpression findClassAttribute(@NotNull String name, boolean inherited);
@@ -955,12 +955,13 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
return true;
}
public boolean visitClassAttributes(Processor<PyTargetExpression> processor, boolean inherited) {
public boolean visitClassAttributes(Processor<PyTargetExpression> processor, boolean inherited, @Nullable final TypeEvalContext context) {
List<PyTargetExpression> methods = getClassAttributes();
if (!ContainerUtil.process(methods, processor)) return false;
if (inherited) {
for (PyClass ancestor : getAncestorClasses(null)) {
if (!ancestor.visitClassAttributes(processor, false)) {
for (PyClass ancestor : getAncestorClasses(context)) {
// TODO: Why there is FALSE here? We support only one level of inheritance?
if (!ancestor.visitClassAttributes(processor, false, context)) {
return false;
}
}
@@ -969,6 +970,14 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
// NOTE: sorry, not enough metaprogramming to generalize visitMethods and visitClassAttributes
}
@NotNull
@Override
public final List<PyTargetExpression> getClassAttributesInherited(@NotNull final TypeEvalContext context) {
final MyAttributesCollector attributesCollector = new MyAttributesCollector();
visitClassAttributes(attributesCollector, true, context);
return attributesCollector.getAttributes();
}
public List<PyTargetExpression> getClassAttributes() {
PyClassStub stub = getStub();
if (stub != null) {
@@ -993,7 +1002,7 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
@Override
public PyTargetExpression findClassAttribute(@NotNull String name, boolean inherited) {
final NameFinder<PyTargetExpression> processor = new NameFinder<PyTargetExpression>(name);
visitClassAttributes(processor, inherited);
visitClassAttributes(processor, inherited, null);
return processor.getResult();
}
@@ -1525,4 +1534,17 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
public PyClassLikeType getType(@NotNull TypeEvalContext context) {
return PyUtil.as(context.getType(this), PyClassLikeType.class);
}
private static final class MyAttributesCollector implements Processor<PyTargetExpression> {
private final List<PyTargetExpression> myAttributes = new ArrayList<PyTargetExpression>();
@Override
public boolean process(final PyTargetExpression expression) {
myAttributes.add(expression);
return true;
}
@NotNull
List<PyTargetExpression> getAttributes() {
return Collections.unmodifiableList(myAttributes);
}
}
}