File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
src/com/magento/idea/magento2plugin/actions/generation Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 1717import com .magento .idea .magento2plugin .actions .generation .dialog .NewCronjobDialog ;
1818import org .jetbrains .annotations .NotNull ;
1919
20- @ SuppressWarnings ({"PMD.FieldNamingConventions" , "PMD.OnlyOneReturn" })
2120public class NewCronjobAction extends AnAction {
21+
2222 public static String ACTION_NAME = "Magento 2 Cron Job" ;
2323 public static String ACTION_DESCRIPTION = "Create a new Magento 2 Cron Job" ;
2424
@@ -34,17 +34,16 @@ public void actionPerformed(final @NotNull AnActionEvent event) {
3434 if (view == null ) {
3535 return ;
3636 }
37-
3837 final Project project = CommonDataKeys .PROJECT .getData (dataContext );
38+
3939 if (project == null ) {
4040 return ;
4141 }
42-
4342 final PsiDirectory directory = view .getOrChooseDirectory ();
43+
4444 if (directory == null ) {
4545 return ;
4646 }
47-
4847 NewCronjobDialog .open (project , directory );
4948 }
5049
Original file line number Diff line number Diff line change 2626import com .magento .idea .magento2plugin .ui .FilteredComboBox ;
2727import com .magento .idea .magento2plugin .util .CamelCaseToSnakeCase ;
2828import com .magento .idea .magento2plugin .util .magento .GetModuleNameByDirectoryUtil ;
29+ import org .jetbrains .annotations .NotNull ;
30+
2931import java .awt .event .ActionEvent ;
3032import java .awt .event .FocusEvent ;
3133import java .awt .event .FocusListener ;
@@ -117,7 +119,7 @@ public class NewCronjobDialog extends AbstractDialog {
117119 * @param project Project
118120 * @param directory Directory
119121 */
120- public NewCronjobDialog (final Project project , final PsiDirectory directory ) {
122+ public NewCronjobDialog (final @ NotNull Project project , final @ NotNull PsiDirectory directory ) {
121123 super ();
122124 this .project = project ;
123125 this .moduleName = GetModuleNameByDirectoryUtil .execute (directory , project );
@@ -246,11 +248,6 @@ public String getCronjobScheduleConfigPath() {
246248 return this .configPathField .getText ().trim ();
247249 }
248250
249- @ Override
250- protected void onCancel () {
251- dispose ();
252- }
253-
254251 private void createUIComponents () {
255252 final List <String > cronGroups = CronGroupIndex .getInstance (project ).getGroups ();
256253
You can’t perform that action at this time.
0 commit comments