| /** |
| * Copyright (c) 2018 Obeo. |
| * This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Obeo - initial API and implementation |
| * |
| */ |
| package org.eclipse.sirius.workflow.provider; |
| |
| import org.eclipse.emf.common.notify.AdapterFactory; |
| import org.eclipse.emf.edit.command.CommandParameter; |
| import org.eclipse.emf.edit.provider.StyledString; |
| |
| /** |
| * Subclass used to not have to modify the generated code. |
| * |
| * @author sbegaudeau |
| */ |
| public class SectionDescriptionItemProviderSpec extends SectionDescriptionItemProvider { |
| |
| /** |
| * The constructor. |
| * |
| * @param adapterFactory |
| * The adapter factory |
| */ |
| public SectionDescriptionItemProviderSpec(AdapterFactory adapterFactory) { |
| super(adapterFactory); |
| } |
| |
| @Override |
| public String getText(Object object) { |
| Object styledText = this.getStyledText(object); |
| if (styledText instanceof StyledString) { |
| return ((StyledString) styledText).getString(); |
| } |
| return super.getText(object); |
| } |
| |
| @Override |
| public Object getStyledText(Object object) { |
| return Utils.computeLabel(this, object, "_UI_SectionDescription_type"); //$NON-NLS-1$ |
| } |
| |
| @Override |
| protected CommandParameter createChildParameter(Object feature, Object child) { |
| Utils.addNoopNavigationOperations(child); |
| return super.createChildParameter(feature, child); |
| } |
| } |