Package tool.content.actions

Source Code of tool.content.actions.SupplierPlanActionProvider

package tool.content.actions;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.ICommonActionConstants;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
import org.eclipse.ui.navigator.ICommonMenuConstants;
import org.eclipse.ui.navigator.ICommonViewerSite;
import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;

public class SupplierPlanActionProvider extends CommonActionProvider {
  OpenSupplierPlanAction openAction;
  public SupplierPlanActionProvider() {
    super();
  }
  @Override
  public void init(ICommonActionExtensionSite aSite) {
    ICommonViewerSite viewSite = aSite.getViewSite();
    if (viewSite instanceof ICommonViewerWorkbenchSite){
      ICommonViewerWorkbenchSite workbenchSite  = (ICommonViewerWorkbenchSite) viewSite;
      openAction = new OpenSupplierPlanAction(workbenchSite.getPage(),
                        workbenchSite.getSelectionProvider());
    }
  }
 
  @Override
  public void fillActionBars(IActionBars actionBars) {
    if (openAction.isEnabled())
      actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openAction);
  }
 
  @Override
  public void fillContextMenu(IMenuManager menu) {
    if (openAction.isEnabled())
      menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openAction);
  }
}
TOP

Related Classes of tool.content.actions.SupplierPlanActionProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.