Skip to content

Commit 519026b

Browse files
author
Vitaliy Boyko
committed
Static fixes, fixed observer reference
1 parent 36ea1c9 commit 519026b

File tree

12 files changed

+52
-45
lines changed

12 files changed

+52
-45
lines changed

src/com/magento/idea/magento2plugin/actions/generation/data/EntityDataMapperData.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77

88
import org.jetbrains.annotations.NotNull;
99

10+
@SuppressWarnings({"PMD.ExcessiveParameterList", "PMD.TooManyFields"})
1011
public class EntityDataMapperData {
1112

1213
private final String moduleName;
1314
private final String entityName;
1415
private final String modelName;
1516
private final String dtoName;
1617
private final String dtoInterfaceName;
17-
private final boolean isDtoWithInterface;
18+
private final boolean dtoWithInterface;
1819

1920
/**
2021
* Magento entity data mapper data constructor.
@@ -39,7 +40,7 @@ public EntityDataMapperData(
3940
this.modelName = modelName;
4041
this.dtoName = dtoName;
4142
this.dtoInterfaceName = dtoInterfaceName;
42-
this.isDtoWithInterface = isDtoWithInterface;
43+
this.dtoWithInterface = isDtoWithInterface;
4344
}
4445

4546
/**
@@ -93,6 +94,6 @@ public String getDtoInterfaceName() {
9394
* @return boolean
9495
*/
9596
public boolean isDtoWithInterface() {
96-
return isDtoWithInterface;
97+
return dtoWithInterface;
9798
}
9899
}

src/com/magento/idea/magento2plugin/actions/generation/data/SaveEntityCommandData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SaveEntityCommandData {
1515
private final String resourceModelName;
1616
private final String dtoName;
1717
private final String dtoInterfaceName;
18-
private final boolean isDtoWithInterface;
18+
private final boolean dtoWithInterface;
1919

2020
/**
2121
* Save Command DTO Constructor.
@@ -43,7 +43,7 @@ public SaveEntityCommandData(
4343
this.resourceModelName = resourceModelName;
4444
this.dtoName = dtoName;
4545
this.dtoInterfaceName = dtoInterfaceName;
46-
this.isDtoWithInterface = isDtoWithInterface;
46+
this.dtoWithInterface = isDtoWithInterface;
4747
}
4848

4949
/**
@@ -106,6 +106,6 @@ public String getDtoInterfaceName() {
106106
* @return boolean
107107
*/
108108
public boolean isDtoWithInterface() {
109-
return isDtoWithInterface;
109+
return dtoWithInterface;
110110
}
111111
}

src/com/magento/idea/magento2plugin/actions/generation/data/SaveEntityControllerFileData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SaveEntityControllerFileData {
1515
private final String entityId;
1616
private final String dtoName;
1717
private final String dtoInterfaceName;
18-
private final boolean isDtoWithInterface;
18+
private final boolean dtoWithInterface;
1919

2020
/**
2121
* Controller save file constructor.
@@ -43,7 +43,7 @@ public SaveEntityControllerFileData(
4343
this.entityId = entityId;
4444
this.dtoName = dtoName;
4545
this.dtoInterfaceName = dtoInterfaceName;
46-
this.isDtoWithInterface = isDtoWithInterface;
46+
this.dtoWithInterface = isDtoWithInterface;
4747
}
4848

4949
/**
@@ -106,6 +106,6 @@ public String getDtoInterfaceName() {
106106
* @return boolean
107107
*/
108108
public boolean isDtoWithInterface() {
109-
return isDtoWithInterface;
109+
return dtoWithInterface;
110110
}
111111
}

src/com/magento/idea/magento2plugin/actions/generation/data/UiComponentGridData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.List;
1010
import java.util.Map;
1111

12+
@SuppressWarnings({"PMD.ExcessiveParameterList"})
1213
public class UiComponentGridData {
1314

1415
private final String moduleName;

src/com/magento/idea/magento2plugin/actions/generation/data/converter/newentitydialog/NewEntityLayoutDtoConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class NewEntityLayoutDtoConverter extends NewEntityLayoutData
2222
*/
2323
public NewEntityLayoutDtoConverter(
2424
final @NotNull EntityCreatorContextData generationContextData,
25-
final @NotNull NewEntityDialogData newEntityDialogData
25+
final @NotNull NewEntityDialogData newEntityDialogData //NOPMD
2626
) {
2727
super(
2828
generationContextData.getModuleName(),

src/com/magento/idea/magento2plugin/actions/generation/data/dialog/NewEntityDialogData.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ public class NewEntityDialogData implements DialogData {
1515
private final String idFieldName;
1616
private final String tableEngine;
1717
private final String tableResource;
18-
private final boolean hasAdminUiComponents;
19-
private final boolean hasDtoInterface;
18+
private final boolean adminUiComponents;
19+
private final boolean dtoInterface;
2020

2121
// Admin UI Components tab data.
2222
private final String route;
2323
private final String formLabel;
2424
private final String formName;
2525
private final String gridName;
26-
private final boolean hasToolbar;
27-
private final boolean hasToolbarBookmarks;
28-
private final boolean hasToolbarColumnsControl;
29-
private final boolean hasToolbarListingFilters;
30-
private final boolean hasToolbarListingPaging;
31-
private final boolean hasToolbarFullTextSearch;
26+
private final boolean toolbar;
27+
private final boolean toolbarBookmarks;
28+
private final boolean toolbarColumnsControl;
29+
private final boolean toolbarListingFilters;
30+
private final boolean toolbarListingPaging;
31+
private final boolean toolbarFullTextSearch;
3232

3333
// Acl tab data.
3434
private final String parentAclId;
@@ -105,18 +105,18 @@ public NewEntityDialogData(
105105
this.idFieldName = idFieldName;
106106
this.tableEngine = tableEngine;
107107
this.tableResource = tableResource;
108-
this.hasAdminUiComponents = hasAdminUiComponents;
109-
this.hasDtoInterface = hasDtoInterface;
108+
this.adminUiComponents = hasAdminUiComponents;
109+
this.dtoInterface = hasDtoInterface;
110110
this.route = route;
111111
this.formLabel = formLabel;
112112
this.formName = formName;
113113
this.gridName = gridName;
114-
this.hasToolbar = hasToolbar;
115-
this.hasToolbarBookmarks = hasToolbarBookmarks;
116-
this.hasToolbarColumnsControl = hasToolbarColumnsControl;
117-
this.hasToolbarListingFilters = hasToolbarListingFilters;
118-
this.hasToolbarListingPaging = hasToolbarListingPaging;
119-
this.hasToolbarFullTextSearch = hasToolbarFullTextSearch;
114+
this.toolbar = hasToolbar;
115+
this.toolbarBookmarks = hasToolbarBookmarks;
116+
this.toolbarColumnsControl = hasToolbarColumnsControl;
117+
this.toolbarListingFilters = hasToolbarListingFilters;
118+
this.toolbarListingPaging = hasToolbarListingPaging;
119+
this.toolbarFullTextSearch = hasToolbarFullTextSearch;
120120
this.parentAclId = parentAclId;
121121
this.aclId = aclId;
122122
this.aclTitle = aclTitle;
@@ -178,7 +178,7 @@ public String getTableResource() {
178178
* @return boolean
179179
*/
180180
public boolean hasAdminUiComponents() {
181-
return hasAdminUiComponents;
181+
return adminUiComponents;
182182
}
183183

184184
/**
@@ -187,7 +187,7 @@ public boolean hasAdminUiComponents() {
187187
* @return boolean
188188
*/
189189
public boolean hasDtoInterface() {
190-
return hasDtoInterface;
190+
return dtoInterface;
191191
}
192192

193193
/**
@@ -232,7 +232,7 @@ public String getGridName() {
232232
* @return boolean
233233
*/
234234
public boolean hasToolbar() {
235-
return hasToolbar;
235+
return toolbar;
236236
}
237237

238238
/**
@@ -241,7 +241,7 @@ public boolean hasToolbar() {
241241
* @return boolean
242242
*/
243243
public boolean hasToolbarBookmarks() {
244-
return hasToolbarBookmarks;
244+
return toolbarBookmarks;
245245
}
246246

247247
/**
@@ -250,7 +250,7 @@ public boolean hasToolbarBookmarks() {
250250
* @return boolean
251251
*/
252252
public boolean hasToolbarColumnsControl() {
253-
return hasToolbarColumnsControl;
253+
return toolbarColumnsControl;
254254
}
255255

256256
/**
@@ -259,7 +259,7 @@ public boolean hasToolbarColumnsControl() {
259259
* @return boolean
260260
*/
261261
public boolean hasToolbarListingFilters() {
262-
return hasToolbarListingFilters;
262+
return toolbarListingFilters;
263263
}
264264

265265
/**
@@ -268,7 +268,7 @@ public boolean hasToolbarListingFilters() {
268268
* @return boolean
269269
*/
270270
public boolean hasToolbarListingPaging() {
271-
return hasToolbarListingPaging;
271+
return toolbarListingPaging;
272272
}
273273

274274
/**
@@ -277,7 +277,7 @@ public boolean hasToolbarListingPaging() {
277277
* @return boolean
278278
*/
279279
public boolean hasToolbarFullTextSearch() {
280-
return hasToolbarFullTextSearch;
280+
return toolbarFullTextSearch;
281281
}
282282

283283
/**

src/com/magento/idea/magento2plugin/actions/generation/dialog/util/ProcessWorker.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static final class InProgressFlag {
6969
/**
7070
* Is action finished flag.
7171
*/
72-
private boolean isFinished;
72+
private boolean finished;
7373

7474
/**
7575
* In progress flag constructor.
@@ -78,7 +78,7 @@ public static final class InProgressFlag {
7878
*/
7979
public InProgressFlag(final boolean inProgress) {
8080
this.inProgress = inProgress;
81-
isFinished = false;
81+
finished = false;
8282
}
8383

8484
/**
@@ -103,16 +103,16 @@ public void setInProgress(final boolean inProgress) {
103103
* Get is progress finished flag value.
104104
*/
105105
public boolean isFinished() {
106-
return isFinished;
106+
return finished;
107107
}
108108

109109
/**
110110
* Set is progress finished flag value.
111111
*
112112
* @param finished boolean
113113
*/
114-
public void setFinished(boolean finished) {
115-
isFinished = finished;
114+
public void setFinished(final boolean finished) {
115+
this.finished = finished;
116116
}
117117
}
118118
}

src/com/magento/idea/magento2plugin/actions/generation/generator/UiComponentGridXmlGenerator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import com.magento.idea.magento2plugin.actions.generation.generator.util.DirectoryGenerator;
1515
import com.magento.idea.magento2plugin.actions.generation.generator.util.FileFromTemplateGenerator;
1616
import com.magento.idea.magento2plugin.actions.generation.generator.util.GetCodeTemplateUtil;
17-
import com.magento.idea.magento2plugin.actions.generation.generator.util.NamespaceBuilder;
1817
import com.magento.idea.magento2plugin.actions.generation.generator.util.PhpClassTypesBuilder;
1918
import com.magento.idea.magento2plugin.indexes.ModuleIndex;
2019
import com.magento.idea.magento2plugin.magento.files.GridActionColumnFile;

src/com/magento/idea/magento2plugin/inspections/xml/ObserverDeclarationInspection.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ public void visitFile(final PsiFile file) {
135135
);
136136
}
137137

138+
if (observerDisabledAttribute != null
139+
&& observerDisabledAttribute.getValue() != null
140+
&& observerDisabledAttribute.getValue().equals("true")
141+
) {
142+
continue;
143+
}
144+
138145
for (final HashMap<String, String> moduleEntry:
139146
modulesWithSameObserverName) {
140147
final Map.Entry<String, String> module = moduleEntry

src/com/magento/idea/magento2plugin/magento/files/AbstractPhpFile.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ public String getClassName() {
9696
*
9797
* @return String
9898
*/
99-
public String getHumanReadableName() {
100-
return null;
101-
}
99+
public abstract String getHumanReadableName();
102100

103101
@Override
104102
public String getFileName() {

0 commit comments

Comments
 (0)