blob: f0a677413e70cdbb26fdd3ae3459f80f6fa9e209 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* 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:
* Pierre Allard,
* Regent L'Archeveque,
* Sebastien Gemme - initial API and implementation
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.common.topology.bindings.provider;
import org.eclipse.apogy.common.topology.bindings.RotationBinding;
import org.eclipse.emf.common.notify.AdapterFactory;
public class RotationBindingCustomItemProvider extends RotationBindingItemProvider {
public RotationBindingCustomItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
@Override
public String getText(Object object) {
RotationBinding rotationBinding = (RotationBinding) object;
String label = null;
if (rotationBinding.getName() != null && rotationBinding.getName().length() > 0) {
label = rotationBinding.getName();
} else {
label = getString("_UI_RotationBinding_type");
}
String info = null;
if (rotationBinding.getRotationAxis() != null) {
info = rotationBinding.getRotationAxis().getName();
}
if (info != null) {
label += " (" + info + ")";
}
return label;
}
}