/** | |
* Copyright (c)2020 CEA LIST, Committer Name, and others. | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License 2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/legal/epl-2.0/ | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* CEA LIST - Initial API and implementation | |
* Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr | |
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr | |
* | |
*/ | |
package org.eclipse.papyrus.pdp4eng.designer.ui.internal; | |
import org.eclipse.jface.viewers.ILabelProviderListener; | |
import org.eclipse.jface.viewers.ITableLabelProvider; | |
import org.eclipse.papyrus.pdp4eng.designer.engine.api.IStrategy; | |
import org.eclipse.swt.graphics.Image; | |
/** | |
* Req004.002: the system shall provide for Model User to show name and goal of strategy | |
* | |
*/ | |
public class StrategyLabelProvider implements ITableLabelProvider { | |
/** | |
* @{inheritDoc | |
*/ | |
public String getColumnText(Object element, int columnIndex) { | |
switch(columnIndex) { | |
case 0: | |
return ((IStrategy)element).getName(); | |
case 1: | |
return ((IStrategy)element).getGoal(); | |
default: | |
return ""; | |
} | |
} | |
/** | |
* @{inheritDoc | |
*/ | |
public void addListener(ILabelProviderListener listener) { | |
} | |
/** | |
* @{inheritDoc | |
*/ | |
public void dispose() { | |
} | |
/** | |
* @{inheritDoc | |
*/ | |
public boolean isLabelProperty(Object element, String property) { | |
return false; | |
} | |
/** | |
* @{inheritDoc | |
*/ | |
public void removeListener(ILabelProviderListener listener) { | |
} | |
public String getText(Object element) { | |
return ((IStrategy)element).getName(); | |
} | |
public Image getColumnImage(Object element, int columnIndex) { | |
return null; | |
} | |
} |