Merge remote-tracking branch 'origin/master'

This commit is contained in:
Konstantin Bulenkov
2014-08-06 13:08:25 +02:00
20 changed files with 107 additions and 82 deletions
@@ -314,8 +314,7 @@ public class JavaStackFrame extends XStackFrame {
final Collection<Value> argValues = frame.getArgumentValues();
int index = 0;
for (Value argValue : argValues) {
final ArgumentValueDescriptorImpl descriptor = myNodeManager.getArgumentValueDescriptor(null, index++, argValue, null);
children.add(JavaValue.create(descriptor, evaluationContext, myNodeManager));
children.add(createArgumentValue(index++, argValue, null, evaluationContext));
}
node.setMessage(MessageDescriptor.LOCAL_VARIABLES_INFO_UNAVAILABLE.getLabel(), XDebuggerUIConstants.INFORMATION_MESSAGE_ICON, SimpleTextAttributes.REGULAR_ATTRIBUTES, null);
//myChildren.add(myNodeManager.createMessageNode(MessageDescriptor.LOCAL_VARIABLES_INFO_UNAVAILABLE));
@@ -326,9 +325,7 @@ public class JavaStackFrame extends XStackFrame {
try {
final Map<DecompiledLocalVariable, Value> values = LocalVariablesUtil.fetchValues(frame.getStackFrame(), decompiled);
for (DecompiledLocalVariable var : decompiled) {
final Value value = values.get(var);
final ArgumentValueDescriptorImpl descriptor = myNodeManager.getArgumentValueDescriptor(null, var.getSlot(), value, var.getName());
children.add(JavaValue.create(descriptor, evaluationContext, myNodeManager));
children.add(createArgumentValue(var.getSlot(), values.get(var), var.getName(), evaluationContext));
}
}
catch (Exception ex) {
@@ -342,6 +339,13 @@ public class JavaStackFrame extends XStackFrame {
}
}
private JavaValue createArgumentValue(int index, Value value, String name, EvaluationContextImpl evaluationContext) {
ArgumentValueDescriptorImpl descriptor = myNodeManager.getArgumentValueDescriptor(null, index, value, name);
// setContext is required to calculate correct name
descriptor.setContext(evaluationContext);
return JavaValue.create(descriptor, evaluationContext, myNodeManager);
}
protected void superBuildVariables(final EvaluationContextImpl evaluationContext, XValueChildrenList children) throws EvaluateException {
final StackFrameProxyImpl frame = getStackFrameProxy();
for (final LocalVariableProxyImpl local : frame.visibleVariables()) {
@@ -142,14 +142,15 @@ public class RunContentDescriptor implements Disposable {
return myContent;
}
public void setRestarter(Runnable runnable) {
myRestarter = runnable;
}
@Nullable
public Runnable getRestarter() {
return myRestarter;
}
public void setRestarter(@Nullable Runnable runnable) {
myRestarter = runnable;
}
public boolean isActivateToolWindowWhenAdded() {
return myActivateToolWindowWhenAdded;
}
@@ -56,7 +56,6 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
public CodeStyleSettings(boolean loadExtensions) {
super(null);
RIGHT_MARGIN = DEFAULT_RIGHT_MARGIN;
initTypeToName();
initImportsByDefault();
@@ -248,6 +247,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
public int INNER_CLASSES_ORDER_WEIGHT = 7;
//----------------- WRAPPING ---------------------------
public int RIGHT_MARGIN = 120;
public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = false;
@@ -287,7 +287,6 @@ public class CommonCodeStyleSettings {
//----------------- GENERAL --------------------
public int RIGHT_MARGIN = -1;
public final static int DEFAULT_RIGHT_MARGIN = 120;
public boolean LINE_COMMENT_AT_FIRST_COLUMN = true;
public boolean BLOCK_COMMENT_AT_FIRST_COLUMN = true;
@@ -18,6 +18,7 @@ package com.intellij.application.options.codeStyle;
import com.intellij.lang.Language;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.psi.codeStyle.CustomCodeStyleSettings;
import com.intellij.ui.SpeedSearchComparator;
import com.intellij.ui.TreeTableSpeedSearch;
@@ -378,7 +379,7 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle
this.groupName = groupName;
try {
Class styleSettingsClass = clazz == null ? CodeStyleSettings.class : clazz;
Class styleSettingsClass = clazz == null ? CommonCodeStyleSettings.class : clazz;
this.field = styleSettingsClass.getField(fieldName);
}
catch (NoSuchFieldException e) {
@@ -74,7 +74,7 @@ public class ProgramRunnerUtil {
}
public static void executeConfiguration(Project project,
DataContext context,
@Nullable DataContext context,
@Nullable RunnerAndConfigurationSettings configuration,
Executor executor,
ExecutionTarget target,
@@ -61,6 +61,15 @@ public class RestartAction extends FakeRerunAction implements DumbAware, AnActio
myDescriptor = descriptor;
myExecutor = executor;
// see IDEADEV-698
if (descriptor.getRestarter() == null) {
descriptor.setRestarter(new Runnable() {
@Override
public void run() {
restart();
}
});
}
}
@Override
@@ -206,12 +206,6 @@ public class RunContentBuilder extends LogConsoleManagerBase {
final RestartAction restartAction = new RestartAction(myExecutor, myRunner, contentDescriptor, getEnvironment());
restartAction.registerShortcut(component);
actionGroup.add(restartAction);
contentDescriptor.setRestarter(new Runnable() {
@Override
public void run() {
restartAction.restart();
}
});
if (myExecutionResult instanceof DefaultExecutionResult) {
final AnAction[] actions = ((DefaultExecutionResult)myExecutionResult).getRestartActions();
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
* @see DiffRequestFactory#createMergeRequest
*/
public abstract class MergeRequest extends DiffRequest {
protected MergeRequest(Project project) {
protected MergeRequest(@Nullable Project project) {
super(project);
}
@@ -30,7 +30,7 @@ public abstract class FileEditorManager {
public static final Key<Boolean> USE_CURRENT_WINDOW = Key.create("OpenFile.searchForOpen");
public static FileEditorManager getInstance(Project project) {
public static FileEditorManager getInstance(@NotNull Project project) {
return project.getComponent(FileEditorManager.class);
}
@@ -23,6 +23,8 @@ import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.DialogWrapperDialog;
import com.intellij.openapi.util.Disposer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
@@ -56,25 +58,26 @@ public class DiffPanelOptions {
myShowSourcePolicy = showSourcePolicy;
}
public void showSource(OpenFileDescriptor descriptor) {
public void showSource(@Nullable OpenFileDescriptor descriptor) {
if (descriptor == null || myDiffPanel.getProject() == null) return;
myShowSourcePolicy.showSource(descriptor, myDiffPanel);
}
public interface ShowSourcePolicy {
void showSource(OpenFileDescriptor descriptor, DiffPanelImpl diffPanel);
void showSource(@NotNull OpenFileDescriptor descriptor, @NotNull DiffPanelImpl diffPanel);
ShowSourcePolicy DONT_SHOW = new ShowSourcePolicy() {
public void showSource(OpenFileDescriptor descriptor, DiffPanelImpl diffPanel) {}
public void showSource(@NotNull OpenFileDescriptor descriptor, @NotNull DiffPanelImpl diffPanel) {}
};
ShowSourcePolicy OPEN_EDITOR = new ShowSourcePolicy() {
public void showSource(OpenFileDescriptor descriptor, DiffPanelImpl diffPanel) {
public void showSource(@NotNull OpenFileDescriptor descriptor, @NotNull DiffPanelImpl diffPanel) {
FileEditorManager.getInstance(diffPanel.getProject()).openTextEditor(descriptor, true);
}
};
ShowSourcePolicy OPEN_EDITOR_AND_CLOSE_DIFF = new ShowSourcePolicy() {
public void showSource(OpenFileDescriptor descriptor, DiffPanelImpl diffPanel) {
public void showSource(@NotNull OpenFileDescriptor descriptor, @NotNull DiffPanelImpl diffPanel) {
OPEN_EDITOR.showSource(descriptor, diffPanel);
if (diffPanel.getOwnerWindow() == null) return;
Disposer.dispose(diffPanel);
@@ -97,7 +100,7 @@ public class DiffPanelOptions {
};
ShowSourcePolicy DEFAULT = new ShowSourcePolicy() {
public void showSource(OpenFileDescriptor descriptor, DiffPanelImpl diffPanel) {
public void showSource(@NotNull OpenFileDescriptor descriptor, @NotNull DiffPanelImpl diffPanel) {
Window window = diffPanel.getOwnerWindow();
if (window == null) return;
else if (window instanceof Frame) OPEN_EDITOR.showSource(descriptor, diffPanel);
@@ -612,7 +612,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
return myData.getProject();
}
public void showSource(OpenFileDescriptor descriptor) {
public void showSource(@Nullable OpenFileDescriptor descriptor) {
myOptions.showSource(descriptor);
}
@@ -1009,10 +1009,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
@Override
public void navigate(boolean requestFocus) {
final OpenFileDescriptor descriptor = mySide.getCurrentOpenFileDescriptor();
if (descriptor != null) {
showSource(descriptor);
}
showSource(mySide.getCurrentOpenFileDescriptor());
}
}
}
@@ -28,11 +28,11 @@ import org.jetbrains.annotations.Nullable;
public class DiffRequestFactoryImpl extends DiffRequestFactory {
public MergeRequest createMergeRequest(String leftText,
String rightText,
String originalContent,
public MergeRequest createMergeRequest(@NotNull String leftText,
@NotNull String rightText,
@NotNull String originalContent,
@NotNull VirtualFile file,
Project project,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
final Document document = FileDocumentManager.getInstance().getDocument(file);
@@ -46,23 +46,20 @@ public class DiffRequestFactoryImpl extends DiffRequestFactory {
}
}
public MergeRequest create3WayDiffRequest(final String leftText,
final String rightText,
final String originalContent,
public MergeRequest create3WayDiffRequest(@NotNull String leftText,
@NotNull String rightText,
@NotNull String originalContent,
@Nullable FileType type,
final Project project,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
if (type != null) {
return new MergeRequestImpl(leftText, originalContent, rightText, type, project, okButtonPresentation, cancelButtonPresentation);
}
return new MergeRequestImpl(leftText, originalContent, rightText, project, okButtonPresentation, cancelButtonPresentation);
return new MergeRequestImpl(leftText, originalContent, rightText, type, project, okButtonPresentation, cancelButtonPresentation);
}
public MergeRequest create3WayDiffRequest(final String leftText,
final String rightText,
final String originalContent,
final Project project,
public MergeRequest create3WayDiffRequest(@NotNull String leftText,
@NotNull String rightText,
@NotNull String originalContent,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
return create3WayDiffRequest(leftText, rightText, originalContent, null, project, okButtonPresentation, cancelButtonPresentation);
@@ -47,40 +47,39 @@ public class MergeRequestImpl extends MergeRequest {
@Nullable private final ActionButtonPresentation myOkButtonPresentation;
@Nullable private final ActionButtonPresentation myCancelButtonPresentation;
public MergeRequestImpl(String left,
MergeVersion base,
String right,
Project project,
public MergeRequestImpl(@NotNull String left,
@NotNull MergeVersion base,
@NotNull String right,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
this(new SimpleContent(left), new MergeContent(base, project), new SimpleContent(right), project, okButtonPresentation,
cancelButtonPresentation);
}
public MergeRequestImpl(DiffContent left,
MergeVersion base,
DiffContent right,
Project project,
public MergeRequestImpl(@NotNull DiffContent left,
@NotNull MergeVersion base,
@NotNull DiffContent right,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
this(left, new MergeContent(base, project), right, project, okButtonPresentation, cancelButtonPresentation);
}
public MergeRequestImpl(String left,
String base,
String right,
Project project,
public MergeRequestImpl(@NotNull String left,
@NotNull String base,
@NotNull String right,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
this(new SimpleContent(left), new SimpleContent(base), new SimpleContent(right), project, okButtonPresentation,
cancelButtonPresentation);
this(left, base, right, null, project, okButtonPresentation, cancelButtonPresentation);
}
public MergeRequestImpl(String left,
String base,
String right,
FileType type,
Project project,
public MergeRequestImpl(@NotNull String left,
@NotNull String base,
@NotNull String right,
@Nullable FileType type,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
this(new SimpleContent(left, type),
@@ -89,10 +88,10 @@ public class MergeRequestImpl extends MergeRequest {
project, okButtonPresentation, cancelButtonPresentation);
}
private MergeRequestImpl(DiffContent left,
DiffContent base,
DiffContent right,
Project project,
private MergeRequestImpl(@NotNull DiffContent left,
@NotNull DiffContent base,
@NotNull DiffContent right,
@Nullable Project project,
@Nullable final ActionButtonPresentation okButtonPresentation,
@Nullable final ActionButtonPresentation cancelButtonPresentation) {
super(project);
@@ -240,11 +239,11 @@ public class MergeRequestImpl extends MergeRequest {
}
public static class MergeContent extends DiffContent {
private final MergeVersion myTarget;
@NotNull private final MergeVersion myTarget;
private final Document myWorkingDocument;
private final Project myProject;
public MergeContent(MergeVersion target, Project project) {
public MergeContent(@NotNull MergeVersion target, Project project) {
myTarget = target;
myProject = project;
myWorkingDocument = myTarget.createWorkingDocument(project);
@@ -393,7 +393,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
group.add(commonActionsManager.createExpandAllAction(treeExpander, myActionsTree.getTree()));
group.add(commonActionsManager.createCollapseAllAction(treeExpander, myActionsTree.getTree()));
group.add(new AnAction("Edit Shortcut", "Edit Shortcut", AllIcons.Actions.Properties) {
group.add(new AnAction("Edit Shortcut", "Edit Shortcut", AllIcons.ToolbarDecorator.Edit) {
{
registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)), myActionsTree.getTree());
}
@@ -923,6 +923,10 @@ public class StringUtil extends StringUtilRt {
}
}
public static String defaultIfEmpty(@Nullable String value, String defaultValue) {
return isEmpty(value) ? defaultValue : value;
}
@Contract("null -> false")
public static boolean isNotEmpty(@Nullable String s) {
return s != null && !s.isEmpty();
@@ -41,6 +41,7 @@ import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.containers.FList;
import com.intellij.util.lang.UrlClassLoader;
import com.intellij.util.xmlb.Accessor;
import com.intellij.util.xmlb.XmlSerializationException;
import com.intellij.util.xmlb.XmlSerializer;
import com.intellij.util.xmlb.XmlSerializerUtil;
import org.jdom.Element;
@@ -121,7 +122,16 @@ public class ShowSerializedXmlAction extends DumbAwareAction {
return;
}
final Element element = XmlSerializer.serialize(o);
final Element element;
try {
element = XmlSerializer.serialize(o);
}
catch (XmlSerializationException e) {
LOG.info(e);
Throwable cause = e.getCause();
Messages.showErrorDialog(project, e.getMessage() + (cause != null ? ": " + cause.getMessage() : ""), CommonBundle.getErrorTitle());
return;
}
final String text = JDOMUtil.writeElement(element, "\n");
Messages.showIdeaMessageDialog(project, text, "Serialized XML for '" + className + "'",
new String[]{CommonBundle.getOkButtonText()}, 0, Messages.getInformationIcon(), null);
@@ -21,6 +21,7 @@ import com.intellij.appengine.util.AppEngineUtil;
import com.intellij.facet.ProjectFacetManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.packaging.artifacts.Artifact;
@@ -67,8 +68,12 @@ public class UploadApplicationAction extends AnAction {
}
@Override
public void errorOccurred(@NotNull String errorMessage) {
Messages.showErrorDialog(project, errorMessage, CommonBundle.getErrorTitle());
public void errorOccurred(@NotNull final String errorMessage) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
Messages.showErrorDialog(project, errorMessage, CommonBundle.getErrorTitle());
}
});
}
}, null);
if (uploader != null) {
@@ -16,6 +16,7 @@
package com.intellij.uiDesigner;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.ClassUtil;
@@ -74,7 +75,8 @@ public final class PsiPropertiesProvider implements PropertiesProvider {
}
final PsiType type = getter.getReturnType();
final String propertyClassName = type.getCanonicalText();
String propertyClassName =
StringUtil.defaultIfEmpty(StringUtil.substringBefore(type.getCanonicalText(), "<"), type.getCanonicalText());
LwIntrospectedProperty property = CompiledClassPropertiesProvider.propertyFromClassName(propertyClassName, name);
if (property == null) {
+4 -4
View File
@@ -21,14 +21,14 @@ setProperty("home", guessHome(this as Script))
includeTargets << new File("${guessHome(this as Script)}/build/scripts/utils.gant")
// signMacZip locates in ultimate_utils.gant
includeTargets << new File("${guessHome(this)}/build/scripts/ultimate_utils.gant")
includeTargets << new File("${guessHome(this)}/ultimate/build/scripts/ultimate_utils.gant")
includeTargets << new File("${guessHome(this)}/build/scripts/libLicenses.gant")
requireProperty("buildNumber", requireProperty("build.number", snapshot))
setProperty("ch", home)
setProperty("pythonCommunityHome", "$home/python")
setProperty("pythonEduHome", "$home/python/edu")
setProperty("ch", "$home")
setProperty("pythonCommunityHome", "$ch/python")
setProperty("pythonEduHome", "$ch/python/edu")
// load ApplicationInfo.xml properties
ant.xmlproperty(file: "$pythonEduHome/resources/idea/PyCharmEduApplicationInfo.xml", collapseAttributes: "true")