From 9c6cf8454ebecbd382cb6e809468518ac6583a36 Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Sun, 31 Jul 2011 20:12:44 +0200 Subject: ASSIGNED - bug 349771: create UI for support adding private comments https://bugs.eclipse.org/bugs/show_bug.cgi?id=349771 --- .../ui/editor/BugzillaTaskEditorCommentPart.java | 4 ++-- .../internal/bugzilla/ui/tasklist/messages.properties | 4 ++-- org.eclipse.mylyn.tasks.ui/icons/etool12/lock.gif | Bin 0 -> 342 bytes org.eclipse.mylyn.tasks.ui/icons/etool12/unlock.gif | Bin 0 -> 333 bytes .../tasks/ui/editors/TaskEditorCommentPart.java | 16 ++++++++++++---- .../src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java | 4 ++-- 6 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 org.eclipse.mylyn.tasks.ui/icons/etool12/lock.gif create mode 100644 org.eclipse.mylyn.tasks.ui/icons/etool12/unlock.gif diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java index 5380593c8..48355b9f2 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java @@ -80,13 +80,13 @@ public class BugzillaTaskEditorCommentPart extends TaskEditorCommentPart { } @Override - protected void addActionsToToolbar(ToolBarManager toolBarManager, TaskComment taskComment, + protected void addActionsToToolbarTitle(ToolBarManager toolBarManager, TaskComment taskComment, CommentViewer commentViewer) { String insidergroup = getModel().getTaskRepository().getProperty(IBugzillaConstants.BUGZILLA_INSIDER_GROUP); if (Boolean.parseBoolean(insidergroup)) { LockAction lockAction = new LockAction(taskComment); toolBarManager.add(lockAction); } - super.addActionsToToolbar(toolBarManager, taskComment, commentViewer); } + } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties index 542a311ab..c1f412f67 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties @@ -43,8 +43,8 @@ BugzillaRepositorySettingsPage_DescriptorFileNotExists=Descriptor File does not BugzillaRepositorySettingsPage_DownloadText=Download From Server BugzillaRepositorySettingsPage_DownloadToolTip=The Administrator must create the file\nso this may fail\! BugzillaRepositorySettingsPage_Error_updating_repository_configuration=Error updating repository configuration -BugzillaRepositorySettingsPage_insiderGroup=insider group -BugzillaRepositorySettingsPage_insiderGroup_ToolTip=User ID is member of the insider group +BugzillaRepositorySettingsPage_insiderGroup=Enable private comments: +BugzillaRepositorySettingsPage_insiderGroup_ToolTip=User ID is member of the insider group\nso private comments are supported BugzillaRepositorySettingsPage_local_users_enabled=Local users enabled: BugzillaRepositorySettingsPage_override_auto_detection_of_platform=Override auto detection of Platform and OS for new bug reports. BugzillaRepositorySettingsPage_RequiresBugzilla3_6=Requires Bugzilla > 3.6\nThe description file is not used diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool12/lock.gif b/org.eclipse.mylyn.tasks.ui/icons/etool12/lock.gif new file mode 100644 index 000000000..d08149301 Binary files /dev/null and b/org.eclipse.mylyn.tasks.ui/icons/etool12/lock.gif differ diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool12/unlock.gif b/org.eclipse.mylyn.tasks.ui/icons/etool12/unlock.gif new file mode 100644 index 000000000..994fb859d Binary files /dev/null and b/org.eclipse.mylyn.tasks.ui/icons/etool12/unlock.gif differ 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 bfcd6ef50..218c23d6e 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 @@ -363,6 +363,10 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { } }); + ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT); + addActionsToToolbarTitle(toolBarManager, taskComment, this); + toolBarManager.createControl(titleComposite); + // only visible when section is expanded final Composite buttonComposite = toolkit.createComposite(titleComposite); RowLayout buttonCompLayout = new RowLayout(); @@ -372,9 +376,9 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { buttonComposite.setBackground(null); buttonComposite.setVisible(commentComposite.isExpanded()); - ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT); - addActionsToToolbar(toolBarManager, taskComment, this); - toolBarManager.createControl(buttonComposite); + ToolBarManager toolBarManager1 = new ToolBarManager(SWT.FLAT); + addActionsToToolbarButton(toolBarManager1, taskComment, this); + toolBarManager1.createControl(buttonComposite); return buttonComposite; } @@ -554,13 +558,17 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart { setPartName(Messages.TaskEditorCommentPart_Comments); } - protected void addActionsToToolbar(ToolBarManager toolBarManager, final TaskComment taskComment, + protected void addActionsToToolbarButton(ToolBarManager toolBarManager, final TaskComment taskComment, CommentViewer commentViewer) { ReplyToCommentAction replyAction = new ReplyToCommentAction(commentViewer, taskComment); replyAction.setImageDescriptor(TasksUiImages.COMMENT_REPLY_SMALL); toolBarManager.add(replyAction); } + protected void addActionsToToolbarTitle(ToolBarManager toolBarManager, final TaskComment taskComment, + CommentViewer commentViewer) { + } + private void collapseAllComments() { try { getTaskEditorPage().setReflow(false); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java index b2491ece8..358a61d07 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java @@ -203,12 +203,12 @@ public class TasksUiImages { * @since 3.7 */ - public static final ImageDescriptor LOCK_CLOSE = create(TOOL, "lock.gif"); //$NON-NLS-1$ + public static final ImageDescriptor LOCK_CLOSE = create(TOOL_SMALL, "lock.gif"); //$NON-NLS-1$ /** * @since 3.7 */ - public static final ImageDescriptor LOCK_OPEN = create(TOOL, "unlock.gif"); //$NON-NLS-1$ + public static final ImageDescriptor LOCK_OPEN = create(TOOL_SMALL, "unlock.gif"); //$NON-NLS-1$ public static Image getImageForPriority(PriorityLevel priorityLevel) { if (priorityLevel == null) { -- cgit v1.2.3