Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 342200
Collapse All | Expand All

(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java (-1 / +15 lines)
Lines 15-20 Link Here
15
import org.eclipse.jface.layout.GridDataFactory;
15
import org.eclipse.jface.layout.GridDataFactory;
16
import org.eclipse.jface.layout.GridLayoutFactory;
16
import org.eclipse.jface.layout.GridLayoutFactory;
17
import org.eclipse.mylyn.commons.ui.CommonImages;
17
import org.eclipse.mylyn.commons.ui.CommonImages;
18
import org.eclipse.mylyn.commons.ui.compatibility.CommonThemes;
18
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
19
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
19
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
20
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
20
import org.eclipse.mylyn.tasks.core.ITaskMapping;
21
import org.eclipse.mylyn.tasks.core.ITaskMapping;
Lines 24-34 Link Here
24
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.events.FocusAdapter;
26
import org.eclipse.swt.events.FocusAdapter;
26
import org.eclipse.swt.events.FocusEvent;
27
import org.eclipse.swt.events.FocusEvent;
28
import org.eclipse.swt.graphics.Color;
27
import org.eclipse.swt.graphics.Image;
29
import org.eclipse.swt.graphics.Image;
28
import org.eclipse.swt.layout.GridLayout;
30
import org.eclipse.swt.layout.GridLayout;
29
import org.eclipse.swt.widgets.Composite;
31
import org.eclipse.swt.widgets.Composite;
30
import org.eclipse.swt.widgets.Control;
32
import org.eclipse.swt.widgets.Control;
31
import org.eclipse.swt.widgets.Label;
33
import org.eclipse.swt.widgets.Label;
34
import org.eclipse.ui.PlatformUI;
32
import org.eclipse.ui.forms.widgets.FormToolkit;
35
import org.eclipse.ui.forms.widgets.FormToolkit;
33
36
34
/**
37
/**
Lines 68-73 Link Here
68
71
69
			if (showLabel && !isPriority) {
72
			if (showLabel && !isPriority) {
70
				editor.createLabelControl(composite, toolkit);
73
				editor.createLabelControl(composite, toolkit);
74
				editor.getLabelControl().setBackground(null);
71
				GridDataFactory.defaultsFor(editor.getLabelControl())
75
				GridDataFactory.defaultsFor(editor.getLabelControl())
72
						.indent(indent, 0)
76
						.indent(indent, 0)
73
						.applyTo(editor.getLabelControl());
77
						.applyTo(editor.getLabelControl());
Lines 93-98 Link Here
93
			}
97
			}
94
98
95
			editor.createControl(composite, toolkit);
99
			editor.createControl(composite, toolkit);
100
			editor.getControl().setBackground(null);
101
			Color color = PlatformUI.getWorkbench()
102
					.getThemeManager()
103
					.getCurrentTheme()
104
					.getColorRegistry()
105
					.get(CommonThemes.COLOR_COMPLETED);
106
			editor.getControl().setForeground(color);
96
			getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
107
			getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
97
		}
108
		}
98
	}
109
	}
Lines 170-175 Link Here
170
		TaskAttribute priorityAttribute = getTaskData().getRoot().getMappedAttribute(TaskAttribute.PRIORITY);
181
		TaskAttribute priorityAttribute = getTaskData().getRoot().getMappedAttribute(TaskAttribute.PRIORITY);
171
		final Control priorityEditor = addAttributeWithIcon(composite, toolkit, priorityAttribute, false);
182
		final Control priorityEditor = addAttributeWithIcon(composite, toolkit, priorityAttribute, false);
172
		if (priorityEditor != null) {
183
		if (priorityEditor != null) {
184
			priorityEditor.setBackground(null);
173
			GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).span(1, 2).applyTo(priorityEditor);
185
			GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).span(1, 2).applyTo(priorityEditor);
174
			// forward focus to the summary editor		
186
			// forward focus to the summary editor		
175
			priorityEditor.addFocusListener(new FocusAdapter() {
187
			priorityEditor.addFocusListener(new FocusAdapter() {
Lines 220-226 Link Here
220
		layout.marginHeight = 0;
232
		layout.marginHeight = 0;
221
		layout.marginWidth = 0;
233
		layout.marginWidth = 0;
222
		headerComposite.setLayout(layout);
234
		headerComposite.setLayout(layout);
223
		GridDataFactory.fillDefaults().grab(true, false).applyTo(headerComposite);
235
		headerComposite.setBackground(null);
236
		headerComposite.setBackgroundMode(SWT.INHERIT_FORCE);
237
		GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.TOP).grab(true, false).applyTo(headerComposite);
224
238
225
//		ITaskMapping mapping = getTaskEditorPage().getConnector().getTaskMapping(getTaskData());
239
//		ITaskMapping mapping = getTaskEditorPage().getConnector().getTaskMapping(getTaskData());
226
//		if (mapping != null) {
240
//		if (mapping != null) {
(-)a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java (-1 / +31 lines)
Lines 35-40 Link Here
35
import org.eclipse.jface.action.Separator;
35
import org.eclipse.jface.action.Separator;
36
import org.eclipse.jface.action.ToolBarManager;
36
import org.eclipse.jface.action.ToolBarManager;
37
import org.eclipse.jface.dialogs.IMessageProvider;
37
import org.eclipse.jface.dialogs.IMessageProvider;
38
import org.eclipse.jface.layout.GridDataFactory;
38
import org.eclipse.jface.resource.CompositeImageDescriptor;
39
import org.eclipse.jface.resource.CompositeImageDescriptor;
39
import org.eclipse.jface.resource.ImageDescriptor;
40
import org.eclipse.jface.resource.ImageDescriptor;
40
import org.eclipse.jface.resource.JFaceResources;
41
import org.eclipse.jface.resource.JFaceResources;
Lines 63-68 Link Here
63
import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil;
64
import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil;
64
import org.eclipse.mylyn.internal.tasks.ui.editors.Messages;
65
import org.eclipse.mylyn.internal.tasks.ui.editors.Messages;
65
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorActionContributor;
66
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorActionContributor;
67
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorSummaryPart;
66
import org.eclipse.mylyn.internal.tasks.ui.util.TaskDragSourceListener;
68
import org.eclipse.mylyn.internal.tasks.ui.util.TaskDragSourceListener;
67
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
69
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
68
import org.eclipse.mylyn.tasks.core.ITask;
70
import org.eclipse.mylyn.tasks.core.ITask;
Lines 86-91 Link Here
86
import org.eclipse.swt.graphics.Image;
88
import org.eclipse.swt.graphics.Image;
87
import org.eclipse.swt.graphics.Point;
89
import org.eclipse.swt.graphics.Point;
88
import org.eclipse.swt.graphics.Rectangle;
90
import org.eclipse.swt.graphics.Rectangle;
91
import org.eclipse.swt.layout.GridLayout;
89
import org.eclipse.swt.layout.RowLayout;
92
import org.eclipse.swt.layout.RowLayout;
90
import org.eclipse.swt.widgets.Composite;
93
import org.eclipse.swt.widgets.Composite;
91
import org.eclipse.swt.widgets.Control;
94
import org.eclipse.swt.widgets.Control;
Lines 186-191 Link Here
186
189
187
	OpenWithBrowserAction openWithBrowserAction;
190
	OpenWithBrowserAction openWithBrowserAction;
188
191
192
	private Composite headingClientComposite;
193
189
	private static boolean toolBarFailureLogged;
194
	private static boolean toolBarFailureLogged;
190
195
191
	public TaskEditor() {
196
	public TaskEditor() {
Lines 207-213 Link Here
207
		// create left tool bar that replaces form heading label
212
		// create left tool bar that replaces form heading label
208
		try {
213
		try {
209
			FormHeading heading = (FormHeading) getHeaderForm().getForm().getForm().getHead();
214
			FormHeading heading = (FormHeading) getHeaderForm().getForm().getForm().getHead();
215
			headingClientComposite = new Composite(heading, SWT.NONE);
216
			//headingClientComposite.setBackground(new org.eclipse.swt.graphics.Color(Display.getCurrent(), 23, 44, 32));
217
			GridLayout headingLayout = new GridLayout();
218
			headingLayout.verticalSpacing = 0;
219
			headingLayout.horizontalSpacing = 0;
220
			headingLayout.marginBottom = 0;
221
			headingLayout.marginTop = 0;
222
			headingLayout.marginLeft = 0;
223
			headingLayout.marginRight = 0;
224
			headingClientComposite.setBackgroundMode(SWT.INHERIT_DEFAULT);
210
225
226
			headingClientComposite.setLayout(headingLayout);
227
			GridDataFactory.fillDefaults().grab(true, false).applyTo(headingClientComposite);
228
			heading.setHeadClient(headingClientComposite);
211
			Field field = FormHeading.class.getDeclaredField("titleRegion"); //$NON-NLS-1$
229
			Field field = FormHeading.class.getDeclaredField("titleRegion"); //$NON-NLS-1$
212
			field.setAccessible(true);
230
			field.setAccessible(true);
213
231
Lines 236-242 Link Here
236
254
237
			//titleLabel = new Label(titleRegion, SWT.NONE);
255
			//titleLabel = new Label(titleRegion, SWT.NONE);
238
			// need a viewer for copy support
256
			// need a viewer for copy support
239
			TextViewer titleViewer = new TextViewer(titleRegion, SWT.READ_ONLY);
257
			TextViewer titleViewer = new TextViewer(titleRegion, SWT.NONE);
240
			// Eclipse 3.3 needs a document, otherwise an NPE is thrown
258
			// Eclipse 3.3 needs a document, otherwise an NPE is thrown
241
			titleViewer.setDocument(new Document());
259
			titleViewer.setDocument(new Document());
242
260
Lines 416-421 Link Here
416
				if (page instanceof ISelectionProvider) {
434
				if (page instanceof ISelectionProvider) {
417
					((ISelectionProvider) page).addSelectionChangedListener(getActionBarContributor());
435
					((ISelectionProvider) page).addSelectionChangedListener(getActionBarContributor());
418
				}
436
				}
437
				if (page instanceof AbstractTaskEditorPage) {
438
					// Pull out summary section into the common header
439
					AbstractTaskEditorPart editorPart = ((AbstractTaskEditorPage) page).getPart(AbstractTaskEditorPage.ID_PART_SUMMARY);
440
					if (editorPart instanceof TaskEditorSummaryPart) {
441
						((TaskEditorSummaryPart) editorPart).createControl(headingClientComposite, getToolkit());
442
						GridDataFactory.fillDefaults()
443
								.align(SWT.FILL, SWT.TOP)
444
								.grab(true, false)
445
								.applyTo(editorPart.getControl());
446
						editorPart.getControl().setBackground(null);
447
					}
448
				}
419
			} catch (Exception e) {
449
			} catch (Exception e) {
420
				StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
450
				StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
421
						"Could not create editor via factory: " + factory, e)); //$NON-NLS-1$
451
						"Could not create editor via factory: " + factory, e)); //$NON-NLS-1$

Return to bug 342200