Javafx: Support application icon in JavaFX self-contained app deployment - show system-dependent paths in dialog, mnemonics in dialog (IDEA-134616)

This commit is contained in:
Pavel Dolgov
2016-04-14 13:34:05 +03:00
parent 5908088ac1
commit 42b9d0025a
2 changed files with 13 additions and 6 deletions
@@ -13,7 +13,8 @@
<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"/>
</constraints>
<properties>
<text value="Linux Icon"/>
<labelFor value="153bd"/>
<text value="&amp;Linux Icon"/>
</properties>
</component>
<vspacer id="3b423">
@@ -32,7 +33,8 @@
<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"/>
</constraints>
<properties>
<text value="Mac Icon"/>
<labelFor value="4c06e"/>
<text value="&amp;Mac Icon"/>
</properties>
</component>
<component id="4c06e" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myMacIconPath">
@@ -46,7 +48,8 @@
<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"/>
</constraints>
<properties>
<text value="Windows Icon"/>
<labelFor value="8c868"/>
<text value="&amp;Windows Icon"/>
</properties>
</component>
<component id="8c868" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myWindowsIconPath">
@@ -28,9 +28,9 @@ public class JavaFxApplicationIconsDialog extends DialogWrapper {
init();
if (icons != null) {
myPanel.myLinuxIconPath.setText(icons.getLinuxIcon());
myPanel.myMacIconPath.setText(icons.getMacIcon());
myPanel.myWindowsIconPath.setText(icons.getWindowsIcon());
setSystemDependentPath(myPanel.myLinuxIconPath, icons.getLinuxIcon());
setSystemDependentPath(myPanel.myMacIconPath, icons.getMacIcon());
setSystemDependentPath(myPanel.myWindowsIconPath, icons.getWindowsIcon());
}
addBrowseListener(myPanel.myLinuxIconPath, "png", project);
@@ -71,6 +71,10 @@ public class JavaFxApplicationIconsDialog extends DialogWrapper {
return FileUtil.toSystemIndependentName(text.trim());
}
private static void setSystemDependentPath(TextFieldWithBrowseButton withBrowseButton, String path) {
withBrowseButton.setText(!StringUtil.isEmptyOrSpaces(path) ? FileUtil.toSystemDependentName(path) : "");
}
private boolean isValidPath(TextFieldWithBrowseButton withBrowseButton, ProjectFileIndex index, String osName) {
final String text = withBrowseButton.getText();
if (StringUtil.isEmptyOrSpaces(text)) return true;