blob: 274320c18fd569976bf7a1c5f1ffe3746d07b0dc [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 - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.addons.provider;
import org.eclipse.apogy.addons.Simple3DTool;
import org.eclipse.emf.common.notify.AdapterFactory;
public class Simple3DToolCustomItemProvider extends Simple3DToolItemProvider {
public Simple3DToolCustomItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
@Override
public String getText(Object object) {
Simple3DTool simple3DTool = (Simple3DTool) object;
String label = getString("_UI_Simple3DTool_type");
label += " (" + getSimple3DToolText(simple3DTool) + ")";
return label;
}
protected String getSimple3DToolText(Simple3DTool simple3DTool) {
String text = new String();
if (simple3DTool.isActive()) {
text += "active";
}
if (simple3DTool.isVisible()) {
if (text.length() > 0) {
text += ", ";
}
text += "visible";
}
return text;
}
}