Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Clarification needed re. icon paths
Clarification needed re. icon paths [message #13643] Tue, 24 February 2009 13:17 Go to next message
Michael Moser is currently offline Michael Moser
Messages: 914
Registered: July 2009
Senior Member
Hi, I was experimenting with the new tool options
"tool.(large|small).path" that you added recently, but didn't succeed,
yet, to get them to working.

How and relative to what directory does one need to specify the path?

My image files sit in <project-root>/images/<nodename>.jpg, so I first
tried with relative paths "images/Artifact.jpg" (relative to the
project's root), "../images.Artifact.jpg" (relative to the .class file
root "bin"), then with full paths "C:/Documents and
Settings/mmo/eclipse/workspace/leonardo2/images/Artifact.jpg ", but
neither yielded any icons in the resulting graphical editor?
I also had tried with backward slashes, but while single backslashes of
course yielded Java compilation errors (due to wrong escape sequences),
double backslashes didn't yield anything better, either.

Any idea, how to specify these paths? Are these supposed to be URLs?
I.e. does one need to specify "file://..." ?

BTW: The tools...path-option only influences the tools-icon. I guess,
the next wish, to also be able to specify the node's label icon, too.
I.e. not just label.icon="true", but label.icon="<iconfile-path>"

Cheers,
Michael
Re: Clarification needed re. icon paths [message #13665 is a reply to message #13643] Tue, 24 February 2009 14:04 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Michael,

Michael Moser wrote:
> Hi, I was experimenting with the new tool options
> "tool.(large|small).path" that you added recently, but didn't succeed,
> yet, to get them to working.
>
> How and relative to what directory does one need to specify the path?
>
> My image files sit in <project-root>/images/<nodename>.jpg, so I first
> tried with relative paths "images/Artifact.jpg" (relative to the
> project's root), "../images.Artifact.jpg" (relative to the .class file
> root "bin"), then with full paths "C:/Documents and
> Settings/mmo/eclipse/workspace/leonardo2/images/Artifact.jpg ", but
> neither yielded any icons in the resulting graphical editor?
> I also had tried with backward slashes, but while single backslashes of
> course yielded Java compilation errors (due to wrong escape sequences),
> double backslashes didn't yield anything better, either.
>
> Any idea, how to specify these paths? Are these supposed to be URLs?
> I.e. does one need to specify "file://..." ?

You need to specify both tool.small.bundle and tool.small.path. For
example the following works:

@gmf.node(label="name",
tool.small.bundle="org.eclipse.epsilon.eugenia.examples.newfeatures.edit ",
tool.small.path="icons/full/obj16/Employee.gif")
class Employee {
attr String name;
}

Also you need to make sure that the "icons" folder above included in the
plugin build.

>
> BTW: The tools...path-option only influences the tools-icon. I guess,
> the next wish, to also be able to specify the node's label icon, too.
> I.e. not just label.icon="true", but label.icon="<iconfile-path>"

AFAIK the GMF editor uses the icon provided by the .edit plugin
generated by EMF. Therefore, a sensible thing to do would be to replace
the generated icon in the .edit plugin with your custom one and then
point tool.small.bundle and tool.small.path to it as well.

>
> Cheers,
> Michael

Cheers,
Dimitris
Re: Clarification needed re. icon paths [message #13686 is a reply to message #13665] Tue, 24 February 2009 14:23 Go to previous messageGo to next message
Michael Moser is currently offline Michael Moser
Messages: 914
Registered: July 2009
Senior Member
Dimitris Kolovos wrote:
> Hi Michael,
>> ...

> You need to specify both tool.small.bundle and tool.small.path. For
> example the following works:

Ah - that's what this bundle business is for!
I hadn't given much thought about it, yet, and so had put on my "tunnel
view" and thought: let's ignore that for now....
Worked like a charm on first trial!
Sorry for my ignorance! :-)

>> ...
> AFAIK the GMF editor uses the icon provided by the .edit plugin
> generated by EMF. Therefore, a sensible thing to do would be to
> replace the generated icon in the .edit plugin with your custom one
> and then point tool.small.bundle and tool.small.path to it as well.

I guess my next question was to be expected: "Couldn't Eugenia copy that
file over?" ;-)

Just kidding! Will do as described.

Thanks again,
Michael
Re: Clarification needed re. icon paths [message #13707 is a reply to message #13686] Wed, 25 February 2009 09:27 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Michael,

Thinking about this again, the palette also uses the icon in the .edit
plugin. Thus, if you replace the generated icon with your own, there is
no need for providing the tool.small.* annotations at all. In fact the
tool.small.* annotations are only useful when you want your node/link to
have a different icon in the palette than the one it has on the actual
editor (... and that's most probably why I hadn't implemented this
before you mentioned it - but it's still a nice feature to have).

Cheers,
Dimitris

Michael Moser wrote:
> Dimitris Kolovos wrote:
>> Hi Michael,
>>> ...
>
>> You need to specify both tool.small.bundle and tool.small.path. For
>> example the following works:
>
> Ah - that's what this bundle business is for!
> I hadn't given much thought about it, yet, and so had put on my "tunnel
> view" and thought: let's ignore that for now....
> Worked like a charm on first trial!
> Sorry for my ignorance! :-)
>
>>> ...
>> AFAIK the GMF editor uses the icon provided by the .edit plugin
>> generated by EMF. Therefore, a sensible thing to do would be to
>> replace the generated icon in the .edit plugin with your custom one
>> and then point tool.small.bundle and tool.small.path to it as well.
>
> I guess my next question was to be expected: "Couldn't Eugenia copy that
> file over?" ;-)
>
> Just kidding! Will do as described.
>
> Thanks again,
> Michael
>
Re: Clarification needed re. icon paths [message #565834 is a reply to message #13643] Tue, 24 February 2009 14:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Michael,

Michael Moser wrote:
> Hi, I was experimenting with the new tool options
> "tool.(large|small).path" that you added recently, but didn't succeed,
> yet, to get them to working.
>
> How and relative to what directory does one need to specify the path?
>
> My image files sit in <project-root>/images/<nodename>.jpg, so I first
> tried with relative paths "images/Artifact.jpg" (relative to the
> project's root), "../images.Artifact.jpg" (relative to the .class file
> root "bin"), then with full paths "C:/Documents and
> Settings/mmo/eclipse/workspace/leonardo2/images/Artifact.jpg ", but
> neither yielded any icons in the resulting graphical editor?
> I also had tried with backward slashes, but while single backslashes of
> course yielded Java compilation errors (due to wrong escape sequences),
> double backslashes didn't yield anything better, either.
>
> Any idea, how to specify these paths? Are these supposed to be URLs?
> I.e. does one need to specify "file://.." ?

You need to specify both tool.small.bundle and tool.small.path. For
example the following works:

@gmf.node(label="name",
tool.small.bundle="org.eclipse.epsilon.eugenia.examples.newfeatures.edit ",
tool.small.path="icons/full/obj16/Employee.gif")
class Employee {
attr String name;
}

Also you need to make sure that the "icons" folder above included in the
plugin build.

>
> BTW: The tools...path-option only influences the tools-icon. I guess,
> the next wish, to also be able to specify the node's label icon, too.
> I.e. not just label.icon="true", but label.icon="<iconfile-path>"

AFAIK the GMF editor uses the icon provided by the .edit plugin
generated by EMF. Therefore, a sensible thing to do would be to replace
the generated icon in the .edit plugin with your custom one and then
point tool.small.bundle and tool.small.path to it as well.

>
> Cheers,
> Michael

Cheers,
Dimitris
Re: Clarification needed re. icon paths [message #565853 is a reply to message #13665] Tue, 24 February 2009 14:23 Go to previous message
Michael Moser is currently offline Michael Moser
Messages: 914
Registered: July 2009
Senior Member
Dimitris Kolovos wrote:
> Hi Michael,
>> ...

> You need to specify both tool.small.bundle and tool.small.path. For
> example the following works:

Ah - that's what this bundle business is for!
I hadn't given much thought about it, yet, and so had put on my "tunnel
view" and thought: let's ignore that for now....
Worked like a charm on first trial!
Sorry for my ignorance! :-)

>> ...
> AFAIK the GMF editor uses the icon provided by the .edit plugin
> generated by EMF. Therefore, a sensible thing to do would be to
> replace the generated icon in the .edit plugin with your custom one
> and then point tool.small.bundle and tool.small.path to it as well.

I guess my next question was to be expected: "Couldn't Eugenia copy that
file over?" ;-)

Just kidding! Will do as described.

Thanks again,
Michael
Re: Clarification needed re. icon paths [message #565880 is a reply to message #13686] Wed, 25 February 2009 09:27 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Michael,

Thinking about this again, the palette also uses the icon in the .edit
plugin. Thus, if you replace the generated icon with your own, there is
no need for providing the tool.small.* annotations at all. In fact the
tool.small.* annotations are only useful when you want your node/link to
have a different icon in the palette than the one it has on the actual
editor (... and that's most probably why I hadn't implemented this
before you mentioned it - but it's still a nice feature to have).

Cheers,
Dimitris

Michael Moser wrote:
> Dimitris Kolovos wrote:
>> Hi Michael,
>>> ...
>
>> You need to specify both tool.small.bundle and tool.small.path. For
>> example the following works:
>
> Ah - that's what this bundle business is for!
> I hadn't given much thought about it, yet, and so had put on my "tunnel
> view" and thought: let's ignore that for now....
> Worked like a charm on first trial!
> Sorry for my ignorance! :-)
>
>>> ...
>> AFAIK the GMF editor uses the icon provided by the .edit plugin
>> generated by EMF. Therefore, a sensible thing to do would be to
>> replace the generated icon in the .edit plugin with your custom one
>> and then point tool.small.bundle and tool.small.path to it as well.
>
> I guess my next question was to be expected: "Couldn't Eugenia copy that
> file over?" ;-)
>
> Just kidding! Will do as described.
>
> Thanks again,
> Michael
>
Previous Topic:Clarification needed re. icon paths
Next Topic:AbstractEmfModel#store exception due to unmapped path
Goto Forum:
  


Current Time: Thu Sep 18 16:04:02 GMT 2014

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

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