This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 199283 - [api] make attachments actionable from associated comment in task editor
Summary: [api] make attachments actionable from associated comment in task editor
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5   Edit
Assignee: Frank Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 322293
Blocks:
  Show dependency tree
 
Reported: 2007-08-08 12:27 EDT by Robert Elves CLA
Modified: 2011-01-22 17:50 EST (History)
4 users (show)

See Also:


Attachments
patch (26.71 KB, patch)
2010-03-28 12:27 EDT, Frank Becker CLA
eclipse: review?
Details | Diff
mylyn/context/zip (11.82 KB, application/octet-stream)
2010-03-28 12:27 EDT, Frank Becker CLA
no flags Details
updated patch (12.49 KB, patch)
2010-07-06 14:20 EDT, Frank Becker CLA
eclipse: review?
Details | Diff
mylyn/context/zip (14.40 KB, application/octet-stream)
2010-07-06 14:20 EDT, Frank Becker CLA
no flags Details
patch for non mac (12.88 KB, patch)
2010-08-11 16:40 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (36.64 KB, application/octet-stream)
2010-08-11 16:40 EDT, Frank Becker CLA
no flags Details
patch with workaround (15.71 KB, patch)
2010-08-11 16:42 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (36.64 KB, application/octet-stream)
2010-08-11 16:42 EDT, Frank Becker CLA
no flags Details
patch V5 (12.44 KB, patch)
2011-01-19 14:39 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (14.78 KB, application/octet-stream)
2011-01-19 14:39 EST, Frank Becker CLA
no flags Details
patch V6 (18.04 KB, patch)
2011-01-21 15:43 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (18.05 KB, application/octet-stream)
2011-01-21 15:44 EST, Frank Becker CLA
no flags Details
reverted changes (8.08 KB, patch)
2011-01-21 18:03 EST, Steffen Pingel CLA
no flags Details | Diff
patch V7 (1.10 KB, patch)
2011-01-22 12:39 EST, Frank Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Elves CLA 2007-08-08 12:27:40 EDT
Attachments are accompanied with attachment information but users are currently forced to scroll up to the Attachments section and locate the associated attachment. It would be more convenient if the attachment could be acted upon from the comment.
Comment 1 Mik Kersten CLA 2007-08-13 22:49:43 EDT
I really like this idea.
Comment 2 Robert Elves CLA 2008-06-14 00:52:54 EDT
Need to defer: http://wiki.eclipse.org/index.php/Mylyn/3.0_Plan#Deferred_Items
Comment 3 Frank Becker CLA 2010-03-28 12:27:46 EDT
Created attachment 163181 [details]
patch

1) Attachments are now included in the Outline view. If you select the attachment in the Outline in the Attachment table is the one entry get selected.

2) in the TaskPerferencePage in Advanced you can now switch the Hyperlink for attachment to show the attachment in the editor attachment table and not use the browser.

Is this what we want to have?

Thoughts?
Comment 4 Frank Becker CLA 2010-03-28 12:27:51 EDT
Created attachment 163182 [details]
mylyn/context/zip
Comment 5 Steffen Pingel CLA 2010-05-17 14:39:54 EDT
The patch looks good. I have two suggestions  for improvement before it is applied:
* TaskAttachmentHyperlink should call TaskEditor.selectReveal() and fall back to the browser if the method returns null. The passed object should potentially be a URI pointing to the attachment. TaskEditorAttachmentPart will need to implement setFormInput() to handle revealing of (attachment) URIs. See TaskEditorCommentPart for an example. The outline should use the same mechanism to reveal the selected attachment.
* The label provider code that detects image filenames should be generalized somewhere and use a set to lookup well known extensions or better use the content type of the corresponding attachment attribute.

I am not sure if a new preference to control opening of attachments is needed. This would only be be used Bugzilla at the moment, right? I'll bring this up on Thursday's call for discussion.
Comment 6 Steffen Pingel CLA 2010-05-20 13:53:15 EDT
As discussed on the call we'll try opening all attachment links in the task editor initially. If that turns out to be problematic, e.g. since clicking a link will cause the editor to scroll and hence cause loss of context, we can revisit this in the future. It was also suggested to add a menu to attachment hyperlinks that gives users a choice to either open the link in the editor or browser. This could work through the multi hyperlink presenter from platform or through a popup menu.

Frank, it would be great if you could consider removing the preference for now and the suggestions from comment 5 and attach a new patch.
Comment 7 Steffen Pingel CLA 2010-05-26 00:04:02 EDT
I'll put this on for 3.5. We are almost done but out of time to get this in for 3.4.
Comment 8 Frank Becker CLA 2010-07-06 14:20:19 EDT
Created attachment 173583 [details]
updated patch

here a patch with an popup menu for selecting which method we should use for show the attachment.
Comment 9 Frank Becker CLA 2010-07-06 14:20:23 EDT
Created attachment 173584 [details]
mylyn/context/zip
Comment 10 Steffen Pingel CLA 2010-07-27 17:53:57 EDT
Instead of creating a custom popup menu this should reuse the multi-hyperlink presenter from platform. You can simply return multiple hyperlink objects for the same portion of text in BugzillaConnectorUi.findHyperlinks(). Otherwise the patch looks good to me just exclude changes to AbstractTaskEditorPage and EditorUtil before committing.
Comment 11 Frank Becker CLA 2010-08-11 16:40:51 EDT
Created attachment 176402 [details]
patch for non mac

Please can someone try this on an none Mac CPU (see bug# 322293)
Comment 12 Frank Becker CLA 2010-08-11 16:40:56 EDT
Created attachment 176403 [details]
mylyn/context/zip
Comment 13 Frank Becker CLA 2010-08-11 16:42:36 EDT
Created attachment 176404 [details]
patch with workaround

Here a patch with an workaround for the Mac.
Comment 14 Frank Becker CLA 2010-08-11 16:42:40 EDT
Created attachment 176405 [details]
mylyn/context/zip
Comment 15 Steffen Pingel CLA 2010-08-20 00:05:26 EDT
The "patch for non mac" works well for me. The only thing that needs to be changed are the labels for the links to make it more clear which link opens the attachment in the browser and which opens it in the editor.

Let's hold off with committing until we have clarification how to deal with bug# 322293.
Comment 16 Scott Kovatch CLA 2011-01-18 13:37:16 EST
If someone here could build a Mylyn plugin with the proposed patch that's crashing on Cocoa I can take a look. The stack trace in bug 322293 is out of date and I can't match it up with the current code.
Comment 17 Frank Becker CLA 2011-01-19 14:39:02 EST
Created attachment 187141 [details]
patch V5

(In reply to comment #16)
> If someone here could build a Mylyn plugin with the proposed patch that's
> crashing on Cocoa I can take a look. The stack trace in bug 322293 is out of
> date and I can't match it up with the current code.
This is the updated Patch.

Steffen can I commit this patch for the next build and when will this be accessible?
Comment 18 Frank Becker CLA 2011-01-19 14:39:04 EST
Created attachment 187142 [details]
mylyn/context/zip
Comment 19 Steffen Pingel CLA 2011-01-19 21:21:23 EST
Looks good to me. Please feel free to commit and I'll try to produce a new build.
Comment 20 Frank Becker CLA 2011-01-21 15:43:58 EST
Created attachment 187327 [details]
patch V6

here the commited patch.

bug#322293 is fixed in Eclipse version "3.7.0.v201101192000" so we can enable it.
Comment 21 Frank Becker CLA 2011-01-21 15:44:01 EST
Created attachment 187328 [details]
mylyn/context/zip
Comment 22 Steffen Pingel CLA 2011-01-21 18:03:20 EST
Created attachment 187342 [details]
reverted changes

Some of the changes broke the build and introduced some side effects. Frank, can you take a look at the patch that I committed?
Comment 23 Frank Becker CLA 2011-01-22 10:49:06 EST
(In reply to comment #22)
> Created attachment 187342 [details]
> reverted changes
> 
> Some of the changes broke the build and introduced some side effects. Frank, can
> you take a look at the patch that I committed?

Steffen,

why did you remove in AbstractTaskEditorPage.selectReveal(Object object) 

		if (object instanceof TaskEditorOutlineNode) { }
		
this is needed because TaskAttachmentTableEditorHyperlink.open() use

		page.selectReveal(TaskAttribute.PREFIX_ATTACHMENT + attachmentId).

I found no other place where selectReveal() is used wit an String Object as parameter.

Without this code there is no difference between the two Hyperlinks.
Comment 24 Frank Becker CLA 2011-01-22 12:39:26 EST
Created attachment 187361 [details]
patch V7

committed patch.

Here the fix so that Show Attachment works.
Comment 25 Steffen Pingel CLA 2011-01-22 17:48:04 EST
(In reply to comment #23)
> why did you remove in AbstractTaskEditorPage.selectReveal(Object object)
[...]
> I found no other place where selectReveal() is used wit an String Object as
> parameter.
> 
> Without this code there is no difference between the two Hyperlinks.

The changes didn't look right to me and not necessary. Looks like your last patch fixed it.

I have tweaked the label of the hyperlink slightly to say "Show ... in Task Editor".

Looks like we are done here. Thanks!