showing settings in AddModule mode

This commit is contained in:
Dmitry Avdeev
2012-10-30 19:46:56 +04:00
parent f6f160a1d3
commit 7905deeba8
5 changed files with 13 additions and 20 deletions
@@ -104,8 +104,7 @@
</grid>
</children>
</grid>
<grid id="fb50c" binding="myModulePanel" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<grid id="fb50c" binding="myModulePanel" layout-manager="GridBagLayout">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
@@ -115,6 +114,7 @@
<component id="40abf" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<gridbag weightx="0.0" weighty="1.0"/>
</constraints>
<properties>
<labelFor value="e6ad1"/>
@@ -126,12 +126,14 @@
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
<gridbag top="0" left="0" bottom="5" right="0" weightx="1.0" weighty="1.0"/>
</constraints>
<properties/>
</component>
<component id="7afef" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<gridbag weightx="0.0" weighty="1.0"/>
</constraints>
<properties>
<labelFor value="4af6e"/>
@@ -141,12 +143,14 @@
<component id="d2d6b" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myModuleContentRoot">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<gridbag top="0" left="0" bottom="5" right="0" weightx="1.0" weighty="1.0"/>
</constraints>
<properties/>
</component>
<component id="2ac4e" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<gridbag weightx="0.0" weighty="1.0"/>
</constraints>
<properties>
<labelFor value="83a50"/>
@@ -156,6 +160,7 @@
<component id="9e1b8" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myModuleFileLocation">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<gridbag top="0" left="0" bottom="5" right="0" weightx="1.0" weighty="1.0"/>
</constraints>
<properties>
<preferredSize width="280" height="20"/>
@@ -307,6 +307,7 @@ public class SelectTemplateStep extends ModuleWizardStep implements SettingsStep
private void setupPanels(@Nullable ProjectTemplate template) {
restorePanel(myNamePathComponent, 4);
restorePanel(myModulePanel, 6);
restorePanel(myExpertPanel, myWizardContext.isCreatingNewProject() ? 1 : 0);
mySettingsStep = myModuleBuilder == null ? null : myModuleBuilder.modifySettingsStep(this);
@@ -495,10 +496,11 @@ public class SelectTemplateStep extends ModuleWizardStep implements SettingsStep
JLabel jLabel = new JBLabel(label);
jLabel.setLabelFor(field);
myNamePathComponent.add(jLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
myNamePathComponent.add(field, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
JPanel panel = myWizardContext.isCreatingNewProject() ? myNamePathComponent : myModulePanel;
panel.add(jLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0));
panel.add(field, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0));
}
@Override
@@ -97,11 +97,6 @@ class TemplateModuleBuilder extends ModuleBuilder {
return myType;
}
@Override
public boolean isTemplateBased() {
return true;
}
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel)
@@ -93,10 +93,6 @@ public abstract class ModuleBuilder extends ProjectBuilder{
return type == null ? null : type.modifySettingsStep(settingsStep, this);
}
public boolean isTemplateBased() {
return false;
}
public void setName(String name) {
myName = acceptParameter(name);
}
@@ -63,11 +63,6 @@ public abstract class WebProjectTemplate<T> extends WebProjectGenerator<T> imple
return builder.getModuleType();
}
@Override
public boolean isTemplateBased() {
return true;
}
@Override
public List<Module> commit(Project project, ModifiableModuleModel model, ModulesProvider modulesProvider) {
List<Module> modules = builder.commit(project, model, modulesProvider);