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 163181 Details for
Bug 199283
[api] make attachments actionable from associated comment in task editor
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
199283.txt (text/plain), 26.71 KB, created by
Frank Becker
on 2010-03-28 12:27:46 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2010-03-28 12:27:46 EDT
Size:
26.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentHyperlink.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentHyperlink.java,v >retrieving revision 1.1 >diff -u -r1.1 TaskAttachmentHyperlink.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentHyperlink.java 14 Aug 2009 14:04:23 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentHyperlink.java 28 Mar 2010 15:47:10 -0000 >@@ -17,8 +17,27 @@ > import org.eclipse.jface.text.IRegion; > import org.eclipse.jface.text.hyperlink.IHyperlink; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; >+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonFormUtil; >+import org.eclipse.mylyn.internal.tasks.core.TaskAttachment; >+import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants; >+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil; >+import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorAttachmentPart; > import org.eclipse.mylyn.tasks.core.TaskRepository; > import org.eclipse.mylyn.tasks.ui.TasksUiUtil; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; >+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.TableItem; >+import org.eclipse.ui.IEditorPart; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.forms.IManagedForm; >+import org.eclipse.ui.forms.widgets.ExpandableComposite; >+import org.eclipse.ui.forms.widgets.ScrolledForm; >+import org.eclipse.ui.forms.widgets.Section; > > /** > * @since 3.2 >@@ -51,8 +70,60 @@ > return null; > } > >+ @SuppressWarnings("restriction") > public void open() { >- String url = repository.getUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentId; >- TasksUiUtil.openUrl(url); >+ if (TasksUiPlugin.getDefault().getPreferenceStore().getBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)) { >+ String url = repository.getUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentId; >+ TasksUiUtil.openUrl(url); >+ } else { >+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); >+ if (window != null) { >+ IWorkbenchPage page = window.getActivePage(); >+ if (page != null) { >+ IEditorPart editor = page.getActiveEditor(); >+ if (editor != null && editor instanceof TaskEditor) { >+ TaskEditor te = ((TaskEditor) editor); >+ Object sp = te.getSelectedPage(); >+ if (sp != null && sp instanceof AbstractTaskEditorPage) { >+ AbstractTaskEditorPage aat = ((AbstractTaskEditorPage) sp); >+ TaskEditorAttachmentPart actionPart = (TaskEditorAttachmentPart) aat.getPart(AbstractTaskEditorPage.ID_PART_ATTACHMENTS); >+ if (actionPart != null && actionPart.getControl() instanceof ExpandableComposite) { >+ CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), true); >+ if (actionPart.getControl() instanceof Section) { >+ Control client = actionPart.getControl(); >+ if (client instanceof Composite) { >+ for (Control control : ((Composite) client).getChildren()) { >+ if (control instanceof Composite) { >+ for (Control control1 : ((Composite) control).getChildren()) { >+ if (control1 instanceof org.eclipse.swt.widgets.Table) { >+ org.eclipse.swt.widgets.Table attachmentTable = ((org.eclipse.swt.widgets.Table) control1); >+ TableItem[] attachments = attachmentTable.getItems(); >+ int index = 0; >+ for (TableItem attachment : attachments) { >+ TaskAttachment attachmentData = ((TaskAttachment) attachment.getData()); >+ if (attachmentData.getTaskAttribute().getValue().equals( >+ attachmentId)) { >+ attachmentTable.deselectAll(); >+ attachmentTable.select(index); >+ IManagedForm mform = actionPart.getManagedForm(); >+ ScrolledForm form = mform.getForm(); >+ EditorUtil.focusOn(form, attachmentTable, 30); >+ break; >+ } >+ index++; >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } > } > } >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java,v >retrieving revision 1.12 >diff -u -r1.12 ITasksUiPreferenceConstants.java >--- src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java 15 Jan 2010 02:02:58 -0000 1.12 >+++ src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java 28 Mar 2010 15:47:12 -0000 >@@ -83,6 +83,8 @@ > > public static final String TASK_LIST_TOOL_TIPS_ENABLED = "org.eclipse.mylyn.tasks.ui.task.list.tool.tip"; //$NON-NLS-1$ > >+ public static final String ATTACHMENT_LINK_TO_BROWSER = "org.eclipse.mylyn.tasks.ui.task.editor.attachment.link.browser"; //$NON-NLS-1$ >+ > // NOTE: legacy name, do not change > public static final String PREF_DATA_DIR = "org.eclipse.mylyn.data.dir"; //$NON-NLS-1$ > >Index: src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java,v >retrieving revision 1.131 >diff -u -r1.131 TasksUiPlugin.java >--- src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java 5 Feb 2010 01:12:35 -0000 1.131 >+++ src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java 28 Mar 2010 15:47:12 -0000 >@@ -69,8 +69,8 @@ > import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil; > import org.eclipse.mylyn.internal.tasks.core.TaskList; > import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta; >-import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; > import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta.Type; >+import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; > import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; > import org.eclipse.mylyn.internal.tasks.core.data.TaskDataStore; > import org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationManager; >@@ -85,12 +85,12 @@ > import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.IRepositoryQuery; > import org.eclipse.mylyn.tasks.core.ITask; >+import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; > import org.eclipse.mylyn.tasks.core.ITaskActivationListener; > import org.eclipse.mylyn.tasks.core.ITaskContainer; > import org.eclipse.mylyn.tasks.core.RepositoryTemplate; > import org.eclipse.mylyn.tasks.core.TaskActivationAdapter; > import org.eclipse.mylyn.tasks.core.TaskRepository; >-import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; > import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; > import org.eclipse.mylyn.tasks.ui.AbstractTaskRepositoryLinkProvider; > import org.eclipse.mylyn.tasks.ui.TasksUi; >@@ -894,6 +894,7 @@ > > store.setDefault(ITasksUiPreferenceConstants.AUTO_EXPAND_TASK_LIST, true); > store.setDefault(ITasksUiPreferenceConstants.TASK_LIST_TOOL_TIPS_ENABLED, true); >+ store.setDefault(ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER, true); > } > > public static TaskActivityManager getTaskActivityManager() { >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java,v >retrieving revision 1.40 >diff -u -r1.40 EditorUtil.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java 15 Oct 2009 02:27:13 -0000 1.40 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java 28 Mar 2010 15:47:12 -0000 >@@ -148,12 +148,16 @@ > } > > /** >- * Scroll to a specified piece of text >+ * Scroll to a specified control > * >+ * @param form >+ * The ScrolledForm we want to set the new Origin > * @param control >- * The StyledText to scroll to >+ * Control that should be visible >+ * @param topSpace >+ * Space on top of the Control > */ >- private static void focusOn(ScrolledForm form, Control control) { >+ public static void focusOn(ScrolledForm form, Control control, int topSpace) { > int pos = 0; > control.setEnabled(true); > control.setFocus(); >@@ -163,7 +167,7 @@ > control = control.getParent(); > } > >- pos = pos - 60; // form.getOrigin().y; >+ pos = pos - topSpace; > if (!form.getBody().isDisposed()) { > form.setOrigin(0, pos); > } >@@ -277,7 +281,7 @@ > } > comp = comp.getParent(); > } >- focusOn(form, control); >+ focusOn(form, control, 60); > } > return true; > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java,v >retrieving revision 1.27 >diff -u -r1.27 Messages.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java 8 Feb 2010 00:38:49 -0000 1.27 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java 28 Mar 2010 15:47:12 -0000 >@@ -153,6 +153,8 @@ > > public static String TaskEditorNewCommentPart_New_Comment; > >+ public static String TaskEditorOutlineNode_Attachments; >+ > public static String TaskEditorOutlineNode_Comments; > > public static String TaskEditorOutlineNode_Description; >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineNode.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineNode.java,v >retrieving revision 1.6 >diff -u -r1.6 TaskEditorOutlineNode.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineNode.java 5 Dec 2008 23:25:50 -0000 1.6 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineNode.java 28 Mar 2010 15:47:12 -0000 >@@ -17,7 +17,9 @@ > > import org.eclipse.core.runtime.Assert; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil; > import org.eclipse.mylyn.tasks.core.IRepositoryPerson; >+import org.eclipse.mylyn.tasks.core.ITaskAttachment; > import org.eclipse.mylyn.tasks.core.ITaskComment; > import org.eclipse.mylyn.tasks.core.data.TaskAttribute; > import org.eclipse.mylyn.tasks.core.data.TaskData; >@@ -28,6 +30,7 @@ > * @author Steffen Pingel > */ > public class TaskEditorOutlineNode { >+ public static final String LABEL_ATTACHMENTS = Messages.TaskEditorOutlineNode_Attachments; > > public static final String LABEL_COMMENTS = Messages.TaskEditorOutlineNode_Comments; > >@@ -69,6 +72,26 @@ > node.setTaskComment(taskComment); > return node; > } >+ } >+ if (TaskAttribute.TYPE_ATTACHMENT.equals(type)) { >+ ITaskAttachment taskAttachment = TasksUiPlugin.getRepositoryModel().createTaskAttachment(taskAttribute); >+ if (taskAttachment != null) { >+ taskAttribute.getTaskData().getAttributeMapper().updateTaskAttachment(taskAttachment, taskAttribute); >+ StringBuilder sb = new StringBuilder(); >+ sb.append(taskAttribute.getTaskData().getAttributeMapper().getValueLabel(taskAttribute)); >+ sb.append(": "); //$NON-NLS-1$ >+ if (AttachmentUtil.isContext(taskAttachment)) { >+ sb.append(Messages.AttachmentTableLabelProvider_Task_Context); >+ } else if (taskAttachment.isPatch()) { >+ sb.append(Messages.AttachmentTableLabelProvider_Patch); >+ } else { >+ sb.append(taskAttachment.getFileName()); >+ } >+ TaskEditorOutlineNode node = new TaskEditorOutlineNode(sb.toString(), taskAttribute); >+ node.setTaskAttachment(taskAttachment); >+ return node; >+ } >+ > } else { > String label = taskAttribute.getTaskData().getAttributeMapper().getValueLabel(taskAttribute); > return new TaskEditorOutlineNode(label, taskAttribute); >@@ -82,6 +105,18 @@ > rootNode = new TaskEditorOutlineNode(Messages.TaskEditorOutlineNode_Task_ + taskData.getTaskId()); > } > addNode(rootNode, taskData, TaskAttribute.DESCRIPTION, LABEL_DESCRIPTION); >+ List<TaskAttribute> attachments = taskData.getAttributeMapper().getAttributesByType(taskData, >+ TaskAttribute.TYPE_ATTACHMENT); >+ if (attachments.size() > 0) { >+ TaskEditorOutlineNode attachmentNode = new TaskEditorOutlineNode(LABEL_ATTACHMENTS); >+ rootNode.addChild(attachmentNode); >+ for (TaskAttribute attachmentAttribute : attachments) { >+ TaskEditorOutlineNode node = createNode(attachmentAttribute); >+ if (node != null) { >+ attachmentNode.addChild(node); >+ } >+ } >+ } > List<TaskAttribute> comments = taskData.getAttributeMapper().getAttributesByType(taskData, > TaskAttribute.TYPE_COMMENT); > if (comments.size() > 0) { >@@ -118,6 +153,8 @@ > > private ITaskComment taskComment; > >+ private ITaskAttachment taskAttachment; >+ > public TaskEditorOutlineNode(String label) { > this(label, null); > } >@@ -183,4 +220,12 @@ > return getLabel(); > } > >+ public ITaskAttachment getTaskAttachment() { >+ return taskAttachment; >+ } >+ >+ public void setTaskAttachment(ITaskAttachment taskAttachment) { >+ this.taskAttachment = taskAttachment; >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlinePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlinePage.java,v >retrieving revision 1.3 >diff -u -r1.3 TaskEditorOutlinePage.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlinePage.java 13 Jan 2009 07:07:35 -0000 1.3 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlinePage.java 28 Mar 2010 15:47:12 -0000 >@@ -16,12 +16,16 @@ > import org.eclipse.jface.viewers.TreeViewer; > import org.eclipse.jface.viewers.Viewer; > import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; >+import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil; > import org.eclipse.mylyn.tasks.core.IRepositoryPerson; >+import org.eclipse.mylyn.tasks.core.ITaskAttachment; > import org.eclipse.mylyn.tasks.core.TaskRepository; > import org.eclipse.mylyn.tasks.ui.TasksUiImages; > import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.ISharedImages; >+import org.eclipse.ui.internal.WorkbenchImages; > import org.eclipse.ui.views.contentoutline.ContentOutlinePage; > > /** >@@ -92,6 +96,8 @@ > > private TreeViewer viewer; > >+ private static final String[] IMAGE_EXTENSIONS = { "jpg", "gif", "png", "tiff", "tif", "bmp" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ >+ > public TaskEditorOutlinePage() { > } > >@@ -132,6 +138,28 @@ > } else { > return CommonImages.getImage(CommonImages.PERSON); > } >+ } else if (node.getTaskAttachment() != null) { >+ ITaskAttachment attachment = node.getTaskAttachment(); >+ if (AttachmentUtil.isContext(attachment)) { >+ return CommonImages.getImage(TasksUiImages.CONTEXT_TRANSFER); >+ } else if (attachment.isPatch()) { >+ return CommonImages.getImage(TasksUiImages.TASK_ATTACHMENT_PATCH); >+ } else { >+ String filename = attachment.getFileName(); >+ if (filename != null) { >+ int dotIndex = filename.lastIndexOf('.'); >+ if (dotIndex != -1) { >+ String fileType = filename.substring(dotIndex + 1); >+ for (String element2 : IMAGE_EXTENSIONS) { >+ if (element2.equalsIgnoreCase(fileType)) { >+ return CommonImages.getImage(CommonImages.IMAGE_FILE); >+ } >+ } >+ } >+ } >+ return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE); >+ } >+ > } else { > return CommonImages.getImage(TasksUiImages.TASK); > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties,v >retrieving revision 1.35 >diff -u -r1.35 messages.properties >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties 8 Feb 2010 00:38:48 -0000 1.35 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties 28 Mar 2010 15:47:13 -0000 >@@ -85,6 +85,7 @@ > TaskEditorDescriptionPart_Search=Search > > TaskEditorNewCommentPart_New_Comment=New Comment >+TaskEditorOutlineNode_Attachments=Attachments > TaskEditorOutlineNode_Comments=Comments > TaskEditorOutlineNode_Description=Description > TaskEditorOutlineNode_New_Comment=New Comment >Index: src/org/eclipse/mylyn/internal/tasks/ui/preferences/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/Messages.java,v >retrieving revision 1.5 >diff -u -r1.5 Messages.java >--- src/org/eclipse/mylyn/internal/tasks/ui/preferences/Messages.java 26 Feb 2010 04:07:19 -0000 1.5 >+++ src/org/eclipse/mylyn/internal/tasks/ui/preferences/Messages.java 28 Mar 2010 15:47:13 -0000 >@@ -63,6 +63,12 @@ > > public static String TasksUiPreferencePage_A_new_empty_Task_List_will_be_created_in_the_chosen_directory_if_one_does_not_already_exists; > >+ public static String TasksUiPreferencePage_Attachment_Link_Target_Browser; >+ >+ public static String TasksUiPreferencePage_Attachment_Link_Target_Description; >+ >+ public static String TasksUiPreferencePage_Attachment_Link_Target_Editor; >+ > public static String TasksUiPreferencePage_highlight_current_line; > > public static String TasksUiPreferencePage_Rich_Editor__Recommended_; >Index: src/org/eclipse/mylyn/internal/tasks/ui/preferences/TasksUiPreferencePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/TasksUiPreferencePage.java,v >retrieving revision 1.41 >diff -u -r1.41 TasksUiPreferencePage.java >--- src/org/eclipse/mylyn/internal/tasks/ui/preferences/TasksUiPreferencePage.java 26 Feb 2010 04:07:20 -0000 1.41 >+++ src/org/eclipse/mylyn/internal/tasks/ui/preferences/TasksUiPreferencePage.java 28 Mar 2010 15:47:13 -0000 >@@ -109,6 +109,10 @@ > > private Button taskListTooltipEnabledButton; > >+ private Button attachmentHyperLinkUseURLButton; >+ >+ private Button attachmentHyperLinkUseTableButton; >+ > public TasksUiPreferencePage() { > super(); > setPreferenceStore(TasksUiPlugin.getDefault().getPreferenceStore()); >@@ -128,6 +132,7 @@ > createTaskEditorGroup(container); > createTaskActivityGroup(container); > Composite advanced = createAdvancedSection(container); >+ createTaskEditorSettings(advanced); > createTaskDataControl(advanced); > > if (getContainer() instanceof IWorkbenchPreferenceContainer) { >@@ -247,6 +252,8 @@ > return false; > } > } >+ getPreferenceStore().setValue(ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER, >+ attachmentHyperLinkUseURLButton.getSelection()); > > return true; > } >@@ -289,6 +296,10 @@ > activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean( > MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED)); > >+ attachmentHyperLinkUseURLButton.setSelection(getPreferenceStore().getBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)); >+ attachmentHyperLinkUseTableButton.setSelection(!getPreferenceStore().getBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)); > return true; > } > >@@ -331,6 +342,10 @@ > > activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getDefaultBoolean( > MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED)); >+ attachmentHyperLinkUseURLButton.setSelection(getPreferenceStore().getDefaultBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)); >+ attachmentHyperLinkUseTableButton.setSelection(!getPreferenceStore().getDefaultBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)); > > updateRefreshGroupEnablements(); > } >@@ -618,4 +633,22 @@ > } > super.dispose(); > } >+ >+ private void createTaskEditorSettings(Composite parent) { >+ Group container = new Group(parent, SWT.SHADOW_ETCHED_IN); >+ container.setLayout(new GridLayout(2, false)); >+ container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ container.setText(Messages.TasksUiPreferencePage_Attachment_Link_Target_Description); >+ attachmentHyperLinkUseURLButton = new Button(container, SWT.RADIO); >+ attachmentHyperLinkUseURLButton.setText(Messages.TasksUiPreferencePage_Attachment_Link_Target_Browser); >+ attachmentHyperLinkUseURLButton.setSelection(getPreferenceStore().getBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)); >+ >+ attachmentHyperLinkUseTableButton = new Button(container, SWT.RADIO); >+ attachmentHyperLinkUseTableButton.setText(Messages.TasksUiPreferencePage_Attachment_Link_Target_Editor); >+ attachmentHyperLinkUseTableButton.setSelection(!getPreferenceStore().getBoolean( >+ ITasksUiPreferenceConstants.ATTACHMENT_LINK_TO_BROWSER)); >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/preferences/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/messages.properties,v >retrieving revision 1.9 >diff -u -r1.9 messages.properties >--- src/org/eclipse/mylyn/internal/tasks/ui/preferences/messages.properties 26 Feb 2010 04:07:20 -0000 1.9 >+++ src/org/eclipse/mylyn/internal/tasks/ui/preferences/messages.properties 28 Mar 2010 15:47:13 -0000 >@@ -27,6 +27,9 @@ > TasksUiPreferencePage_minutes=minutes > TasksUiPreferencePage_minutes_of_inactivity=minutes of inactivity. > TasksUiPreferencePage_A_new_empty_Task_List_will_be_created_in_the_chosen_directory_if_one_does_not_already_exists=A new empty Task List will be created in the chosen directory if one does not already exists. Your previous directory and its contents will not be deleted.\n\nProceed? >+TasksUiPreferencePage_Attachment_Link_Target_Browser=Browser >+TasksUiPreferencePage_Attachment_Link_Target_Description=Attachment Hyperlink target for attachments >+TasksUiPreferencePage_Attachment_Link_Target_Editor=Section in TaskEditor > TasksUiPreferencePage_highlight_current_line=Highlight current line > TasksUiPreferencePage_Rich_Editor__Recommended_=Rich Editor (Recommended) > TasksUiPreferencePage_Scheduling=Scheduling >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java,v >retrieving revision 1.156 >diff -u -r1.156 AbstractTaskEditorPage.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java 18 Mar 2010 17:45:05 -0000 1.156 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java 28 Mar 2010 15:47:13 -0000 >@@ -54,6 +54,7 @@ > import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer; > import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener; > import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable; >+import org.eclipse.mylyn.internal.tasks.core.TaskAttachment; > import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; > import org.eclipse.mylyn.internal.tasks.core.data.ITaskDataManagerListener; > import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManagerEvent; >@@ -88,9 +89,9 @@ > import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.IRepositoryElement; > import org.eclipse.mylyn.tasks.core.ITask; >+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; > import org.eclipse.mylyn.tasks.core.RepositoryStatus; > import org.eclipse.mylyn.tasks.core.TaskRepository; >-import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; > import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; > import org.eclipse.mylyn.tasks.core.data.TaskAttribute; > import org.eclipse.mylyn.tasks.core.data.TaskData; >@@ -123,6 +124,7 @@ > import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Menu; > import org.eclipse.swt.widgets.ScrollBar; >+import org.eclipse.swt.widgets.TableItem; > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorSite; > import org.eclipse.ui.PlatformUI; >@@ -1053,8 +1055,41 @@ > } > } > } >+ EditorUtil.reveal(form, attribute.getId()); >+ } else if (TaskAttribute.TYPE_ATTACHMENT.equals(attribute.getMetaData().getType())) { >+ AbstractTaskEditorPart actionPart = getPart(ID_PART_ATTACHMENTS); >+ if (actionPart != null && actionPart.getControl() instanceof ExpandableComposite) { >+ CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), true); >+ if (actionPart.getControl() instanceof Section) { >+ Control client = actionPart.getControl(); >+ if (client instanceof Composite) { >+ for (Control control : ((Composite) client).getChildren()) { >+ if (control instanceof Composite) { >+ for (Control control1 : ((Composite) control).getChildren()) { >+ if (control1 instanceof org.eclipse.swt.widgets.Table) { >+ org.eclipse.swt.widgets.Table attachmentTable = ((org.eclipse.swt.widgets.Table) control1); >+ TableItem[] attachments = attachmentTable.getItems(); >+ int index = 0; >+ for (TableItem attachment : attachments) { >+ TaskAttachment attachmentData = ((TaskAttachment) attachment.getData()); >+ if (attachmentData.getTaskAttribute() == attribute) { >+ attachmentTable.deselectAll(); >+ attachmentTable.select(index); >+ IManagedForm mform = actionPart.getManagedForm(); >+ ScrolledForm form = mform.getForm(); >+ EditorUtil.focusOn(form, attachmentTable, 30); >+ break; >+ } >+ index++; >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } > } >- EditorUtil.reveal(form, attribute.getId()); > } else { > EditorUtil.reveal(form, node.getLabel()); > }
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
Flags:
eclipse
:
review?
Actions:
View
|
Diff
Attachments on
bug 199283
: 163181 |
163182
|
173583
|
173584
|
176402
|
176403
|
176404
|
176405
|
187141
|
187142
|
187327
|
187328
|
187342
|
187361