View | Details | Raw Unified | Return to bug 278102 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXMLRPCTest.java (-17 / +21 lines)
Lines 33-63 Link Here
33
33
34
	@Override
34
	@Override
35
	public void setUp() throws Exception {
35
	public void setUp() throws Exception {
36
/*
36
		WebLocation webLocation = new WebLocation(BugzillaFixture.current().getRepositoryUrl() + "/xmlrpc.cgi");
37
		WebLocation webLocation = new WebLocation(BugzillaFixture.current().getRepositoryUrl() + "/xmlrpc.cgi");
37
		webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
38
		webLocation.setCredentials(AuthenticationType.REPOSITORY, "tests@mylyn.eclipse.org", "mylyntest");
39
*/
40
		WebLocation webLocation = new WebLocation("http://macmainz.dyndns.org/Internet/BugzillaDevelop//xmlrpc.cgi");
41
		webLocation.setCredentials(AuthenticationType.REPOSITORY, "Frank@Frank-Becker.de", "fr$an¤k");
38
		bugzillaClient = new BugzillaXmlRpcClient(webLocation);
42
		bugzillaClient = new BugzillaXmlRpcClient(webLocation);
39
		bugzillaClient.setContentTypeCheckingEnabled(true);
43
		bugzillaClient.setContentTypeCheckingEnabled(true);
40
	}
44
	}
41
45
42
	@SuppressWarnings("unused")
46
	@SuppressWarnings("unused")
43
	public void testxmlrpc() throws Exception {
47
	public void testxmlrpc() throws Exception {
44
		if (BugzillaFixture.current() != BugzillaFixture.BUGS_3_6_XML_RPC_DISABLED) {
48
//		if (BugzillaFixture.current() != BugzillaFixture.BUGS_3_6_XML_RPC_DISABLED) {
45
			int uID = bugzillaClient.login();
49
		int uID = bugzillaClient.login();
46
			String x0 = bugzillaClient.getVersion();
50
		String x0 = bugzillaClient.getVersion();
47
			HashMap<?, ?> x1 = bugzillaClient.getTime();
51
		HashMap<?, ?> x1 = bugzillaClient.getTime();
48
			Date x2 = bugzillaClient.getDBTime();
52
		Date x2 = bugzillaClient.getDBTime();
49
			Date x3 = bugzillaClient.getWebTime();
53
		Date x3 = bugzillaClient.getWebTime();
50
			Object[] xx0 = bugzillaClient.getUserInfoFromIDs(new Integer[] { 1, 2 });
54
		Object[] xx0 = bugzillaClient.getUserInfoFromIDs(new Integer[] { 1, 2 });
51
			Object[] xx1 = bugzillaClient.getUserInfoFromNames(new String[] { "tests@mylyn.eclipse.org" });
55
//		Object[] xx1 = bugzillaClient.getUserInfoFromNames(new String[] { "tests@mylyn.eclipse.org" });
52
			Object[] xx2 = bugzillaClient.getUserInfoWithMatch(new String[] { "est" });
56
//		Object[] xx2 = bugzillaClient.getUserInfoWithMatch(new String[] { "est" });
53
			Object[] xx3 = bugzillaClient.getAllFields();
57
		Object[] xx3 = bugzillaClient.getAllFields();
54
			Object[] xx4 = bugzillaClient.getFieldsWithNames(new String[] { "qa_contact" });
58
		Object[] xx4 = bugzillaClient.getFieldsWithNames(new String[] { "qa_contact" });
55
			Object[] xx5 = bugzillaClient.getFieldsWithIDs(new Integer[] { 12, 18 });
59
		Object[] xx5 = bugzillaClient.getFieldsWithIDs(new Integer[] { 12, 18 });
56
			Object[] xx6 = bugzillaClient.getSelectableProducts();
60
		Object[] xx6 = bugzillaClient.getSelectableProducts();
57
			Object[] xx7 = bugzillaClient.getEnterableProducts();
61
		Object[] xx7 = bugzillaClient.getEnterableProducts();
58
			Object[] xx8 = bugzillaClient.getAccessibleProducts();
62
		Object[] xx8 = bugzillaClient.getAccessibleProducts();
59
			Object[] xx9 = bugzillaClient.getProducts(new Integer[] { 1, 3 });
63
		Object[] xx9 = bugzillaClient.getProducts(new Integer[] { 1, 3 });
60
		}
64
//		}
61
	}
65
	}
62
66
63
	@SuppressWarnings("unused")
67
	@SuppressWarnings("unused")
(-)plugin.xml (-1 / +19 lines)
Lines 631-637 Link Here
631
               value="org.eclipse.mylyn.tasks.ui.views.tasks">
631
               value="org.eclipse.mylyn.tasks.ui.views.tasks">
632
         </parameter>
632
         </parameter>
633
      </key>
633
      </key>
634
  </extension>
634
     <key
635
           commandId="org.eclipse.mylyn.task.ui.actions.outline.related.tasks.dialog"
636
           contextId="org.eclipse.mylyn.tasks.ui.editors.task"
637
           schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
638
           sequence="M1+M2+O">
639
      </key>
640
   </extension>
635
  
641
  
636
   <extension
642
   <extension
637
         point="org.eclipse.ui.themes">
643
         point="org.eclipse.ui.themes">
Lines 828-833 Link Here
828
               style="push"
834
               style="push"
829
               toolbarPath="org.eclipse.search.searchActionSet/Search"
835
               toolbarPath="org.eclipse.search.searchActionSet/Search"
830
               tooltip="%OpenTaskAction.tooltip"/>
836
               tooltip="%OpenTaskAction.tooltip"/>
837
	     <action
838
               definitionId="org.eclipse.mylyn.task.ui.actions.outline.related.tasks.dialog"
839
               label="Quick Outline"
840
               class="org.eclipse.mylyn.internal.tasks.ui.editors.outline.ShowQuickOutlineAction"
841
               menubarPath="navigate/showIn"
842
               id="org.eclipse.mylyn.task.ui.actions.outline.related.tasks.dialog">
843
         </action>
831
      </actionSet>
844
      </actionSet>
832
   </extension>
845
   </extension>
833
   
846
   
Lines 835-840 Link Here
835
      <command id="org.eclipse.mylyn.tasks.ui.command.previousTask"
848
      <command id="org.eclipse.mylyn.tasks.ui.command.previousTask"
836
               defaultHandler="org.eclipse.mylyn.internal.tasks.ui.TaskHistoryHandler"
849
               defaultHandler="org.eclipse.mylyn.internal.tasks.ui.TaskHistoryHandler"
837
               name="%command.previousTask.name"/>
850
               name="%command.previousTask.name"/>
851
      <command
852
            name="Quick Outline"
853
            description="Show the quick outline for the editor input"
854
            id="org.eclipse.mylyn.task.ui.actions.outline.related.tasks.dialog"
855
            categoryId="org.eclipse.mylyn.tasks.ui.commands"/>   
838
   </extension>
856
   </extension>
839
857
840
  <!-- command-based implementation of the previousTask/history dropdown, 
858
  <!-- command-based implementation of the previousTask/history dropdown, 
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorUtil.java (-5 / +97 lines)
Lines 25-37 Link Here
25
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonTextSupport;
25
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonTextSupport;
26
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonThemes;
26
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonThemes;
27
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil;
27
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil;
28
import org.eclipse.mylyn.internal.tasks.core.TaskAttachment;
28
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
29
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
29
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewAttachmentWizardDialog;
30
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewAttachmentWizardDialog;
30
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard.Mode;
31
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard.Mode;
32
import org.eclipse.mylyn.tasks.core.TaskRepository;
31
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource;
33
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource;
32
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
34
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
33
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
35
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
36
import org.eclipse.mylyn.tasks.core.data.TaskRelation;
37
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
34
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
38
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
39
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
35
import org.eclipse.mylyn.tasks.ui.editors.TaskFormPage;
40
import org.eclipse.mylyn.tasks.ui.editors.TaskFormPage;
36
import org.eclipse.swt.SWT;
41
import org.eclipse.swt.SWT;
37
import org.eclipse.swt.custom.CCombo;
42
import org.eclipse.swt.custom.CCombo;
Lines 58-63 Link Here
58
import org.eclipse.swt.widgets.Menu;
63
import org.eclipse.swt.widgets.Menu;
59
import org.eclipse.swt.widgets.ScrollBar;
64
import org.eclipse.swt.widgets.ScrollBar;
60
import org.eclipse.swt.widgets.Scrollable;
65
import org.eclipse.swt.widgets.Scrollable;
66
import org.eclipse.swt.widgets.TableItem;
61
import org.eclipse.swt.widgets.Widget;
67
import org.eclipse.swt.widgets.Widget;
62
import org.eclipse.ui.PlatformUI;
68
import org.eclipse.ui.PlatformUI;
63
import org.eclipse.ui.actions.ActionFactory;
69
import org.eclipse.ui.actions.ActionFactory;
Lines 153-159 Link Here
153
	 * @param control
159
	 * @param control
154
	 *            The StyledText to scroll to
160
	 *            The StyledText to scroll to
155
	 */
161
	 */
156
	private static void focusOn(ScrolledForm form, Control control) {
162
	public static void focusOn(ScrolledForm form, Control control) {
157
		int pos = 0;
163
		int pos = 0;
158
		control.setEnabled(true);
164
		control.setEnabled(true);
159
		control.setFocus();
165
		control.setFocus();
Lines 405-412 Link Here
405
		} else {
411
		} else {
406
			roundedBorder.setLayout(GridLayoutFactory.fillDefaults().margins(0, 6).create());
412
			roundedBorder.setLayout(GridLayoutFactory.fillDefaults().margins(0, 6).create());
407
		}
413
		}
408
		GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(EditorUtil.MAXIMUM_WIDTH, SWT.DEFAULT).grab(
414
		GridDataFactory.fillDefaults()
409
				true, false).applyTo(roundedBorder);
415
				.align(SWT.FILL, SWT.BEGINNING)
416
				.hint(EditorUtil.MAXIMUM_WIDTH, SWT.DEFAULT)
417
				.grab(true, false)
418
				.applyTo(roundedBorder);
410
		return roundedBorder;
419
		return roundedBorder;
411
	}
420
	}
412
421
Lines 432-439 Link Here
432
				textFont.dispose();
441
				textFont.dispose();
433
			}
442
			}
434
		});
443
		});
435
		Color color = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry().get(
444
		Color color = PlatformUI.getWorkbench()
436
				CommonThemes.COLOR_COMPLETED);
445
				.getThemeManager()
446
				.getCurrentTheme()
447
				.getColorRegistry()
448
				.get(CommonThemes.COLOR_COMPLETED);
437
		text.setForeground(color);
449
		text.setForeground(color);
438
		return textFont;
450
		return textFont;
439
	}
451
	}
Lines 590-593 Link Here
590
		}
602
		}
591
	}
603
	}
592
604
605
	public static void focusFromStructuredSelection(Object select, AbstractTaskEditorPage taskEditorPage) {
606
		if (select instanceof TaskEditorOutlineNode) {
607
			TaskEditorOutlineNode node = (TaskEditorOutlineNode) select;
608
			TaskAttribute attribute = node.getData();
609
			if (attribute != null) {
610
				if (TaskAttribute.TYPE_COMMENT.equals(attribute.getMetaData().getType())) {
611
					AbstractTaskEditorPart actionPart = taskEditorPage.getPart(AbstractTaskEditorPage.ID_PART_COMMENTS);
612
					if (actionPart != null && actionPart.getControl() instanceof ExpandableComposite) {
613
						CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), true);
614
						if (actionPart.getControl() instanceof Section) {
615
							Control client = ((Section) actionPart.getControl()).getClient();
616
							if (client instanceof Composite) {
617
								for (Control control : ((Composite) client).getChildren()) {
618
									// toggle subsections
619
									if (control instanceof Section) {
620
										CommonFormUtil.setExpanded((Section) control, true);
621
									}
622
								}
623
							}
624
						}
625
					}
626
					EditorUtil.reveal(taskEditorPage.getManagedForm().getForm(), attribute.getId());
627
				} else if (TaskAttribute.TYPE_ATTACHMENT.equals(attribute.getMetaData().getType())) {
628
					AbstractTaskEditorPart actionPart = taskEditorPage.getPart(AbstractTaskEditorPage.ID_PART_ATTACHMENTS);
629
					if (actionPart != null && actionPart.getControl() instanceof ExpandableComposite) {
630
						CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), true);
631
						if (actionPart.getControl() instanceof Section) {
632
							Control client = actionPart.getControl();
633
							if (client instanceof Composite) {
634
								for (Control control : ((Composite) client).getChildren()) {
635
									if (control instanceof Composite) {
636
										for (Control control1 : ((Composite) control).getChildren()) {
637
											if (control1 instanceof org.eclipse.swt.widgets.Table) {
638
												org.eclipse.swt.widgets.Table attachmentTable = ((org.eclipse.swt.widgets.Table) control1);
639
												TableItem[] attachments = attachmentTable.getItems();
640
												int index = 0;
641
												for (TableItem attachment : attachments) {
642
													TaskAttachment attachmentData = ((TaskAttachment) attachment.getData());
643
													if (attachmentData.getTaskAttribute() == attribute) {
644
														attachmentTable.deselectAll();
645
														attachmentTable.select(index);
646
														IManagedForm mform = actionPart.getManagedForm();
647
														ScrolledForm form = mform.getForm();
648
														EditorUtil.focusOn(form, attachmentTable);
649
														break;
650
													}
651
													index++;
652
												}
653
											}
654
										}
655
									}
656
								}
657
							}
658
						}
659
					}
660
				} else {
661
					TaskEditorAttributePart actionPart = (TaskEditorAttributePart) taskEditorPage.getPart(AbstractTaskEditorPage.ID_PART_ATTRIBUTES);
662
					Section section = actionPart.getSection();
663
					boolean expanded = section.isExpanded();
664
					if (!expanded && actionPart != null && actionPart.getControl() instanceof ExpandableComposite) {
665
						CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), true);
666
						if (!expanded) {
667
							CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), false);
668
						}
669
					}
670
671
					EditorUtil.reveal(taskEditorPage.getManagedForm().getForm(), attribute.getId());
672
				}
673
			} else {
674
				TaskRelation taskRelation = node.getTaskRelation();
675
				TaskRepository taskRepository = node.getTaskRepository();
676
				if (taskRelation != null && taskRepository != null) {
677
					String taskID = taskRelation.getTaskId();
678
					TasksUiUtil.openTask(taskRepository, taskID);
679
				} else {
680
					EditorUtil.reveal(taskEditorPage.getManagedForm().getForm(), node.getLabel());
681
				}
682
			}
683
		}
684
	}
593
}
685
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java (+10 lines)
Lines 151-164 Link Here
151
151
152
	public static String TaskEditorNewCommentPart_New_Comment;
152
	public static String TaskEditorNewCommentPart_New_Comment;
153
153
154
	public static String TaskEditorOutlineNode_Attachments;
155
156
	public static String TaskEditorOutlineNode_Attributes;
157
154
	public static String TaskEditorOutlineNode_Comments;
158
	public static String TaskEditorOutlineNode_Comments;
155
159
156
	public static String TaskEditorOutlineNode_Description;
160
	public static String TaskEditorOutlineNode_Description;
157
161
158
	public static String TaskEditorOutlineNode_New_Comment;
162
	public static String TaskEditorOutlineNode_New_Comment;
159
163
164
	public static String TaskEditorOutlineNode_Related_Tasks;
165
160
	public static String TaskEditorOutlineNode_Task_;
166
	public static String TaskEditorOutlineNode_Task_;
161
167
168
	public static String TaskEditorOutlineNode_TaskRelation_Label;
169
170
	public static String TaskEditorOutlineNode_unknown_Label;
171
162
	public static String TaskEditorPeoplePart_People;
172
	public static String TaskEditorPeoplePart_People;
163
173
164
	public static String TaskEditorPlanningPart_0_SECOUNDS;
174
	public static String TaskEditorPlanningPart_0_SECOUNDS;
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineContentProvider.java (+56 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
13
14
import org.eclipse.jface.viewers.ITreeContentProvider;
15
import org.eclipse.jface.viewers.Viewer;
16
17
public class TaskEditorOutlineContentProvider implements ITreeContentProvider {
18
19
	public void dispose() {
20
		// ignore
21
	}
22
23
	public Object[] getChildren(Object parentElement) {
24
		if (parentElement instanceof TaskEditorOutlineNode) {
25
			Object[] children = ((TaskEditorOutlineNode) parentElement).getChildren();
26
			return children;
27
		}
28
		return new Object[0];
29
	}
30
31
	public Object[] getElements(Object inputElement) {
32
		if (inputElement instanceof TaskEditorOutlineModel) {
33
			return new Object[] { ((TaskEditorOutlineModel) inputElement).getRoot() };
34
		}
35
		return new Object[0];
36
	}
37
38
	public Object getParent(Object element) {
39
		if (element instanceof TaskEditorOutlineNode) {
40
			return ((TaskEditorOutlineNode) element).getParent();
41
		}
42
		return null;
43
	}
44
45
	public boolean hasChildren(Object element) {
46
		if (element instanceof TaskEditorOutlineNode) {
47
			return ((TaskEditorOutlineNode) element).getChildren().length > 0;
48
		}
49
		return false;
50
	}
51
52
	public void inputChanged(Viewer viewerChanged, Object oldInput, Object newInput) {
53
		// ignore
54
	}
55
56
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineModel.java (+26 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
13
14
public class TaskEditorOutlineModel {
15
16
	private final TaskEditorOutlineNode root;
17
18
	public TaskEditorOutlineModel(TaskEditorOutlineNode root) {
19
		this.root = root;
20
	}
21
22
	public TaskEditorOutlineNode getRoot() {
23
		return root;
24
	}
25
26
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineNode.java (-2 / +121 lines)
Lines 12-26 Link Here
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
13
13
14
import java.util.ArrayList;
14
import java.util.ArrayList;
15
import java.util.Collection;
15
import java.util.Date;
16
import java.util.Date;
16
import java.util.List;
17
import java.util.List;
18
import java.util.Map;
17
19
18
import org.eclipse.core.runtime.Assert;
20
import org.eclipse.core.runtime.Assert;
21
import org.eclipse.mylyn.internal.tasks.core.TaskList;
22
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
19
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
23
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
24
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
25
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
20
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
26
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
27
import org.eclipse.mylyn.tasks.core.ITask;
28
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
21
import org.eclipse.mylyn.tasks.core.ITaskComment;
29
import org.eclipse.mylyn.tasks.core.ITaskComment;
30
import org.eclipse.mylyn.tasks.core.TaskRepository;
22
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
31
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
23
import org.eclipse.mylyn.tasks.core.data.TaskData;
32
import org.eclipse.mylyn.tasks.core.data.TaskData;
33
import org.eclipse.mylyn.tasks.core.data.TaskRelation;
34
import org.eclipse.mylyn.tasks.ui.TasksUi;
35
import org.eclipse.osgi.util.NLS;
24
36
25
/**
37
/**
26
 * A node for the tree in {@link TaskEditorOutlinePage}.
38
 * A node for the tree in {@link TaskEditorOutlinePage}.
Lines 35-40 Link Here
35
47
36
	public static final String LABEL_NEW_COMMENT = Messages.TaskEditorOutlineNode_New_Comment;
48
	public static final String LABEL_NEW_COMMENT = Messages.TaskEditorOutlineNode_New_Comment;
37
49
50
	public static final String LABEL_ATTACHMENTS = Messages.TaskEditorOutlineNode_Attachments;
51
52
	public static final String LABEL_ATTRIBUTES = Messages.TaskEditorOutlineNode_Attributes;
53
54
	public static final String LABEL_RELATED_TASKS = Messages.TaskEditorOutlineNode_Related_Tasks;
55
38
	private static TaskEditorOutlineNode createNode(TaskData taskData, String attributeId, String label) {
56
	private static TaskEditorOutlineNode createNode(TaskData taskData, String attributeId, String label) {
39
		TaskAttribute taskAttribute = taskData.getRoot().getMappedAttribute(attributeId);
57
		TaskAttribute taskAttribute = taskData.getRoot().getMappedAttribute(attributeId);
40
		if (taskAttribute != null) {
58
		if (taskAttribute != null) {
Lines 69-87 Link Here
69
				node.setTaskComment(taskComment);
87
				node.setTaskComment(taskComment);
70
				return node;
88
				return node;
71
			}
89
			}
90
		} else if (TaskAttribute.TYPE_ATTACHMENT.equals(type)) {
91
			ITaskAttachment taskAttachment = TasksUiPlugin.getRepositoryModel().createTaskAttachment(taskAttribute);
92
			if (taskAttachment != null) {
93
				taskAttribute.getTaskData().getAttributeMapper().updateTaskAttachment(taskAttachment, taskAttribute);
94
				StringBuilder sb = new StringBuilder();
95
				sb.append(taskAttribute.getTaskData().getAttributeMapper().getValueLabel(taskAttribute));
96
				sb.append(": "); //$NON-NLS-1$
97
				if (AttachmentUtil.isContext(taskAttachment)) {
98
					sb.append(Messages.AttachmentTableLabelProvider_Task_Context);
99
				} else if (taskAttachment.isPatch()) {
100
					sb.append(Messages.AttachmentTableLabelProvider_Patch);
101
				} else {
102
					sb.append(taskAttachment.getFileName());
103
				}
104
				TaskEditorOutlineNode node = new TaskEditorOutlineNode(sb.toString(), taskAttribute);
105
				node.setTaskAttachment(taskAttachment);
106
				return node;
107
			}
72
		} else {
108
		} else {
73
			String label = taskAttribute.getTaskData().getAttributeMapper().getValueLabel(taskAttribute);
109
			String label = taskAttribute.getTaskData().getAttributeMapper().getLabel(taskAttribute);
110
			if (label.endsWith(":")) { //$NON-NLS-1$
111
				label = label.substring(0, label.length() - 1);
112
			}
74
			return new TaskEditorOutlineNode(label, taskAttribute);
113
			return new TaskEditorOutlineNode(label, taskAttribute);
75
		}
114
		}
76
		return null;
115
		return null;
77
	}
116
	}
78
117
79
	public static TaskEditorOutlineNode parse(TaskData taskData) {
118
	public static TaskEditorOutlineNode parse(TaskData taskData, boolean includeAttributes) {
80
		TaskEditorOutlineNode rootNode = createNode(taskData, TaskAttribute.SUMMARY, null);
119
		TaskEditorOutlineNode rootNode = createNode(taskData, TaskAttribute.SUMMARY, null);
81
		if (rootNode == null) {
120
		if (rootNode == null) {
82
			rootNode = new TaskEditorOutlineNode(Messages.TaskEditorOutlineNode_Task_ + taskData.getTaskId());
121
			rootNode = new TaskEditorOutlineNode(Messages.TaskEditorOutlineNode_Task_ + taskData.getTaskId());
83
		}
122
		}
123
		if (includeAttributes) {
124
			final TaskList taskList = TasksUiPlugin.getTaskList();
125
			TaskEditorOutlineNode relatedTasksNode = new TaskEditorOutlineNode(LABEL_RELATED_TASKS);
126
			rootNode.addChild(relatedTasksNode);
127
			AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(taskData.getConnectorKind());
128
			Collection<TaskRelation> relations = connector.getTaskRelations(taskData);
129
			TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
130
			TaskRepository taskRepository = manager.getRepository(taskData.getConnectorKind(),
131
					taskData.getRepositoryUrl());
132
			for (TaskRelation taskRelation : relations) {
133
				ITask task = taskList.getTask(taskData.getRepositoryUrl(), taskRelation.getTaskId());
134
				String label;
135
				if (task != null) {
136
					label = NLS.bind(Messages.TaskEditorOutlineNode_TaskRelation_Label,
137
							new Object[] { taskRelation.getTaskId(), task.getSummary() });
138
				} else {
139
					label = NLS.bind(Messages.TaskEditorOutlineNode_TaskRelation_Label,
140
							new Object[] { taskRelation.getTaskId(), Messages.TaskEditorOutlineNode_unknown_Label });
141
				}
142
				TaskEditorOutlineNode childNode = new TaskEditorOutlineNode(label);
143
144
				childNode.setTaskRelation(taskRelation);
145
				childNode.setTaskRepository(taskRepository);
146
				relatedTasksNode.addChild(childNode);
147
			}
148
149
			TaskEditorOutlineNode attributesNode = new TaskEditorOutlineNode(LABEL_ATTRIBUTES);
150
			rootNode.addChild(attributesNode);
151
			Map<String, TaskAttribute> attributes = taskData.getRoot().getAttributes();
152
			for (TaskAttribute attribute : attributes.values()) {
153
				if (TaskAttribute.KIND_DEFAULT.equals(attribute.getMetaData().getKind())) {
154
					TaskEditorOutlineNode node = createNode(attribute);
155
					if (node != null) {
156
						attributesNode.addChild(node);
157
					}
158
				}
159
			}
160
		}
84
		addNode(rootNode, taskData, TaskAttribute.DESCRIPTION, LABEL_DESCRIPTION);
161
		addNode(rootNode, taskData, TaskAttribute.DESCRIPTION, LABEL_DESCRIPTION);
162
		List<TaskAttribute> attachments = taskData.getAttributeMapper().getAttributesByType(taskData,
163
				TaskAttribute.TYPE_ATTACHMENT);
164
		if (attachments.size() > 0) {
165
			TaskEditorOutlineNode attachmentNode = new TaskEditorOutlineNode(LABEL_ATTACHMENTS);
166
			rootNode.addChild(attachmentNode);
167
			for (TaskAttribute attachmentAttribute : attachments) {
168
				TaskEditorOutlineNode node = createNode(attachmentAttribute);
169
				if (node != null) {
170
					attachmentNode.addChild(node);
171
				}
172
			}
173
		}
85
		List<TaskAttribute> comments = taskData.getAttributeMapper().getAttributesByType(taskData,
174
		List<TaskAttribute> comments = taskData.getAttributeMapper().getAttributesByType(taskData,
86
				TaskAttribute.TYPE_COMMENT);
175
				TaskAttribute.TYPE_COMMENT);
87
		if (comments.size() > 0) {
176
		if (comments.size() > 0) {
Lines 118-123 Link Here
118
207
119
	private ITaskComment taskComment;
208
	private ITaskComment taskComment;
120
209
210
	private ITaskAttachment taskAttachment;
211
212
	private TaskRelation taskRelation;
213
214
	private TaskRepository taskRepository;
215
121
	public TaskEditorOutlineNode(String label) {
216
	public TaskEditorOutlineNode(String label) {
122
		this(label, null);
217
		this(label, null);
123
	}
218
	}
Lines 183-186 Link Here
183
		return getLabel();
278
		return getLabel();
184
	}
279
	}
185
280
281
	public ITaskAttachment getTaskAttachment() {
282
		return taskAttachment;
283
	}
284
285
	public void setTaskAttachment(ITaskAttachment taskAttachment) {
286
		this.taskAttachment = taskAttachment;
287
	}
288
289
	public TaskRelation getTaskRelation() {
290
		return taskRelation;
291
	}
292
293
	public void setTaskRelation(TaskRelation taskRelation) {
294
		this.taskRelation = taskRelation;
295
	}
296
297
	public TaskRepository getTaskRepository() {
298
		return taskRepository;
299
	}
300
301
	public void setTaskRepository(TaskRepository taskRepository) {
302
		this.taskRepository = taskRepository;
303
	}
304
186
}
305
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlineNodeLabelProvider.java (+116 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Frank Becker and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Frank Becker - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
13
14
import org.eclipse.jface.viewers.LabelProvider;
15
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
16
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
17
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
18
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
19
import org.eclipse.mylyn.tasks.core.TaskRepository;
20
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
21
import org.eclipse.mylyn.tasks.ui.TasksUi;
22
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
23
import org.eclipse.swt.graphics.Image;
24
import org.eclipse.ui.ISharedImages;
25
import org.eclipse.ui.internal.WorkbenchImages;
26
27
/**
28
 * @author Frank Becker
29
 */
30
public class TaskEditorOutlineNodeLabelProvider extends LabelProvider {
31
32
	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$	@Override
33
34
	@Override
35
	public Image getImage(Object element) {
36
		if (element instanceof TaskEditorOutlineNode) {
37
			TaskEditorOutlineNode node = (TaskEditorOutlineNode) element;
38
			if (TaskEditorOutlineNode.LABEL_COMMENTS.equals(node.getLabel())
39
					|| TaskEditorOutlineNode.LABEL_NEW_COMMENT.equals(node.getLabel())) {
40
				return CommonImages.getImage(TasksUiImages.COMMENT);
41
			}
42
			if (TaskEditorOutlineNode.LABEL_DESCRIPTION.equals(node.getLabel())) {
43
				return CommonImages.getImage(TasksUiImages.TASK_NOTES);
44
			} else if (node.getTaskComment() != null) {
45
				IRepositoryPerson author = node.getTaskComment().getAuthor();
46
				TaskAttribute taskAttribute = node.getData();
47
				String repositoryUrl = taskAttribute.getTaskData().getRepositoryUrl();
48
				String connectorKind = null;
49
				TaskRepository taskRepository = null;
50
				if (repositoryUrl != null) {
51
					connectorKind = taskAttribute.getTaskData().getConnectorKind();
52
					if (connectorKind != null) {
53
						taskRepository = TasksUi.getRepositoryManager().getRepository(connectorKind, repositoryUrl);
54
					}
55
				}
56
				if (taskRepository != null && author != null
57
						&& author.getPersonId().equals(taskRepository.getUserName())) {
58
					return CommonImages.getImage(CommonImages.PERSON_ME);
59
				} else {
60
					return CommonImages.getImage(CommonImages.PERSON);
61
				}
62
			} else if (node.getTaskAttachment() != null) {
63
				ITaskAttachment attachment = node.getTaskAttachment();
64
				if (AttachmentUtil.isContext(attachment)) {
65
					return CommonImages.getImage(TasksUiImages.CONTEXT_TRANSFER);
66
				} else if (attachment.isPatch()) {
67
					return CommonImages.getImage(TasksUiImages.TASK_ATTACHMENT_PATCH);
68
				} else {
69
					String filename = attachment.getFileName();
70
					if (filename != null) {
71
						int dotIndex = filename.lastIndexOf('.');
72
						if (dotIndex != -1) {
73
							String fileType = filename.substring(dotIndex + 1);
74
							for (String element2 : IMAGE_EXTENSIONS) {
75
								if (element2.equalsIgnoreCase(fileType)) {
76
									return CommonImages.getImage(CommonImages.IMAGE_FILE);
77
								}
78
							}
79
						}
80
					}
81
					return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE);
82
				}
83
			} else if (node.getData() != null) {
84
				return super.getImage(element);
85
			} else {
86
				return CommonImages.getImage(TasksUiImages.TASK);
87
			}
88
		} else {
89
			return super.getImage(element);
90
		}
91
	}
92
93
	@Override
94
	public String getText(Object element) {
95
		if (element instanceof TaskEditorOutlineNode) {
96
			TaskEditorOutlineNode node = (TaskEditorOutlineNode) element;
97
			if (TaskEditorOutlineNode.LABEL_COMMENTS.equals(node.getLabel())
98
					|| TaskEditorOutlineNode.LABEL_NEW_COMMENT.equals(node.getLabel())
99
					|| TaskEditorOutlineNode.LABEL_DESCRIPTION.equals(node.getLabel())) {
100
				return node.getLabel();
101
			}
102
			if (node.getData() != null && node.getTaskAttachment() == null && node.getTaskComment() == null) {
103
				// regular attribute
104
				TaskAttribute taskAttribute = node.getData();
105
				String label = taskAttribute.getTaskData().getAttributeMapper().getLabel(taskAttribute);
106
				if (!label.endsWith(":")) { //$NON-NLS-1$
107
					label += ":"; //$NON-NLS-1$
108
				}
109
				return label + " " + taskAttribute.getTaskData().getAttributeMapper().getValueLabel(taskAttribute); //$NON-NLS-1$
110
			}
111
			return node.getLabel();
112
		}
113
		return super.getText(element);
114
	}
115
116
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorOutlinePage.java (-98 / +1 lines)
Lines 11-26 Link Here
11
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
13
13
14
import org.eclipse.jface.viewers.ITreeContentProvider;
15
import org.eclipse.jface.viewers.LabelProvider;
16
import org.eclipse.jface.viewers.TreeViewer;
14
import org.eclipse.jface.viewers.TreeViewer;
17
import org.eclipse.jface.viewers.Viewer;
18
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
19
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
20
import org.eclipse.mylyn.tasks.core.TaskRepository;
15
import org.eclipse.mylyn.tasks.core.TaskRepository;
21
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
22
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
16
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
23
import org.eclipse.swt.graphics.Image;
24
import org.eclipse.swt.widgets.Composite;
17
import org.eclipse.swt.widgets.Composite;
25
import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
18
import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
26
19
Lines 31-91 Link Here
31
 */
24
 */
32
public class TaskEditorOutlinePage extends ContentOutlinePage {
25
public class TaskEditorOutlinePage extends ContentOutlinePage {
33
26
34
	private static class TaskEditorOutlineContentProvider implements ITreeContentProvider {
35
36
		public void dispose() {
37
			// ignore
38
		}
39
40
		public Object[] getChildren(Object parentElement) {
41
			if (parentElement instanceof TaskEditorOutlineNode) {
42
				Object[] children = ((TaskEditorOutlineNode) parentElement).getChildren();
43
				return children;
44
			}
45
			return new Object[0];
46
		}
47
48
		public Object[] getElements(Object inputElement) {
49
			if (inputElement instanceof TaskEditorOutlineModel) {
50
				return new Object[] { ((TaskEditorOutlineModel) inputElement).getRoot() };
51
			}
52
			return new Object[0];
53
		}
54
55
		public Object getParent(Object element) {
56
			if (element instanceof TaskEditorOutlineNode) {
57
				return ((TaskEditorOutlineNode) element).getParent();
58
			}
59
			return null;
60
		}
61
62
		public boolean hasChildren(Object element) {
63
			if (element instanceof TaskEditorOutlineNode) {
64
				return ((TaskEditorOutlineNode) element).getChildren().length > 0;
65
			}
66
			return false;
67
		}
68
69
		public void inputChanged(Viewer viewerChanged, Object oldInput, Object newInput) {
70
			// ignore
71
		}
72
73
	}
74
75
	private static class TaskEditorOutlineModel {
76
77
		private final TaskEditorOutlineNode root;
78
79
		public TaskEditorOutlineModel(TaskEditorOutlineNode root) {
80
			this.root = root;
81
		}
82
83
		public TaskEditorOutlineNode getRoot() {
84
			return root;
85
		}
86
87
	}
88
89
	private TaskEditorOutlineModel model;
27
	private TaskEditorOutlineModel model;
90
28
91
	private TaskRepository taskRepository;
29
	private TaskRepository taskRepository;
Lines 113-154 Link Here
113
		super.createControl(parent);
51
		super.createControl(parent);
114
		viewer = getTreeViewer();
52
		viewer = getTreeViewer();
115
		viewer.setContentProvider(new TaskEditorOutlineContentProvider());
53
		viewer.setContentProvider(new TaskEditorOutlineContentProvider());
116
		viewer.setLabelProvider(new LabelProvider() {
54
		viewer.setLabelProvider(new TaskEditorOutlineNodeLabelProvider());
117
			@Override
118
			public Image getImage(Object element) {
119
				if (element instanceof TaskEditorOutlineNode) {
120
					TaskEditorOutlineNode node = (TaskEditorOutlineNode) element;
121
					if (TaskEditorOutlineNode.LABEL_COMMENTS.equals(node.getLabel())
122
							|| TaskEditorOutlineNode.LABEL_NEW_COMMENT.equals(node.getLabel())) {
123
						return CommonImages.getImage(TasksUiImages.COMMENT);
124
					}
125
					if (TaskEditorOutlineNode.LABEL_DESCRIPTION.equals(node.getLabel())) {
126
						return CommonImages.getImage(TasksUiImages.TASK_NOTES);
127
					} else if (node.getTaskComment() != null) {
128
						IRepositoryPerson author = node.getTaskComment().getAuthor();
129
						if (taskRepository != null && author != null
130
								&& author.getPersonId().equals(taskRepository.getUserName())) {
131
							return CommonImages.getImage(CommonImages.PERSON_ME);
132
						} else {
133
							return CommonImages.getImage(CommonImages.PERSON);
134
						}
135
					} else {
136
						return CommonImages.getImage(TasksUiImages.TASK);
137
					}
138
				} else {
139
					return super.getImage(element);
140
				}
141
			}
142
143
			@Override
144
			public String getText(Object element) {
145
				if (element instanceof TaskEditorOutlineNode) {
146
					TaskEditorOutlineNode node = (TaskEditorOutlineNode) element;
147
					return node.getLabel();
148
				}
149
				return super.getText(element);
150
			}
151
		});
152
		viewer.setInput(model);
55
		viewer.setInput(model);
153
		viewer.expandAll();
56
		viewer.expandAll();
154
	}
57
	}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties (+5 lines)
Lines 83-92 Link Here
83
TaskEditorDescriptionPart_Search=Search
83
TaskEditorDescriptionPart_Search=Search
84
84
85
TaskEditorNewCommentPart_New_Comment=New Comment
85
TaskEditorNewCommentPart_New_Comment=New Comment
86
TaskEditorOutlineNode_Attachments=Attachments
87
TaskEditorOutlineNode_Attributes=Attributes
86
TaskEditorOutlineNode_Comments=Comments
88
TaskEditorOutlineNode_Comments=Comments
87
TaskEditorOutlineNode_Description=Description
89
TaskEditorOutlineNode_Description=Description
88
TaskEditorOutlineNode_New_Comment=New Comment
90
TaskEditorOutlineNode_New_Comment=New Comment
91
TaskEditorOutlineNode_Related_Tasks=Related Tasks
89
TaskEditorOutlineNode_Task_=Task 
92
TaskEditorOutlineNode_Task_=Task 
93
TaskEditorOutlineNode_TaskRelation_Label={0}: {1}
94
TaskEditorOutlineNode_unknown_Label=<unknown>
90
95
91
TaskEditorPeoplePart_People=People
96
TaskEditorPeoplePart_People=People
92
97
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/outline/QuickOutlineDialog.java (+525 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Frank Becker and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Frank Becker - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors.outline;
13
14
import org.eclipse.jface.action.IMenuManager;
15
import org.eclipse.jface.action.Separator;
16
import org.eclipse.jface.dialogs.Dialog;
17
import org.eclipse.jface.dialogs.PopupDialog;
18
import org.eclipse.jface.text.IInformationControl;
19
import org.eclipse.jface.text.IInformationControlExtension;
20
import org.eclipse.jface.text.IInformationControlExtension2;
21
import org.eclipse.jface.viewers.DoubleClickEvent;
22
import org.eclipse.jface.viewers.IDoubleClickListener;
23
import org.eclipse.jface.viewers.IOpenListener;
24
import org.eclipse.jface.viewers.IStructuredSelection;
25
import org.eclipse.jface.viewers.OpenEvent;
26
import org.eclipse.jface.viewers.StructuredSelection;
27
import org.eclipse.jface.viewers.TreeViewer;
28
import org.eclipse.jface.viewers.Viewer;
29
import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil;
30
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorOutlineContentProvider;
31
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorOutlineModel;
32
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorOutlineNode;
33
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
34
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
35
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.events.DisposeEvent;
37
import org.eclipse.swt.events.DisposeListener;
38
import org.eclipse.swt.events.FocusListener;
39
import org.eclipse.swt.events.KeyEvent;
40
import org.eclipse.swt.events.KeyListener;
41
import org.eclipse.swt.events.ModifyEvent;
42
import org.eclipse.swt.events.ModifyListener;
43
import org.eclipse.swt.events.MouseAdapter;
44
import org.eclipse.swt.events.MouseEvent;
45
import org.eclipse.swt.events.MouseListener;
46
import org.eclipse.swt.events.SelectionEvent;
47
import org.eclipse.swt.events.SelectionListener;
48
import org.eclipse.swt.graphics.Color;
49
import org.eclipse.swt.graphics.FontMetrics;
50
import org.eclipse.swt.graphics.GC;
51
import org.eclipse.swt.graphics.Point;
52
import org.eclipse.swt.layout.GridData;
53
import org.eclipse.swt.layout.GridLayout;
54
import org.eclipse.swt.widgets.Composite;
55
import org.eclipse.swt.widgets.Control;
56
import org.eclipse.swt.widgets.Text;
57
import org.eclipse.swt.widgets.Tree;
58
import org.eclipse.swt.widgets.TreeItem;
59
import org.eclipse.ui.IEditorPart;
60
import org.eclipse.ui.IWorkbenchPage;
61
import org.eclipse.ui.IWorkbenchWindow;
62
import org.eclipse.ui.dialogs.PatternFilter;
63
import org.eclipse.ui.forms.editor.IFormPage;
64
65
public class QuickOutlineDialog extends PopupDialog implements IInformationControl, IInformationControlExtension,
66
		IInformationControlExtension2, DisposeListener {
67
68
	private class OpenListener implements IOpenListener, IDoubleClickListener, MouseListener {
69
70
		private final Viewer viewer;
71
72
		public OpenListener(Viewer viewer) {
73
			this.viewer = viewer;
74
		}
75
76
		public void mouseDoubleClick(MouseEvent e) {
77
			setSelection(e);
78
		}
79
80
		public void mouseDown(MouseEvent e) {
81
			setSelection(e);
82
		}
83
84
		public void mouseUp(MouseEvent e) {
85
			// ignore
86
87
		}
88
89
		public void doubleClick(DoubleClickEvent event) {
90
			open(null);
91
		}
92
93
		public void open(OpenEvent event) {
94
			AbstractTaskEditorPage taskEditorPage = getTaskEditorPage();
95
			if (taskEditorPage == null) {
96
				return;
97
			}
98
99
			StructuredSelection selection = (StructuredSelection) viewer.getSelection();
100
			Object select = (selection).getFirstElement();
101
			EditorUtil.focusFromStructuredSelection(select, taskEditorPage);
102
		}
103
104
		private void setSelection(MouseEvent event) {
105
			try {
106
				Object selection = ((Tree) event.getSource()).getSelection()[0].getData();
107
				viewer.setSelection(new StructuredSelection(selection));
108
				open(null);
109
			} catch (Exception e) {
110
				// ignore
111
			}
112
		}
113
114
	}
115
116
	public static final String ID_VIEWER = "org.eclipse.mylyn.internal.tasks.ui.taskdata.quick"; //$NON-NLS-1$
117
118
	private TreeViewer viewer;
119
120
	private Text filterText;
121
122
	private PatternFilter namePatternFilter;
123
124
	private OpenListener openListener;
125
126
	private final IWorkbenchWindow window;
127
128
	public QuickOutlineDialog(IWorkbenchWindow window) {
129
		super(window.getShell(), SWT.RESIZE, true, true, true, true, true, null, "Press ''Esc'' to exit the dialog.");
130
		this.window = window;
131
		create();
132
	}
133
134
	@Override
135
	public boolean close() {
136
		// nothing additional to dispose
137
		return super.close();
138
	}
139
140
	@Override
141
	protected Control createDialogArea(Composite parent) {
142
		createViewer(parent);
143
		createUIListenersTreeViewer();
144
		addDisposeListener(this);
145
146
		return viewer.getControl();
147
	}
148
149
	private void createViewer(Composite parent) {
150
		Control composite = super.createDialogArea(parent);
151
		viewer = createCommonViewer((Composite) composite);
152
		openListener = new OpenListener(viewer);
153
154
		viewer.addOpenListener(openListener);
155
		viewer.getTree().addMouseListener(openListener);
156
157
		namePatternFilter = new PatternFilter();
158
		namePatternFilter.setIncludeLeadingWildcard(true);
159
		viewer.addFilter(namePatternFilter);
160
161
		AbstractTaskEditorPage taskEditorPage = getTaskEditorPage();
162
		if (taskEditorPage != null) {
163
			try {
164
				viewer.getControl().setRedraw(false);
165
				TaskEditorOutlineNode root = TaskEditorOutlineNode.parse(taskEditorPage.getModel().getTaskData(), true);
166
				viewer.setInput(new TaskEditorOutlineModel(root));
167
				viewer.expandAll();
168
			} finally {
169
				viewer.getControl().setRedraw(true);
170
			}
171
		}
172
	}
173
174
	protected TreeViewer createCommonViewer(Composite parent) {
175
		TreeViewer viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
176
		viewer.setUseHashlookup(true);
177
		viewer.getControl().setLayoutData(new GridData(500, 400));
178
		viewer.setContentProvider(new TaskEditorOutlineContentProvider());
179
		viewer.setLabelProvider(new QuickOutlineLabelProvider());
180
		return viewer;
181
	}
182
183
	@Override
184
	protected void fillDialogMenu(IMenuManager dialogMenu) {
185
		dialogMenu.add(new Separator());
186
		super.fillDialogMenu(dialogMenu);
187
	}
188
189
	private void createUIListenersTreeViewer() {
190
		final Tree tree = viewer.getTree();
191
		tree.addKeyListener(new KeyListener() {
192
			public void keyPressed(KeyEvent e) {
193
				if (e.character == 0x1B) {
194
					// Dispose on ESC key press
195
					dispose();
196
				}
197
			}
198
199
			public void keyReleased(KeyEvent e) {
200
				// ignore
201
			}
202
		});
203
204
		tree.addMouseListener(new MouseAdapter() {
205
			@Override
206
			public void mouseUp(MouseEvent e) {
207
				handleTreeViewerMouseUp(tree, e);
208
			}
209
		});
210
211
		tree.addSelectionListener(new SelectionListener() {
212
			public void widgetSelected(SelectionEvent e) {
213
				// ignore
214
			}
215
216
			public void widgetDefaultSelected(SelectionEvent e) {
217
				gotoSelectedElement();
218
			}
219
		});
220
	}
221
222
	private void handleTreeViewerMouseUp(final Tree tree, MouseEvent e) {
223
		if ((tree.getSelectionCount() < 1) || (e.button != 1) || (tree.equals(e.getSource()) == false)) {
224
			return;
225
		}
226
		// Selection is made in the selection changed listener
227
		Object object = tree.getItem(new Point(e.x, e.y));
228
		TreeItem selection = tree.getSelection()[0];
229
		if (selection.equals(object)) {
230
			gotoSelectedElement();
231
		}
232
	}
233
234
	private Object getSelectedElement() {
235
		if (viewer == null) {
236
			return null;
237
		}
238
		return ((IStructuredSelection) viewer.getSelection()).getFirstElement();
239
	}
240
241
	public void addDisposeListener(DisposeListener listener) {
242
		getShell().addDisposeListener(listener);
243
	}
244
245
	public void addFocusListener(FocusListener listener) {
246
		getShell().addFocusListener(listener);
247
	}
248
249
	public Point computeSizeHint() {
250
		// Note that it already has the persisted size if persisting is enabled.
251
		return getShell().getSize();
252
	}
253
254
	public void dispose() {
255
		close();
256
	}
257
258
	public boolean isFocusControl() {
259
		if (viewer.getControl().isFocusControl() || filterText.isFocusControl()) {
260
			return true;
261
		}
262
		return false;
263
	}
264
265
	public void removeDisposeListener(DisposeListener listener) {
266
		getShell().removeDisposeListener(listener);
267
	}
268
269
	public void removeFocusListener(FocusListener listener) {
270
		getShell().removeFocusListener(listener);
271
	}
272
273
	public void setBackgroundColor(Color background) {
274
		applyBackgroundColor(background, getContents());
275
	}
276
277
	public void setFocus() {
278
		getShell().forceFocus();
279
		filterText.setFocus();
280
	}
281
282
	public void setForegroundColor(Color foreground) {
283
		applyForegroundColor(foreground, getContents());
284
	}
285
286
	public void setInformation(String information) {
287
		// See IInformationControlExtension2
288
	}
289
290
	public void setLocation(Point location) {
291
		/*
292
		 * If the location is persisted, it gets managed by PopupDialog - fine. Otherwise, the location is
293
		 * computed in Window#getInitialLocation, which will center it in the parent shell / main
294
		 * monitor, which is wrong for two reasons:
295
		 * - we want to center over the editor / subject control, not the parent shell
296
		 * - the center is computed via the initalSize, which may be also wrong since the size may 
297
		 *   have been updated since via min/max sizing of AbstractInformationControlManager.
298
		 * In that case, override the location with the one computed by the manager. Note that
299
		 * the call to constrainShellSize in PopupDialog.open will still ensure that the shell is
300
		 * entirely visible.
301
		 */
302
		if (getPersistLocation() == false || getDialogSettings() == null) {
303
			getShell().setLocation(location);
304
		}
305
	}
306
307
	public void setSize(int width, int height) {
308
		getShell().setSize(width, height);
309
	}
310
311
	public void setSizeConstraints(int maxWidth, int maxHeight) {
312
		// Ignore
313
	}
314
315
	public void setVisible(boolean visible) {
316
		if (visible) {
317
			open();
318
		} else {
319
			saveDialogBounds(getShell());
320
			getShell().setVisible(false);
321
		}
322
	}
323
324
	public boolean hasContents() {
325
		if ((viewer == null) || (viewer.getInput() == null)) {
326
			return false;
327
		}
328
		return true;
329
	}
330
331
	public void setInput(Object input) {
332
		if (input != null) {
333
			viewer.setSelection(new StructuredSelection(input));
334
		}
335
	}
336
337
	public void widgetDisposed(DisposeEvent e) {
338
		// Note: We do not reuse the dialog
339
		viewer = null;
340
		filterText = null;
341
	}
342
343
	@Override
344
	protected Control createTitleControl(Composite parent) {
345
		Composite control = new Composite(parent, SWT.NONE);
346
		GridLayout layout = new GridLayout(1, false);
347
		layout.marginHeight = 0;
348
		control.setLayout(layout);
349
		control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
350
351
		// Applies only to dialog title - not body.  See createDialogArea
352
		// Create the text widget
353
		createUIWidgetFilterText(control);
354
		// Add listeners to the text widget
355
		createUIListenersFilterText();
356
		// Return the text widget
357
		return control;
358
	}
359
360
	private void createUIWidgetFilterText(Composite parent) {
361
		// Create the widget
362
		filterText = new Text(parent, SWT.NONE);
363
		// Set the font 
364
		GC gc = new GC(parent);
365
		gc.setFont(parent.getFont());
366
		FontMetrics fontMetrics = gc.getFontMetrics();
367
		gc.dispose();
368
		// Create the layout
369
		GridData data = new GridData(GridData.FILL_HORIZONTAL);
370
		data.heightHint = Dialog.convertHeightInCharsToPixels(fontMetrics, 1);
371
		data.horizontalAlignment = GridData.FILL;
372
		data.verticalAlignment = GridData.CENTER;
373
		filterText.setLayoutData(data);
374
	}
375
376
	/**
377
	 * 
378
	 */
379
	private void gotoSelectedElement() {
380
		Object selectedElement = getSelectedElement();
381
		if (selectedElement == null) {
382
			return;
383
		}
384
		dispose();
385
	}
386
387
	private void createUIListenersFilterText() {
388
		filterText.addKeyListener(new KeyListener() {
389
			public void keyPressed(KeyEvent e) {
390
				if (e.keyCode == 0x0D) {
391
					// Return key was pressed
392
					gotoSelectedElement();
393
				} else if (e.keyCode == SWT.ARROW_DOWN) {
394
					// Down key was pressed
395
					viewer.getTree().setFocus();
396
				} else if (e.keyCode == SWT.ARROW_UP) {
397
					// Up key was pressed
398
					viewer.getTree().setFocus();
399
				} else if (e.character == 0x1B) {
400
					// Escape key was pressed
401
					dispose();
402
				}
403
			}
404
405
			public void keyReleased(KeyEvent e) {
406
				// NO-OP
407
			}
408
		});
409
		// Handle text modify events
410
		filterText.addModifyListener(new ModifyListener() {
411
			public void modifyText(ModifyEvent e) {
412
				String text = ((Text) e.widget).getText();
413
				int length = text.length();
414
				if (length > 0) {
415
					// Append a '*' pattern to the end of the text value if it
416
					// does not have one already
417
					if (text.charAt(length - 1) != '*') {
418
						text = text + '*';
419
					}
420
					// Prepend a '*' pattern to the beginning of the text value
421
					// if it does not have one already
422
					if (text.charAt(0) != '*') {
423
						text = '*' + text;
424
					}
425
				}
426
				// Set and update the pattern
427
				setMatcherString(text, true);
428
			}
429
		});
430
	}
431
432
	/**
433
	 * Sets the patterns to filter out for the receiver.
434
	 * <p>
435
	 * The following characters have special meaning: ? => any character * => any string
436
	 * </p>
437
	 * 
438
	 * @param pattern
439
	 *            the pattern
440
	 * @param update
441
	 *            <code>true</code> if the viewer should be updated
442
	 */
443
	private void setMatcherString(String pattern, boolean update) {
444
		namePatternFilter.setPattern(pattern);
445
		if (update) {
446
			stringMatcherUpdated();
447
		}
448
	}
449
450
	/**
451
	 * The string matcher has been modified. The default implementation refreshes the view and selects the first matched
452
	 * element
453
	 */
454
	private void stringMatcherUpdated() {
455
		// Refresh the tree viewer to re-filter
456
		viewer.getControl().setRedraw(false);
457
		viewer.refresh();
458
		viewer.expandAll();
459
//		selectFirstMatch();
460
		viewer.getControl().setRedraw(true);
461
	}
462
463
	protected AbstractTaskEditorPage getTaskEditorPage() {
464
		IWorkbenchPage activePage = window.getActivePage();
465
		if (activePage == null) {
466
			return null;
467
		}
468
		IEditorPart editorPart = activePage.getActiveEditor();
469
		AbstractTaskEditorPage taskEditorPage = null;
470
		if (editorPart instanceof TaskEditor) {
471
			TaskEditor taskEditor = (TaskEditor) editorPart;
472
			IFormPage formPage = taskEditor.getActivePageInstance();
473
			if (formPage instanceof AbstractTaskEditorPage) {
474
				taskEditorPage = (AbstractTaskEditorPage) formPage;
475
			}
476
		}
477
		return taskEditorPage;
478
	}
479
480
//	/**
481
//	 * Selects the first element in the tree which matches the current filter pattern.
482
//	 */
483
//	private void selectFirstMatch() {
484
//		Tree tree = viewer.getTree();
485
//		Object element = findFirstMatchToPattern(tree.getItems());
486
//		if (element != null) {
487
//			viewer.setSelection(new StructuredSelection(element), true);
488
//		} else {
489
//			viewer.setSelection(StructuredSelection.EMPTY);
490
//		}
491
//	}
492
//
493
//	/**
494
//	 * @param items
495
//	 * @return
496
//	 */
497
//	private Object findFirstMatchToPattern(TreeItem[] items) {
498
//		// Match the string pattern against labels
499
//		ILabelProvider labelProvider = (ILabelProvider) viewer.getLabelProvider();
500
//		// Process each item in the tree
501
//		for (TreeItem item : items) {
502
//			Object element = item.getData();
503
//			// Return the first element if no pattern is set
504
//			if (fStringMatcher == null) {
505
//				return element;
506
//			}
507
//			// Return the element if it matches the pattern
508
//			if (element != null) {
509
//				String label = labelProvider.getText(element);
510
//				if (fStringMatcher.match(label)) {
511
//					return element;
512
//				}
513
//			}
514
//			// Recursively check the elements children for a match
515
//			element = findFirstMatchToPattern(item.getItems());
516
//			// Return the child element match if found
517
//			if (element != null) {
518
//				return element;
519
//			}
520
//		}
521
//		// No match found
522
//		return null;
523
//	}
524
525
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/outline/QuickOutlineLabelProvider.java (+66 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Frank Becker and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Frank Becker - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors.outline;
13
14
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorOutlineNode;
15
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorOutlineNodeLabelProvider;
16
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
17
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
18
import org.eclipse.mylyn.tasks.core.data.TaskData;
19
import org.eclipse.swt.graphics.Image;
20
21
/**
22
 * @author Frank Becker
23
 */
24
public class QuickOutlineLabelProvider extends TaskEditorOutlineNodeLabelProvider {
25
26
	@Override
27
	public String getText(Object element) {
28
		String result = ""; //$NON-NLS-1$
29
		if (element instanceof TaskData) {
30
			TaskData node = (TaskData) element;
31
			result = node.getTaskId();
32
		} else if (element instanceof TaskAttribute) {
33
			TaskAttribute node = (TaskAttribute) element;
34
			TaskAttributeMetaData meta = node.getMetaData();
35
			if (meta != null) {
36
				String lable = meta.getLabel();
37
				if (lable != null) {
38
					result = lable + " (" + node.getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
39
				} else {
40
					if (TaskAttribute.TYPE_ATTACHMENT.equals(meta.getType())) {
41
						result = "Attachment: " + node.getValue(); //$NON-NLS-1$
42
					} else if (TaskAttribute.TYPE_COMMENT.equals(meta.getType())) {
43
						result = "Comment: " + node.getValue(); //$NON-NLS-1$
44
					} else {
45
						result = "<" + node.getId() + ">"; //$NON-NLS-1$//$NON-NLS-2$
46
					}
47
				}
48
			}
49
		} else if (element instanceof TaskEditorOutlineNode) {
50
			result = super.getText(element);
51
		} else if (element instanceof String) {
52
			result = (String) element;
53
		}
54
		return result;
55
	}
56
57
	@Override
58
	public Image getImage(Object element) {
59
		if (element instanceof TaskEditorOutlineNode) {
60
			return super.getImage(element);
61
		} else {
62
			return null;
63
		}
64
	}
65
66
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/outline/ShowQuickOutlineAction.java (+46 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Frank Becker and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Frank Becker - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors.outline;
13
14
import org.eclipse.jface.action.IAction;
15
import org.eclipse.jface.viewers.ISelection;
16
import org.eclipse.ui.IWorkbenchWindow;
17
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
18
19
/**
20
 * @author Frank Becker
21
 */
22
public class ShowQuickOutlineAction implements IWorkbenchWindowActionDelegate {
23
24
	private QuickOutlineDialog inplaceDialog;
25
26
	private IWorkbenchWindow window;
27
28
	public void run(IAction action) {
29
		inplaceDialog = new QuickOutlineDialog(window);
30
		inplaceDialog.open();
31
		inplaceDialog.setFocus();
32
	}
33
34
	public void dispose() {
35
		inplaceDialog = null;
36
	}
37
38
	public void init(IWorkbenchWindow window) {
39
		this.window = window;
40
	}
41
42
	public void selectionChanged(IAction action, ISelection selection) {
43
		// ignore
44
	}
45
46
}
(-)src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java (-36 / +15 lines)
Lines 92-98 Link Here
92
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
92
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
93
import org.eclipse.mylyn.tasks.core.TaskRepository;
93
import org.eclipse.mylyn.tasks.core.TaskRepository;
94
import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy;
94
import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy;
95
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
96
import org.eclipse.mylyn.tasks.core.data.TaskData;
95
import org.eclipse.mylyn.tasks.core.data.TaskData;
97
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
96
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
98
import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent;
97
import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent;
Lines 136-142 Link Here
136
import org.eclipse.ui.forms.widgets.ExpandableComposite;
135
import org.eclipse.ui.forms.widgets.ExpandableComposite;
137
import org.eclipse.ui.forms.widgets.FormToolkit;
136
import org.eclipse.ui.forms.widgets.FormToolkit;
138
import org.eclipse.ui.forms.widgets.ScrolledForm;
137
import org.eclipse.ui.forms.widgets.ScrolledForm;
139
import org.eclipse.ui.forms.widgets.Section;
140
import org.eclipse.ui.handlers.IHandlerService;
138
import org.eclipse.ui.handlers.IHandlerService;
141
import org.eclipse.ui.services.IDisposable;
139
import org.eclipse.ui.services.IDisposable;
142
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
140
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
Lines 1033-1071 Link Here
1033
					ISelection selection = event.getSelection();
1031
					ISelection selection = event.getSelection();
1034
					if (selection instanceof StructuredSelection) {
1032
					if (selection instanceof StructuredSelection) {
1035
						Object select = ((StructuredSelection) selection).getFirstElement();
1033
						Object select = ((StructuredSelection) selection).getFirstElement();
1036
						if (select instanceof TaskEditorOutlineNode) {
1034
						EditorUtil.focusFromStructuredSelection(select, AbstractTaskEditorPage.this);
1037
							TaskEditorOutlineNode node = (TaskEditorOutlineNode) select;
1035
						getEditor().setActivePage(getId());
1038
							TaskAttribute attribute = node.getData();
1039
							if (attribute != null) {
1040
								if (TaskAttribute.TYPE_COMMENT.equals(attribute.getMetaData().getType())) {
1041
									AbstractTaskEditorPart actionPart = getPart(ID_PART_COMMENTS);
1042
									if (actionPart != null && actionPart.getControl() instanceof ExpandableComposite) {
1043
										CommonFormUtil.setExpanded((ExpandableComposite) actionPart.getControl(), true);
1044
										if (actionPart.getControl() instanceof Section) {
1045
											Control client = ((Section) actionPart.getControl()).getClient();
1046
											if (client instanceof Composite) {
1047
												for (Control control : ((Composite) client).getChildren()) {
1048
													// toggle subsections
1049
													if (control instanceof Section) {
1050
														CommonFormUtil.setExpanded((Section) control, true);
1051
													}
1052
												}
1053
											}
1054
										}
1055
									}
1056
								}
1057
								EditorUtil.reveal(form, attribute.getId());
1058
							} else {
1059
								EditorUtil.reveal(form, node.getLabel());
1060
							}
1061
							getEditor().setActivePage(getId());
1062
						}
1063
					}
1036
					}
1064
				}
1037
				}
1065
			});
1038
			});
1066
		}
1039
		}
1067
		if (getModel() != null) {
1040
		if (getModel() != null) {
1068
			TaskEditorOutlineNode node = TaskEditorOutlineNode.parse(getModel().getTaskData());
1041
			TaskEditorOutlineNode node = TaskEditorOutlineNode.parse(getModel().getTaskData(), false);
1069
			outlinePage.setInput(getTaskRepository(), node);
1042
			outlinePage.setInput(getTaskRepository(), node);
1070
		} else {
1043
		} else {
1071
			outlinePage.setInput(null, null);
1044
			outlinePage.setInput(null, null);
Lines 1239-1253 Link Here
1239
			if (part.getControl() != null) {
1212
			if (part.getControl() != null) {
1240
				if (ID_PART_ACTIONS.equals(part.getPartId())) {
1213
				if (ID_PART_ACTIONS.equals(part.getPartId())) {
1241
					// do not expand horizontally
1214
					// do not expand horizontally
1242
					GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(false, false).applyTo(
1215
					GridDataFactory.fillDefaults()
1243
							part.getControl());
1216
							.align(SWT.FILL, SWT.FILL)
1217
							.grab(false, false)
1218
							.applyTo(part.getControl());
1244
				} else {
1219
				} else {
1245
					if (part.getExpandVertically()) {
1220
					if (part.getExpandVertically()) {
1246
						GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(
1221
						GridDataFactory.fillDefaults()
1247
								part.getControl());
1222
								.align(SWT.FILL, SWT.FILL)
1223
								.grab(true, true)
1224
								.applyTo(part.getControl());
1248
					} else {
1225
					} else {
1249
						GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(
1226
						GridDataFactory.fillDefaults()
1250
								part.getControl());
1227
								.align(SWT.FILL, SWT.TOP)
1228
								.grab(true, false)
1229
								.applyTo(part.getControl());
1251
					}
1230
					}
1252
				}
1231
				}
1253
				// for outline
1232
				// for outline

Return to bug 278102