Javafx: Edit output level of the packager in artifact properties (IDEA-183393)

This commit is contained in:
Pavel Dolgov
2017-12-18 17:46:22 +03:00
parent ef92b183ce
commit 5fd40e63e8
2 changed files with 23 additions and 1 deletions

View File

@@ -8,7 +8,7 @@
<properties/>
<border type="none"/>
<children>
<grid id="ca833" layout-manager="GridLayoutManager" row-count="17" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="ca833" layout-manager="GridLayoutManager" row-count="18" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -328,6 +328,20 @@
<text value=""/>
</properties>
</component>
<component id="b08ee" class="javax.swing.JLabel">
<constraints>
<grid row="17" 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>
<properties>
<text value="Build output level:"/>
</properties>
</component>
<component id="2acc4" class="javax.swing.JComboBox" binding="myMsgOutputLevel">
<constraints>
<grid row="17" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children>
</grid>
<vspacer id="1a12e">

View File

@@ -28,6 +28,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.ui.ArtifactPropertiesEditor;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.ColumnInfo;
import com.intellij.util.ui.ListTableModel;
import org.jetbrains.annotations.Nullable;
@@ -67,6 +68,7 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor {
private JavaFxEditCertificatesDialog myDialog;
private List<JavaFxManifestAttribute> myCustomManifestAttributes;
private JavaFxApplicationIcons myIcons;
private JComboBox<String> myMsgOutputLevel;
public JavaFxArtifactPropertiesEditor(JavaFxArtifactProperties properties, final Project project, Artifact artifact) {
super();
@@ -110,6 +112,9 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor {
bundleNames.add(bundle.name());
}
myNativeBundleCB.setModel(new DefaultComboBoxModel<>(ArrayUtil.toStringArray(bundleNames)));
final List<String> outputLevels = ContainerUtil.map2List(JavaFxPackagerConstants.MsgOutputLevel.values(), Enum::name);
myMsgOutputLevel.setModel(new DefaultComboBoxModel<>(outputLevels.toArray(ArrayUtil.EMPTY_STRING_ARRAY)));
}
@Override
@@ -153,6 +158,7 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor {
if (!Comparing.equal(myCustomManifestAttributes, myProperties.getCustomManifestAttributes())) return true;
if (!Comparing.equal(myIcons, myProperties.getIcons())) return true;
if (!Comparing.equal(myMsgOutputLevel.getSelectedItem(), myProperties.getMsgOutputLevel())) return true;
return false;
}
@@ -198,6 +204,7 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor {
myProperties.setCustomManifestAttributes(myCustomManifestAttributes);
myProperties.setIcons(myIcons);
myProperties.setMsgOutputLevel((String)myMsgOutputLevel.getSelectedItem());
}
@Nullable
@@ -226,6 +233,7 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor {
myEditSignCertificateButton.setEnabled(myProperties.isEnabledSigning());
myCustomManifestAttributes = myProperties.getCustomManifestAttributes();
myIcons = myProperties.getIcons();
myMsgOutputLevel.setSelectedItem(myProperties.getMsgOutputLevel());
}
private static void setText(TextFieldWithBrowseButton tf, final String title) {