IDEADEV-40607: Artifact editing actions should be dumb​-​aware
[fedora-idea.git] / java / idea-ui / src / com / intellij / openapi / roots / ui / configuration / artifacts / actions / SortElementsToggleAction.java
blobe7303ea3971060dd372900af8fefa4785938d331
1 package com.intellij.openapi.roots.ui.configuration.artifacts.actions;
3 import com.intellij.openapi.actionSystem.AnActionEvent;
4 import com.intellij.openapi.actionSystem.ToggleAction;
5 import com.intellij.openapi.project.DumbAware;
6 import com.intellij.openapi.roots.ui.configuration.artifacts.LayoutTreeComponent;
7 import com.intellij.openapi.util.IconLoader;
9 /**
10 * @author nik
12 public class SortElementsToggleAction extends ToggleAction implements DumbAware {
13 private LayoutTreeComponent myLayoutTreeComponent;
15 public SortElementsToggleAction(final LayoutTreeComponent layoutTreeComponent) {
16 super("Sort", "Sort Elements by Names and Types", IconLoader.getIcon("/objectBrowser/sorted.png"));
17 myLayoutTreeComponent = layoutTreeComponent;
20 @Override
21 public boolean isSelected(AnActionEvent e) {
22 return myLayoutTreeComponent.isSortElements();
25 @Override
26 public void setSelected(AnActionEvent e, boolean state) {
27 myLayoutTreeComponent.setSortElements(state);