Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:11 Go to next message
J. Weimar is currently offline J. WeimarFriend
Messages: 8
Registered: March 2011
Location: Germany
Junior Member
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 12:39]

Report message to a moderator

Re: Images from user directories (as opposed to plugin resources) [message #662235 is a reply to message #661882] Tue, 29 March 2011 19:44 Go to previous messageGo to next message
J. Weimar is currently offline J. WeimarFriend
Messages: 8
Registered: March 2011
Location: Germany
Junior Member
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 13:07 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 14:44 Go to previous message
J. Weimar is currently offline J. WeimarFriend
Messages: 8
Registered: March 2011
Location: Germany
Junior Member
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: Tue Apr 23 08:31:48 GMT 2024

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

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

Back to the top