/*******************************************************************************
* Copyright (c) 2011, 2012 University of Mannheim: Chair for Software Engineering
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ralph Gerbig - initial API and implementation and initial documentation
*******************************************************************************/
package de.uni_mannheim.informatik.swt.models.plm.diagram.custom.popupbartools;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyValueRequest;
import org.eclipse.gmf.runtime.diagram.ui.tools.AbstractPopupBarTool;
import de.uni_mannheim.informatik.swt.models.plm.diagram.custom.commands.ToggleCommand;
public class TogglePopupBarTool extends AbstractPopupBarTool{
public TogglePopupBarTool(EditPart epHost, CreateRequest theRequest) {
super(epHost, theRequest);
}
@Override
protected Request createTargetRequest() {
ChangePropertyValueRequest req = new ChangePropertyValueRequest("toggle", "toggle");
return req;
}
@Override
protected Command getCommand() {
return new ToggleCommand((IGraphicalEditPart)getHost());
}
}