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
;
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
;
21 public boolean isSelected(AnActionEvent e
) {
22 return myLayoutTreeComponent
.isSortElements();
26 public void setSelected(AnActionEvent e
, boolean state
) {
27 myLayoutTreeComponent
.setSortElements(state
);