mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inplace introduce: type mnemonics, etc
This commit is contained in:
+4
-1
@@ -114,7 +114,10 @@ public class InplaceIntroduceConstantPopup extends AbstractJavaInplaceIntroducer
|
||||
gc.gridy = 2;
|
||||
gc.gridx = 0;
|
||||
gc.gridwidth = 2;
|
||||
myWholePanel.add(typeComponent(), gc);
|
||||
JComponent typeChooser = typeComponent();
|
||||
if (typeChooser != null) {
|
||||
myWholePanel.add(typeChooser, gc);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+4
-1
@@ -111,7 +111,10 @@ public class InplaceIntroduceFieldPopup extends AbstractJavaInplaceIntroducer {
|
||||
|
||||
myWholePanel.add(myIntroduceFieldPanel.createCenterPanel(), gc);
|
||||
gc.gridy++ ;
|
||||
myWholePanel.add(typeComponent(), gc);
|
||||
JComponent typeChooser = typeComponent();
|
||||
if (typeChooser != null) {
|
||||
myWholePanel.add(typeChooser, gc);
|
||||
}
|
||||
myIntroduceFieldPanel.initializeControls(initializerExpression, ourLastInitializerPlace);
|
||||
|
||||
|
||||
|
||||
+9
-1
@@ -15,6 +15,7 @@ import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
import com.intellij.psi.codeStyle.VariableKind;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.introduce.inplace.AbstractInplaceIntroducer;
|
||||
import com.intellij.refactoring.introduceField.InplaceCombosUtil;
|
||||
import com.intellij.refactoring.ui.TypeSelector;
|
||||
import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -92,10 +93,17 @@ public abstract class AbstractJavaInplaceIntroducer extends AbstractInplaceIntro
|
||||
return myTypeSelector.getSelectedType();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected JComponent typeComponent() {
|
||||
JComponent component = myTypeSelector.getComponent();
|
||||
if (component instanceof JLabel) return null;
|
||||
LOG.assertTrue(component instanceof JComboBox);
|
||||
InplaceCombosUtil.appendActions((JComboBox)component, myProject);
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
panel.add(new JLabel("Type: "), BorderLayout.WEST);
|
||||
JLabel label = new JLabel("Type: ");
|
||||
label.setLabelFor(component);
|
||||
label.setDisplayedMnemonic('T');
|
||||
panel.add(label, BorderLayout.WEST);
|
||||
panel.add(component, BorderLayout.CENTER);
|
||||
return panel;
|
||||
}
|
||||
|
||||
+5
-2
@@ -85,8 +85,11 @@ public class InplaceIntroduceParameterPopup extends AbstractJavaInplaceIntroduce
|
||||
}
|
||||
};
|
||||
myPanel.append2MainPanel(myWholePanel);
|
||||
myWholePanel.add(typeComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
|
||||
new Insets(0,0,0,0), 0,0));
|
||||
JComponent typeChooser = typeComponent();
|
||||
if (typeChooser != null) {
|
||||
myWholePanel.add(typeChooser, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
|
||||
new Insets(0,0,0,0), 0,0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user