Rev | Line | |
---|
[61] | 1 | /* |
---|
| 2 | * generated by Xtext |
---|
| 3 | */ |
---|
[84] | 4 | package de.ugoe.cs.swe.bnftools.ui.labeling
|
---|
| 5 |
|
---|
| 6 | import com.google.inject.Inject
|
---|
| 7 | import de.ugoe.cs.swe.bnftools.ebnf.Atom
|
---|
| 8 | import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry
|
---|
| 9 | import de.ugoe.cs.swe.bnftools.ebnf.DefinitionList
|
---|
[67] | 10 | import de.ugoe.cs.swe.bnftools.ebnf.ImportSection
|
---|
| 11 | import de.ugoe.cs.swe.bnftools.ebnf.Rule
|
---|
[68] | 12 | import de.ugoe.cs.swe.bnftools.ebnf.SingleDefinition
|
---|
| 13 | import de.ugoe.cs.swe.bnftools.ebnf.Term
|
---|
[84] | 14 | import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
|
---|
| 15 | import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider
|
---|
[67] | 16 |
|
---|
[61] | 17 | /** |
---|
| 18 | * Provides labels for a EObjects. |
---|
| 19 | * |
---|
| 20 | * see http://www.eclipse.org/Xtext/documentation.html#labelProvider |
---|
| 21 | */ |
---|
[84] | 22 | class EbnfLabelProvider extends DefaultEObjectLabelProvider { |
---|
[61] | 23 | |
---|
| 24 | @Inject |
---|
[84] | 25 | new(AdapterFactoryLabelProvider delegate) { |
---|
[61] | 26 | super(delegate); |
---|
| 27 | } |
---|
| 28 | |
---|
[67] | 29 | def text(ImportSection sec){ |
---|
| 30 | 'Imports' |
---|
| 31 | } |
---|
[61] | 32 | |
---|
[67] | 33 | def text(BnfEntry entry){ |
---|
[84] | 34 | 'Rule: '+entry.rule.name |
---|
| 35 | } |
---|
[68] | 36 | |
---|
| 37 | def text(Rule rule){ |
---|
[84] | 38 | |
---|
[68] | 39 | } |
---|
| 40 | |
---|
| 41 | def text(DefinitionList dlist){ |
---|
| 42 | 'Definition List' |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | def text(SingleDefinition sdef){ |
---|
| 46 | 'Single Definition' |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | def text(Term term){ |
---|
| 50 | 'Term' |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | def text(Atom atom){ |
---|
| 54 | 'Atom' |
---|
| 55 | } |
---|
| 56 | |
---|
[61] | 57 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.