Skip to content

Commit 79a0572

Browse files
committed
1195: Changed Magento icons to GraphQL icons for GraphQL related actions
1 parent 02f8189 commit 79a0572

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

resources/icons/graphql.svg

Lines changed: 11 additions & 0 deletions
Loading

src/com/magento/idea/magento2plugin/MagentoIcons.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ public class MagentoIcons {
1717
IconLoader.getIcon("/icons/pluginIcon16x16.svg", MagentoIcons.class);
1818
public static final Icon PLUGIN_ICON_MEDIUM =
1919
IconLoader.getIcon("/icons/pluginIcon64x64.svg", MagentoIcons.class);
20+
public static final Icon GRAPHQL = IconLoader.getIcon("/icons/graphql.svg", MagentoIcons.class);
2021
}

src/com/magento/idea/magento2plugin/actions/context/AbstractContextAction.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.magento.idea.magento2plugin.magento.packages.Package;
2525
import com.magento.idea.magento2plugin.project.Settings;
2626
import com.magento.idea.magento2plugin.util.magento.GetMagentoModuleUtil;
27+
import javax.swing.Icon;
2728
import org.jetbrains.annotations.NotNull;
2829
import org.jetbrains.annotations.Nullable;
2930

@@ -51,6 +52,24 @@ public AbstractContextAction(
5152
this.moduleFile = moduleFile;
5253
}
5354

55+
/**
56+
* Abstract context action constructor.
57+
*
58+
* @param title String
59+
* @param description String
60+
* @param moduleFile ModuleFileInterface
61+
* @param icon Icon
62+
*/
63+
public AbstractContextAction(
64+
final @NotNull String title,
65+
final @NotNull String description,
66+
final @NotNull ModuleFileInterface moduleFile,
67+
final @Nullable Icon icon
68+
) {
69+
super(title, description, icon);
70+
this.moduleFile = moduleFile;
71+
}
72+
5473
@Override
5574
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
5675
public void update(final @NotNull AnActionEvent event) {

src/com/magento/idea/magento2plugin/actions/context/xml/NewGraphQLSchemaAction.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.intellij.ide.fileTemplates.actions.AttributesDefaults;
99
import com.intellij.psi.PsiDirectory;
1010
import com.intellij.psi.PsiFile;
11+
import com.magento.idea.magento2plugin.MagentoIcons;
1112
import com.magento.idea.magento2plugin.actions.context.AbstractContextAction;
1213
import com.magento.idea.magento2plugin.magento.files.SchemaGraphQLsFile;
1314
import com.magento.idea.magento2plugin.magento.packages.ComponentType;
@@ -25,7 +26,12 @@ public class NewGraphQLSchemaAction extends AbstractContextAction {
2526
* New schema.graphqls file action constructor.
2627
*/
2728
public NewGraphQLSchemaAction() {
28-
super(ACTION_NAME, ACTION_DESCRIPTION, SchemaGraphQLsFile.getInstance());
29+
super(
30+
ACTION_NAME,
31+
ACTION_DESCRIPTION,
32+
SchemaGraphQLsFile.getInstance(),
33+
MagentoIcons.GRAPHQL
34+
);
2935
}
3036

3137
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class NewGraphQlResolverAction extends AnAction {
2323
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 GraphQL Resolver";
2424

2525
public NewGraphQlResolverAction() {
26-
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.MODULE);
26+
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.GRAPHQL);
2727
}
2828

2929
@Override

0 commit comments

Comments
 (0)