Skip to content

Commit

Permalink
Added JrePath editor
Browse files Browse the repository at this point in the history
  • Loading branch information
aparnamichael committed Mar 28, 2024
1 parent 66ce680 commit 697b302
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="io.openliberty.tools.intellij.runConfiguration.LibertyRunSettingsEditor">
<grid id="27dc6" binding="root" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="root" layout-manager="GridLayoutManager" row-count="6" 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="20" y="20" width="500" height="400"/>
Expand Down Expand Up @@ -38,7 +38,7 @@
<toolTipText resource-bundle="messages/LibertyBundles" key="run.config.liberty.project.tool.tip"/>
</properties>
</component>
<component id="7181e" class="com.intellij.ui.StateRestoringCheckBox" binding="runInContainerCheckBox" custom-create="true" >
<component id="7181e" class="com.intellij.ui.StateRestoringCheckBox" binding="runInContainerCheckBox" custom-create="true">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
Expand All @@ -49,6 +49,23 @@
<verticalAlignment value="3"/>
</properties>
</component>
<component id="50e4c" class="com.intellij.execution.ui.JrePathEditor" binding="myJrePathEditor">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="16be5" class="com.intellij.openapi.ui.LabeledComponent" binding="myModule">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<componentClass value="com.intellij.application.options.ModuleDescriptionsComboBox"/>
<enabled value="true"/>
<labelLocation value="West"/>
<text resource-bundle="messages/ExecutionBundle" key="application.configuration.use.classpath.and.jdk.of.module.label"/>
</properties>
</component>
</children>
</grid>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
******************************************************************************/
package io.openliberty.tools.intellij.runConfiguration;

import com.intellij.application.options.ModuleDescriptionsComboBox;
import com.intellij.execution.ui.ConfigurationModuleSelector;
import com.intellij.execution.ui.DefaultJreSelector;
import com.intellij.execution.ui.JrePathEditor;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ui.configuration.JdkComboBox;
import com.intellij.openapi.roots.ui.configuration.ProjectJdkConfigurableUi;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.LabeledComponent;
import com.intellij.ui.EditorTextField;
Expand All @@ -29,9 +35,15 @@ public class LibertyRunSettingsEditor extends SettingsEditor<LibertyRunConfigura
private JPanel root;
private LabeledComponent<EditorTextField> editableParams;
private LabeledComponent<ComboBox> libertyModule;

private StateRestoringCheckBox runInContainerCheckBox;
private JrePathEditor myJrePathEditor;
private final ConfigurationModuleSelector myModuleSelector;
private LabeledComponent<ModuleDescriptionsComboBox> myModule;

public LibertyRunSettingsEditor(Project project) {
myModuleSelector = new ConfigurationModuleSelector(project, getModulesComponent());
myJrePathEditor.setDefaultJreSelector(DefaultJreSelector.fromModuleDependencies(getModulesComponent(), false));
libertyModule.getComponent().setModel(new DefaultComboBoxModel(LibertyModules.getInstance().getLibertyBuildFilesAsString(project).toArray()));
}

Expand Down Expand Up @@ -71,5 +83,16 @@ public void createUIComponents() {
editableParams = new LabeledComponent<>();
editableParams.setComponent(new EditorTextField());
runInContainerCheckBox = new StateRestoringCheckBox();

// final var ui = new ProjectJdkConfigurableUi();
// libertyJdkComponent = new LabeledComponent<>();
// libertyJdkComponent.setComponent(ui.getJdkComboBox());



}

public ModuleDescriptionsComboBox getModulesComponent() {
return myModule.getComponent();
}
}

0 comments on commit 697b302

Please sign in to comment.