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:
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* @see <a href="http://confluence.jetbrains.com/display/IDEADEV/Indexing+and+PSI+Stubs+in+IntelliJ+IDEA">Indexing and PSI Stubs in IntelliJ IDEA</a>
|
||||
*
|
||||
* @see <a href="http://devnet.jetbrains.com/message/5485343#_ga=1.104383616.1427417469.1367843132">Lifecycle of stub creation</a>
|
||||
*/
|
||||
package com.intellij.psi.stubs;
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.ide.customize;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.startup.StartupActionScriptManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
@@ -27,7 +26,6 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -160,11 +158,6 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionLis
|
||||
for (AbstractCustomizeWizardStep step : mySteps) {
|
||||
if (!step.beforeOkAction()) return;
|
||||
}
|
||||
try {
|
||||
PluginManager.saveDisabledPlugins(PluginGroups.getInstance().getDisabledPluginIds(), false);
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
}
|
||||
super.doOKAction();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ide.customize;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.VerticalFlowLayout;
|
||||
@@ -33,6 +34,7 @@ import javax.swing.border.CompoundBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -224,6 +226,16 @@ public class CustomizePluginsStepPanel extends AbstractCustomizeWizardStep imple
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean beforeOkAction() {
|
||||
try {
|
||||
PluginManager.saveDisabledPlugins(PluginGroups.getInstance().getDisabledPluginIds(), false);
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private class IdSetPanel extends JPanel implements LinkListener<String> {
|
||||
private JLabel myTitleLabel = new JLabel();
|
||||
private JPanel myContentPanel = new JPanel(new GridLayout(0, 3, 5, 5));
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.intellij.ui.ScreenUtil;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.mac.MacPopupMenuUI;
|
||||
import com.intellij.util.IJSwingUtilities;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.PlatformUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -416,7 +417,7 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo
|
||||
return;
|
||||
}
|
||||
}
|
||||
myCurrentLaf = lookAndFeelInfo;
|
||||
myCurrentLaf = ObjectUtils.chooseNotNull(findLaf(lookAndFeelInfo.getClassName()), lookAndFeelInfo);
|
||||
|
||||
checkLookAndFeel(lookAndFeelInfo, false);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
</group>
|
||||
|
||||
<!-- Refactor -->
|
||||
<group id="RefactoringMenu" popup="true">
|
||||
<group id="RefactoringMenu" class="com.intellij.ide.actions.NonTrivialActionGroup" popup="true">
|
||||
<action id="Refactorings.QuickListPopupAction"
|
||||
class = "com.intellij.refactoring.actions.RefactoringQuickListPopupAction"
|
||||
text = "Refactor This..." description="Context aware popup with list of refactoring actions"/>
|
||||
|
||||
+7
-7
@@ -23,20 +23,20 @@
|
||||
<children>
|
||||
<grid id="5482b" binding="myConditionExpressionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="1" use-parent-layout="false"/>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="1" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
<component id="fbbb7" class="com.intellij.ui.components.JBCheckBox" binding="myConditionEnabledCheckbox">
|
||||
<grid id="5547c" binding="myConditionEnabledPanel" layout-manager="CardLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="1" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/XDebuggerBundle" key="xbreakpoints.condition.checkbox"/>
|
||||
</properties>
|
||||
</component>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<nested-form id="11152" form-file="com/intellij/xdebugger/impl/breakpoints/ui/XSuspendPolicyPanel.form" binding="mySuspendPolicyPanel">
|
||||
|
||||
+28
-6
@@ -18,7 +18,10 @@ package com.intellij.xdebugger.impl.breakpoints.ui;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.ui.popup.util.DetailView;
|
||||
import com.intellij.xdebugger.XDebuggerBundle;
|
||||
import com.intellij.xdebugger.XExpression;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpointManager;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpointType;
|
||||
import com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel;
|
||||
@@ -29,6 +32,8 @@ import com.intellij.xdebugger.impl.ui.DebuggerUIUtil;
|
||||
import com.intellij.xdebugger.impl.ui.XDebuggerExpressionComboBox;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.plaf.basic.BasicRadioButtonUI;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -83,6 +88,7 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
private JPanel myCustomRightPropertiesPanelWrapper;
|
||||
private JBCheckBox myConditionEnabledCheckbox;
|
||||
private JPanel myCustomTopPropertiesPanelWrapper;
|
||||
private JPanel myConditionEnabledPanel;
|
||||
private final List<XBreakpointCustomPropertiesPanel<B>> myCustomPanels;
|
||||
|
||||
private List<XBreakpointPropertiesSubPanel<B>> mySubPanels = new ArrayList<XBreakpointPropertiesSubPanel<B>>();
|
||||
@@ -91,12 +97,17 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
|
||||
private B myBreakpoint;
|
||||
|
||||
private final boolean myShowAllOptions;
|
||||
private static final String CONDITION_ENABLED_LABEL = "label";
|
||||
private static final String CONDITION_ENABLED_CHECKBOX = "checkbox";
|
||||
|
||||
public void setDetailView(DetailView detailView) {
|
||||
myMasterBreakpointPanel.setDetailView(detailView);
|
||||
}
|
||||
|
||||
public XLightBreakpointPropertiesPanel(Project project, XBreakpointManager breakpointManager, B breakpoint, boolean showAllOptions) {
|
||||
myBreakpoint = breakpoint;
|
||||
myShowAllOptions = showAllOptions;
|
||||
XBreakpointType<B, ?> breakpointType = XBreakpointUtil.getType(breakpoint);
|
||||
|
||||
mySuspendPolicyPanel.init(project, breakpointManager, breakpoint);
|
||||
@@ -112,6 +123,13 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
|
||||
myCustomPanels = new ArrayList<XBreakpointCustomPropertiesPanel<B>>();
|
||||
if (debuggerEditorsProvider != null) {
|
||||
myConditionEnabledCheckbox = new JBCheckBox(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
|
||||
JBLabel conditionEnabledLabel = new JBLabel(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
|
||||
conditionEnabledLabel.setBorder(new EmptyBorder(0, ((BasicRadioButtonUI)myConditionEnabledCheckbox.getUI()).getDefaultIcon().getIconWidth() +
|
||||
myConditionEnabledCheckbox.getIconTextGap() +
|
||||
myConditionEnabledCheckbox.getBorder().getBorderInsets(myConditionEnabledCheckbox).left, 0, 0));
|
||||
myConditionEnabledPanel.add(myConditionEnabledCheckbox, CONDITION_ENABLED_CHECKBOX);
|
||||
myConditionEnabledPanel.add(conditionEnabledLabel, CONDITION_ENABLED_LABEL);
|
||||
myConditionComboBox = new XDebuggerExpressionComboBox(project, debuggerEditorsProvider, CONDITION_HISTORY_ID, myBreakpoint.getSourcePosition());
|
||||
JComponent conditionComponent = myConditionComboBox.getComponent();
|
||||
myConditionExpressionPanel.add(conditionComponent, BorderLayout.CENTER);
|
||||
@@ -161,7 +179,7 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
@Override
|
||||
public void focusGained(FocusEvent event) {
|
||||
if (myConditionComboBox != null) {
|
||||
IdeFocusManager.findInstance().requestFocus(myConditionComboBox.getComponent(), false);
|
||||
IdeFocusManager.findInstance().requestFocus(myConditionComboBox.getEditorComponent(), false);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -187,7 +205,8 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
|
||||
if (myConditionComboBox != null) {
|
||||
myBreakpoint.setConditionEnabled(myConditionEnabledCheckbox.isSelected());
|
||||
myBreakpoint.setConditionExpression(myConditionComboBox.getExpression());
|
||||
XExpression expression = myConditionComboBox.getExpression();
|
||||
myBreakpoint.setConditionExpression(expression != null && !expression.getExpression().isEmpty() ? expression : null);
|
||||
myConditionComboBox.saveTextInHistory();
|
||||
}
|
||||
|
||||
@@ -203,8 +222,13 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
}
|
||||
|
||||
if (myConditionComboBox != null) {
|
||||
myConditionEnabledCheckbox.setSelected(myBreakpoint.isConditionEnabled());
|
||||
myConditionComboBox.setExpression(myBreakpoint.getConditionExpressionInt());
|
||||
XExpression condition = myBreakpoint.getConditionExpressionInt();
|
||||
myConditionComboBox.setExpression(condition);
|
||||
boolean hideCheckbox = !myShowAllOptions && condition == null;
|
||||
myConditionEnabledCheckbox.setSelected(hideCheckbox || (myBreakpoint.isConditionEnabled() && condition != null));
|
||||
((CardLayout)myConditionEnabledPanel.getLayout()).show(myConditionEnabledPanel, hideCheckbox ? CONDITION_ENABLED_LABEL : CONDITION_ENABLED_CHECKBOX);
|
||||
|
||||
onCheckboxChanged();
|
||||
}
|
||||
|
||||
for (XBreakpointCustomPropertiesPanel<B> customPanel : myCustomPanels) {
|
||||
@@ -212,8 +236,6 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
}
|
||||
myEnabledCheckbox.setSelected(myBreakpoint.isEnabled());
|
||||
myEnabledCheckbox.setText(XBreakpointUtil.getShortText(myBreakpoint) + " enabled");
|
||||
|
||||
onCheckboxChanged();
|
||||
}
|
||||
|
||||
public JPanel getMainPanel() {
|
||||
|
||||
@@ -9,7 +9,13 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public interface FunctionParameter {
|
||||
/**
|
||||
* @return parameter position
|
||||
* Position value if argument is keyword-only
|
||||
*/
|
||||
int POSITION_NOT_SUPPORTED = -1;
|
||||
|
||||
/**
|
||||
* @return parameter position. Be sure to check position is supported (!= {@link #POSITION_NOT_SUPPORTED} )
|
||||
* @see #POSITION_NOT_SUPPORTED
|
||||
*/
|
||||
int getPosition();
|
||||
|
||||
|
||||
@@ -107,7 +107,14 @@ public class PsiQuery {
|
||||
*/
|
||||
@NotNull
|
||||
public PsiQuery parents(@NotNull final Class<? extends PsiElement> clazz) {
|
||||
throw new RuntimeException("Not impl");
|
||||
final List<PsiElement> result = new ArrayList<PsiElement>();
|
||||
for (final PsiElement element : myPsiElements) {
|
||||
final PsiElement parent = PsiTreeUtil.getParentOfType(element, clazz);
|
||||
if (parent != null) {
|
||||
result.add(parent);
|
||||
}
|
||||
}
|
||||
return new PsiQuery(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.jetbrains.NotNullPredicate;
|
||||
import com.jetbrains.python.FunctionParameter;
|
||||
import com.jetbrains.python.PyElementTypes;
|
||||
import com.jetbrains.python.PyTokenTypes;
|
||||
import com.jetbrains.python.PythonDialectsTokenSetProvider;
|
||||
import com.jetbrains.python.FunctionParameter;
|
||||
import com.jetbrains.python.psi.*;
|
||||
import com.jetbrains.python.psi.resolve.PyResolveContext;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -344,11 +344,13 @@ public class PyArgumentListImpl extends PyElementImpl implements PyArgumentList
|
||||
}
|
||||
|
||||
final PyExpression[] arguments = getArguments();
|
||||
if (arguments.length > parameter.getPosition()) {
|
||||
final PyExpression result = arguments[parameter.getPosition()];
|
||||
final int position = parameter.getPosition();
|
||||
if ((position != FunctionParameter.POSITION_NOT_SUPPORTED) && (arguments.length > position)) {
|
||||
final PyExpression result = arguments[position];
|
||||
if (result instanceof PyKeywordArgument) {
|
||||
((PyKeywordArgument)result).getValueExpression();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user