Skip to main content



      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 12:41 Go to next message
Eclipse UserFriend
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 297 times)
Re: Multiple icons for single entry in outline view [message #1723999 is a reply to message #1723884] Fri, 19 February 2016 10:41 Go to previous messageGo to next message
Eclipse UserFriend
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 10:45 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Multiple icons for single entry in outline view [message #1724022 is a reply to message #1724000] Fri, 19 February 2016 16:52 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 21:56:04 EDT 2025

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

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

Back to the top