mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
MRI-2340 Automatically convert all UI Designer forms to sources
GitOrigin-RevId: 55249a442675e053b5093502648453b84391ec54
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1a1cdc46b2
commit
b5eb6d8e20
+193
-12
@@ -11,30 +11,210 @@ import com.intellij.openapi.options.SearchableConfigurable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Insets;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class CompilerCacheConfigurable implements SearchableConfigurable, Configurable.NoScroll {
|
||||
private JPanel myPanel;
|
||||
private final JPanel myPanel;
|
||||
private final Project myProject;
|
||||
private JBLabel myForceUpdateDescription;
|
||||
private JBCheckBox myCbForceUpdateCaches;
|
||||
private JBCheckBox myCbDisableCacheDownload;
|
||||
private JTextField myMaxDownloadDurationField;
|
||||
private JBLabel myMaxDownloadDurationDescription;
|
||||
private JBCheckBox myCbCleanupAsynchronously;
|
||||
private JBLabel myCleanupAsynchronouslyDescription;
|
||||
private final JBLabel myForceUpdateDescription;
|
||||
private final JBCheckBox myCbForceUpdateCaches;
|
||||
private final JBCheckBox myCbDisableCacheDownload;
|
||||
private final JTextField myMaxDownloadDurationField;
|
||||
private final JBLabel myMaxDownloadDurationDescription;
|
||||
private final JBCheckBox myCbCleanupAsynchronously;
|
||||
private final JBLabel myCleanupAsynchronouslyDescription;
|
||||
|
||||
public CompilerCacheConfigurable(final Project project) {
|
||||
myProject = project;
|
||||
myForceUpdateDescription.setText("<html>Turn off the heuristic that determines when it's faster to download cache or build locally and force downloads the nearest cache at each build</html>"); //NON-NLS
|
||||
myMaxDownloadDurationDescription.setText("<html>Set maximum applicable time of caches download. If the approximate time of work will be higher local build will be executed.</html>"); //NON-NLS
|
||||
myCleanupAsynchronouslyDescription.setText("<html>Removes old cache directories asynchronously. This option might produce garbage under 'system/plugins' and spawn long-living rsync processes.</html>"); //NON-NLS
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
// >>> IMPORTANT!! <<<
|
||||
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||
myPanel = new JPanel();
|
||||
myPanel.setLayout(new GridLayoutManager(9, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myCbForceUpdateCaches = new JBCheckBox();
|
||||
this.$$$loadButtonText$$$(myCbForceUpdateCaches,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "compiler.cache.option.force.update"));
|
||||
myPanel.add(myCbForceUpdateCaches, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myCbDisableCacheDownload = new JBCheckBox();
|
||||
this.$$$loadButtonText$$$(myCbDisableCacheDownload,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "compiler.cache.option.disable.update"));
|
||||
myPanel.add(myCbDisableCacheDownload, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
null, null, null, 0, false));
|
||||
final JBLabel jBLabel1 = new JBLabel();
|
||||
jBLabel1.setComponentStyle(UIUtil.ComponentStyle.SMALL);
|
||||
jBLabel1.setFontColor(UIUtil.FontColor.BRIGHTER);
|
||||
jBLabel1.setText("Turn off the caches download for example when you have a limited internet connection."); //NON-NLS
|
||||
myPanel.add(jBLabel1, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
|
||||
null, 2, false));
|
||||
myMaxDownloadDurationDescription = new JBLabel();
|
||||
myMaxDownloadDurationDescription.setComponentStyle(UIUtil.ComponentStyle.SMALL);
|
||||
myMaxDownloadDurationDescription.setFontColor(UIUtil.FontColor.BRIGHTER);
|
||||
myMaxDownloadDurationDescription.setText(""); //NON-NLS
|
||||
myPanel.add(myMaxDownloadDurationDescription, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK |
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK |
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||
myForceUpdateDescription = new JBLabel();
|
||||
myForceUpdateDescription.setBackground(new Color(-1907998));
|
||||
myForceUpdateDescription.setComponentStyle(UIUtil.ComponentStyle.SMALL);
|
||||
myForceUpdateDescription.setFontColor(UIUtil.FontColor.BRIGHTER);
|
||||
myForceUpdateDescription.setHorizontalAlignment(10);
|
||||
myForceUpdateDescription.setHorizontalTextPosition(11);
|
||||
myForceUpdateDescription.setText(""); //NON-NLS
|
||||
myForceUpdateDescription.setVerticalAlignment(0);
|
||||
myPanel.add(myForceUpdateDescription, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
null, null, null, 2, false));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myPanel.add(panel1, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
|
||||
new Dimension(883, 34), null, 0, false));
|
||||
final JLabel label1 = new JLabel();
|
||||
this.$$$loadLabelText$$$(label1,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "compiler.cache.option.max.download.time"));
|
||||
panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myMaxDownloadDurationField = new JTextField();
|
||||
myMaxDownloadDurationField.setColumns(5);
|
||||
panel1.add(myMaxDownloadDurationField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK |
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,
|
||||
null, null, null, 0, false));
|
||||
final JBLabel jBLabel2 = new JBLabel();
|
||||
this.$$$loadLabelText$$$(jBLabel2, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"compiler.cache.option.max.download.time.units"));
|
||||
panel1.add(jBLabel2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
panel1.add(spacer1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
|
||||
final Spacer spacer2 = new Spacer();
|
||||
myPanel.add(spacer2, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
myCbCleanupAsynchronously = new JBCheckBox();
|
||||
this.$$$loadButtonText$$$(myCbCleanupAsynchronously, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"compiler.cache.option.cleanup.asynchronously"));
|
||||
myPanel.add(myCbCleanupAsynchronously, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK |
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK |
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||
myCleanupAsynchronouslyDescription = new JBLabel();
|
||||
myCleanupAsynchronouslyDescription.setComponentStyle(UIUtil.ComponentStyle.SMALL);
|
||||
myCleanupAsynchronouslyDescription.setFontColor(UIUtil.FontColor.BRIGHTER);
|
||||
myCleanupAsynchronouslyDescription.setText(""); //NON-NLS
|
||||
myPanel.add(myCleanupAsynchronouslyDescription,
|
||||
new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 2,
|
||||
false));
|
||||
}
|
||||
myForceUpdateDescription.setText(
|
||||
"<html>Turn off the heuristic that determines when it's faster to download cache or build locally and force downloads the nearest cache at each build</html>"); //NON-NLS
|
||||
myMaxDownloadDurationDescription.setText(
|
||||
"<html>Set maximum applicable time of caches download. If the approximate time of work will be higher local build will be executed.</html>"); //NON-NLS
|
||||
myCleanupAsynchronouslyDescription.setText(
|
||||
"<html>Removes old cache directories asynchronously. This option might produce garbage under 'system/plugins' and spawn long-living rsync processes.</html>"); //NON-NLS
|
||||
}
|
||||
|
||||
private static Method $$$cachedGetBundleMethod$$$ = null;
|
||||
|
||||
/** @noinspection ALL */
|
||||
private String $$$getMessageFromBundle$$$(String path, String key) {
|
||||
ResourceBundle bundle;
|
||||
try {
|
||||
Class<?> thisClass = this.getClass();
|
||||
if ($$$cachedGetBundleMethod$$$ == null) {
|
||||
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
|
||||
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
|
||||
}
|
||||
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
|
||||
}
|
||||
catch (Exception e) {
|
||||
bundle = ResourceBundle.getBundle(path);
|
||||
}
|
||||
return bundle.getString(key);
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadLabelText$$$(JLabel component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setDisplayedMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadButtonText$$$(AbstractButton component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
public JComponent $$$getRootComponent$$$() { return myPanel; }
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return JavaCompilerBundle.message("compiler.cache.description");
|
||||
@@ -55,7 +235,8 @@ public class CompilerCacheConfigurable implements SearchableConfigurable, Config
|
||||
boolean isModified = ComparingUtils.isModified(myCbForceUpdateCaches, CompilerCacheLoadingSettings.getForceUpdateValue());
|
||||
isModified |= ComparingUtils.isModified(myCbDisableCacheDownload, CompilerCacheLoadingSettings.getDisableUpdateValue());
|
||||
isModified |= ComparingUtils.isModified(myCbCleanupAsynchronously, CompilerCacheLoadingSettings.getCleanupAsynchronouslyValue());
|
||||
isModified |= ComparingUtils.isModified(myMaxDownloadDurationField, String.valueOf(CompilerCacheLoadingSettings.getMaxDownloadDuration()));
|
||||
isModified |=
|
||||
ComparingUtils.isModified(myMaxDownloadDurationField, String.valueOf(CompilerCacheLoadingSettings.getMaxDownloadDuration()));
|
||||
return isModified;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,31 +9,91 @@ import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.options.SearchableConfigurable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.RawCommandLineEditor;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.model.java.compiler.RmicCompilerOptions;
|
||||
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
*/
|
||||
public class RmicConfigurable implements SearchableConfigurable, Configurable.NoScroll {
|
||||
private JPanel myPanel;
|
||||
private JCheckBox myCbEnabled;
|
||||
private JCheckBox myCbGenerateIiopStubs;
|
||||
private JCheckBox myCbDebuggingInfo;
|
||||
private JCheckBox myCbGenerateNoWarnings;
|
||||
private RawCommandLineEditor myAdditionalOptionsField;
|
||||
private final JPanel myPanel;
|
||||
private final JCheckBox myCbEnabled;
|
||||
private final JCheckBox myCbGenerateIiopStubs;
|
||||
private final JCheckBox myCbDebuggingInfo;
|
||||
private final JCheckBox myCbGenerateNoWarnings;
|
||||
private final RawCommandLineEditor myAdditionalOptionsField;
|
||||
private final RmicCompilerOptions myRmicSettings;
|
||||
private final Project myProject;
|
||||
private JLabel myFieldLabel;
|
||||
private final JLabel myFieldLabel;
|
||||
|
||||
public RmicConfigurable(final Project project) {
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
// >>> IMPORTANT!! <<<
|
||||
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||
myPanel = new JPanel();
|
||||
myPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myCbEnabled = new JCheckBox();
|
||||
this.$$$loadButtonText$$$(myCbEnabled,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "rmic.option.enable.rmi.stubs"));
|
||||
panel1.add(myCbEnabled, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myCbGenerateIiopStubs = new JCheckBox();
|
||||
this.$$$loadButtonText$$$(myCbGenerateIiopStubs,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "rmic.option.generate.iiop.stubs"));
|
||||
panel1.add(myCbGenerateIiopStubs, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myCbDebuggingInfo = new JCheckBox();
|
||||
myCbDebuggingInfo.setSelected(false);
|
||||
this.$$$loadButtonText$$$(myCbDebuggingInfo, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"java.compiler.option.generate.debugging.info"));
|
||||
panel1.add(myCbDebuggingInfo, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myCbGenerateNoWarnings = new JCheckBox();
|
||||
this.$$$loadButtonText$$$(myCbGenerateNoWarnings, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"java.compiler.option.generate.no.warnings"));
|
||||
panel1.add(myCbGenerateNoWarnings, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JPanel panel2 = new JPanel();
|
||||
panel2.setLayout(new GridLayoutManager(1, 2, new Insets(10, 8, 0, 0), -1, -1));
|
||||
myPanel.add(panel2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null,
|
||||
0, false));
|
||||
myFieldLabel = new JLabel();
|
||||
this.$$$loadLabelText$$$(myFieldLabel, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"java.compiler.option.additional.command.line.parameters"));
|
||||
panel2.add(myFieldLabel,
|
||||
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myAdditionalOptionsField = new RawCommandLineEditor();
|
||||
panel2.add(myAdditionalOptionsField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
|
||||
new Dimension(150, -1), null, 0, false));
|
||||
}
|
||||
myRmicSettings = RmicConfiguration.getOptions(project);
|
||||
myProject = project;
|
||||
myCbEnabled.addItemListener(new ItemListener() {
|
||||
@@ -45,6 +105,78 @@ public class RmicConfigurable implements SearchableConfigurable, Configurable.No
|
||||
myAdditionalOptionsField.setDialogCaption(myFieldLabel.getText());
|
||||
}
|
||||
|
||||
private static Method $$$cachedGetBundleMethod$$$ = null;
|
||||
|
||||
/** @noinspection ALL */
|
||||
private String $$$getMessageFromBundle$$$(String path, String key) {
|
||||
ResourceBundle bundle;
|
||||
try {
|
||||
Class<?> thisClass = this.getClass();
|
||||
if ($$$cachedGetBundleMethod$$$ == null) {
|
||||
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
|
||||
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
|
||||
}
|
||||
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
|
||||
}
|
||||
catch (Exception e) {
|
||||
bundle = ResourceBundle.getBundle(path);
|
||||
}
|
||||
return bundle.getString(key);
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadLabelText$$$(JLabel component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setDisplayedMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadButtonText$$$(AbstractButton component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
public JComponent $$$getRootComponent$$$() { return myPanel; }
|
||||
|
||||
private void setOptionsEnabled(final boolean selected) {
|
||||
myCbGenerateIiopStubs.setEnabled(selected);
|
||||
myCbGenerateNoWarnings.setEnabled(selected);
|
||||
@@ -87,8 +219,8 @@ public class RmicConfigurable implements SearchableConfigurable, Configurable.No
|
||||
@Override
|
||||
public void apply() throws ConfigurationException {
|
||||
try {
|
||||
myRmicSettings.IS_EANABLED = myCbEnabled.isSelected();
|
||||
myRmicSettings.GENERATE_IIOP_STUBS = myCbGenerateIiopStubs.isSelected();
|
||||
myRmicSettings.IS_EANABLED = myCbEnabled.isSelected();
|
||||
myRmicSettings.GENERATE_IIOP_STUBS = myCbGenerateIiopStubs.isSelected();
|
||||
myRmicSettings.DEBUGGING_INFO = myCbDebuggingInfo.isSelected();
|
||||
myRmicSettings.GENERATE_NO_WARNINGS = myCbGenerateNoWarnings.isSelected();
|
||||
myRmicSettings.ADDITIONAL_OPTIONS_STRING = myAdditionalOptionsField.getText();
|
||||
|
||||
@@ -15,9 +15,11 @@ import com.intellij.openapi.options.SearchableConfigurable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.util.NullableFunction;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.CollectionFactory;
|
||||
@@ -27,13 +29,18 @@ import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JPanel;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Insets;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -41,33 +48,136 @@ import java.util.Set;
|
||||
*/
|
||||
public class ValidationConfigurable implements SearchableConfigurable, Configurable.NoScroll {
|
||||
|
||||
private JPanel myPanel;
|
||||
private JCheckBox myValidateBox;
|
||||
private ElementsChooser<Validator> myValidators;
|
||||
private JPanel myExcludedEntriesPanel;
|
||||
private JPanel myValidatorsPanel;
|
||||
private final JPanel myPanel;
|
||||
private final JCheckBox myValidateBox;
|
||||
private final ElementsChooser<Validator> myValidators;
|
||||
private final JPanel myExcludedEntriesPanel;
|
||||
private final JPanel myValidatorsPanel;
|
||||
private final Project myProject;
|
||||
private final ValidationConfiguration myConfiguration;
|
||||
private final ExcludedEntriesConfigurable myExcludedConfigurable;
|
||||
|
||||
public ValidationConfigurable(final Project project) {
|
||||
myProject = project;
|
||||
{
|
||||
myValidators = new ElementsChooser<>(true) {
|
||||
@Override
|
||||
protected String getItemText(final @NotNull Validator validator) {
|
||||
return validator.getDescription();
|
||||
}
|
||||
};
|
||||
}
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
// >>> IMPORTANT!! <<<
|
||||
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||
myPanel = new JPanel();
|
||||
myPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myValidateBox = new JCheckBox();
|
||||
this.$$$loadButtonText$$$(myValidateBox,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "settings.validate.on.build"));
|
||||
myPanel.add(myValidateBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, 0));
|
||||
myPanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null,
|
||||
0, false));
|
||||
myValidatorsPanel = new JPanel();
|
||||
myValidatorsPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myValidatorsPanel.putClientProperty("BorderFactoryClass", "com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndentWithoutInsets");
|
||||
panel1.add(myValidatorsPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
|
||||
null, null, 0, false));
|
||||
myValidatorsPanel.add(myValidators, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
null, new Dimension(150, 50), null, 0, false));
|
||||
myExcludedEntriesPanel = new JPanel();
|
||||
myExcludedEntriesPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myExcludedEntriesPanel.putClientProperty("BorderFactoryClass",
|
||||
"com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndentWithoutInsets");
|
||||
panel1.add(myExcludedEntriesPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
null, null, null, 0, false));
|
||||
final Splitter splitter1 = new Splitter();
|
||||
splitter1.setOrientation(true);
|
||||
panel1.add(splitter1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
|
||||
null, 0, false));
|
||||
splitter1.setFirstComponent(myValidatorsPanel);
|
||||
splitter1.setSecondComponent(myExcludedEntriesPanel);
|
||||
}
|
||||
myConfiguration = ValidationConfiguration.getInstance(myProject);
|
||||
myExcludedConfigurable = createExcludedConfigurable(project);
|
||||
|
||||
myValidatorsPanel.setBorder(IdeBorderFactory.createTitledBorder(JavaCompilerBundle.message("settings.validators"), false, JBUI.insetsTop(8)).setShowLine(false));
|
||||
myValidatorsPanel.setBorder(
|
||||
IdeBorderFactory.createTitledBorder(JavaCompilerBundle.message("settings.validators"), false, JBUI.insetsTop(8)).setShowLine(false));
|
||||
myValidators.getEmptyText().setText(JavaCompilerBundle.message("no.validators"));
|
||||
|
||||
myExcludedEntriesPanel.setBorder(IdeBorderFactory.createTitledBorder(JavaCompilerBundle.message("settings.exclude.from.validation"), false, JBUI.insetsTop(8)).setShowLine(false));
|
||||
myExcludedEntriesPanel.setBorder(
|
||||
IdeBorderFactory.createTitledBorder(JavaCompilerBundle.message("settings.exclude.from.validation"), false, JBUI.insetsTop(8))
|
||||
.setShowLine(false));
|
||||
}
|
||||
|
||||
private static Method $$$cachedGetBundleMethod$$$ = null;
|
||||
|
||||
/** @noinspection ALL */
|
||||
private String $$$getMessageFromBundle$$$(String path, String key) {
|
||||
ResourceBundle bundle;
|
||||
try {
|
||||
Class<?> thisClass = this.getClass();
|
||||
if ($$$cachedGetBundleMethod$$$ == null) {
|
||||
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
|
||||
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
|
||||
}
|
||||
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
|
||||
}
|
||||
catch (Exception e) {
|
||||
bundle = ResourceBundle.getBundle(path);
|
||||
}
|
||||
return bundle.getString(key);
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadButtonText$$$(AbstractButton component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
public JComponent $$$getRootComponent$$$() { return myPanel; }
|
||||
|
||||
private static ExcludedEntriesConfigurable createExcludedConfigurable(@NotNull Project project) {
|
||||
var index = project.isDefault() ? null : ProjectRootManager.getInstance(project).getFileIndex();
|
||||
var descriptor = new FileChooserDescriptor(true, true, false, false, false, true)
|
||||
.withFileFilter(file -> index == null || !index.isExcluded(file));
|
||||
|
||||
List<VirtualFile> allContentRoots = new ArrayList<>();
|
||||
for (final Module module: ModuleManager.getInstance(project).getModules()) {
|
||||
for (final Module module : ModuleManager.getInstance(project).getModules()) {
|
||||
final VirtualFile[] moduleContentRoots = ModuleRootManager.getInstance(module).getContentRoots();
|
||||
Collections.addAll(allContentRoots, moduleContentRoots);
|
||||
}
|
||||
@@ -108,18 +218,18 @@ public class ValidationConfigurable implements SearchableConfigurable, Configura
|
||||
Set<Validator> set = CollectionFactory.createCustomHashingStrategySet(new HashingStrategy<>() {
|
||||
@Override
|
||||
public int hashCode(Validator object) {
|
||||
return object==null?0:object.getId().hashCode();
|
||||
return object == null ? 0 : object.getId().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Validator o1, Validator o2) {
|
||||
return (o1==null?"":o1.getId()).equals(o2==null?"":o2.getId());
|
||||
return (o1 == null ? "" : o1.getId()).equals(o2 == null ? "" : o2.getId());
|
||||
}
|
||||
});
|
||||
set.addAll(selectedElements);
|
||||
return myConfiguration.isValidateOnBuild() != myValidateBox.isSelected() ||
|
||||
set.retainAll(markedValidators) ||
|
||||
myExcludedConfigurable.isModified();
|
||||
set.retainAll(markedValidators) ||
|
||||
myExcludedConfigurable.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,7 +237,7 @@ public class ValidationConfigurable implements SearchableConfigurable, Configura
|
||||
myConfiguration.setValidateOnBuild(myValidateBox.isSelected());
|
||||
for (int i = 0; i < myValidators.getElementCount(); i++) {
|
||||
final Validator validator = myValidators.getElementAt(i);
|
||||
myConfiguration.setSelected(validator, myValidators.isElementMarked(validator));
|
||||
myConfiguration.setSelected(validator, myValidators.isElementMarked(validator));
|
||||
}
|
||||
myExcludedConfigurable.apply();
|
||||
}
|
||||
@@ -143,7 +253,9 @@ public class ValidationConfigurable implements SearchableConfigurable, Configura
|
||||
}
|
||||
|
||||
private @Unmodifiable List<Validator> getMarkedValidators(@NotNull List<Validator> validators) {
|
||||
return ContainerUtil.mapNotNull(validators, (NullableFunction<Validator, Validator>)validator -> myConfiguration.isSelected(validator) ? validator : null);
|
||||
return ContainerUtil.mapNotNull(validators, (NullableFunction<Validator, Validator>)validator -> myConfiguration.isSelected(validator)
|
||||
? validator
|
||||
: null);
|
||||
}
|
||||
|
||||
private List<Validator> getValidators() {
|
||||
@@ -155,13 +267,4 @@ public class ValidationConfigurable implements SearchableConfigurable, Configura
|
||||
public void disposeUIResources() {
|
||||
myExcludedConfigurable.disposeUIResources();
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
myValidators = new ElementsChooser<>(true) {
|
||||
@Override
|
||||
protected String getItemText(final @NotNull Validator validator) {
|
||||
return validator.getDescription();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+169
-9
@@ -14,36 +14,124 @@ import com.intellij.packaging.elements.PackagingElementResolvingContext;
|
||||
import com.intellij.packaging.impl.elements.ManifestFileUtil;
|
||||
import com.intellij.ui.ComboboxSpeedSearch;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.ui.SimpleListCellRenderer;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class JarArtifactFromModulesDialog extends DialogWrapper {
|
||||
private JPanel myMainPanel;
|
||||
private TextFieldWithBrowseButton myMainClassField;
|
||||
private JComboBox<Module> myModuleComboBox;
|
||||
private JLabel myMainClassLabel;
|
||||
private TextFieldWithBrowseButton myManifestDirField;
|
||||
private JLabel myManifestDirLabel;
|
||||
private JRadioButton myExtractJarsRadioButton;
|
||||
private JRadioButton myCopyJarsRadioButton;
|
||||
private JCheckBox myIncludeTestsCheckBox;
|
||||
private final JPanel myMainPanel;
|
||||
private final TextFieldWithBrowseButton myMainClassField;
|
||||
private final JComboBox<Module> myModuleComboBox;
|
||||
private final JLabel myMainClassLabel;
|
||||
private final TextFieldWithBrowseButton myManifestDirField;
|
||||
private final JLabel myManifestDirLabel;
|
||||
private final JRadioButton myExtractJarsRadioButton;
|
||||
private final JRadioButton myCopyJarsRadioButton;
|
||||
private final JCheckBox myIncludeTestsCheckBox;
|
||||
private final PackagingElementResolvingContext myContext;
|
||||
|
||||
public JarArtifactFromModulesDialog(PackagingElementResolvingContext context) {
|
||||
super(context.getProject());
|
||||
myContext = context;
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
// >>> IMPORTANT!! <<<
|
||||
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||
myMainPanel = new JPanel();
|
||||
myMainPanel.setLayout(new GridLayoutManager(7, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myMainClassLabel = new JLabel();
|
||||
this.$$$loadLabelText$$$(myMainClassLabel,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "jar.artifacts.dialog.label.main.class"));
|
||||
myMainPanel.add(myMainClassLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null,
|
||||
null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
myMainPanel.add(spacer1, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
myMainClassField = new TextFieldWithBrowseButton();
|
||||
myMainPanel.add(myMainClassField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
|
||||
null, null, 0, false));
|
||||
final JLabel label1 = new JLabel();
|
||||
this.$$$loadLabelText$$$(label1, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "jar.artifacts.dialog.label.module"));
|
||||
myMainPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
|
||||
false));
|
||||
myModuleComboBox = new JComboBox();
|
||||
myMainPanel.add(myModuleComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
|
||||
new Dimension(400, -1), null, 0, false));
|
||||
myManifestDirLabel = new JLabel();
|
||||
this.$$$loadLabelText$$$(myManifestDirLabel, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"jar.artifacts.dialog.label.directory.for.metainf"));
|
||||
myMainPanel.add(myManifestDirLabel, new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null,
|
||||
null, null, 0, false));
|
||||
myManifestDirField = new TextFieldWithBrowseButton();
|
||||
myMainPanel.add(myManifestDirField, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
|
||||
null, null, 2, false));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
panel1.putClientProperty("BorderFactoryClass", "com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent");
|
||||
myMainPanel.add(panel1, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
|
||||
null, 0, false));
|
||||
panel1.setBorder(IdeBorderFactory.PlainSmallWithIndent.createTitledBorder(null, this.$$$getMessageFromBundle$$$(
|
||||
"messages/JavaCompilerBundle", "jar.artifacts.dialog.border.title.jar.files.from.libraries"), TitledBorder.DEFAULT_JUSTIFICATION,
|
||||
TitledBorder.DEFAULT_POSITION, null, null));
|
||||
myExtractJarsRadioButton = new JRadioButton();
|
||||
myExtractJarsRadioButton.setSelected(true);
|
||||
this.$$$loadButtonText$$$(myExtractJarsRadioButton, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"jar.artifacts.dialog.radio.button.extract.to.the.target.jar"));
|
||||
panel1.add(myExtractJarsRadioButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final Spacer spacer2 = new Spacer();
|
||||
panel1.add(spacer2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
|
||||
myCopyJarsRadioButton = new JRadioButton();
|
||||
this.$$$loadButtonText$$$(myCopyJarsRadioButton, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"jar.artifacts.dialog.radio.button.copy.to.the.output.directory.and.link.via.manifest"));
|
||||
panel1.add(myCopyJarsRadioButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myIncludeTestsCheckBox = new JCheckBox();
|
||||
this.$$$loadButtonText$$$(myIncludeTestsCheckBox, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"jar.artifacts.dialog.checkbox.include.tests"));
|
||||
myMainPanel.add(myIncludeTestsCheckBox, new GridConstraints(5, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK |
|
||||
GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED,
|
||||
null, null, null, 0, false));
|
||||
label1.setLabelFor(myModuleComboBox);
|
||||
ButtonGroup buttonGroup;
|
||||
buttonGroup = new ButtonGroup();
|
||||
buttonGroup.add(myExtractJarsRadioButton);
|
||||
buttonGroup.add(myCopyJarsRadioButton);
|
||||
}
|
||||
setTitle(JavaCompilerBundle.message("create.jar.from.modules"));
|
||||
myMainClassLabel.setLabelFor(myMainClassField.getTextField());
|
||||
myManifestDirLabel.setLabelFor(myManifestDirField.getTextField());
|
||||
@@ -72,6 +160,78 @@ public class JarArtifactFromModulesDialog extends DialogWrapper {
|
||||
init();
|
||||
}
|
||||
|
||||
private static Method $$$cachedGetBundleMethod$$$ = null;
|
||||
|
||||
/** @noinspection ALL */
|
||||
private String $$$getMessageFromBundle$$$(String path, String key) {
|
||||
ResourceBundle bundle;
|
||||
try {
|
||||
Class<?> thisClass = this.getClass();
|
||||
if ($$$cachedGetBundleMethod$$$ == null) {
|
||||
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
|
||||
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
|
||||
}
|
||||
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
|
||||
}
|
||||
catch (Exception e) {
|
||||
bundle = ResourceBundle.getBundle(path);
|
||||
}
|
||||
return bundle.getString(key);
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadLabelText$$$(JLabel component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setDisplayedMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadButtonText$$$(AbstractButton component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
public JComponent $$$getRootComponent$$$() { return myMainPanel; }
|
||||
|
||||
private void setupModulesCombobox(PackagingElementResolvingContext context) {
|
||||
final Module[] modules = context.getModulesProvider().getModules().clone();
|
||||
Arrays.sort(modules, ModulesAlphaComparator.INSTANCE);
|
||||
|
||||
+178
-14
@@ -15,45 +15,135 @@ import com.intellij.packaging.ui.ArtifactEditorContext;
|
||||
import com.intellij.packaging.ui.ManifestFileConfiguration;
|
||||
import com.intellij.packaging.ui.PackagingElementPropertiesPanel;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import java.awt.CardLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElementWithManifest<?>> extends PackagingElementPropertiesPanel {
|
||||
public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElementWithManifest<?>>
|
||||
extends PackagingElementPropertiesPanel {
|
||||
private final E myElement;
|
||||
private final ArtifactEditorContext myContext;
|
||||
private JPanel myMainPanel;
|
||||
private TextFieldWithBrowseButton myMainClassField;
|
||||
private TextFieldWithBrowseButton myClasspathField;
|
||||
private JLabel myTitleLabel;
|
||||
private JButton myCreateManifestButton;
|
||||
private JButton myUseExistingManifestButton;
|
||||
private JPanel myPropertiesPanel;
|
||||
private TextFieldWithBrowseButton myManifestPathField;
|
||||
private JLabel myManifestNotFoundLabel;
|
||||
private final JPanel myMainPanel;
|
||||
private final TextFieldWithBrowseButton myMainClassField;
|
||||
private final TextFieldWithBrowseButton myClasspathField;
|
||||
private final JLabel myTitleLabel;
|
||||
private final JButton myCreateManifestButton;
|
||||
private final JButton myUseExistingManifestButton;
|
||||
private final JPanel myPropertiesPanel;
|
||||
private final TextFieldWithBrowseButton myManifestPathField;
|
||||
private final JLabel myManifestNotFoundLabel;
|
||||
private ManifestFileConfiguration myManifestFileConfiguration;
|
||||
|
||||
public ElementWithManifestPropertiesPanel(E element, final ArtifactEditorContext context) {
|
||||
myElement = element;
|
||||
myContext = context;
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
// >>> IMPORTANT!! <<<
|
||||
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||
myMainPanel = new JPanel();
|
||||
myMainPanel.setLayout(new GridLayoutManager(2, 1, new Insets(5, 5, 5, 5), -1, -1));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
myMainPanel.add(spacer1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
myPropertiesPanel = new JPanel();
|
||||
myPropertiesPanel.setLayout(new CardLayout(0, 0));
|
||||
myMainPanel.add(myPropertiesPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
null, null, null, 0, false));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myPropertiesPanel.add(panel1, "properties");
|
||||
final JLabel label1 = new JLabel();
|
||||
this.$$$loadLabelText$$$(label1, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "label.text.main.class"));
|
||||
panel1.add(label1,
|
||||
new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myMainClassField = new TextFieldWithBrowseButton();
|
||||
panel1.add(myMainClassField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label2 = new JLabel();
|
||||
this.$$$loadLabelText$$$(label2, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "label.text.class.path"));
|
||||
panel1.add(label2,
|
||||
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myClasspathField = new TextFieldWithBrowseButton();
|
||||
panel1.add(myClasspathField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myTitleLabel = new JLabel();
|
||||
myTitleLabel.setText("element name");
|
||||
panel1.add(myTitleLabel,
|
||||
new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label3 = new JLabel();
|
||||
this.$$$loadLabelText$$$(label3,
|
||||
this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle", "element.with.manifest.label.manifest.file"));
|
||||
panel1.add(label3,
|
||||
new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myManifestPathField = new TextFieldWithBrowseButton();
|
||||
panel1.add(myManifestPathField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
|
||||
null, null, 0, false));
|
||||
final JPanel panel2 = new JPanel();
|
||||
panel2.setLayout(new GridLayoutManager(3, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||
myPropertiesPanel.add(panel2, "buttons");
|
||||
myCreateManifestButton = new JButton();
|
||||
this.$$$loadButtonText$$$(myCreateManifestButton, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"element.with.manifest.button.create.manifest"));
|
||||
panel2.add(myCreateManifestButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final Spacer spacer2 = new Spacer();
|
||||
panel2.add(spacer2, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
|
||||
final Spacer spacer3 = new Spacer();
|
||||
panel2.add(spacer3, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
myUseExistingManifestButton = new JButton();
|
||||
this.$$$loadButtonText$$$(myUseExistingManifestButton, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"element.with.manifest.button.use.existing.manifest"));
|
||||
panel2.add(myUseExistingManifestButton,
|
||||
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
myManifestNotFoundLabel = new JLabel();
|
||||
this.$$$loadLabelText$$$(myManifestNotFoundLabel, this.$$$getMessageFromBundle$$$("messages/JavaCompilerBundle",
|
||||
"element.with.manifest.label.meta.inf.manifest.mf.file.not.found"));
|
||||
panel2.add(myManifestNotFoundLabel,
|
||||
new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
label3.setLabelFor(myManifestPathField);
|
||||
}
|
||||
|
||||
ManifestFileUtil.setupMainClassField(context.getProject(), myMainClassField);
|
||||
|
||||
myClasspathField.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Messages.showTextAreaDialog(myClasspathField.getTextField(), JavaCompilerBundle.message("edit.classpath"), "classpath-attribute-editor");
|
||||
Messages.showTextAreaDialog(myClasspathField.getTextField(), JavaCompilerBundle.message("edit.classpath"),
|
||||
"classpath-attribute-editor");
|
||||
}
|
||||
});
|
||||
myClasspathField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@@ -78,6 +168,78 @@ public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElem
|
||||
myManifestPathField.addActionListener(e -> chooseManifest());
|
||||
}
|
||||
|
||||
private static Method $$$cachedGetBundleMethod$$$ = null;
|
||||
|
||||
/** @noinspection ALL */
|
||||
private String $$$getMessageFromBundle$$$(String path, String key) {
|
||||
ResourceBundle bundle;
|
||||
try {
|
||||
Class<?> thisClass = this.getClass();
|
||||
if ($$$cachedGetBundleMethod$$$ == null) {
|
||||
Class<?> dynamicBundleClass = thisClass.getClassLoader().loadClass("com.intellij.DynamicBundle");
|
||||
$$$cachedGetBundleMethod$$$ = dynamicBundleClass.getMethod("getBundle", String.class, Class.class);
|
||||
}
|
||||
bundle = (ResourceBundle)$$$cachedGetBundleMethod$$$.invoke(null, path, thisClass);
|
||||
}
|
||||
catch (Exception e) {
|
||||
bundle = ResourceBundle.getBundle(path);
|
||||
}
|
||||
return bundle.getString(key);
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadLabelText$$$(JLabel component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setDisplayedMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
private void $$$loadButtonText$$$(AbstractButton component, String text) {
|
||||
StringBuffer result = new StringBuffer();
|
||||
boolean haveMnemonic = false;
|
||||
char mnemonic = '\0';
|
||||
int mnemonicIndex = -1;
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == '&') {
|
||||
i++;
|
||||
if (i == text.length()) break;
|
||||
if (!haveMnemonic && text.charAt(i) != '&') {
|
||||
haveMnemonic = true;
|
||||
mnemonic = text.charAt(i);
|
||||
mnemonicIndex = result.length();
|
||||
}
|
||||
}
|
||||
result.append(text.charAt(i));
|
||||
}
|
||||
component.setText(result.toString());
|
||||
if (haveMnemonic) {
|
||||
component.setMnemonic(mnemonic);
|
||||
component.setDisplayedMnemonicIndex(mnemonicIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinspection ALL */
|
||||
public JComponent $$$getRootComponent$$$() { return myMainPanel; }
|
||||
|
||||
private void createManifest() {
|
||||
final VirtualFile file = ManifestFileUtil.showDialogAndCreateManifest(myContext, myElement);
|
||||
if (file == null) {
|
||||
@@ -129,8 +291,11 @@ public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElem
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return myManifestFileConfiguration != null && (!myManifestFileConfiguration.getClasspath().equals(getConfiguredClasspath())
|
||||
|| !Objects.equals(myManifestFileConfiguration.getMainClass(), getConfiguredMainClass())
|
||||
|| !Objects.equals(myManifestFileConfiguration.getManifestFilePath(), getConfiguredManifestPath()));
|
||||
||
|
||||
!Objects.equals(myManifestFileConfiguration.getMainClass(), getConfiguredMainClass())
|
||||
||
|
||||
!Objects.equals(myManifestFileConfiguration.getManifestFilePath(),
|
||||
getConfiguredManifestPath()));
|
||||
}
|
||||
|
||||
private @Nullable String getConfiguredManifestPath() {
|
||||
@@ -160,5 +325,4 @@ public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElem
|
||||
final String className = myMainClassField.getText();
|
||||
return !className.isEmpty() ? className : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user