Skip to main content



      Home
Home » Modeling » Graphiti » Images from user directories (as opposed to plugin resources)(How to create an Image from a file in the diagram users directory?)
Images from user directories (as opposed to plugin resources) [message #661882] Mon, 28 March 2011 08:11 Go to next message
Eclipse UserFriend
I want to include in my diagrams images from the users directory, i.e. not from
the plugin. I tried using a second ImageProvider, but I cannot get this to work
for images from sources different than the plugin directory space. Using mutiple ImageProviders for images from the plugin works fine (once the Imageprovides are both declared (twice) in the plugin.xml file.

My first ImageProvider works fine and provides the icons necessary for the
diagram type (e.g. for the ContextButtons).

How to construct an ImageProvider which looks for images in the users
directory?

Or do I have to replicate a lot of code and provide my own Graphics Algorithm?

[Updated on: Mon, 28 March 2011 08:39] by Moderator

Re: Images from user directories (as opposed to plugin resources) [message #662235 is a reply to message #661882] Tue, 29 March 2011 15:44 Go to previous messageGo to next message
Eclipse UserFriend
After many experiments, I solved my problem myself: To make my ImageProvider work with local files, I had to use file.getLocationURI().toString() instead of file.file.getFullPath().toString().
Re: Images from user directories (as opposed to plugin resources) [message #663260 is a reply to message #661882] Mon, 04 April 2011 09:07 Go to previous messageGo to next message
Eclipse UserFriend
1. seems still to be open:
You can register several ImageProviders simply by adding them to the
defeinition of your DiagramTypeProvider in your plugin.xml

Michael


"J. Weimar" wrote in message news:imptgq$qm8$1@news.eclipse.org...

I want to include in my diagrams images from the users directory, i.e. not
from
the plugin. I tried using a second ImageProvider, but I cannot get this to
work
even for images from the plugin directory space.

My first ImageProvider works fine and provides the icons necessary for the
diagram type (e.g. for the ContextButtons).

Therefore I now have two problems:
1. Is it possible to use more than one ImageProvider? The code seems to go
through a list, but I cannot get more than one ImageProvider to work.

2. How to construct an ImageProvider which looks for images in the users
directory?
Re: Images from user directories (as opposed to plugin resources) [message #663292 is a reply to message #663260] Mon, 04 April 2011 10:44 Go to previous message
Eclipse UserFriend
Thanks for the reply, I edited the original request to remove 1. once I solved the problem 1 myself. But your email copy did not get changed Sad.

Best regards, Jörg.


Previous Topic:Modifying a separate Ecore file outside Create-Features
Next Topic:Non Rectangular selection area
Goto Forum:
  


Current Time: Wed Jul 23 12:49:56 EDT 2025

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

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

Back to the top