Skip to content

Commit a6f19bc

Browse files
868: Code refactoring
1 parent 0d85916 commit a6f19bc

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/com/magento/idea/magento2plugin/actions/generation/NewCronjobAction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import com.magento.idea.magento2plugin.actions.generation.dialog.NewCronjobDialog;
1818
import org.jetbrains.annotations.NotNull;
1919

20-
@SuppressWarnings({"PMD.FieldNamingConventions", "PMD.OnlyOneReturn"})
2120
public 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

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import com.magento.idea.magento2plugin.ui.FilteredComboBox;
2727
import com.magento.idea.magento2plugin.util.CamelCaseToSnakeCase;
2828
import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil;
29+
import org.jetbrains.annotations.NotNull;
30+
2931
import java.awt.event.ActionEvent;
3032
import java.awt.event.FocusEvent;
3133
import 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

0 commit comments

Comments
 (0)