Commit f990ab39 authored by Chen Wenwen's avatar Chen Wenwen
Browse files

a little bit change for branch

refs 951
parent bde782cd
......@@ -19,6 +19,8 @@ package org.fortiss.af3.mira.ui.editor;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.checkAndPickFirstSafe;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.selectAll;
import static org.eclipse.core.databinding.property.Properties.observeEach;
import static org.eclipse.emf.databinding.EMFProperties.values;
import static org.fortiss.af3.mira.model.usecase.UsecasePackage.Literals.SCENARIO_STEP__ACTION;
import static org.fortiss.af3.mira.model.usecase.UsecasePackage.Literals.SCENARIO_STEP__ACTION_TYPE;
import static org.fortiss.af3.mira.model.usecase.UsecasePackage.Literals.SCENARIO_STEP__ACTOR;
......@@ -30,7 +32,6 @@ import static org.fortiss.tooling.base.utils.BaseModelElementUtils.getIndex;
import static org.fortiss.tooling.kernel.model.FortissToolingKernelPackage.Literals.INAMED_ELEMENT__NAME;
import org.eclipse.core.databinding.observable.map.IObservableMap;
import org.eclipse.core.databinding.property.Properties;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.emf.databinding.EMFProperties;
import org.eclipse.emf.databinding.FeaturePath;
......@@ -70,7 +71,7 @@ import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: CC67551475A9F7B4E0D26D7BBA5CBE26
* @ConQAT.Rating YELLOW Hash: F0910E55C781B421BD2385027AEA6D47
*/
public class ScenarioEditor extends FormsEditorBase<Scenario> {
......@@ -173,21 +174,26 @@ public class ScenarioEditor extends FormsEditorBase<Scenario> {
// observer Branch->action and Branch->Parent->Name
IEMFValueProperty[] propertiesForBranch =
EMFProperties.values(FeaturePath.fromList(SCENARIO_STEP__BRANCH,
SCENARIO_STEP__ACTION), FeaturePath.fromList(SCENARIO_STEP__BRANCH,
IHIERARCHIC_ELEMENT__CONTAINER, INAMED_ELEMENT__NAME));
values(FeaturePath.fromList(SCENARIO_STEP__BRANCH, SCENARIO_STEP__ACTION),
FeaturePath.fromList(SCENARIO_STEP__BRANCH, IHIERARCHIC_ELEMENT__CONTAINER,
INAMED_ELEMENT__NAME));
IObservableMap[] mapForBranch =
Properties.observeEach(content.getKnownElements(), propertiesForBranch);
observeEach(content.getKnownElements(), propertiesForBranch);
columnBranch.setLabelProvider(new ObservableMapCellLabelProvider(mapForBranch) {
/** {@inheritDoc} */
@Override
public void update(ViewerCell cell) {
ScenarioStep step = (ScenarioStep)cell.getElement();
if(step.getBranch() != null) {
cell.setText(step.getBranch().getScenario().getName() + " - Step " +
BaseModelElementUtils.getIndex(step.getBranch()) + "(" +
step.getBranch().getAction() + ")");
System.out.println(step.getBranch().getScenario().getName() + " - Step " +
BaseModelElementUtils.getIndex(step.getBranch()) + "(" +
step.getBranch().getAction() + ")");
}
}
});
columnBranch.setEditingSupport(new ScenarioStepBranchEditingSupport(columnBranch
......
......@@ -41,7 +41,7 @@ import org.fortiss.tooling.kernel.service.ICommandStackService;
* @author uden
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 1F6B3401972338809DB7C7E74E357EF0
* @ConQAT.Rating YELLOW Hash: 7C23BD197B2AE37FEA6BEB68E205CE85
*/
public final class ScenarioStepBranchEditingSupport extends EditingSupport {
......@@ -97,7 +97,7 @@ public final class ScenarioStepBranchEditingSupport extends EditingSupport {
public String getText(Object element) {
ScenarioStep step = (ScenarioStep)element;
return step.getScenario().getName() + " - Step " +
BaseModelElementUtils.getIndex(step) + "(" + step.getAction() + ")";
(BaseModelElementUtils.getIndex(step) + 1) + "(" + step.getAction() + ")";
}
});
editor.setInput(steps);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment