Package org.eclipse.bpmn2.modeler.ui.features.participant

Source Code of org.eclipse.bpmn2.modeler.ui.features.participant.ParticipantFeatureContainer

/*******************************************************************************
* Copyright (c) 2011 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.ui.features.participant;

import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.modeler.core.features.BaseElementFeatureContainer;
import org.eclipse.bpmn2.modeler.core.features.MultiUpdateFeature;
import org.eclipse.bpmn2.modeler.core.features.participant.AddParticipantFeature;
import org.eclipse.bpmn2.modeler.core.features.participant.ParticipantDirectEditFeature;
import org.eclipse.bpmn2.modeler.core.features.participant.ParticipantLayoutFeature;
import org.eclipse.bpmn2.modeler.core.features.participant.ParticipantMultiplicityUpdateFeature;
import org.eclipse.bpmn2.modeler.core.features.participant.ParticipantResizeFeature;
import org.eclipse.bpmn2.modeler.core.features.participant.UpdateParticipantFeature;
import org.eclipse.bpmn2.modeler.ui.features.choreography.ChoreographyUpdateMessageLinkFeature;
import org.eclipse.graphiti.features.IAddFeature;
import org.eclipse.graphiti.features.ICreateFeature;
import org.eclipse.graphiti.features.IDeleteFeature;
import org.eclipse.graphiti.features.IDirectEditingFeature;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.ILayoutFeature;
import org.eclipse.graphiti.features.IMoveShapeFeature;
import org.eclipse.graphiti.features.IResizeShapeFeature;
import org.eclipse.graphiti.features.IUpdateFeature;

public class ParticipantFeatureContainer extends BaseElementFeatureContainer {

  @Override
  public boolean canApplyTo(Object o) {
    return super.canApplyTo(o) && o instanceof Participant;
  }

  @Override
  public ICreateFeature getCreateFeature(IFeatureProvider fp) {
    return new CreateParticipantFeature(fp);
  }

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddParticipantFeature(fp);
  }

  @Override
  public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
    MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
    multiUpdate.addUpdateFeature(new UpdateParticipantFeature(fp));
    multiUpdate.addUpdateFeature(new ParticipantMultiplicityUpdateFeature(fp));
    multiUpdate.addUpdateFeature(new ChoreographyUpdateMessageLinkFeature(fp));
    return multiUpdate;
  }

  @Override
  public IDirectEditingFeature getDirectEditingFeature(IFeatureProvider fp) {
    return new ParticipantDirectEditFeature(fp);
  }

  @Override
  public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
    return new ParticipantLayoutFeature(fp);
  }

  @Override
  public IMoveShapeFeature getMoveFeature(IFeatureProvider fp) {
    return new ParticipantMoveFeature(fp);
  }

  @Override
  public IResizeShapeFeature getResizeFeature(IFeatureProvider fp) {
    return new ParticipantResizeFeature(fp);
  }

  @Override
  public IDeleteFeature getDeleteFeature(IFeatureProvider fp) {
    return new ParticipantDeleteFeature(fp);
  }
}
TOP

Related Classes of org.eclipse.bpmn2.modeler.ui.features.participant.ParticipantFeatureContainer

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.