Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 203718 Details for
Bug 286294
support starring of comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
quick and dirty implementation of private starred comments
clipboard.txt (text/plain), 7.19 KB, created by
Sam Davis
on 2011-09-20 21:27:32 EDT
(
hide
)
Description:
quick and dirty implementation of private starred comments
Filename:
MIME Type:
Creator:
Sam Davis
Created:
2011-09-20 21:27:32 EDT
Size:
7.19 KB
patch
obsolete
>diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java >index 56bc966..3f05c1a 100644 >--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java >+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java >@@ -139,8 +139,12 @@ public class Messages extends NLS { > > public static String TaskEditorCommentPart_Expand_Comments; > >+ public static String TaskEditorCommentPart_Expand_Starred; >+ > public static String TaskEditorCommentPart_Privat_Comment_ToolTip_Text; > >+ public static String TaskEditorCommentPart_Star_this_comment; >+ > public static String TaskEditorDescriptionPart_Description; > > public static String TaskEditorDescriptionPart_Detector; >diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java >index c877b17..df046f3 100644 >--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java >+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java >@@ -250,6 +250,23 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > } > } > >+ /** >+ * Expands this group and all starred comments in it. >+ */ >+ public void setStarredExpanded(boolean expanded) { >+ if (groupSection != null && groupSection.isExpanded() != expanded) { >+ CommonFormUtil.setExpanded(groupSection, expanded); >+ } >+ >+ if (commentViewers != null) { >+ for (CommentViewer commentViewer : commentViewers) { >+ if (commentViewer.isStarred()) { >+ commentViewer.setExpanded(expanded); >+ } >+ } >+ } >+ } >+ > public void setRenderedInSubSection(boolean renderedInSubSection) { > this.renderedInSubSection = renderedInSubSection; > } >@@ -298,6 +315,8 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > > private class CommentViewer { > >+ protected static final String COMMENT_STARRED = "org.eclipse.mylyn.internal.tasks.ui.editors.comment.starred"; //$NON-NLS-1$ >+ > private Composite buttonComposite; > > private final TaskAttribute commentAttribute; >@@ -364,6 +383,22 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > titleComposite.setLayout(rowLayout); > titleComposite.setBackground(null); > >+ final ImageHyperlink starButton = toolkit.createImageHyperlink(titleComposite, SWT.NONE); >+ starButton.setToolTipText(Messages.TaskEditorCommentPart_Star_this_comment); >+ starButton.setImage(isStarred() >+ ? CommonImages.getImage(CommonImages.CHECKBOX_SELECTED) >+ : CommonImages.getImage(CommonImages.CHECKBOX_CLEARED)); >+ starButton.addHyperlinkListener(new HyperlinkAdapter() { >+ @Override >+ public void linkActivated(HyperlinkEvent e) { >+ boolean starred = !isStarred(); >+ setStarred(starred); >+ starButton.setImage(starred >+ ? CommonImages.getImage(CommonImages.CHECKBOX_SELECTED) >+ : CommonImages.getImage(CommonImages.CHECKBOX_CLEARED)); >+ } >+ }); >+ > ImageHyperlink expandCommentHyperlink = createTitleHyperLink(toolkit, titleComposite, taskComment); > expandCommentHyperlink.addHyperlinkListener(new HyperlinkAdapter() { > @Override >@@ -513,6 +548,16 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > return commentComposite; > } > >+ public boolean isStarred() { >+ String key = COMMENT_STARRED + taskComment.getNumber(); >+ return Boolean.parseBoolean(getTaskEditorPage().getTask().getAttribute(key)); >+ } >+ >+ public void setStarred(boolean starred) { >+ getTaskEditorPage().getTask().setAttribute(COMMENT_STARRED + taskComment.getNumber(), >+ Boolean.toString(starred)); >+ } >+ > } > > private class ReplyToCommentAction extends AbstractReplyToCommentAction implements IMenuCreator { >@@ -546,7 +591,6 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > selectionProvider.setSelection(new StructuredSelection(taskComment)); > return commentMenu; > } >- > } > > /** Expandable composites are indented by 6 pixels by default. */ >@@ -736,6 +780,36 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > getTaskEditorPage().reflow(); > } > >+ private void expandStarredComments(boolean expandViewers) { >+ try { >+ expandAllInProgress = true; >+ suppressExpandViewers = !expandViewers; >+ getTaskEditorPage().setReflow(false); >+ >+ if (section != null) { >+ // the expandAllInProgress flag will ensure that comments in top-level groups have been >+ // expanded, no need to expand groups explicitly >+ //boolean expandGroups = section.getClient() != null; >+ >+ CommonFormUtil.setExpanded(section, true); >+ >+ if (expandViewers) { >+ List<CommentGroupViewer> groupViewers = getCommentGroupViewers(); >+ for (int i = groupViewers.size() - 1; i >= 0; i--) { >+ if (!groupViewers.get(i).isFullyExpanded()) { >+ groupViewers.get(i).setStarredExpanded(true); >+ } >+ } >+ } >+ } >+ } finally { >+ expandAllInProgress = false; >+ suppressExpandViewers = false; >+ getTaskEditorPage().setReflow(true); >+ } >+ getTaskEditorPage().reflow(); >+ } >+ > private void expandSection(final FormToolkit toolkit, final Section section) { > Composite composite = toolkit.createComposite(section); > section.setClient(composite); >@@ -775,9 +849,19 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { > expandAllAction.setToolTipText(Messages.TaskEditorCommentPart_Expand_Comments); > barManager.add(expandAllAction); > >+ Action expandStarredAction = new Action("") { //$NON-NLS-1$ >+ @Override >+ public void run() { >+ expandStarredComments(true); >+ } >+ }; >+ expandStarredAction.setImageDescriptor(CommonImages.CHECKBOX_SELECTED); >+ expandStarredAction.setToolTipText(Messages.TaskEditorCommentPart_Expand_Starred); >+ barManager.add(expandStarredAction); >+ > if (commentAttributes.isEmpty()) { > collapseAllAction.setEnabled(false); >- expandAllAction.setEnabled(false); >+ expandStarredAction.setEnabled(false); > } > } > >diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties >index d071214..c92077e 100644 >--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties >+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties >@@ -75,7 +75,9 @@ TaskEditorCommentPart_1=) > TaskEditorCommentPart_Collapse_Comments=Collapse Comments > TaskEditorCommentPart_Comments=Comments > TaskEditorCommentPart_Expand_Comments=Expand Comments >+TaskEditorCommentPart_Expand_Starred=Expand Starred > TaskEditorCommentPart_Privat_Comment_ToolTip_Text=Private Comment from {0} >+TaskEditorCommentPart_Star_this_comment=Star this comment. > > TaskEditorDescriptionPart_Description=Description > TaskEditorDescriptionPart_Detector=Detector:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 286294
: 203718 |
203719
|
203720