package jetbrains.mps.lang.editor.diagram.runtime.jetpad.palette.ui;

/*Generated by MPS */

import jetbrains.mps.lang.editor.diagram.runtime.jetpad.palette.openapi.PaletteToggleAction;
import com.intellij.openapi.actionSystem.AnActionEvent;

/*package*/ class PaletteToggleActionAdapter extends DiagramPaletteToggleAction {
  private PaletteToggleAction myAction;
  public PaletteToggleActionAdapter(PaletteToggleAction action, DiagramPalette palette) {
    super(palette, action);
    myAction = action;
  }


  @Override
  public void setSelected(AnActionEvent event, boolean isSelected) {
    super.setSelected(event, isSelected);
    if (isSelected) {
      myAction.onClick();
    }
  }

}
