Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 203994

Summary: Create image attachments from clipboard
Product: z_Archived Reporter: Andreas Goetz <cpuidle>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P4 CC: DaleWKing, mik.kersten, steffen.pingel, wmitsuda
Version: 2.0Keywords: helpwanted
Target Milestone: 3.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 78856    
Bug Blocks: 211072    
Attachments:
Description Flags
experimental patch
none
mylyn/context/zip none

Description Andreas Goetz CLA 2007-09-19 11:35:54 EDT
It would be great if creating enhancements from clipboard would support image creation. That would save the clipboard->mspaint->save as->file orgie at least for Windows.
Comment 1 Andreas Goetz CLA 2007-09-19 11:37:58 EDT
*** Bug 203995 has been marked as a duplicate of this bug. ***
Comment 2 Mik Kersten CLA 2007-09-20 00:58:19 EDT
Agreed that this would be nice.  For now we have the screenshot capability, which addresses some of the use cases.
Comment 3 Eugene Kuleshov CLA 2007-10-08 11:11:17 EDT
*** Bug 205735 has been marked as a duplicate of this bug. ***
Comment 4 Eugene Kuleshov CLA 2007-11-18 01:33:02 EST
Created attachment 83177 [details]
experimental patch

Timing is probably bad, but here is what I have, just in case whoever will be working on this functionality will find it useful.

After looking at this wizard I wonder why it is not using LocalAttachment instance to communicate changes between wizard pages? 

Also, it makes sense to use content type chooser to select what image format should be used for attachment, though it should be filtered out for clipboard attachments
Comment 5 Eugene Kuleshov CLA 2007-11-18 01:33:06 EST
Created attachment 83178 [details]
mylyn/context/zip
Comment 6 Willian Mitsuda CLA 2007-11-18 23:26:28 EST
In addition to recognizing images when creating from clipboard, I think it is important to add some button to screenshot editor itself, like "Paste from Clipboard" because I often find myself having to capturing many times until I get a good adjustment.

So in this case you can just hit PrintScreen and press the button to paste a new screenshot from clipboard as many times as necessary, and don't have to cancel/restart the wizard.
Comment 7 Eugene Kuleshov CLA 2007-11-19 00:02:54 EST
(In reply to comment #6)
> I think it is important to add some button to screenshot editor itself, like "Paste from
> Clipboard" because I often find myself having to capturing many times until I
> get a good adjustment.

Sounds like we won't need that strange "capture" action once this will be implemented. ;-)
Comment 8 Willian Mitsuda CLA 2007-11-19 00:13:22 EST
(In reply to comment #7)
> Sounds like we won't need that strange "capture" action once this will be
> implemented. ;-)

I suppose we will, unless we find a better way to capture Eclipse window itself (without the wizard window in front of).
Comment 9 Eugene Kuleshov CLA 2007-11-19 01:13:38 EST
IMHO, the only reason to have special capture action is to capture menus and cursors, but current action don't handle that either...
Comment 10 Mik Kersten CLA 2007-11-27 01:18:05 EST
 (In reply to comment #9)
> IMHO, the only reason to have special capture action is to capture menus and
> cursors, but current action don't handle that either...

While Print Screen is definitely valuable, it is advanced user functionality and does not remove the need for an explicit capture button.

+1 for Willian's Past action suggestion.

Eugene: I still need to hear back from the Eclipse Foundation before applying.  In case I do, how well-tested is this patch?
Comment 11 Eugene Kuleshov CLA 2007-11-27 01:44:02 EST
(In reply to comment #10)
> While Print Screen is definitely valuable, it is advanced user functionality and
> does not remove the need for an explicit capture button.

You'd be surprised how popular PrintScreen is for regular users.

> Eugene: I still need to hear back from the Eclipse Foundation before applying.

Hear what?

> In case I do, how well-tested is this patch?

Please read comment #4
Comment 12 Mik Kersten CLA 2007-11-27 10:51:53 EST
(In reply to comment #11)
> > Eugene: I still need to hear back from the Eclipse Foundation before applying.
> 
> Hear what?

Regarding the patch problem on bug 201028.  Email me privately if you want to discuss further.
 
> > In case I do, how well-tested is this patch?
> 
> Please read comment #4

There are no comments about testing there.  I assume from the comment and title that this is experimentation and will require additional testing and review.
Comment 13 Willian Mitsuda CLA 2007-11-27 12:11:52 EST
(In reply to comment #11)
> You'd be surprised how popular PrintScreen is for regular users.

Yes, I hear more often people saying: "send me a printscreen of your window" than "send me a screenshot capture".
Comment 14 Eugene Kuleshov CLA 2007-11-27 14:47:52 EST
(In reply to comment #12)
> > Hear what?
> Regarding the patch problem on bug 201028.  Email me privately if you want to
> discuss further.

How is that related to this issue? Besides, it been already discussed and you don't answer on private emails from me anyways.

> > Please read comment #4
> There are no comments about testing there.  I assume from the comment and title
> that this is experimentation and will require additional testing and review.

There is also been no request to review or apply patch either.
Comment 15 Eugene Kuleshov CLA 2008-02-22 18:22:39 EST
Hooking up attachment from clipboard is a no brainer, but with markup page it doesn't look pretty. 

Willian, now that your screenshot markup stuff is in, will you have chance to look at this? I took a quick pass trough your stuff and it seem like there is a big misalignment around ImageAttachment and IImageCreator, ie, ScreenshotAttachmentPage should allow to set image from outside and attachment can flip between ImageAttachment and LocalAttachment based on selection of the file or workspace resource. Shouldn't logic you have in ImageAttachment actually live in the PreviewPage, which can keep the state and listen to changes from the other pages using some kind of resource/image change listener.
Comment 16 Steffen Pingel CLA 2008-03-12 21:42:13 EDT
Is anybody planning to work on this feature?
Comment 17 Willian Mitsuda CLA 2008-03-12 23:35:51 EDT
(In reply to comment #16)
> Is anybody planning to work on this feature?
> 

Yes, I do. Unfortunately, I hadn't time yet to work on a solution to unify LocalAttachment and ImageAttachment.
Comment 18 Willian Mitsuda CLA 2008-03-14 22:24:17 EDT
 (In reply to comment #15)
> Willian, now that your screenshot markup stuff is in, will you have chance to
> look at this? 

Sure.

> I took a quick pass trough your stuff and it seem like there is a
> big misalignment around ImageAttachment and IImageCreator, ie,
> ScreenshotAttachmentPage should allow to set image from outside and attachment
> can flip between ImageAttachment and LocalAttachment based on selection of the
> file or workspace resource. Shouldn't logic you have in ImageAttachment actually
> live in the PreviewPage, which can keep the state and listen to changes from the
> other pages using some kind of resource/image change listener.

I think it is better to cleanup LocalAttachment/ImageAttachment first. I opened bug#222833 for that. Feel free to add your opinions in there.

Once it is done, I guess this one would be a piece of cake to fix.
Comment 19 Steffen Pingel CLA 2008-03-14 23:58:04 EDT
+1 I'll follow up on bug 222833.
Comment 20 Steffen Pingel CLA 2008-05-01 03:26:59 EDT
Implemented as part of bug 222833. Clipboard images are attached as PNGs.