Skip to content

Commit e35cd32

Browse files
author
Vitaliy Boyko
committed
Adjusted licenses select
1 parent 62fa18c commit e35cd32

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewMagentoModuleDialog.form

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<constraints>
66
<xy x="48" y="54" width="462" height="431"/>
77
</constraints>
8-
<properties/>
8+
<properties>
9+
<preferredSize width="350" height="391"/>
10+
</properties>
911
<border type="none"/>
1012
<children>
1113
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@@ -131,8 +133,8 @@
131133
</grid>
132134
</constraints>
133135
<properties>
134-
<editable value="false"/>
135-
<enabled value="false"/>
136+
<editable value="true"/>
137+
<enabled value="true"/>
136138
<toolTipText value="Module's Custom License"/>
137139
</properties>
138140
</component>

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewMagentoModuleDialog.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public NewMagentoModuleDialog(@NotNull Project project, @NotNull PsiDirectory in
8484
setLicenses();
8585

8686
moduleLicenseCustom.setToolTipText("Custom License Name");
87-
moduleLicenseCustom.setText("Custom License Name");
87+
moduleLicenseCustom.setText("proprietary");
8888

8989
buttonOK.addActionListener(new ActionListener() {
9090
public void actionPerformed(ActionEvent e) {
@@ -193,19 +193,10 @@ public String getModuleVersion() {
193193
return this.moduleVersion.getText().trim();
194194
}
195195

196-
/**
197-
* Retrieve selected licenses name for the module
198-
*
199-
* @return List
200-
*/
201196
public List getModuleLicense() {
202197
List selectedLicenses = this.moduleLicense.getSelectedValuesList();
203198
Package.License customLicense = Package.License.CUSTOM;
204199

205-
/**
206-
* When custom license is selected, the selected label "Custom License"
207-
* must be replaced with the custom license name provided
208-
*/
209200
if (selectedLicenses.contains(customLicense.getLicenseName())) {
210201
selectedLicenses.remove(customLicense.getLicenseName());
211202
selectedLicenses.add(moduleLicenseCustom.getText());
@@ -227,9 +218,6 @@ private String getComposerPackageName() {
227218
.concat(camelCaseToHyphen.convert(getModuleName()));
228219
}
229220

230-
/**
231-
* Set licenses to select from
232-
*/
233221
private void setLicenses() {
234222
Package.License[] licenses = Package.License.values();
235223
Vector<String> licenseNames = new Vector<>(licenses.length);
@@ -243,9 +231,6 @@ private void setLicenses() {
243231
moduleLicense.addListSelectionListener(this);
244232
}
245233

246-
/**
247-
* Make the Custom Module License input available when custom license is selected
248-
*/
249234
private void handleModuleCustomLicenseInputVisibility () {
250235
boolean isCustomLicenseSelected = false;
251236

src/com/magento/idea/magento2plugin/magento/packages/Package.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ public static enum Areas {
2424
}
2525

2626
public static enum License {
27+
CUSTOM("Custom License"),
2728
OSL("Open Software License (OSL)"),
2829
MPL("Mozilla Public License (MPL)"),
2930
MITL("Massachusetts Institute of Technology License (MITL)"),
3031
LGPL("GNU Lesser General Public License (LGPL)"),
3132
GPL("GNU General Public License (GPL)"),
3233
BSDL("Berkeley Software Distribution License (BSDL)"),
3334
ASL("Apache Software License (ASL)"),
34-
AFL("Academic Free License (AFL)"),
35-
CUSTOM("Custom License");
35+
AFL("Academic Free License (AFL)");
3636

3737
private String licenseName;
3838

0 commit comments

Comments
 (0)