blob: 0962b3af2e725ff1fc6d05e4d8d851aea45becf7 [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.examples.camera.provider;
import org.eclipse.apogy.examples.camera.CameraSimulated;
import org.eclipse.emf.common.notify.AdapterFactory;
public class CameraSimulatedCustomItemProvider extends CameraSimulatedItemProvider {
public CameraSimulatedCustomItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
@Override
public String getText(Object object) {
// Cast down to the simulated camera
CameraSimulated cameraSimulated = (CameraSimulated) object;
// Get the basic label
String label = getString("_UI_CameraSimulated_type");
// If there is a camera
if (cameraSimulated != null) {
// Add the appropriate values
label += " (Zoom: Current=" + cameraSimulated.getCurrentZoom() + " Commanded="
+ cameraSimulated.getCommandedZoom() + ")";
}
// Just return the label
return label;
}
}