'How to add image next to the title text of an Expandable composite?
I am working on modifying EGit for an use case. The current state looks like the following:
I now want to add an image next to the title text of the unstaged section i.e. next to "Unstaged Changes (0)". Check the following for reference:
I am not looing to add image to the toolbar, but next to the text.
Check the following code for the current unstaged section:
Section unstagedSection;
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
unstagedSection = toolkit.createSection(parent, ExpandableComposite.SHORT_TITLE_BAR);
unstagedSection.setText("Unstaged Changes" + " (0)"); //$NON-NLS-1$
unstagedSection.clientVerticalSpacing = 0;
GridDataFactory.fillDefaults().grab(true, false).applyTo(unstagedSection);
Composite unstagedComposite = toolkit.createComposite(unstagedSection);
toolkit.paintBordersFor(unstagedComposite);
GridLayoutFactory.fillDefaults().applyTo(unstagedComposite);
unstagedSection.setClient(unstagedComposite);
I want to know if it is possible to add the image next to the title text of the Section and how?.
Any kind of help will be appreciated. Thanks.
Edit 1: I have reached till this point. The only thing I need to know is how to put it right after the text.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|