Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [RAP E4]Image can't be seen in a treeviewer
icon5.gif  [RAP E4]Image can't be seen in a treeviewer [message #1731951] Wed, 11 May 2016 09:09 Go to next message
zanry li is currently offline zanry liFriend
Messages: 5
Registered: May 2016
Junior Member
Hi,
I created a treeviewer and set label provider like this:
treeViewer.setLabelProvider(new ViewLabelProvider());
class ViewLabelProvider extends LabelProvider {

@Override
public Image getImage(Object element) {
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
}
}

After I runned the application the label can be seen but the image cannot.
Please help, thanks.
PS: The source code is in ProjectManagementPart.java
Re: [RAP E4]Image can't be seen in a treeviewer [message #1731964 is a reply to message #1731951] Wed, 11 May 2016 10:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
You should not have access to PlatformUI.getWorkbench() in an e4
application. RAP e4 does not support mixed mode like Eclipse 4 on the
desktop does, so you need to remove all references to the 3.x APIs (best
would be to remove them from your target!)

Tom

On 11.05.16 11:09, zanry li wrote:
> Hi,
> I created a treeviewer and set label provider like this:
> treeViewer.setLabelProvider(new ViewLabelProvider());
> class ViewLabelProvider extends LabelProvider {
>
> @Override
> public Image getImage(Object element) {
> return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
> }
> }
>
> After I runned the application the label can be seen but the image cannot.
> Please help, thanks.
> PS: The source code is in ProjectManagementPart.java
>
Re: [RAP E4]Image can't be seen in a treeviewer [message #1732029 is a reply to message #1731964] Thu, 12 May 2016 06:10 Go to previous message
zanry li is currently offline zanry liFriend
Messages: 5
Registered: May 2016
Junior Member
Thanks to your reply!
Previous Topic:Problem when closing MPart in RAP e4 the whole application crash
Next Topic:Duplicate Entry Point URL definition
Goto Forum:
  


Current Time: Tue Mar 19 06:14:16 GMT 2024

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

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

Back to the top