| /** |
| * 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 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * |
| * This copyright notice shows up in the generated Java code |
| */ |
| package org.eclipse.osbp.xtext.perspective.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.chart.Chart; |
| import org.eclipse.osbp.xtext.dialogdsl.Dialog; |
| import org.eclipse.osbp.xtext.organizationdsl.Organization; |
| import org.eclipse.osbp.xtext.perspective.Perspective; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveBPMN; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveChart; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveDialog; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveGrid; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveModel; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveOrganization; |
| import org.eclipse.osbp.xtext.perspective.PerspectivePackage; |
| import org.eclipse.osbp.xtext.perspective.PerspectivePart; |
| import org.eclipse.osbp.xtext.perspective.PerspectivePartStack; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveReport; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveSashContainer; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveSelection; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveTable; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveTopology; |
| import org.eclipse.osbp.xtext.reportdsl.Report; |
| import org.eclipse.osbp.xtext.table.Table; |
| import org.eclipse.osbp.xtext.topologydsl.Topology; |
| |
| /** |
| * Provides labels for a EObjects. |
| * |
| * see http://www.eclipse.org/Xtext/documentation.html#labelProvider |
| */ |
| @SuppressWarnings("all") |
| public class PerspectiveDslLabelProvider extends BasicDSLLabelProvider { |
| @Inject |
| public PerspectiveDslLabelProvider(final AdapterFactoryLabelProvider delegate) { |
| super(delegate); |
| } |
| |
| public Object text(final Object o) { |
| Object _switchResult = null; |
| boolean _matched = false; |
| if (!_matched) { |
| if (o instanceof PerspectivePackage) { |
| _matched=true; |
| String _name = ((PerspectivePackage)o).getName(); |
| _switchResult = this.generateText(o, "package", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof Perspective) { |
| _matched=true; |
| String _name = ((Perspective)o).getName(); |
| _switchResult = this.generateText(o, "perspective", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveSashContainer) { |
| _matched=true; |
| String _elementId = ((PerspectiveSashContainer)o).getElementId(); |
| _switchResult = this.generateText(o, "sashContainer", _elementId); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectivePartStack) { |
| _matched=true; |
| String _elementId = ((PerspectivePartStack)o).getElementId(); |
| _switchResult = this.generateText(o, "partStack", _elementId); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectivePart) { |
| _matched=true; |
| String _elementId = ((PerspectivePart)o).getElementId(); |
| _switchResult = this.generateText(o, "part", _elementId); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveSelection) { |
| _matched=true; |
| Table _ref = ((PerspectiveSelection)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "select", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveTable) { |
| _matched=true; |
| Table _ref = ((PerspectiveTable)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "table", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveGrid) { |
| _matched=true; |
| Table _ref = ((PerspectiveGrid)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "grid", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveChart) { |
| _matched=true; |
| Chart _ref = ((PerspectiveChart)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "chart", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveReport) { |
| _matched=true; |
| Report _ref = ((PerspectiveReport)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "report", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveOrganization) { |
| _matched=true; |
| Organization _ref = ((PerspectiveOrganization)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "organigram", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveTopology) { |
| _matched=true; |
| Topology _ref = ((PerspectiveTopology)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "topology", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveDialog) { |
| _matched=true; |
| Dialog _ref = ((PerspectiveDialog)o).getRef(); |
| String _name = _ref.getName(); |
| _switchResult = this.generateText(o, "dialog", _name); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveBPMN) { |
| _matched=true; |
| _switchResult = this.generateText(o, "bpmn"); |
| } |
| } |
| 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 PerspectiveModel) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("model.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectivePackage) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("package.gif", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof Perspective) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_perspective.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveSelection) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_select.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveTable) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_table.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveGrid) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("CxGridSourceInput.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveChart) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_chart.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveReport) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_report.gif", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveOrganization) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_organigram.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveTopology) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_topology.png", _class); |
| } |
| } |
| if (!_matched) { |
| if (o instanceof PerspectiveDialog) { |
| _matched=true; |
| Class<? extends PerspectiveDslLabelProvider> _class = this.getClass(); |
| _switchResult = this.getInternalImage("dsl_dialog.gif", _class); |
| } |
| } |
| if (!_matched) { |
| _switchResult = super.image(o); |
| } |
| return _switchResult; |
| } |
| } |