| /** |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * ============================================================================ |
| * Initial contribution: |
| * Loetz GmbH & Co. KG |
| * |
| * generated by xtext |
| */ |
| package org.eclipse.osbp.xtext.dialogdsl.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.dialogdsl.Dialog; |
| import org.eclipse.osbp.xtext.dialogdsl.DialogModel; |
| |
| /** |
| * Provides labels for a EObjects. |
| * |
| * see http://www.eclipse.org/Xtext/documentation.html#labelProvider |
| */ |
| @SuppressWarnings("all") |
| public class DialogDslLabelProvider extends BasicDSLLabelProvider { |
| @Inject |
| public DialogDslLabelProvider(final AdapterFactoryLabelProvider delegate) { |
| super(delegate); |
| } |
| |
| public Object text(final Object o) { |
| Object _switchResult = null; |
| boolean _matched = false; |
| if (!_matched) { |
| if (o instanceof Dialog) { |
| _matched=true; |
| String _name = ((Dialog)o).getName(); |
| _switchResult = this.generateText(o, "dialog", _name); |
| } |
| } |
| if (!_matched) { |
| _switchResult = super.text(o); |
| } |
| return _switchResult; |
| } |
| |
| public Object image(final Object o) { |
| Object _switchResult = null; |
| boolean _matched = false; |
| if (!_matched) { |
| if (o instanceof DialogModel) { |
| _matched=true; |
| Class<? extends DialogDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("model.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof Dialog) { |
| _matched=true; |
| Class<? extends DialogDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_dialog.gif", _class); |
| } |
| } |
| if (!_matched) { |
| _switchResult = super.image(o); |
| } |
| return _switchResult; |
| } |
| } |