Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Multiple icons for single entry in outline view
Multiple icons for single entry in outline view [message #1723884] Thu, 18 February 2016 17:41 Go to next message
Tobias Schmidt is currently offline Tobias SchmidtFriend
Messages: 5
Registered: February 2016
Junior Member
Hey there,

is it possible to assign more than one icon per entry in the outline view?

It seems like there is an extra column in Eclipse to display another image.
For example if something is static:
index.php/fa/25040/0/

Basically I want exactly that functionality, so I can show something is static or abstract.

Thanks in advance!
  • Attachment: static.png
    (Size: 20.61KB, Downloaded 229 times)
Re: Multiple icons for single entry in outline view [message #1723999 is a reply to message #1723884] Fri, 19 February 2016 15:41 Go to previous messageGo to next message
Thomas Fritsch is currently offline Thomas FritschFriend
Messages: 28
Registered: April 2013
Location: Germany
Junior Member
In your LabelProvider you can do it like this (assuming you use Xtend language):

import com.google.inject.Inject
import java.lang.reflect.Modifier
import org.eclipse.xtext.common.types.JvmVisibility
import org.eclipse.xbase.ui.labeling.XbaseImages2

class MyLanguageLabelProvider extends XbaseLabelProvider {

    @Inject XBaseImages2 images
	
    def image(SomeAttribute it) {
        return images.forField(JvmVisibility.PUBLIC, Modifier.STATIC)
    }
}
Re: Multiple icons for single entry in outline view [message #1724000 is a reply to message #1723884] Fri, 19 February 2016 15:45 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
In Xtend, we're using JDT's org.eclipse.jdt.ui.JavaElementImageDescriptor, which layers adornments on top of the icons.
Follow the traces from XbaseImages.


---
Get professional support from the Xtext committers at www.typefox.io
Re: Multiple icons for single entry in outline view [message #1724022 is a reply to message #1724000] Fri, 19 February 2016 21:52 Go to previous message
Tobias Schmidt is currently offline Tobias SchmidtFriend
Messages: 5
Registered: February 2016
Junior Member
Thanks to you both for the quick und precise responses!
Previous Topic:Export XMI
Next Topic:Custom Content Assist in Xtext
Goto Forum:
  


Current Time: Thu Oct 06 17:58:45 GMT 2022

Powered by FUDForum. Page generated in 0.01967 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top