Skip to content

Commit cdcdb2a

Browse files
author
Vitaliy
authored
Merge branch '1.0.1-develop' into improved-deploy-to-alpha
2 parents 6cd3958 + eeefbe9 commit cdcdb2a

20 files changed

+88
-57
lines changed

resources/magento2/common.properties

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
common.magento.installationPath=Magento Installation Path
12
common.package.name=Package Name
23
common.module.name=Module Name
3-
common.module.version=Module Version
4-
common.module.license=Module's license(s)
5-
common.module.dependencies=Module Dependencies
6-
common.module.description=Module Description
4+
common.module.version=Version
5+
common.module.license=License(s)
6+
common.dependencies=Dependencies
77
common.ok=OK
88
common.cancel=Cancel
99
common.error=Error
1010
common.module.target=Target Module
1111
common.area.target=Target Area
12+
common.name=Name
13+
common.className=Class Name
14+
common.directoryPath=Directory Path
15+
common.methodType=Method Type
16+
common.sortOrder=Sort Order
17+
common.hint.viewModelPreferredVersusBlock=Please consider creating a view model instead of a block if possible for your use case.
18+
common.schedule=Schedule
19+
common.schedule.fixed=Fixed
20+
common.schedule.configurable=Configurable
21+
common.schedule.everyMinute=Every Minute
22+
common.schedule.atMidnight=At midnight
23+
common.schedule.custom=Custom
24+
common.cronGroup=Cron Group
25+
common.directory=Directory
26+
common.notAvailable=N/A
27+
common.classInheritance=Inherit Class
28+
common.license.proprietary=Proprietary
29+
common.description=Description

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
* All code generate dialog should extend this class
1212
*/
1313
public abstract class AbstractDialog extends JDialog {
14-
protected void pushToMiddle() {
15-
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
16-
this.setLocation(dim.width / 2 -this.getSize().width / 2, dim.height / 2 - this.getSize().height / 2);
14+
protected void centerDialog(AbstractDialog dialog) {
15+
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
16+
int x = screenSize.width / 2 - dialog.getSize().width / 2;
17+
int y = screenSize.height / 2 - dialog.getSize().height / 2;
18+
dialog.setLocation(x, y);
1719
}
1820

1921
protected void onCancel() {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<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"/>
7878
</constraints>
7979
<properties>
80-
<text value="Plugin Class Name"/>
80+
<text resource-bundle="magento2/common" key="common.className"/>
8181
</properties>
8282
</component>
8383
<component id="e4858" class="javax.swing.JTextField" binding="pluginDirectory">
@@ -100,15 +100,15 @@
100100
<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"/>
101101
</constraints>
102102
<properties>
103-
<text value="Plugin Directory Path"/>
103+
<text resource-bundle="magento2/common" key="common.directoryPath"/>
104104
</properties>
105105
</component>
106106
<component id="14359" class="javax.swing.JLabel" binding="pluginNameLabel">
107107
<constraints>
108108
<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"/>
109109
</constraints>
110110
<properties>
111-
<text value="Plugin Name"/>
111+
<text resource-bundle="magento2/common" key="common.name"/>
112112
</properties>
113113
</component>
114114
<component id="9431c" class="javax.swing.JTextField" binding="pluginName">
@@ -143,7 +143,7 @@
143143
<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"/>
144144
</constraints>
145145
<properties>
146-
<text value="Sort Order"/>
146+
<text resource-bundle="magento2/common" key="common.sortOrder"/>
147147
</properties>
148148
</component>
149149
</children>
@@ -171,7 +171,7 @@
171171
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
172172
</constraints>
173173
<properties>
174-
<text value="Plugin Method Type"/>
174+
<text resource-bundle="magento2/common" key="common.methodType"/>
175175
</properties>
176176
</component>
177177
<component id="bd654" class="com.magento.idea.magento2plugin.ui.FilteredComboBox" binding="pluginModule" custom-create="true">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public CreateAPluginDialog(@NotNull Project project, Method targetMethod, PhpCla
5858
setContentPane(contentPane);
5959
setModal(true);
6060
getRootPane().setDefaultButton(buttonOK);
61-
pushToMiddle();
6261
fillPluginTypeOptions();
6362
fillTargetAreaOptions();
6463

@@ -158,6 +157,7 @@ public String getPluginModule() {
158157
public static void open(@NotNull Project project, Method targetMethod, PhpClass targetClass) {
159158
CreateAPluginDialog dialog = new CreateAPluginDialog(project, targetMethod, targetClass);
160159
dialog.pack();
160+
dialog.centerDialog(dialog);
161161
dialog.setVisible(true);
162162
}
163163

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<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"/>
6767
</constraints>
6868
<properties>
69-
<text value="Observer Class Name"/>
69+
<text resource-bundle="magento2/common" key="common.className"/>
7070
</properties>
7171
</component>
7272
<component id="e4858" class="javax.swing.JTextField" binding="observerDirectory">
@@ -89,15 +89,15 @@
8989
<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"/>
9090
</constraints>
9191
<properties>
92-
<text value="Observer Directory Path"/>
92+
<text resource-bundle="magento2/common" key="common.directoryPath"/>
9393
</properties>
9494
</component>
9595
<component id="54e7b" class="javax.swing.JLabel" binding="observerNameLabel">
9696
<constraints>
9797
<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"/>
9898
</constraints>
9999
<properties>
100-
<text value="Observer Name"/>
100+
<text resource-bundle="magento2/common" key="common.name"/>
101101
</properties>
102102
</component>
103103
<component id="ad3ba" class="javax.swing.JTextField" binding="observerClassName">
@@ -155,4 +155,7 @@
155155
</component>
156156
</children>
157157
</grid>
158+
<inspectionSuppressions>
159+
<suppress inspection="InvalidPropertyKeyForm" id="3fe2b"/>
160+
</inspectionSuppressions>
158161
</form>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public CreateAnObserverDialog(@NotNull Project project, String targetEvent) {
4949
setContentPane(contentPane);
5050
setModal(true);
5151
getRootPane().setDefaultButton(buttonOK);
52-
pushToMiddle();
5352
fillTargetAreaOptions();
5453

5554
buttonOK.addActionListener(new ActionListener() {
@@ -131,6 +130,7 @@ public String getObserverModule() {
131130
public static void open(@NotNull Project project, String targetEvent) {
132131
CreateAnObserverDialog dialog = new CreateAnObserverDialog(project, targetEvent);
133132
dialog.pack();
133+
dialog.centerDialog(dialog);
134134
dialog.setVisible(true);
135135
}
136136

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<grid id="cbd77" binding="contentPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
44
<margin top="10" left="10" bottom="10" right="10"/>
55
<constraints>
6-
<xy x="48" y="54" width="419" height="297"/>
6+
<xy x="48" y="54" width="455" height="297"/>
77
</constraints>
88
<properties>
99
<name value="New Magento2 Block.."/>
@@ -69,7 +69,7 @@
6969
</constraints>
7070
<properties>
7171
<labelFor value="2d9cc"/>
72-
<text value="Block Name"/>
72+
<text resource-bundle="magento2/common" key="common.name"/>
7373
</properties>
7474
</component>
7575
<component id="2d9cc" class="javax.swing.JTextField" binding="blockName">
@@ -100,7 +100,7 @@
100100
</constraints>
101101
<properties>
102102
<labelFor value="fdc52"/>
103-
<text value="Block Directory"/>
103+
<text resource-bundle="magento2/common" key="common.directory"/>
104104
</properties>
105105
<clientProperties>
106106
<html.disable class="java.lang.Boolean" value="true"/>
@@ -127,7 +127,7 @@
127127
<enabled value="false"/>
128128
<margin top="0" left="0" bottom="0" right="0"/>
129129
<opaque value="false"/>
130-
<text value="Please consider creating a view model instead of a block if possible for your use case."/>
130+
<text resource-bundle="magento2/common" key="common.hint.viewModelPreferredVersusBlock"/>
131131
</properties>
132132
<clientProperties>
133133
<html.disable class="java.lang.Boolean" value="false"/>
@@ -148,4 +148,7 @@
148148
<member id="e6153"/>
149149
</group>
150150
</buttonGroups>
151+
<inspectionSuppressions>
152+
<suppress inspection="InvalidPropertyKeyForm" id="be25f"/>
153+
</inspectionSuppressions>
151154
</form>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public NewBlockDialog(Project project, PsiDirectory directory) {
4343
setModal(true);
4444
setTitle("Create a new Magento 2 block..");
4545
getRootPane().setDefaultButton(buttonOK);
46-
pushToMiddle();
4746
suggestBlockDirectory();
4847

4948
buttonOK.addActionListener(new ActionListener() {
@@ -77,6 +76,7 @@ public void actionPerformed(ActionEvent e) {
7776
public static void open(Project project, PsiDirectory directory) {
7877
NewBlockDialog dialog = new NewBlockDialog(project, directory);
7978
dialog.pack();
79+
dialog.centerDialog(dialog);
8080
dialog.setVisible(true);
8181
}
8282

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</constraints>
7474
<properties>
7575
<labelFor value="fe780"/>
76-
<text value="Cronjob ClassName"/>
76+
<text resource-bundle="magento2/common" key="common.className"/>
7777
</properties>
7878
</component>
7979
<component id="e23f7" class="javax.swing.JLabel">
@@ -82,15 +82,15 @@
8282
</constraints>
8383
<properties>
8484
<labelFor value="b2d70"/>
85-
<text value="Cronjob Directory"/>
85+
<text resource-bundle="magento2/common" key="common.directory"/>
8686
</properties>
8787
</component>
8888
<component id="462a3" class="javax.swing.JLabel">
8989
<constraints>
9090
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
9191
</constraints>
9292
<properties>
93-
<text value="Schedule"/>
93+
<text resource-bundle="magento2/common" key="common.schedule"/>
9494
</properties>
9595
</component>
9696
<vspacer id="efb9e">
@@ -104,15 +104,15 @@
104104
</constraints>
105105
<properties>
106106
<selected value="true"/>
107-
<text value="Fixed"/>
107+
<text resource-bundle="magento2/common" key="common.schedule.fixed"/>
108108
</properties>
109109
</component>
110110
<component id="649c" class="javax.swing.JRadioButton" binding="configurableScheduleRadioButton">
111111
<constraints>
112112
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
113113
</constraints>
114114
<properties>
115-
<text value="Configurable"/>
115+
<text resource-bundle="magento2/common" key="common.schedule.configurable"/>
116116
</properties>
117117
</component>
118118
<grid id="832a2" binding="fixedSchedulePanel" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@@ -131,15 +131,15 @@
131131
</constraints>
132132
<properties>
133133
<selected value="true"/>
134-
<text value="Every Minute"/>
134+
<text resource-bundle="magento2/common" key="common.schedule.everyMinute"/>
135135
</properties>
136136
</component>
137137
<component id="daa" class="javax.swing.JRadioButton" binding="customScheduleRadioButton">
138138
<constraints>
139139
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
140140
</constraints>
141141
<properties>
142-
<text value="Custom"/>
142+
<text resource-bundle="magento2/common" key="common.schedule.custom"/>
143143
</properties>
144144
</component>
145145
<component id="5be88" class="javax.swing.JTextField" binding="cronjobScheduleField">
@@ -159,7 +159,7 @@
159159
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
160160
</constraints>
161161
<properties>
162-
<text value="At midnight"/>
162+
<text resource-bundle="magento2/common" key="common.schedule.atMidnight"/>
163163
</properties>
164164
</component>
165165
</children>
@@ -197,7 +197,7 @@
197197
<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"/>
198198
</constraints>
199199
<properties>
200-
<text value="Cron Group"/>
200+
<text resource-bundle="magento2/common" key="common.cronGroup"/>
201201
</properties>
202202
</component>
203203
<component id="77d9d" class="com.magento.idea.magento2plugin.ui.FilteredComboBox" binding="cronGroupComboBox" custom-create="true">
@@ -213,7 +213,7 @@
213213
<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"/>
214214
</constraints>
215215
<properties>
216-
<text value="Cronjob Name"/>
216+
<text resource-bundle="magento2/common" key="common.name"/>
217217
</properties>
218218
</component>
219219
<component id="555fd" class="javax.swing.JTextField" binding="cronjobNameField">
@@ -250,4 +250,7 @@
250250
<member id="ee2c9"/>
251251
</group>
252252
</buttonGroups>
253+
<inspectionSuppressions>
254+
<suppress inspection="InvalidPropertyKeyForm" id="e23f7"/>
255+
</inspectionSuppressions>
253256
</form>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public NewCronjobDialog(Project project, PsiDirectory directory) {
5555
setModal(true);
5656
getRootPane().setDefaultButton(buttonOK);
5757
setTitle("Create a new Magento 2 cronjob..");
58-
pushToMiddle();
5958

6059
buttonOK.addActionListener(e -> onOK());
6160
buttonCancel.addActionListener(e -> onCancel());
@@ -119,8 +118,8 @@ public void actionPerformed(ActionEvent e) {
119118

120119
public static void open(Project project, PsiDirectory directory) {
121120
NewCronjobDialog dialog = new NewCronjobDialog(project, directory);
122-
123121
dialog.pack();
122+
dialog.centerDialog(dialog);
124123
dialog.setVisible(true);
125124
}
126125

0 commit comments

Comments
 (0)