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 63421 Details for
Bug 172021
[api] AbstractRepositoryTaskEditor should optionally support delete/remove for comments and attachments
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]
Patch for deleting attachments and comments
delete-att-comment-patch.txt (text/plain), 5.94 KB, created by
Lubos Pochman
on 2007-04-10 15:39:59 EDT
(
hide
)
Description:
Patch for deleting attachments and comments
Filename:
MIME Type:
Creator:
Lubos Pochman
Created:
2007-04-10 15:39:59 EDT
Size:
5.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.tasks.ui >Index: src/org/eclipse/mylar/internal/tasks/ui/TasksUiImages.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/internal/tasks/ui/TasksUiImages.java,v >retrieving revision 1.2 >diff -u -r1.2 TasksUiImages.java >--- src/org/eclipse/mylar/internal/tasks/ui/TasksUiImages.java 31 Mar 2007 02:16:58 -0000 1.2 >+++ src/org/eclipse/mylar/internal/tasks/ui/TasksUiImages.java 10 Apr 2007 19:38:09 -0000 >@@ -57,6 +57,8 @@ > > public static final ImageDescriptor REMOVE = create(T_ELCL, "remove.gif"); > >+ public static final ImageDescriptor COMMENT_DELETE = create(T_ELCL, "comment_delete.png"); >+ > public static final ImageDescriptor FILTER_COMPLETE = create(T_ELCL, "filter-complete.gif"); > > public static final ImageDescriptor FILTER_ARCHIVE = create(T_ELCL, "filter-archive.gif"); >Index: src/org/eclipse/mylar/tasks/ui/editors/AbstractRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/editors/AbstractRepositoryTaskEditor.java,v >retrieving revision 1.112 >diff -u -r1.112 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylar/tasks/ui/editors/AbstractRepositoryTaskEditor.java 4 Apr 2007 03:05:39 -0000 1.112 >+++ src/org/eclipse/mylar/tasks/ui/editors/AbstractRepositoryTaskEditor.java 10 Apr 2007 19:38:10 -0000 >@@ -1088,6 +1088,14 @@ > toolkit.paintBordersFor(summaryComposite); > } > >+ protected boolean supportsAttachmentDelete() { >+ return false; >+ } >+ >+ protected void deleteAttachment(RepositoryAttachment attachment) { >+ >+ } >+ > protected void createAttachmentLayout(Composite composite) { > > // TODO: expand to show new attachments >@@ -1098,7 +1106,7 @@ > attachmentsComposite.setLayout(new GridLayout(1, false)); > attachmentsComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); > section.setClient(attachmentsComposite); >- >+ > if (taskData.getAttachments().size() > 0) { > > attachmentsTable = toolkit.createTable(attachmentsComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION); >@@ -1325,8 +1333,12 @@ > registerDropListener(label); > } > >+ final Composite attachmentControlsComposite = toolkit.createComposite(attachmentsComposite); >+ attachmentControlsComposite.setLayout(new GridLayout(2, false)); >+ attachmentControlsComposite.setLayoutData(new GridData(GridData.BEGINNING)); >+ > /* Launch a NewAttachemntWizard */ >- Button addAttachmentButton = toolkit.createButton(attachmentsComposite, "Attach File...", SWT.PUSH); >+ Button addAttachmentButton = toolkit.createButton(attachmentControlsComposite, "Attach File...", SWT.PUSH); > > ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskData.getId()); > if (task == null) { >@@ -1359,9 +1371,45 @@ > } > }); > >+ Button deleteAttachmentButton = null; >+ if (supportsAttachmentDelete()) { >+ deleteAttachmentButton = toolkit.createButton(attachmentControlsComposite, "Delete Attachment...", SWT.PUSH); >+ >+ deleteAttachmentButton.addSelectionListener(new SelectionListener() { >+ public void widgetDefaultSelected(SelectionEvent e) { >+ // ignore >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), >+ taskData.getId()); >+ if (task == null || !(task instanceof AbstractRepositoryTask)) { >+ // Should not happen >+ return; >+ } >+ if (AbstractRepositoryTaskEditor.this.isDirty >+ || ((AbstractRepositoryTask) task).getSyncState().equals(RepositoryTaskSyncState.OUTGOING)) { >+ MessageDialog.openInformation(attachmentsComposite.getShell(), >+ "Task not synchronized or dirty editor", >+ "Commit edits or synchronize task before deleting attachments."); >+ return; >+ } else { >+ if (attachmentsTableViewer.getSelection() != null) { >+ RepositoryAttachment attachment = >+ (RepositoryAttachment) (((StructuredSelection) attachmentsTableViewer.getSelection()).getFirstElement()); >+ deleteAttachment(attachment); >+ } >+ } >+ } >+ }); >+ >+ } > registerDropListener(section); > registerDropListener(attachmentsComposite); > registerDropListener(addAttachmentButton); >+ if (supportsAttachmentDelete()) { >+ registerDropListener(deleteAttachmentButton); >+ } > } > > private void registerDropListener(final Control control) { >@@ -1697,6 +1745,14 @@ > } > } > >+ protected boolean supportsCommentDelete() { >+ return false; >+ } >+ >+ protected void deleteComment(TaskComment comment) { >+ >+ } >+ > protected void createCommentLayout(Composite composite) { > commentsSection = createSection(composite, getSectionLabel(SECTION_NAME.COMMENTS_SECTION)); > commentsSection.setText(commentsSection.getText() + " (" + taskData.getComments().size() + ")"); >@@ -1784,6 +1840,17 @@ > // code for outline > commentStyleText.add(styledText); > textHash.put(taskComment, styledText); >+ >+ if (supportsCommentDelete()) { >+ Button deleteButton = toolkit.createButton(ecComposite, null, SWT.PUSH); >+ deleteButton.setImage(TasksUiImages.getImage(TasksUiImages.COMMENT_DELETE)); >+ deleteButton.setToolTipText("Remove comment above."); >+ deleteButton.addListener(SWT.Selection, new Listener() { >+ public void handleEvent(Event e) { >+ deleteComment(taskComment); >+ } >+ }); >+ } > } > if (foundNew) { > commentsSection.setExpanded(true); >@@ -2633,7 +2700,7 @@ > } > } else { > modifiedTask = (AbstractRepositoryTask) TasksUiPlugin.getTaskListManager().getTaskList() >- .getTask(repository.getUrl(), taskData.getId()); >+ .getTask(repository.getUrl(), taskId); > } > > // Synchronization accounting...
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 172021
:
63421
|
63422
|
63424
|
63795