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 148903
Collapse All | Expand All

(-)src/org/eclipse/mylar/internal/tasks/ui/editors/AbstractRepositoryTaskEditor.java (-98 / +114 lines)
Lines 122-127 Link Here
122
/**
122
/**
123
 * @author Mik Kersten
123
 * @author Mik Kersten
124
 * @author Rob Elves
124
 * @author Rob Elves
125
 * @author Jeff Pound (Attachment work)
125
 */
126
 */
126
public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
127
public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
127
128
Lines 314-321 Link Here
314
315
315
	}
316
	}
316
317
317
	private static final class AttachmentTableLabelProvider extends DecoratingLabelProvider implements ITableColorProvider,
318
	private static final class AttachmentTableLabelProvider extends DecoratingLabelProvider implements
318
			ITableLabelProvider {
319
			ITableColorProvider, ITableLabelProvider {
319
320
320
		public AttachmentTableLabelProvider(ILabelProvider provider, ILabelDecorator decorator) {
321
		public AttachmentTableLabelProvider(ILabelProvider provider, ILabelDecorator decorator) {
321
			super(provider, decorator);
322
			super(provider, decorator);
Lines 437-454 Link Here
437
		return addCommentsTextBox.getText();
438
		return addCommentsTextBox.getText();
438
	}
439
	}
439
440
440
//	/**
441
	// /**
441
//	 * @return Any currently selected text.
442
	// * @return Any currently selected text.
442
//	 */
443
	// */
443
//	protected StyledText getCurrentText() {
444
	// protected StyledText getCurrentText() {
444
//		return currentSelectedText;
445
	// return currentSelectedText;
445
//	}
446
	// }
446
447
447
	
448
	protected void createFormContent(final IManagedForm managedForm) {
448
	protected void createFormContent(final IManagedForm managedForm) {
449
		super.createFormContent(managedForm);
449
		super.createFormContent(managedForm);
450
		form = managedForm.getForm();
450
		form = managedForm.getForm();
451
		toolkit = managedForm.getToolkit();		
451
		toolkit = managedForm.getToolkit();
452
		if (getRepositoryTaskData() == null) {
452
		if (getRepositoryTaskData() == null) {
453
			Composite composite = new Composite(form.getBody(), SWT.NULL);
453
			Composite composite = new Composite(form.getBody(), SWT.NULL);
454
			composite.setLayout(new GridLayout());
454
			composite.setLayout(new GridLayout());
Lines 461-467 Link Here
461
		editorComposite = form.getBody();
461
		editorComposite = form.getBody();
462
		editorComposite.setLayout(new GridLayout());
462
		editorComposite.setLayout(new GridLayout());
463
		editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
463
		editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
464
		///createContextMenu(editorComposite);
464
		// /createContextMenu(editorComposite);
465
465
466
		createReportHeaderLayout(editorComposite);
466
		createReportHeaderLayout(editorComposite);
467
		Composite attribComp = createAttributeLayout(editorComposite);
467
		Composite attribComp = createAttributeLayout(editorComposite);
Lines 477-516 Link Here
477
		getSite().getPage().addSelectionListener(selectionListener);
477
		getSite().getPage().addSelectionListener(selectionListener);
478
		getSite().setSelectionProvider(selectionProvider);
478
		getSite().setSelectionProvider(selectionProvider);
479
	}
479
	}
480
	
480
481
//	@Override
481
	// @Override
482
//	public void createPartControl(Composite parent) {
482
	// public void createPartControl(Composite parent) {
483
//		if (getRepositoryTaskData() == null) {
483
	// if (getRepositoryTaskData() == null) {
484
//			Composite composite = new Composite(parent, SWT.NULL);
484
	// Composite composite = new Composite(parent, SWT.NULL);
485
//			composite.setLayout(new GridLayout());
485
	// composite.setLayout(new GridLayout());
486
//			Label noBugLabel = new Label(composite, SWT.NULL);
486
	// Label noBugLabel = new Label(composite, SWT.NULL);
487
//			noBugLabel.setText("Could not download task data, possibly due to timeout or connectivity problem.\n"
487
	// noBugLabel.setText("Could not download task data, possibly due to timeout
488
//					+ "Please check connection and try again.");
488
	// or connectivity problem.\n"
489
//			return;
489
	// + "Please check connection and try again.");
490
//		}
490
	// return;
491
//
491
	// }
492
//		toolkit = new FormToolkit(parent.getDisplay());
492
	//
493
//		form = toolkit.createScrolledForm(parent);
493
	// toolkit = new FormToolkit(parent.getDisplay());
494
//
494
	// form = toolkit.createScrolledForm(parent);
495
//		editorComposite = form.getBody();
495
	//
496
//		editorComposite.setLayout(new GridLayout());
496
	// editorComposite = form.getBody();
497
//		editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
497
	// editorComposite.setLayout(new GridLayout());
498
//		createContextMenu(editorComposite);
498
	// editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
499
//
499
	// createContextMenu(editorComposite);
500
//		createReportHeaderLayout(editorComposite);
500
	//
501
//		Composite attribComp = createAttributeLayout(editorComposite);
501
	// createReportHeaderLayout(editorComposite);
502
//		createCustomAttributeLayout(attribComp);
502
	// Composite attribComp = createAttributeLayout(editorComposite);
503
//		createDescriptionLayout(editorComposite);
503
	// createCustomAttributeLayout(attribComp);
504
//		createAttachmentLayout(editorComposite);
504
	// createDescriptionLayout(editorComposite);
505
//		createCommentLayout(editorComposite, form);
505
	// createAttachmentLayout(editorComposite);
506
//		createActionsLayout(editorComposite);
506
	// createCommentLayout(editorComposite, form);
507
//
507
	// createActionsLayout(editorComposite);
508
//		// editorComposite.setMenu(contextMenuManager.createContextMenu(editorComposite));
508
	//
509
//
509
	// //
510
//		form.reflow(true);
510
	// editorComposite.setMenu(contextMenuManager.createContextMenu(editorComposite));
511
//		getSite().getPage().addSelectionListener(selectionListener);
511
	//
512
//		getSite().setSelectionProvider(selectionProvider);
512
	// form.reflow(true);
513
//	}
513
	// getSite().getPage().addSelectionListener(selectionListener);
514
	// getSite().setSelectionProvider(selectionProvider);
515
	// }
514
516
515
	/**
517
	/**
516
	 * By default puts task number, date opened and date modified in header
518
	 * By default puts task number, date opened and date modified in header
Lines 656-691 Link Here
656
658
657
	public abstract void createCustomAttributeLayout();
659
	public abstract void createCustomAttributeLayout();
658
660
659
//	protected void createContextMenu(final Composite comp) {
661
	// protected void createContextMenu(final Composite comp) {
660
//		contextMenuManager = new MenuManager(CONTEXT_MENU_ID);
662
	// contextMenuManager = new MenuManager(CONTEXT_MENU_ID);
661
//		contextMenuManager.setRemoveAllWhenShown(true);
663
	// contextMenuManager.setRemoveAllWhenShown(true);
662
//		contextMenuManager.addMenuListener(new IMenuListener() {
664
	// contextMenuManager.addMenuListener(new IMenuListener() {
663
//			public void menuAboutToShow(IMenuManager manager) {
665
	// public void menuAboutToShow(IMenuManager manager) {
664
//				manager.add(cutAction);
666
	// manager.add(cutAction);
665
//				manager.add(copyAction);
667
	// manager.add(copyAction);
666
//				manager.add(pasteAction);
668
	// manager.add(pasteAction);
667
////				Clipboard clipboard = new Clipboard(comp.getDisplay());
669
	// // Clipboard clipboard = new Clipboard(comp.getDisplay());
668
////				TextTransfer textTransfer = TextTransfer.getInstance();
670
	// // TextTransfer textTransfer = TextTransfer.getInstance();
669
////				String textData = (String) clipboard.getContents(textTransfer);
671
	// // String textData = (String) clipboard.getContents(textTransfer);
670
////				if (textData != null) {
672
	// // if (textData != null) {
671
////					pasteAction.setEnabled(true);
673
	// // pasteAction.setEnabled(true);
672
////				} else {
674
	// // } else {
673
////					pasteAction.setEnabled(false);
675
	// // pasteAction.setEnabled(false);
674
////				}
676
	// // }
675
//
677
	//
676
//				if (currentSelectedText == null || currentSelectedText.getSelectionText().length() == 0) {
678
	// if (currentSelectedText == null ||
677
//					copyAction.setEnabled(false);
679
	// currentSelectedText.getSelectionText().length() == 0) {
678
//				} else {
680
	// copyAction.setEnabled(false);
679
//					copyAction.setEnabled(true);
681
	// } else {
680
//				}
682
	// copyAction.setEnabled(true);
681
//				// manager.add(revealAllAction);
683
	// }
682
//				manager.add(new Separator());
684
	// // manager.add(revealAllAction);
683
//				manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
685
	// manager.add(new Separator());
684
//			}
686
	// manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
685
//		});
687
	// }
686
//		// getSite().registerContextMenu(CONTEXT_MENU_ID, contextMenuManager,
688
	// });
687
//		// getSite().getSelectionProvider());
689
	// // getSite().registerContextMenu(CONTEXT_MENU_ID, contextMenuManager,
688
//	}
690
	// // getSite().getSelectionProvider());
691
	// }
689
692
690
	/**
693
	/**
691
	 * Adds a text field to display and edit the bug's summary.
694
	 * Adds a text field to display and edit the bug's summary.
Lines 928-933 Link Here
928
					final LocalAttachment att = naw.getAttachment();
931
					final LocalAttachment att = naw.getAttachment();
929
					att.setReport(getRepositoryTaskData());
932
					att.setReport(getRepositoryTaskData());
930
					getRepositoryTaskData().setNewAttachment(att);
933
					getRepositoryTaskData().setNewAttachment(att);
934
					setAttachContext(att.isPatch());
931
935
932
					// TODO: Add row to table
936
					// TODO: Add row to table
933
					// RepositoryTaskData data = getRepositoryTaskData();
937
					// RepositoryTaskData data = getRepositoryTaskData();
Lines 1006-1013 Link Here
1006
		GridData sectionCompositeData = new GridData(GridData.FILL_HORIZONTAL);
1010
		GridData sectionCompositeData = new GridData(GridData.FILL_HORIZONTAL);
1007
		sectionComposite.setLayoutData(sectionCompositeData);
1011
		sectionComposite.setLayoutData(sectionCompositeData);
1008
1012
1009
		TextViewer viewer = addRepositoryTextViewer(repository, sectionComposite, getRepositoryTaskData().getDescription(),
1013
		TextViewer viewer = addRepositoryTextViewer(repository, sectionComposite, getRepositoryTaskData()
1010
				SWT.MULTI | SWT.WRAP);
1014
				.getDescription(), SWT.MULTI | SWT.WRAP);
1011
		final StyledText styledText = viewer.getTextWidget();
1015
		final StyledText styledText = viewer.getTextWidget();
1012
		styledText.addListener(SWT.FocusIn, new DescriptionListener());
1016
		styledText.addListener(SWT.FocusIn, new DescriptionListener());
1013
		styledText.setLayout(new GridLayout());
1017
		styledText.setLayout(new GridLayout());
Lines 1103-1109 Link Here
1103
			ecComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
1107
			ecComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
1104
			expandableComposite.setClient(ecComposite);
1108
			expandableComposite.setClient(ecComposite);
1105
1109
1106
			TextViewer viewer = addRepositoryTextViewer(repository, ecComposite, taskComment.getText(), SWT.MULTI | SWT.WRAP);
1110
			TextViewer viewer = addRepositoryTextViewer(repository, ecComposite, taskComment.getText(), SWT.MULTI
1111
					| SWT.WRAP);
1107
			styledText = viewer.getTextWidget();
1112
			styledText = viewer.getTextWidget();
1108
			GridDataFactory.fillDefaults().hint(DESCRIPTION_WIDTH, SWT.DEFAULT).applyTo(styledText);
1113
			GridDataFactory.fillDefaults().hint(DESCRIPTION_WIDTH, SWT.DEFAULT).applyTo(styledText);
1109
1114
Lines 1250-1256 Link Here
1250
	 */
1255
	 */
1251
	protected abstract String getTitleString();
1256
	protected abstract String getTitleString();
1252
1257
1253
1254
	/**
1258
	/**
1255
	 * This refreshes the text in the title label of the info area (it contains
1259
	 * This refreshes the text in the title label of the info area (it contains
1256
	 * elements which can change).
1260
	 * elements which can change).
Lines 1366-1388 Link Here
1366
		form.setFocus();
1370
		form.setFocus();
1367
	}
1371
	}
1368
1372
1369
//	/**
1373
	// /**
1370
//	 * Updates the dirty status of this editor page. The dirty status is true if
1374
	// * Updates the dirty status of this editor page. The dirty status is true
1371
//	 * the bug report has been modified but not saved. The title of the editor
1375
	// if
1372
//	 * is also updated to reflect the status.
1376
	// * the bug report has been modified but not saved. The title of the editor
1373
//	 * 
1377
	// * is also updated to reflect the status.
1374
//	 * @param newDirtyStatus
1378
	// *
1375
//	 *            is true when the bug report has been modified but not saved
1379
	// * @param newDirtyStatus
1376
//	 */
1380
	// * is true when the bug report has been modified but not saved
1377
//	public void changeDirtyStatus(boolean newDirtyStatus) {
1381
	// */
1378
//		isDirty = newDirtyStatus;
1382
	// public void changeDirtyStatus(boolean newDirtyStatus) {
1379
////		if (parentEditor == null) {
1383
	// isDirty = newDirtyStatus;
1380
////			firePropertyChange(PROP_DIRTY);
1384
	// // if (parentEditor == null) {
1381
////		} else {
1385
	// // firePropertyChange(PROP_DIRTY);
1382
////			parentEditor.markDirty();
1386
	// // } else {
1383
////		}
1387
	// // parentEditor.markDirty();
1384
//		getManagedForm().dirtyStateChanged();
1388
	// // }
1385
//	}
1389
	// getManagedForm().dirtyStateChanged();
1390
	// }
1386
1391
1387
	/**
1392
	/**
1388
	 * Updates the title of the editor to reflect dirty status. If the bug
1393
	 * Updates the title of the editor to reflect dirty status. If the bug
Lines 1511-1517 Link Here
1511
1516
1512
	protected StyledText addCommentsTextBox = null;
1517
	protected StyledText addCommentsTextBox = null;
1513
1518
1514
//	protected Text descriptionTextBox = null;
1519
	// protected Text descriptionTextBox = null;
1515
	protected TextViewer newDescriptionTextViewer = null;
1520
	protected TextViewer newDescriptionTextViewer = null;
1516
1521
1517
	// private FormText previousText = null;
1522
	// private FormText previousText = null;
Lines 1662-1667 Link Here
1662
		return isDisposed;
1667
		return isDisposed;
1663
	}
1668
	}
1664
1669
1670
	// The implementation of the attach context UI is connector dependant.
1671
	protected boolean getAttachContext() {
1672
		return false;
1673
	}
1674
1675
	// The implementation of the attach context UI is connector dependant.
1676
	// this method is called when a user attaches a patch to the task
1677
	protected void setAttachContext(boolean attachContext) {
1678
1679
	}
1680
1665
	public void close() {
1681
	public void close() {
1666
		Display activeDisplay = getSite().getShell().getDisplay();
1682
		Display activeDisplay = getSite().getShell().getDisplay();
1667
		activeDisplay.asyncExec(new Runnable() {
1683
		activeDisplay.asyncExec(new Runnable() {
Lines 1720-1726 Link Here
1720
	public void setDescriptionText(String text) {
1736
	public void setDescriptionText(String text) {
1721
		this.newDescriptionTextViewer.setDocument(new Document(text));
1737
		this.newDescriptionTextViewer.setDocument(new Document(text));
1722
	}
1738
	}
1723
	
1739
1724
	// private class DisplayableLocalAttachment extends RepositoryAttachment {
1740
	// private class DisplayableLocalAttachment extends RepositoryAttachment {
1725
	// private static final long serialVersionUID = 900218036143022422L;
1741
	// private static final long serialVersionUID = 900218036143022422L;
1726
	//		
1742
	//		
(-)src/org/eclipse/mylar/internal/bugzilla/ui/editor/ExistingBugEditor.java (-6 / +52 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.mylar.internal.bugzilla.ui.editor;
11
package org.eclipse.mylar.internal.bugzilla.ui.editor;
12
12
13
import java.io.File;
13
import java.io.IOException;
14
import java.io.IOException;
14
import java.io.UnsupportedEncodingException;
15
import java.io.UnsupportedEncodingException;
15
import java.text.SimpleDateFormat;
16
import java.text.SimpleDateFormat;
Lines 29-34 Link Here
29
import org.eclipse.jface.dialogs.MessageDialog;
30
import org.eclipse.jface.dialogs.MessageDialog;
30
import org.eclipse.jface.viewers.SelectionChangedEvent;
31
import org.eclipse.jface.viewers.SelectionChangedEvent;
31
import org.eclipse.jface.viewers.StructuredSelection;
32
import org.eclipse.jface.viewers.StructuredSelection;
33
import org.eclipse.mylar.context.core.ContextCorePlugin;
32
import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin;
34
import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin;
33
import org.eclipse.mylar.internal.bugzilla.core.BugzillaReportElement;
35
import org.eclipse.mylar.internal.bugzilla.core.BugzillaReportElement;
34
import org.eclipse.mylar.internal.bugzilla.core.BugzillaReportSubmitForm;
36
import org.eclipse.mylar.internal.bugzilla.core.BugzillaReportSubmitForm;
Lines 42-47 Link Here
42
import org.eclipse.mylar.internal.tasks.ui.editors.RepositoryTaskSelection;
44
import org.eclipse.mylar.internal.tasks.ui.editors.RepositoryTaskSelection;
43
import org.eclipse.mylar.internal.tasks.ui.views.DatePicker;
45
import org.eclipse.mylar.internal.tasks.ui.views.DatePicker;
44
import org.eclipse.mylar.internal.tasks.ui.views.TaskRepositoriesView;
46
import org.eclipse.mylar.internal.tasks.ui.views.TaskRepositoriesView;
47
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
48
import org.eclipse.mylar.tasks.core.ITask;
45
import org.eclipse.mylar.tasks.core.RepositoryOperation;
49
import org.eclipse.mylar.tasks.core.RepositoryOperation;
46
import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute;
50
import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute;
47
import org.eclipse.mylar.tasks.core.RepositoryTaskData;
51
import org.eclipse.mylar.tasks.core.RepositoryTaskData;
Lines 78-83 Link Here
78
 * 
82
 * 
79
 * @author Mik Kersten (hardening of prototype)
83
 * @author Mik Kersten (hardening of prototype)
80
 * @author Rob Elves (adaption to Eclipse Forms)
84
 * @author Rob Elves (adaption to Eclipse Forms)
85
 * @authos Jeff Pound (Attachment work)
81
 */
86
 */
82
public class ExistingBugEditor extends AbstractRepositoryTaskEditor {
87
public class ExistingBugEditor extends AbstractRepositoryTaskEditor {
83
88
Lines 97-102 Link Here
97
102
98
	protected Control[] radioOptions;
103
	protected Control[] radioOptions;
99
104
105
	protected Button attachContextButton;
106
100
	protected List keyWordsList;
107
	protected List keyWordsList;
101
108
102
	protected Text keywordsText;
109
	protected Text keywordsText;
Lines 136-149 Link Here
136
		// config.setLeftLabel("Local Bug Report");
143
		// config.setLeftLabel("Local Bug Report");
137
		// config.setRightLabel("Remote Bug Report");
144
		// config.setRightLabel("Remote Bug Report");
138
		// config.setLeftImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT));
145
		// config.setLeftImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT));
139
		//		config.setRightImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT));
146
		// config.setRightImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT));
140
		// compareInput = new BugzillaCompareInput(config);
147
		// compareInput = new BugzillaCompareInput(config);
141
	}
148
	}
142
149
143
	@Override
150
	@Override
144
	public void init(IEditorSite site, IEditorInput input) {
151
	public void init(IEditorSite site, IEditorInput input) {
145
		 if (!(input instanceof ExistingBugEditorInput))
152
		if (!(input instanceof ExistingBugEditorInput))
146
			return;//MylarStatusHandler.log("Invalid Input: Must be ExistingBugEditorInput", this);
153
			return;// MylarStatusHandler.log("Invalid Input: Must be
154
		// ExistingBugEditorInput", this);
147
155
148
		editorInput = (AbstractBugEditorInput) input;
156
		editorInput = (AbstractBugEditorInput) input;
149
		taskData = editorInput.getRepositoryTaskData();
157
		taskData = editorInput.getRepositoryTaskData();
Lines 163-168 Link Here
163
	@Override
171
	@Override
164
	protected void addRadioButtons(Composite buttonComposite) {
172
	protected void addRadioButtons(Composite buttonComposite) {
165
		addSelfToCC(buttonComposite);
173
		addSelfToCC(buttonComposite);
174
		addAttachContextButton(buttonComposite);
166
		FormToolkit toolkit = new FormToolkit(buttonComposite.getDisplay());
175
		FormToolkit toolkit = new FormToolkit(buttonComposite.getDisplay());
167
		int i = 0;
176
		int i = 0;
168
		Button selected = null;
177
		Button selected = null;
Lines 254-259 Link Here
254
		toolkit.paintBordersFor(buttonComposite);
263
		toolkit.paintBordersFor(buttonComposite);
255
	}
264
	}
256
265
266
	private void addAttachContextButton(Composite buttonComposite) {
267
		ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(
268
				AbstractRepositoryTask.getHandle(repository.getUrl(), taskData.getId()));
269
		File contextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
270
271
		FormToolkit toolkit = new FormToolkit(buttonComposite.getDisplay());
272
		attachContextButton = toolkit.createButton(buttonComposite, "Attach context to repository task", SWT.CHECK);
273
		GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
274
		data.horizontalSpan = 4;
275
		attachContextButton.setLayoutData(data);
276
		attachContextButton.setEnabled(contextFile != null && contextFile.exists());
277
	}
278
257
	private void addSelfToCC(Composite composite) {
279
	private void addSelfToCC(Composite composite) {
258
		// if they aren't already on the cc list create an add self check box
280
		// if they aren't already on the cc list create an add self check box
259
		FormToolkit toolkit = new FormToolkit(composite.getDisplay());
281
		FormToolkit toolkit = new FormToolkit(composite.getDisplay());
Lines 262-268 Link Here
262
		if (repository.getUserName() == null) {
284
		if (repository.getUserName() == null) {
263
			return;
285
			return;
264
		}
286
		}
265
		
287
266
		if (owner != null && owner.getValue().indexOf(repository.getUserName()) != -1) {
288
		if (owner != null && owner.getValue().indexOf(repository.getUserName()) != -1) {
267
			return;
289
			return;
268
		}
290
		}
Lines 384-389 Link Here
384
					public void run() {
406
					public void run() {
385
						if (event.getJob().getResult().getCode() == Status.OK
407
						if (event.getJob().getResult().getCode() == Status.OK
386
								&& event.getJob().getResult().getMessage() != null) {//
408
								&& event.getJob().getResult().getMessage() != null) {//
409
							// Attach context
410
							if (getAttachContext()) {
411
								ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(
412
										AbstractRepositoryTask.getHandle(repository.getUrl(), taskData.getId()));
413
								try {
414
									bugzillaRepositoryClient.attachContext(repository, (AbstractRepositoryTask) task,
415
											"");
416
								} catch (Exception e) {
417
									// TODO
418
									e.printStackTrace();
419
								}
420
							}
387
							close();
421
							close();
388
							return;
422
							return;
389
						} else if (event.getJob().getResult().getCode() == Status.INFO) {
423
						} else if (event.getJob().getResult().getCode() == Status.INFO) {
Lines 404-410 Link Here
404
		};
438
		};
405
439
406
		bugzillaRepositoryClient.submitBugReport(bugzillaReportSubmitForm, submitJobListener);
440
		bugzillaRepositoryClient.submitBugReport(bugzillaReportSubmitForm, submitJobListener);
407
408
	}
441
	}
409
442
410
	@Override
443
	@Override
Lines 591-597 Link Here
591
	}
624
	}
592
625
593
	protected void addCCList(FormToolkit toolkit, String ccValue, Composite attributesComposite) {
626
	protected void addCCList(FormToolkit toolkit, String ccValue, Composite attributesComposite) {
594
		//newLayout(attributesComposite, 1, "Add CC:", PROPERTY);
627
		// newLayout(attributesComposite, 1, "Add CC:", PROPERTY);
595
		toolkit.createLabel(attributesComposite, "Add CC:");
628
		toolkit.createLabel(attributesComposite, "Add CC:");
596
		ccText = toolkit.createText(attributesComposite, ccValue);
629
		ccText = toolkit.createText(attributesComposite, ccValue);
597
		ccText.setFont(TEXT_FONT);
630
		ccText.setFont(TEXT_FONT);
Lines 956-961 Link Here
956
		return editorInput.getRepositoryTaskData();
989
		return editorInput.getRepositoryTaskData();
957
	}
990
	}
958
991
992
	public boolean getAttachContext() {
993
		if (attachContextButton == null) {
994
			return false;
995
		}
996
		return attachContextButton.getSelection();
997
	}
998
999
	public void setAttachContext(boolean attachContext) {
1000
		if (attachContextButton != null && attachContextButton.isEnabled()) {
1001
			attachContextButton.setSelection(attachContext);
1002
		}
1003
	}
1004
959
	// TODO used for spell checking. Add back when we want to support this
1005
	// TODO used for spell checking. Add back when we want to support this
960
	// protected Button checkSpellingButton;
1006
	// protected Button checkSpellingButton;
961
	//	
1007
	//	

Return to bug 148903