blob: 472f331def35205004b9640467f0d17961680d89 [file] [log] [blame]
/*
*
* Copyright (c) 2013, 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
*
*/
package org.eclipse.osbp.xtext.datamartdsl.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.datamartdsl.Addition
import org.eclipse.osbp.xtext.datamartdsl.ConditionalExpression
import org.eclipse.osbp.xtext.datamartdsl.Conjunction
import org.eclipse.osbp.xtext.datamartdsl.DatamartAttribute
import org.eclipse.osbp.xtext.datamartdsl.DatamartAttributeBase
import org.eclipse.osbp.xtext.datamartdsl.DatamartAxis
import org.eclipse.osbp.xtext.datamartdsl.DatamartColumn
import org.eclipse.osbp.xtext.datamartdsl.DatamartCondition
import org.eclipse.osbp.xtext.datamartdsl.DatamartCube
import org.eclipse.osbp.xtext.datamartdsl.DatamartDefineDerivedMeasure
import org.eclipse.osbp.xtext.datamartdsl.DatamartDefinition
import org.eclipse.osbp.xtext.datamartdsl.DatamartDerivedMeasure
import org.eclipse.osbp.xtext.datamartdsl.DatamartEntity
import org.eclipse.osbp.xtext.datamartdsl.DatamartHierarchy
import org.eclipse.osbp.xtext.datamartdsl.DatamartMeasure
import org.eclipse.osbp.xtext.datamartdsl.DatamartMember
import org.eclipse.osbp.xtext.datamartdsl.DatamartModel
import org.eclipse.osbp.xtext.datamartdsl.DatamartOrder
import org.eclipse.osbp.xtext.datamartdsl.DatamartOwner
import org.eclipse.osbp.xtext.datamartdsl.DatamartPackage
import org.eclipse.osbp.xtext.datamartdsl.DatamartReference
import org.eclipse.osbp.xtext.datamartdsl.DatamartRole
import org.eclipse.osbp.xtext.datamartdsl.DatamartSlicer
import org.eclipse.osbp.xtext.datamartdsl.DatamartTask
import org.eclipse.osbp.xtext.datamartdsl.DatamartTaskFilter
import org.eclipse.osbp.xtext.datamartdsl.Disjunction
import org.eclipse.osbp.xtext.datamartdsl.Division
import org.eclipse.osbp.xtext.datamartdsl.Expression
import org.eclipse.osbp.xtext.datamartdsl.Multiplication
import org.eclipse.osbp.xtext.datamartdsl.Subtraction
/**
* Provides labels for a EObjects.
*
* see http://www.eclipse.org/Xtext/documentation.html#labelProvider
*/
class DatamartDSLLabelProvider extends BasicDSLLabelProvider {
@Inject
new(AdapterFactoryLabelProvider delegate) {
super(delegate);
}
override text ( Object o ) {
switch (o) {
DatamartPackage : generateText( o, 'package' , o.name )
DatamartDefinition : generateText( o, 'definition' , o.name )
DatamartRole : generateText( o, 'role' , o.assignedRole.name )
DatamartTask : generateText( o, 'task' , o.taskQuery.literal )
DatamartColumn : generateText( o, 'column' , o.columnRef.literal )
DatamartTaskFilter : generateText( o, 'task filter' , o.filterRef.literal )
DatamartCube : generateText( o, 'cube' , o.cubeRef.name )
DatamartReference : generateText( o, 'reference' , o.ref.name )
DatamartEntity : generateText( o, 'entity' , o.entityRef.name )
DatamartOwner : generateText( o, 'owner' , o.joinRef.ref.name )
DatamartMember : generateText( o, 'member' , o.joinRef.ref.name )
DatamartAttributeBase : generateText( o, 'property' , o.attributeRef.name )
DatamartCondition : generateText( o, 'condition' )
DatamartOrder : generateText( o, 'order' )
DatamartDerivedMeasure : generateText( o, 'derived measure' , o.derivedRef.name )
DatamartDefineDerivedMeasure : generateText( o, 'defined derived measure', o.name )
DatamartSlicer : generateText( o, 'slicer' )
DatamartAxis : generateText( o, 'axis' )
DatamartMeasure : generateText( o, 'measure' , o.measureRef.name )
DatamartHierarchy : generateText( o, 'hierarchy' , o.hierarchyRef.name )
Addition : generateText( o, 'addition' )
Subtraction : generateText( o, 'subtraction' )
Multiplication : generateText( o, 'multiplication' )
Division : generateText( o, 'division' )
Conjunction : generateText( o, 'conjunction' )
Disjunction : generateText( o, 'disjunction' )
ConditionalExpression : generateText( o, 'conditional expression' )
Expression : generateText( o, 'expression' )
default : super.text( o )
}
}
override image ( Object o ) {
switch (o) {
DatamartModel : getInternalImage( 'model.png' , class )
DatamartPackage : getInternalImage( 'package.gif' , class )
DatamartDefinition : getInternalImage( 'definition.png' , class )
DatamartRole : getInternalImage( 'role.png' , class )
DatamartTask : getInternalImage( 'task.png' , class )
DatamartColumn : getInternalImage( 'column.png' , class )
DatamartTaskFilter : getInternalImage( 'taskfilter.png' , class )
DatamartCube : getInternalImage( 'dsl_cube.png' , class )
DatamartReference : getInternalImage( 'reference.png' , class )
DatamartEntity : getInternalImage( 'datamartentity.png' , class )
DatamartOwner : getInternalImage( 'owner.png' , class )
DatamartMember : getInternalImage( 'member.png' , class )
DatamartAttributeBase : getInternalImage( 'datamartproperty.png' , class )
DatamartCondition : getInternalImage( 'condition.png' , class )
DatamartOrder : getInternalImage( 'order.png' , class )
DatamartDerivedMeasure : getInternalImage( 'measure-derived.png' , class )
DatamartDefineDerivedMeasure : getInternalImage( 'measure-defined.png' , class )
DatamartSlicer : getInternalImage( 'slicer.png' , class )
DatamartAxis : getInternalImage( 'axis.png' , class )
DatamartMeasure : getInternalImage( 'measure.png' , class )
DatamartHierarchy : getInternalImage( 'dsl_hierarchy.gif' , class )
Addition : getInternalImage( 'math-3-addition.png' , class )
Subtraction : getInternalImage( 'math-3-subtraction.png' , class )
Multiplication : getInternalImage( 'math-3-multiplication.png' , class )
Division : getInternalImage( 'math-3-division.png' , class )
Conjunction : getInternalImage( 'math-3-conjunction.png' , class )
Disjunction : getInternalImage( 'math-3-disjunction.png' , class )
ConditionalExpression : getInternalImage( 'expression-conditional.png' , class )
Expression : getInternalImage( 'expression.png' , class )
default : super.image( o )
}
}
}