easy-18in/src/main/java/de/marhali/easyi18n/action/treeview/ExpandTreeViewAction.java
2021-07-19 15:00:59 +02:00

29 lines
816 B
Java

package de.marhali.easyi18n.action.treeview;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import org.jetbrains.annotations.NotNull;
import java.util.ResourceBundle;
/**
* Action to expand the entire tree (open all nodes with children).
* @author marhali
*/
public class ExpandTreeViewAction extends AnAction {
private final Runnable expandRunnable;
public ExpandTreeViewAction(Runnable expandRunnable) {
super(ResourceBundle.getBundle("messages").getString("view.tree.expand"),
null, AllIcons.Actions.Expandall);
this.expandRunnable = expandRunnable;
}
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
expandRunnable.run();
}
}