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 63795 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.
New patch for deleting attachments and comments
delete-att-comment-patch.txt (text/plain), 5.88 KB, created by
Lubos Pochman
on 2007-04-13 16:45:18 EDT
(
hide
)
Description:
New patch for deleting attachments and comments
Filename:
MIME Type:
Creator:
Lubos Pochman
Created:
2007-04-13 16:45:18 EDT
Size:
5.88 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 13 Apr 2007 20:42:32 -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.114 >diff -u -r1.114 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylar/tasks/ui/editors/AbstractRepositoryTaskEditor.java 10 Apr 2007 01:18:16 -0000 1.114 >+++ src/org/eclipse/mylar/tasks/ui/editors/AbstractRepositoryTaskEditor.java 13 Apr 2007 20:42:33 -0000 >@@ -1083,6 +1083,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 >@@ -1093,7 +1101,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); >@@ -1320,8 +1328,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) { >@@ -1354,9 +1366,47 @@ > } > }); > >+ 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 != null && attachmentsTableViewer.getSelection() != null && >+ ((StructuredSelection)attachmentsTableViewer.getSelection()).getFirstElement() != null) { >+ RepositoryAttachment attachment = >+ (RepositoryAttachment) (((StructuredSelection) attachmentsTableViewer.getSelection()).getFirstElement()); >+ deleteAttachment(attachment); >+ submitToRepository(); >+ } >+ } >+ } >+ }); >+ >+ } > registerDropListener(section); > registerDropListener(attachmentsComposite); > registerDropListener(addAttachmentButton); >+ if (supportsAttachmentDelete()) { >+ registerDropListener(deleteAttachmentButton); >+ } > } > > private void registerDropListener(final Control control) { >@@ -1586,6 +1636,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() + ")"); >@@ -1673,6 +1731,20 @@ > // 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) { >+ if (taskComment != null) { >+ deleteComment(taskComment); >+ submitToRepository(); >+ } >+ } >+ }); >+ } > } > if (foundNew) { > commentsSection.setExpanded(true);
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 Raw
Actions:
View
Attachments on
bug 172021
:
63421
|
63422
|
63424
| 63795