X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.processeditor%2Fsrc%2Forg%2Fsimantics%2Fprocesseditor%2Factions%2FReversePipelineAction.java;fp=org.simantics.processeditor%2Fsrc%2Forg%2Fsimantics%2Fprocesseditor%2Factions%2FReversePipelineAction.java;h=0000000000000000000000000000000000000000;hb=6b6fcff5d6c326feef07ccf8401f97911778fffe;hp=37cd717d0310ff8a793481e4d868f99ba6ddc730;hpb=504c111db40d78f4913badddd126b283b5504dbb;p=simantics%2F3d.git diff --git a/org.simantics.processeditor/src/org/simantics/processeditor/actions/ReversePipelineAction.java b/org.simantics.processeditor/src/org/simantics/processeditor/actions/ReversePipelineAction.java deleted file mode 100644 index 37cd717d..00000000 --- a/org.simantics.processeditor/src/org/simantics/processeditor/actions/ReversePipelineAction.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.processeditor.actions; - -import java.util.List; - -import org.simantics.db.Graph; -import org.simantics.db.GraphRequestStatus; -import org.simantics.db.Resource; -import org.simantics.layer0.utils.EntityFactory; -import org.simantics.layer0.utils.IEntity; -import org.simantics.processeditor.ProcessResource; -import org.simantics.processeditor.common.PipingTools2; -import org.simantics.processeditor.stubs.PipelineComponent; -import org.simantics.proconf.g3d.actions.WriteAction; -import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase; - - - -public class ReversePipelineAction extends WriteAction { - - public ReversePipelineAction(ThreeDimensionalEditorBase parent) { - super(parent,false); - } - - @Override - public boolean usable(Graph graph, List resources) { - if (resources.size() != 1) - return false; - IEntity t = EntityFactory.create(graph, resources.get(0)); - return (t.isInstanceOf(ProcessResource.plant3Dresource.PipelineComponent)); - } - - @Override - public GraphRequestStatus doChanges(Graph graph) throws Exception { - Resource r = parent.getSelectionAdapter().getSelectedResources().get(0); - PipelineComponent comp = new PipelineComponent(graph, r); - PipingTools2.reversePipeRun(PipingTools2.getPipeRun(comp)); - - return GraphRequestStatus.transactionComplete(); - } - - - @Override - public void init() { - this.setText("Reverse pipeline"); - } - -}