| /******************************************************************************* |
| * 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.addons.ros.ui.provider; |
| |
| import org.eclipse.apogy.addons.ros.ui.TFDisplay3DTool; |
| import org.eclipse.emf.common.notify.AdapterFactory; |
| |
| public class TFDisplay3DToolCustomItemProvider extends TFDisplay3DToolItemProvider { |
| public TFDisplay3DToolCustomItemProvider(AdapterFactory adapterFactory) { |
| super(adapterFactory); |
| } |
| |
| @Override |
| public String getText(Object object) { |
| TFDisplay3DTool tfDisplay3DTool = (TFDisplay3DTool) object; |
| |
| String label = null; |
| |
| if (tfDisplay3DTool.getName() != null && tfDisplay3DTool.getName().length() > 0) { |
| label = tfDisplay3DTool.getName(); |
| } else { |
| label = getString("_UI_TFDisplay3DTool_type"); |
| } |
| |
| // Adds Simple3DTool Text. |
| label += " ("; |
| String simpleToolText = getSimple3DToolText(tfDisplay3DTool); |
| if (simpleToolText.length() > 0) { |
| label += simpleToolText + ", "; |
| } |
| |
| label += "<" + tfDisplay3DTool.getTopicName() + ">)"; |
| |
| return label; |
| } |
| |
| } |