Run configurations layout fixes

This commit is contained in:
Evgeny Zakrevsky
2011-11-03 03:59:03 +03:00
parent a8c8df6d64
commit f1ba7574e3
8 changed files with 42 additions and 18 deletions
@@ -158,7 +158,7 @@ public class AppletConfigurable extends SettingsEditor<AppletConfiguration> impl
}
});
setAnchor(myModule.getLabel());
setAnchor(myVMParameters.getLabel());
}
private void removeParameter() {
@@ -31,13 +31,15 @@ import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiMethodUtil;
import com.intellij.ui.EditorTextFieldWithBrowseButton;
import com.intellij.ui.PanelWithAnchor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class ApplicationConfigurable extends SettingsEditor<ApplicationConfiguration> {
public class ApplicationConfigurable extends SettingsEditor<ApplicationConfiguration> implements PanelWithAnchor {
private CommonJavaParametersPanel myCommonProgramParameters;
private LabeledComponent<EditorTextFieldWithBrowseButton> myMainClass;
private LabeledComponent<JComboBox> myModule;
@@ -48,6 +50,7 @@ public class ApplicationConfigurable extends SettingsEditor<ApplicationConfigura
private JCheckBox myShowSwingInspectorCheckbox;
private final JreVersionDetector myVersionDetector;
private final Project myProject;
private JComponent myAnchor;
public ApplicationConfigurable(final Project project) {
myProject = project;
@@ -61,16 +64,7 @@ public class ApplicationConfigurable extends SettingsEditor<ApplicationConfigura
ClassBrowser.createApplicationClassBrowser(project, myModuleSelector).setField(getMainClassField());
myVersionDetector = new JreVersionDetector();
settingAnchors();
}
private void settingAnchors() {
JComponent anchor = myCommonProgramParameters.getAnchor();
myMainClass.setAnchor(anchor);
myCommonProgramParameters.setAnchor(anchor);
anchor = myModule.getLabel();
myAlternativeJREPanel.setAnchor(anchor);
setAnchor(myModule.getAnchor());
}
public void applyEditorTo(final ApplicationConfiguration configuration) throws ConfigurationException {
@@ -137,4 +131,18 @@ public class ApplicationConfigurable extends SettingsEditor<ApplicationConfigura
}
}));
}
@Override
public JComponent getAnchor() {
return myAnchor;
}
@Override
public void setAnchor(@Nullable JComponent anchor) {
this.myAnchor = anchor;
myMainClass.setAnchor(anchor);
myCommonProgramParameters.setAnchor(anchor);
myAlternativeJREPanel.setAnchor(anchor);
myModule.setAnchor(anchor);
}
}
@@ -364,7 +364,6 @@ class RunConfigurable extends BaseConfigurable {
panel.add(new JLabel("Press the"));
final JEditorPane browser = new JEditorPane();
browser.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
browser.setEditable(false);
browser.setEditorKit(new HTMLEditorKit());
browser.setBackground(myRightPanel.getBackground());
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.execution.impl.SingleConfigurationConfigurable.MyValidatableComponent">
<grid id="cae26" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="cae26" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="13" y="24" width="615" height="174"/>
@@ -11,7 +11,7 @@
<grid id="cd390" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="5" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -46,7 +46,7 @@
<xy id="49cf" binding="myComponentPlace" layout-manager="XYLayout" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -79,6 +79,12 @@
</component>
</children>
</grid>
<component id="c89fa" class="javax.swing.JSeparator">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children>
</grid>
</form>
@@ -239,6 +239,11 @@ public final class SingleConfigurationConfigurable<Config extends RunConfigurati
updateWarning();
}
});
settingAnchor();
}
private void settingAnchor() {
}
public final JComponent getWholePanel() {
@@ -32,6 +32,7 @@ public class LabeledComponent<Comp extends JComponent> extends JPanel implements
private final JBLabel myLabel = new JBLabel();
private Comp myComponent;
private String myLabelConstraints = BorderLayout.NORTH;
private JComponent myAnchor;
public LabeledComponent() {
super(new BorderLayout(UIUtil.DEFAULT_HGAP, 2));
@@ -49,6 +50,7 @@ public class LabeledComponent<Comp extends JComponent> extends JPanel implements
private void insertLabel() {
remove(myLabel);
add(myLabel, myLabelConstraints);
setAnchor(myLabel);
}
public void setText(String textWithMnemonic) {
@@ -142,11 +144,12 @@ public class LabeledComponent<Comp extends JComponent> extends JPanel implements
@Override
public JComponent getAnchor() {
return myLabel.getAnchor();
return myAnchor;
}
@Override
public void setAnchor(@Nullable JComponent labelAnchor) {
myAnchor = labelAnchor;
myLabel.setAnchor(labelAnchor);
}
@@ -125,7 +125,7 @@ public class UIUtil {
public static final Color AQUA_SEPARATOR_BACKGROUND_COLOR = new Color(240, 240, 240);
public static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
public static final int DEFAULT_HGAP = 8;
public static final int DEFAULT_HGAP = 10;
public static final int DEFAULT_VGAP = 4;
public static final int LARGE_HGAP = 30;
public static final int LARGE_VGAP = 20;
@@ -71,6 +71,9 @@
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
</clientProperties>
<border type="etched" title-resource-bundle="messages/AndroidBundle" title-key="deployment.target.settings.title"/>
<children>
<component id="69acb" class="javax.swing.JRadioButton" binding="myEmulatorRadioButton">