/*******************************************************************************
* Copyright (c) 2011, 2012, 2013 Red Hat, Inc.
* All rights reserved.
* This program is 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:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
import org.eclipse.bpmn2.EventBasedGateway;
import org.eclipse.bpmn2.ExclusiveGateway;
import org.eclipse.bpmn2.InclusiveGateway;
import org.eclipse.bpmn2.ParallelGateway;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
import org.eclipse.bpmn2.modeler.ui.property.gateways.GatewayPropertySection;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
public class JbpmGatewayPropertySection extends GatewayPropertySection {
/* (non-Javadoc)
* @see org.eclipse.bpmn2.modeler.ui.property.AbstractBpmn2PropertySection#createSectionRoot()
*/
@Override
protected AbstractDetailComposite createSectionRoot() {
return new JbpmGatewayDetailComposite(this);
}
@Override
public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
return new JbpmGatewayDetailComposite(parent,style);
}
@Override
public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
if (super.appliesTo(part, selection)) {
EObject be = getBusinessObjectForSelection(selection);
return be instanceof ExclusiveGateway ||
be instanceof InclusiveGateway ||
be instanceof ParallelGateway ||
be instanceof EventBasedGateway;
}
return false;
}
}