blob: b40b92e122a976de8daf7d2a980ca2b07de117ec [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* 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:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*
* This copyright notice shows up in the generated Java code
*/
package org.eclipse.osbp.xtext.strategy.ui.labeling;
import com.google.inject.Inject;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.osbp.xtext.basic.ui.labeling.BasicDSLLabelProvider;
import org.eclipse.osbp.xtext.strategy.FocusingEnhancer;
import org.eclipse.osbp.xtext.strategy.FocusingStrategy;
import org.eclipse.osbp.xtext.strategy.LayoutingStrategy;
import org.eclipse.osbp.xtext.strategy.Strategy;
import org.eclipse.osbp.xtext.strategy.StrategyDefault;
import org.eclipse.osbp.xtext.strategy.StrategyModel;
import org.eclipse.osbp.xtext.strategy.StrategyPackage;
import org.eclipse.osbp.xtext.strategy.StrategyTarget;
/**
* Provides labels for a EObjects.
*
* see http://www.eclipse.org/Xtext/documentation.html#labelProvider
*/
@SuppressWarnings("all")
public class StrategyDSLLabelProvider extends BasicDSLLabelProvider {
@Inject
public StrategyDSLLabelProvider(final AdapterFactoryLabelProvider delegate) {
super(delegate);
}
@Override
public Object text(final Object o) {
Object _switchResult = null;
boolean _matched = false;
if (o instanceof StrategyPackage) {
_matched=true;
_switchResult = this.generateText(o, "package", ((StrategyPackage) o).getName());
}
if (!_matched) {
if (o instanceof Strategy) {
_matched=true;
_switchResult = this.generateText(o, "strategy model");
}
}
if (!_matched) {
if (o instanceof StrategyTarget) {
_matched=true;
_switchResult = this.generateText(o, "strategies");
}
}
if (!_matched) {
if (o instanceof LayoutingStrategy) {
_matched=true;
_switchResult = this.generateText(o, "layoutingStrategy", ((LayoutingStrategy) o).getName());
}
}
if (!_matched) {
if (o instanceof FocusingStrategy) {
_matched=true;
_switchResult = this.generateText(o, "focusingStrategy", ((FocusingStrategy) o).getName());
}
}
if (!_matched) {
if (o instanceof FocusingEnhancer) {
_matched=true;
_switchResult = this.generateText(o, "focusingEnhancer", ((FocusingEnhancer) o).getName());
}
}
if (!_matched) {
if (o instanceof StrategyDefault) {
_matched=true;
_switchResult = this.generateText(o, "default");
}
}
if (!_matched) {
_switchResult = super.text(o);
}
return _switchResult;
}
@Override
public Object image(final Object o) {
Object _switchResult = null;
boolean _matched = false;
if (o instanceof StrategyModel) {
_matched=true;
_switchResult = this.getInternalImage("model.png", this.getClass());
}
if (!_matched) {
if (o instanceof StrategyPackage) {
_matched=true;
_switchResult = this.getInternalImage("package.gif", this.getClass());
}
}
if (!_matched) {
if (o instanceof Strategy) {
_matched=true;
_switchResult = this.getInternalImage("dsl_strategy.png", this.getClass());
}
}
if (!_matched) {
if (o instanceof StrategyTarget) {
_matched=true;
_switchResult = this.getInternalImage("strategies.png", this.getClass());
}
}
if (!_matched) {
if (o instanceof LayoutingStrategy) {
_matched=true;
_switchResult = this.getInternalImage("layout.png", this.getClass());
}
}
if (!_matched) {
if (o instanceof FocusingStrategy) {
_matched=true;
_switchResult = this.getInternalImage("focus.png", this.getClass());
}
}
if (!_matched) {
if (o instanceof FocusingEnhancer) {
_matched=true;
_switchResult = this.getInternalImage("focus-enhance.png", this.getClass());
}
}
if (!_matched) {
if (o instanceof StrategyDefault) {
_matched=true;
_switchResult = this.getInternalImage("strategy-default.png", this.getClass());
}
}
if (!_matched) {
_switchResult = super.image(o);
}
return _switchResult;
}
}