Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 213131 - [wikitext] consider moving "preview" button into the section bar
Summary: [wikitext] consider moving "preview" button into the section bar
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Jingwen 'Owen' Ou CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-16 22:19 EST by Eugene Kuleshov CLA
Modified: 2008-07-16 19:04 EDT (History)
4 users (show)

See Also:


Attachments
present look of the Trac editor (76.76 KB, image/jpeg)
2007-12-16 22:21 EST, Eugene Kuleshov CLA
no flags Details
moving the preview button into the section bar (12.58 KB, patch)
2008-06-18 20:09 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
screenshot of moving the preview button to the section bar (10.64 KB, image/png)
2008-06-18 20:12 EDT, Jingwen 'Owen' Ou CLA
no flags Details
recut the patch (10.28 KB, patch)
2008-06-19 00:43 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
re-recut the patch (10.10 KB, patch)
2008-06-19 01:31 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
all-in-one patch fixing: not checked (default) - edit mode; checked - preview mode (10.16 KB, patch)
2008-06-20 17:04 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
try this (503 bytes, image/png)
2008-06-30 20:56 EDT, Mik Kersten CLA
no flags Details
a patch applying the new icon (1.02 KB, patch)
2008-07-01 01:06 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
mylyn/context/zip (1.00 KB, application/octet-stream)
2008-07-01 01:06 EDT, Jingwen 'Owen' Ou CLA
no flags Details
fixing the tooltips of the preview button (1.72 KB, patch)
2008-07-05 14:16 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
mylyn/context/zip (942 bytes, application/octet-stream)
2008-07-05 14:16 EDT, Jingwen 'Owen' Ou CLA
no flags Details
reimplement ExtensibleRichTextAttributeEditor to supports sitching between RepositoryTextViewer and MarkViewer(WikiText) (12.05 KB, patch)
2008-07-16 18:47 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
mylyn/context/zip (1.20 KB, application/octet-stream)
2008-07-16 18:47 EDT, Jingwen 'Owen' Ou CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kuleshov CLA 2007-12-16 22:19:36 EST
Consider moving "preview" button into the section bar, perhaps next to "reply". I am not sure if this is specific to Trac only or part of the common Task Editor UI.

BTW, it seems like widget used to show preview there is either have an extra border or isn't using flat form look.
Comment 1 Eugene Kuleshov CLA 2007-12-16 22:21:25 EST
Created attachment 85361 [details]
present look of the Trac editor
Comment 2 Jingwen 'Owen' Ou CLA 2008-06-17 14:04:45 EDT
Steffen, you could assign this task to me 
Comment 3 Jingwen 'Owen' Ou CLA 2008-06-18 20:09:19 EDT
Created attachment 105360 [details]
moving the preview button into the section bar

a nice hack: marking the tab text invisible, saving resource, but still using the multitab function. detail in screen shot and comment
Comment 4 Jingwen 'Owen' Ou CLA 2008-06-18 20:12:19 EDT
Created attachment 105361 [details]
screenshot of moving the preview button to the section bar
Comment 5 Jingwen 'Owen' Ou CLA 2008-06-18 20:19:39 EDT
Steffen & Mik (I cced you because you seem to be the "icon" authoring all the icons - the CommonImages class), will it be possible that this patch is applied and you guys also get a new icon for the editing/preview button on the top right as shown in the screen shot? 
Comment 6 Steffen Pingel CLA 2008-06-18 20:29:56 EDT
Yes, don't worry about the icons. We'll create one when applying the patch. Reusing an existing icon is perfectly okay.
Comment 7 David Green CLA 2008-06-18 21:04:32 EDT
Nice work on the patch Owen!  Is there a reason why you've created a new class ExtensibleRichTextAttributeEditor2 instead of modifying ExtensibleRichTextAttributeEditor?
Comment 8 Jingwen 'Owen' Ou CLA 2008-06-18 21:55:40 EDT
 (In reply to comment #7)
> Nice work on the patch Owen!  Is there a reason why you've created a new class
> ExtensibleRichTextAttributeEditor2 instead of modifying
> ExtensibleRichTextAttributeEditor?

the reason is that I am not sure whats the status of Mylyn right now, I have to watch out before modifying every class...instead of wiping everything, I created another one. It would be great if the patch is applied, but we can also get the initial version back only by changing the class name. Also for the purpose of future reference of the initial version. As commented in ExtensibleRichTextAttributeEditor2, it is a totally replacement for ExtensibleRichTextAttributeEditor.

I am not sure whether its a good idea to create a patch like this. Please comment.
Comment 9 David Green CLA 2008-06-18 22:05:37 EDT
(In reply to comment #8)
> 
> I am not sure whether its a good idea to create a patch like this. Please
> comment.
> 

It's much better to create patches that modify existing classes instead of creating a new class every time you want to change something.  That way we can see which source code changed, and it's easier to keep track of what's what.

Comment 10 Jingwen 'Owen' Ou CLA 2008-06-19 00:43:06 EDT
Created attachment 105369 [details]
recut the patch

changing ExtensibleRichTextAttributeEditor2 to ExtensibleRichTextAttributeEditor, others the same
Comment 11 Jingwen 'Owen' Ou CLA 2008-06-19 01:31:20 EDT
Created attachment 105371 [details]
re-recut the patch

forgot to add David's name back to @author after the refactoring. This patch should be no typos...Sorry David...
Comment 12 Steffen Pingel CLA 2008-06-20 04:37:42 EDT
Patch looks great! I noticed that the button is toggled by default when editing. Could you change it so it stays pressed in preview mode?

I also notice a light blue background in the line that is edited. I don't remember seeing that before. Is that caused by a change in Textile-J or Mylyn?
Comment 13 David Green CLA 2008-06-20 11:16:16 EDT
(In reply to comment #12)
> I also notice a light blue background in the line that is edited. I don't
> remember seeing that before. Is that caused by a change in Textile-J or Mylyn?

(In reply to comment #12)
> I also notice a light blue background in the line that is edited. I don't
> remember seeing that before. Is that caused by a change in Textile-J or Mylyn?

The light blue background is setup by MarkupTaskEditorExtension (Textile-J) with the following code:

bc. 
support.setCursorLinePainterPreferenceKeys(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE,
  AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);

the cursor line is highlighted according to a user preference.
Comment 14 Jingwen 'Owen' Ou CLA 2008-06-20 14:36:57 EDT
 (In reply to comment #12)
> Patch looks great! I noticed that the button is toggled by default when editing.
> Could you change it so it stays pressed in preview mode?
> 

I am sorry Steffen, could you explain why would it saty pressed in preview mode? Lost you...

Right now when the task editor is first open, its in editing mode, and when clicking the button, it enters preview mode to preview the editing. Its a toggle button switching between the two modes.
Comment 15 Steffen Pingel CLA 2008-06-20 16:43:20 EDT
> Right now when the task editor is first open, its in editing mode, and when
> clicking the button, it enters preview mode to preview the editing. 

When I opened the editor the button was checked by default. Could reverse the meaning of the button: unchecked (default) = edit, checked = preview?
Comment 16 Jingwen 'Owen' Ou CLA 2008-06-20 17:04:25 EDT
Created attachment 105547 [details]
all-in-one patch fixing: not checked (default) - edit mode; checked - preview mode
Comment 17 Steffen Pingel CLA 2008-06-27 02:28:35 EDT
Patch applied. Great work Owen! I'll bug Mik to create a new icon for the preview.
Comment 18 Mik Kersten CLA 2008-06-30 20:56:40 EDT
Created attachment 106185 [details]
try this
Comment 19 Jingwen 'Owen' Ou CLA 2008-07-01 01:06:08 EDT
Created attachment 106206 [details]
a patch applying the new icon

thanks Mik :)
Comment 20 Jingwen 'Owen' Ou CLA 2008-07-01 01:06:15 EDT
Created attachment 106207 [details]
mylyn/context/zip
Comment 21 Jingwen 'Owen' Ou CLA 2008-07-05 14:16:44 EDT
Created attachment 106643 [details]
fixing the tooltips of the preview button

a patch that fixes the following: before clicking the preview button, it displays "Click to preview", after clicking, it becomes "Preview".
Comment 22 Jingwen 'Owen' Ou CLA 2008-07-05 14:16:52 EDT
Created attachment 106644 [details]
mylyn/context/zip
Comment 23 Steffen Pingel CLA 2008-07-05 23:24:06 EDT
I have changed the tooltip to "Preview" in compliance with the Eclipse User Guide Lines [http://wiki.eclipse.org/User_Interface_Guidelines#Appearance]:

"The tool tips for a command should describe the behavior which occursif the command is invoked, independent of the current state. For push buttons, the label should decribe the result of users pushing the button. For toggle buttons, it should describe its effect when the item is toggled on, and the label should not change depending on the state of the button."

Comment 24 Jingwen 'Owen' Ou CLA 2008-07-05 23:40:13 EDT
(In reply to comment #23)
> I have changed the tooltip to "Preview" in compliance with the Eclipse User
> Guide Lines [http://wiki.eclipse.org/User_Interface_Guidelines#Appearance]:
> 
> "The tool tips for a command should describe the behavior which occursif the
> command is invoked, independent of the current state. For push buttons, the
> label should decribe the result of users pushing the button. For toggle buttons,
> it should describe its effect when the item is toggled on, and the label should
> not change depending on the state of the button."

thanks for the info, Steffen, I will apply the guidelines on all my future patches
Comment 25 Steffen Pingel CLA 2008-07-05 23:50:13 EDT
No worries. I wasn't sure about the right way to handle the tooltip so I looked it up. The guide lines are a great reference that we try to follow as close as possible in Mylyn.
Comment 26 Jingwen 'Owen' Ou CLA 2008-07-16 18:47:47 EDT
Created attachment 107680 [details]
reimplement ExtensibleRichTextAttributeEditor to supports sitching between RepositoryTextViewer and MarkViewer(WikiText)

this reimplementation is related to bug 219939
Comment 27 Jingwen 'Owen' Ou CLA 2008-07-16 18:47:50 EDT
Created attachment 107681 [details]
mylyn/context/zip
Comment 28 Jingwen 'Owen' Ou CLA 2008-07-16 18:53:54 EDT
the new implementation use StackLayout since it provides more flexible way of switching controls, while keeping the original features (switching between editing and previewing). The reimplementation is to provide method to disable/enable WikiText (bug 219939). 
Comment 29 Steffen Pingel CLA 2008-07-16 19:04:59 EDT
That sounds like a good idea. Owen, please file a new bug for this and attach the patch there. One thing you could consider as well is to construct the controls lazily, i.e. create the preview widget when a preview is requested for the first time.