/**
 * プロジェクト名 laxIde
 * クラス名 LetsAjaxContextMenuProvider.java
 * 作成日: 2007/05/31
 * 
 */
package jp.co.cybec.laxide;

import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.actions.GEFActionConstants;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.actions.ActionFactory;

public class LetsAjaxContextMenuProvider extends ContextMenuProvider {

	private ActionRegistry registry;

	public LetsAjaxContextMenuProvider(EditPartViewer viewer) {
		super(viewer);
	}

	@Override
	public void buildContextMenu(IMenuManager menu) {
		GEFActionConstants.addStandardActionGroups(menu);

		menu.appendToGroup(GEFActionConstants.GROUP_UNDO, registry
				.getAction(ActionFactory.UNDO.getId()));

		menu.appendToGroup(GEFActionConstants.GROUP_UNDO, registry
				.getAction(ActionFactory.REDO.getId()));

		menu.appendToGroup(GEFActionConstants.GROUP_EDIT, registry
				.getAction(ActionFactory.DELETE.getId()));
	}

	/**
	 * @param registry
	 *            registry を設定。
	 */
	public void setRegistry(ActionRegistry registry) {
		this.registry = registry;
	}

}
