package jetbrains.mps.ide.tools.todo;

/*Generated by MPS */

import jetbrains.mps.plugins.tool.GeneratedTool;
import javax.swing.Icon;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindowAnchor;
import jetbrains.mps.project.MPSProject;
import java.awt.Container;
import javax.swing.JComponent;

public class TodoViewer_Tool extends GeneratedTool {
  private static final Icon ICON = AllIcons.Toolwindows.ToolWindowTodo;
  private TodoViewer myComponent;
  public TodoViewer_Tool(Project project) {
    super(project, "ToDo", null, ICON, ToolWindowAnchor.BOTTOM, false);
  }
  public void init(Project project) {
    super.init(project);
    TodoViewer_Tool.this.myComponent = new TodoViewer(project.getComponent(MPSProject.class), TodoViewer_Tool.this);
  }
  public void dispose() {
    Container container = TodoViewer_Tool.this.myComponent.getParent();
    if (container != null) {
      container.remove(TodoViewer_Tool.this.myComponent);
    }
    TodoViewer_Tool.this.myComponent.dispose();
    TodoViewer_Tool.this.myComponent = null;
    super.dispose();
  }
  @Override
  protected boolean isInitiallyAvailable() {
    return true;
  }
  public JComponent getComponent() {
    return TodoViewer_Tool.this.myComponent;
  }
}
