Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » License of the icons
License of the icons [message #1063661] Thu, 13 June 2013 15:54 Go to next message
kon f is currently offline kon f
Messages: 112
Registered: March 2012
Senior Member
Hey,

I created a copy action and also would like to provide an icon in the context menu. I would be nice if the look would be similar to the icons that are already present in the context menu. So I was wondering if I could use a slight variation of the ShowInSource.png? Or is there already an icon for the "copy" action that I could directly use?

Thank you!

Kon

Edit: My action label contains an & char that is translated to & in the xml file. Unfortunately, the ampersand character is not shown in the context menu (the surrounding character are shown). Is this intended?

[Updated on: Thu, 13 June 2013 15:59]

Report message to a moderator

Re: License of the icons [message #1063675 is a reply to message #1063661] Thu, 13 June 2013 17:18 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 942
Registered: July 2009
Senior Member
The images included in Sapphire are covered by EPL. The license requires that any derivative works is offered under EPL as well. Doesn't have to be anything elaborate. For instance, a reply to this thread with your created image and a statement that it is a derivative work offered under EPL would be sufficient.

Quote:
My action label contains an & char that is translated to & in the xml file. Unfortunately, the ampersand character is not shown in the context menu (the surrounding character are shown). Is this intended?


Try doubling up the & char. A single & char in front of a letter tags that letter for ALT key access to the control. For instance "&Name" would bind ALT+N.
Re: License of the icons [message #1063767 is a reply to message #1063675] Fri, 14 June 2013 07:40 Go to previous message
kon f is currently offline kon f
Messages: 112
Registered: March 2012
Senior Member
Hey Konstantin,

thank you for the reply. I modified the ShowInSource.png image (that is licensed with the EPL) and created this one index.php/fa/15337/0/. The newly created image uses the EPL license.

Encoded as Base64
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH3QYNDxExFgXsOwAAAUtJREFUOMuVkr9LA0EQhb85YkDOyoBgq03KiIgGNCntrLS1ECIIFhYxTZCQQgh2Noqg9lZCegsVxEbQYOXfYKWVudsdi9wPY+5iHBhY2N03b9+3QlDto4IypNZqzzJsn+vWnH51/cR+be9o2gAnXBhNH5B1c8zmi4kuIwFfBasMtKqSdXOMuTlm8ktcHc73iWQiASNY29urnd1y03kD4OmkwlRhl/DWS6dIooAXOABobZeBMgDWBAeCF06448kCxvQaoH5xy2q3mpiHBMQGqJweLOr7RzfqUalEIXpWMEYxRmlc3o1MJabgC0YVo0p9c3lkKlEGXXWiDP5D5UeIgrWxwKhU4n9gwWr8R35TCR2E9XhcQSXSgcbeivoqiMD0ZBbH+2Rj/z4RoyqIKCCkRn3eWND16sOfDjJpAp518IMnNbdKNCn1OTBqQYVvm+7/Omdx2pUAAAAASUVORK5CYII=


Being able to use the ampersand in my label, I had to escape it with two leading &&. Here is the result:

<label>Copy&amp;&amp;&amp;Paste</label>


And here my copy action handler that I use in the outline tree.

public class CopyListElementActionHandler extends SapphireActionHandler {
    @Override
    protected Object run(final SapphireRenderingContext context) {
        IModelElement modelElement = (IModelElement) getModelElement();

        if (!(modelElement.parent() instanceof ModelElementList)) {
            return null;
        }

        ModelElementList<?> mel = (ModelElementList<?>) modelElement.parent();
        IModelElement modelElementCopy = (IModelElement) mel.insert(modelElement.type());
        modelElementCopy.copy(modelElement);

        return modelElementCopy;
    }
}


Thank you! Smile

Kon
  • Attachment: copy.png
    (Size: 0.44KB, Downloaded 94 times)

[Updated on: Fri, 21 June 2013 09:29]

Report message to a moderator

Previous Topic:XmlElement CDATA section
Next Topic:Error indication for list
Goto Forum:
  


Current Time: Fri Oct 24 23:08:29 GMT 2014

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

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