Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343972 - Support image in editor page header
Summary: Support image in editor page header
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2011-04-27 10:39 EDT by Greg Amerson CLA
Modified: 2021-11-19 09:21 EST (History)
2 users (show)

See Also:


Attachments
Patch #1 (6.25 KB, patch)
2011-04-27 10:43 EDT, Greg Amerson CLA
no flags Details | Diff
Patch #2 (7.11 KB, patch)
2011-04-27 11:06 EDT, Greg Amerson CLA
no flags Details | Diff
Patch #3 (10.00 KB, patch)
2011-05-12 16:17 EDT, Greg Amerson CLA
konstantin: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Amerson CLA 2011-04-27 10:39:27 EDT
In the editor that I'm porting to sapphire we were setting the header image in the scrolledForm on the FormEditorPage.  I'd like to have this abillity in Sapphire.
Comment 1 Greg Amerson CLA 2011-04-27 10:43:43 EDT
Created attachment 194163 [details]
Patch #1

Added a image to IMasterDetailsEditorPageDef and then pulled that image during creation of formContent in the MasterDetailsEditorPage
Comment 2 Greg Amerson CLA 2011-04-27 11:06:49 EDT
Created attachment 194167 [details]
Patch #2

Updated patch, that also adds a property editor for the image to the Form Editor Page node in the sdef editor.
Comment 3 Konstantin Komissarchik CLA 2011-04-27 13:44:56 EDT
Review comments...

1. The new image property should be in IEditorPageDef rather than IMasterDetailsEditorPageDef and it should be called PageHeaderImage to be consistent with the existing PageHeaderText property.

2. FunctionResult needs to be disposed when no longer necessary. It should generally be retained for the duration of the part's life, listened to for changes, and disposed when the part is disposed. Management of the function result should be in the part (SapphireEditorPagePart) rather than in presentation code (MasterDetailsEditorPage). Presentation should access the image as ImageData via a method on part and it needs to listen on part for image changes. See SapphireWizardPagePart/SapphireWizardPage for an example. I see that it has the ImageDescriptor/Image data bug that I will fix. Also, the page doesn't listen on part's image change event, but it is otherwise a good example.
Comment 4 Konstantin Komissarchik CLA 2011-04-27 14:11:29 EDT
I just fixed wizard code so that that it should be a better example to follow for #2.
Comment 5 Greg Amerson CLA 2011-04-27 14:27:33 EDT
Thanks(In reply to comment #4)
> I just fixed wizard code so that that it should be a better example to follow
> for #2.

Thanks for that.  I'll submit an updated patch as soon as I can but I've got another project deadline coming that is going to take me off my sapphire editor for a few days.  What is the 0.3 target date?
Comment 6 Konstantin Komissarchik CLA 2011-04-27 14:33:48 EDT
The 0.3 release is set to ship on 06-22 (concurrently with Indigo), but the deadline for non-committer contributions is 05-18. That's because Eclipse Foundation reviews project's IP log that lists all such contributions prior to a release.

The 0.4 release has yet to be scheduled and there can be 0.3.x releases as necessary. What is your timeframe for shipping something based on Sapphire?
Comment 7 Greg Amerson CLA 2011-04-27 14:43:31 EDT
(In reply to comment #6)
> The 0.3 release is set to ship on 06-22 (concurrently with Indigo), but the
> deadline for non-committer contributions is 05-18. That's because Eclipse
> Foundation reviews project's IP log that lists all such contributions prior to
> a release.
> 
> The 0.4 release has yet to be scheduled and there can be 0.3.x releases as
> necessary. What is your timeframe for shipping something based on Sapphire?

I'm actually going to be demo-ing the new sapphire based editors next month at a user/developer conference my company is having.  But I don't plan on releasing it until early summer, so June/Indigo release would be good.  I'd like to get nightly builds of it earlier but I'm not sure how the sapphire integration would work when its in non-released form.  

Regardless I should have not trouble circling back to finish up this patch before 5-18.  I'm glad to know about that date as I hope to use the diagram page support and really kick the tires on sapphire's node diagramming capabilities before then to give any feedback prior June release.
Comment 8 Konstantin Komissarchik CLA 2011-04-27 15:22:12 EDT
> I'd like to get nightly builds of it earlier but I'm not sure how the sapphire
> integration would work when its in non-released form.  

Not quite sure what you mean here. Could you clarify?
Comment 9 Greg Amerson CLA 2011-04-27 15:37:44 EDT
(In reply to comment #8)
> > I'd like to get nightly builds of it earlier but I'm not sure how the sapphire
> > integration would work when its in non-released form.  
> 
> Not quite sure what you mean here. Could you clarify?

For my eclipse plugins that I build I have a stable and nightly update-sites.  I normally like to push new features to the nightly updatesite to get early feedback from users.  I'd like to do that with sapphire before Indigo but I don't know how the requirement of installing sapphire would work well.  I guess I could require they install sapphire plugins from a nightly of 0.3.x and then come get my nightly, i just wish there was a better way and a way that didn't require users to install from two update-sites in this case.
Comment 10 Konstantin Komissarchik CLA 2011-04-27 17:13:54 EDT
> I'd like to do that with sapphire before Indigo but I
> don't know how the requirement of installing sapphire would work well.  I guess
> I could require they install sapphire plugins from a nightly of 0.3.x and then
> come get my nightly, i just wish there was a better way and a way that didn't
> require users to install from two update-sites in this case.

I recommend mirroring the particular build of Sapphire that your build used into your repository. I would do that for both your stable and nightly repositories at least until Sapphire is included in the release train repository (will not happen until Juno release in 2012). You may even want to keep mirroring beyond that point to make install easier for users of prior Eclipse releases.
Comment 11 Greg Amerson CLA 2011-04-27 17:30:04 EDT
(In reply to comment #10)
> > I'd like to do that with sapphire before Indigo but I
> > don't know how the requirement of installing sapphire would work well.  I guess
> > I could require they install sapphire plugins from a nightly of 0.3.x and then
> > come get my nightly, i just wish there was a better way and a way that didn't
> > require users to install from two update-sites in this case.
> 
> I recommend mirroring the particular build of Sapphire that your build used
> into your repository. I would do that for both your stable and nightly
> repositories at least until Sapphire is included in the release train
> repository (will not happen until Juno release in 2012). You may even want to
> keep mirroring beyond that point to make install easier for users of prior
> Eclipse releases.

Good to know.  I was thinking that Sapphire would be available in Indigo release-train repository, so I can make plans for mirroring in the mean time.
Comment 12 Konstantin Komissarchik CLA 2011-05-09 14:32:41 EDT
Do you think you will be able to complete this in time for it to get reviewed in time for May 18th deadline or should we defer to 0.4 at this point?
Comment 13 Greg Amerson CLA 2011-05-09 16:09:38 EDT
I should be able to get to this later this week.  So definitely before the 18th deadline.
Comment 14 Greg Amerson CLA 2011-05-12 16:17:23 EDT
Created attachment 195542 [details]
Patch #3

Fixed patch with suggestions from comment#3  Also added sample page-header-image to gallery header (it would be better to use another image but patches don't support binary).
Comment 15 Konstantin Komissarchik CLA 2011-05-12 22:39:46 EDT
Patch #3 throws an NPE if an editor page does not have image defined. It also doesn't dispose the created SWT image. Since we are short on time for more iterations, I went ahead and made the fixes myself. See SapphireEditorFormPage.refreshImage() and dispose().
Comment 16 Konstantin Komissarchik CLA 2011-05-12 22:40:29 EDT
Oh and I also added a note about this to the what's new doc.
Comment 17 Ling Hao CLA 2011-06-09 14:48:46 EDT
Verify with sapphire-gallery.xml.