Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365948 - Contribution for PictureControl
Summary: Contribution for PictureControl
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Wim Jongman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 14:05 EST by Angelo ZERR CLA
Modified: 2021-07-05 11:39 EDT (History)
4 users (show)

See Also:


Attachments
Zip which contains doc + source + exampel of PhotoControl (126.46 KB, application/zip)
2011-12-07 14:05 EST, Angelo ZERR CLA
no flags Details
Same zip than below with ASF License. (128.47 KB, application/zip)
2011-12-12 07:46 EST, Angelo ZERR CLA
no flags Details
PictureControl+samples with copy of IOUtils of commons-io 2.0.1 (138.46 KB, application/zip)
2012-01-27 03:49 EST, Angelo ZERR CLA
no flags Details
picture control+example+snippets+feature+tests Plug-In (108.47 KB, application/zip)
2012-02-15 05:42 EST, Angelo ZERR CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Angelo ZERR CLA 2011-12-07 14:05:57 EST
Created attachment 208062 [details]
Zip which contains doc + source + exampel of PhotoControl

Hi Nebula Team,

We (Pascal Leclercq and me) would like to contribute to Nebula project with our PictureControl which works with RCP and RAP. The Nebula PictureControl  provides a control to display an image, remove and modify it (see doc in the zip attached). It is used in the RCP/RAP application http://xdocreport-rap.opensagres.cloudbees.net/xdocreport?startup=fr.opensagres.xdocreport.eclipse.ui.application This control is usefull to manage photo, logo in a SWT, RCP and RAP Application. It works with SWT (see PictureControl) and FormToolkit see FormPictureControl) and you can bind it to bind byte array image with Model (PJO, EMF, etc) object with JFace Databinding.

I have attached a zip where you can find :
    *  an ODTwhich explains Nebula PictureControl project and show screenshot.
    * org.eclipse.nebula.widgets.picture : plugin which contains the Nebula Picture control.
    * org.eclipse.nebula.widgets.picture.example : Main example with PictureControl.

I have developped this control with Pascal Leclercq.

Hope you will like it.
Comment 1 Wim Jongman CLA 2011-12-12 07:23:50 EST
Hi, I see that you include some software that you did not write yourself in:

org.eclipse.nebula.widgets.picture\src\main\java\org\eclipse\nebula\widgets\picture\internal

This could be a blocker.

Can you replace these classes or include a reference to the original library?

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
Comment 2 Wim Jongman CLA 2011-12-12 07:26:25 EST
I tried to use the class and resize with layout. I could not get this working. Is this supported? Can users provide a layout on the control?
Comment 3 Angelo ZERR CLA 2011-12-12 07:46:41 EST
Created attachment 208254 [details]
Same zip than below with ASF License.

According the comment https://bugs.eclipse.org/bugs/show_bug.cgi?id=365948#c1 source was changed to add ASF license for classes from org.eclipse.nebula.widgets.picture.internal package (coming from commons-io).
Comment 4 Angelo ZERR CLA 2011-12-12 07:50:16 EST
(In reply to comment #2)
> I tried to use the class and resize with layout. I could not get this working.
> Is this supported? Can users provide a layout on the control?

The choice which we have done is that the picture have static size. The size is setted with AbstractPictureControl#setMaxImageWidth and AbstractPictureControl#setMaxImageHeigtht or by setting a default image which set the size of the picture.

This behaviour could be perhaps improved to manage your case?

Regards Angelo
Comment 5 Mickael Istria CLA 2011-12-12 09:33:08 EST
This look quite good and useful. Moreover, it is very cool to see it running in RAP.
Comment 6 Wim Jongman CLA 2011-12-20 09:04:43 EST
Filed CQ 5906

https://dev.eclipse.org/ipzilla/show_bug.cgi?id=5906
Comment 7 Angelo ZERR CLA 2012-01-09 15:30:09 EST
(In reply to comment #6)
> Filed CQ 5906
> 
> https://dev.eclipse.org/ipzilla/show_bug.cgi?id=5906

Hi,

Here information about my contribution for PictureControl : 

1.  I authored 100% of the content I'm contributing
Yes except for the 3 classes from org.eclipse.nebula.widgets.picture.internal package (ByteArrayOutputStream, IOUtils, LineIterator) code from Commons IO (Apache ASF). I have just copy/paste those 3 classes and change the package name.

2.  I have the rights to donate the content to Eclipse
I believe because I have already donate Eclipse code (Eclipse E4 CSS Engine and WTP Jetty). So I suppose Yes

3.  I'm contributing it under the EPL
Yes

Regards Angelo
Comment 8 Pascal Leclercq CLA 2012-01-09 15:40:17 EST
Hi all,

Here information about my contribution for PictureControl : 

1.  I authored 100% of the content I'm contributing
Yes 
Same remarks as Angelo.

2.  I have the rights to donate the content to Eclipse

This works has been done on spare time. So I guess "yes" is the right answer 

3.  I'm contributing it under the EPL
Yes

Regards Pascal
Comment 9 Angelo ZERR CLA 2012-01-27 03:49:37 EST
Created attachment 210168 [details]
PictureControl+samples with copy of IOUtils of commons-io 2.0.1

Hi,

Here a new zip which uses IOUtils from the commons-io 2.0.1 (to respect the commons-io version from the orbit http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/). I have copy/paste IOUtils class (and some dependencies classes) in the project and rename the package or.appache.commons.io to org.eclipse.nebula.widgets.picture.internal.

Regards Angelo
Comment 10 Mickael Istria CLA 2012-01-27 04:39:18 EST
Duplicating stuff is often not a good idea.
The best way would be to create a CQ to request consumption of commons-io reusing the Orbit bundle, and then you would be allowed to put a dependency to commons-io in your code.
Comment 11 Angelo ZERR CLA 2012-01-27 04:46:17 EST
(In reply to comment #10)

Hi Mickael,

> Duplicating stuff is often not a good idea.
I agree with you, but in my case IOUtils is used just to copy InputStream to byte array. Code of that is not very complex and I think it's really shame to have dependencies to commons.io just for that. More commons* JAR libraries is real nightmare when you don't use OSGi because some libraries depends on commons.io XXXX version and some libraries depends on commons.io YYYY version. commons* JAR are used every time but version of thoe JAR are a very big problem. That's why I prefer duplicate code. 

> The best way would be to create a CQ to request consumption of commons-io
> reusing the Orbit bundle, and then you would be allowed to put a dependency to
> commons-io in your code.
Comment 12 Mickael Istria CLA 2012-01-27 05:09:12 EST
(In reply to comment #11)
> IOUtils is used just to copy InputStream to
> byte array.

Ok. So you're right, it does not require more efforts.
Comment 13 Angelo ZERR CLA 2012-02-15 05:42:52 EST
Created attachment 211032 [details]
picture control+example+snippets+feature+tests Plug-In

Hi Wim,

Here a new patch which contains the picture
control+example+snippets+feature+tests Plug-In with pom.xml.

I have do the same thing than oscilloscope project.

The example project contains PictureExampleTab to see the demo of the
picture control. The snippets project is the same project than the old
example project that I have renammed.

So I think (if you agree) that you can push it to Git
https://github.com/eclipse/nebula/

Hope I have done no error with POM.

Rgards Angelo
Comment 14 Wim Jongman CLA 2012-03-02 12:39:43 EST
Thanks all!