blob: 753f5eabab5c6abedab6dd497b7d8117f5ce02b9 [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.core.programs.controllers.provider;
import java.util.Collection;
import org.eclipse.apogy.core.invocator.ApogyCoreInvocatorPackage;
import org.eclipse.apogy.core.programs.controllers.ApogyCoreProgramsControllersFactory;
import org.eclipse.apogy.core.programs.controllers.ControllersConfiguration;
import org.eclipse.emf.common.notify.AdapterFactory;
public class ControllersConfigurationCustomItemProvider extends ControllersConfigurationItemProvider {
public ControllersConfigurationCustomItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
@Override
public String getText(Object object) {
ControllersConfiguration config = (ControllersConfiguration) object;
String label = config.getName();
if (label == null || label.length() == 0) {
label = getString("_UI_ControllersConfiguration_type");
}
if (config.isStarted())
label += " (Started)";
return label;
}
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors
.add(createChildParameter(ApogyCoreInvocatorPackage.Literals.OPERATION_CALL_CONTAINER__OPERATION_CALLS,
ApogyCoreProgramsControllersFactory.eINSTANCE.createOperationCallControllerBinding()));
}
}