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 291084 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/monitor/ui/MonitorUiPlugin.java (-1 / +8 lines)
Lines 84-89 Link Here
84
84
85
	public static final String PREF_USER_ACTIVITY_ENABLED = "org.eclipse.mylyn.monitor.user.activity.enabled"; //$NON-NLS-1$
85
	public static final String PREF_USER_ACTIVITY_ENABLED = "org.eclipse.mylyn.monitor.user.activity.enabled"; //$NON-NLS-1$
86
86
87
	public static final String ACTIVITY_TRACKING_ENABLED = "org.eclipse.mylyn.monitor.activity.tracking.enabled"; //$NON-NLS-1$
88
87
	private IWorkbenchWindow launchingWorkbenchWindow = null;
89
	private IWorkbenchWindow launchingWorkbenchWindow = null;
88
90
89
	private final org.eclipse.jface.util.IPropertyChangeListener PROPERTY_LISTENER = new org.eclipse.jface.util.IPropertyChangeListener() {
91
	private final org.eclipse.jface.util.IPropertyChangeListener PROPERTY_LISTENER = new org.eclipse.jface.util.IPropertyChangeListener() {
Lines 98-104 Link Here
98
				} else {
100
				} else {
99
					activityContextManager.stop();
101
					activityContextManager.stop();
100
				}
102
				}
101
103
			} else if (event.getProperty().equals(ACTIVITY_TRACKING_ENABLED)) {
104
				ContextCorePlugin.getDefault().setActivityTrackingEnabled(
105
						getPreferenceStore().getBoolean(ACTIVITY_TRACKING_ENABLED));
102
			}
106
			}
103
		}
107
		}
104
108
Lines 417-422 Link Here
417
				activityContextManager.start();
421
				activityContextManager.start();
418
			}
422
			}
419
423
424
			ContextCorePlugin.getDefault().setActivityTrackingEnabled(
425
					getPreferenceStore().getBoolean(ACTIVITY_TRACKING_ENABLED));
426
420
			getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
427
			getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
421
428
422
		} catch (Exception e) {
429
		} catch (Exception e) {
(-)src/org/eclipse/mylyn/internal/tasks/ui/preferences/TasksUiPreferencePage.java (-221 / +42 lines)
Lines 99-104 Link Here
99
99
100
	private Combo weekStartCombo;
100
	private Combo weekStartCombo;
101
101
102
	private Button activityTrackingEnabledButton;
103
102
	public TasksUiPreferencePage() {
104
	public TasksUiPreferencePage() {
103
		super();
105
		super();
104
		setPreferenceStore(TasksUiPlugin.getDefault().getPreferenceStore());
106
		setPreferenceStore(TasksUiPlugin.getDefault().getPreferenceStore());
Lines 199-205 Link Here
199
				timeoutEnabledButton.getSelection());
201
				timeoutEnabledButton.getSelection());
200
		MonitorUiPlugin.getDefault().getPreferenceStore().setValue(ActivityContextManager.ACTIVITY_TIMEOUT,
202
		MonitorUiPlugin.getDefault().getPreferenceStore().setValue(ActivityContextManager.ACTIVITY_TIMEOUT,
201
				timeoutMinutes.getSelection() * (60 * 1000));
203
				timeoutMinutes.getSelection() * (60 * 1000));
202
		//backupNow.setEnabled(true);
204
205
		MonitorUiPlugin.getDefault().getPreferenceStore().setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED,
206
				activityTrackingEnabledButton.getSelection());
203
207
204
		String taskDirectory = taskDirectoryText.getText();
208
		String taskDirectory = taskDirectoryText.getText();
205
		taskDirectory = taskDirectory.replaceAll(BACKSLASH_MULTI, FORWARDSLASH);
209
		taskDirectory = taskDirectory.replaceAll(BACKSLASH_MULTI, FORWARDSLASH);
Lines 262-267 Link Here
262
		timeoutMinutes.setSelection(minutes);
266
		timeoutMinutes.setSelection(minutes);
263
		timeoutEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
267
		timeoutEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
264
				ActivityContextManager.ACTIVITY_TIMEOUT_ENABLED));
268
				ActivityContextManager.ACTIVITY_TIMEOUT_ENABLED));
269
270
		activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
271
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED));
272
265
		return true;
273
		return true;
266
	}
274
	}
267
275
Lines 306-311 Link Here
306
		timeoutMinutes.setSelection(activityTimeoutMinutes);
314
		timeoutMinutes.setSelection(activityTimeoutMinutes);
307
		timeoutEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getDefaultBoolean(
315
		timeoutEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getDefaultBoolean(
308
				ActivityContextManager.ACTIVITY_TIMEOUT_ENABLED));
316
				ActivityContextManager.ACTIVITY_TIMEOUT_ENABLED));
317
318
		activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getDefaultBoolean(
319
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED));
320
309
		updateRefreshGroupEnablements();
321
		updateRefreshGroupEnablements();
310
	}
322
	}
311
323
Lines 413-466 Link Here
413
425
414
				if (taskDataDirectoryAction != IDialogConstants.CANCEL_ID) {
426
				if (taskDataDirectoryAction != IDialogConstants.CANCEL_ID) {
415
					taskDirectoryText.setText(dir);
427
					taskDirectoryText.setText(dir);
416
//					backupFolderText.setText(dir + FORWARDSLASH + ITasksCoreConstants.DEFAULT_BACKUP_FOLDER_NAME);
417
//					backupNow.setEnabled(false);
418
				}
428
				}
419
			}
429
			}
420
430
421
		});
431
		});
422
432
423
//		Composite backupComposite = new Composite(taskDataGroup, SWT.NULL);
424
//		gridLayout = new GridLayout(5, false);
425
//		gridLayout.marginWidth = 0;
426
//		gridLayout.marginHeight = 0;
427
//		backupComposite.setLayout(gridLayout);
428
//		backupComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
429
430
//		label = new Label(backupComposite, SWT.NULL);
431
//		label.setText("Backup every");
432
//		backupScheduleTimeText = new Text(backupComposite, SWT.BORDER | SWT.RIGHT);
433
//		final GridData gridData_1 = new GridData();
434
//		gridData_1.widthHint = 13;
435
//		backupScheduleTimeText.setLayoutData(gridData_1);
436
//
437
//		backupScheduleTimeText.setText("" + getPreferenceStore().getInt(TasksUiPreferenceConstants.BACKUP_SCHEDULE));
438
//		backupScheduleTimeText.addModifyListener(new ModifyListener() {
439
//			public void modifyText(ModifyEvent e) {
440
//				updateRefreshGroupEnablements();
441
//			}
442
//		});
443
//
444
//		label = new Label(backupComposite, SWT.NONE);
445
//		label.setText("days to");
446
447
//		String backupDirectory = TasksUiPlugin.getDefault().getBackupFolderPath();// getPreferenceStore().getString(TaskListPreferenceConstants.BACKUP_FOLDER);
448
//		backupDirectory = backupDirectory.replaceAll(BACKSLASH_MULTI, FORWARDSLASH);
449
//		backupFolderText = new Text(backupComposite, SWT.BORDER);
450
//		backupFolderText.setText(backupDirectory);
451
//		backupFolderText.setEditable(false);
452
//		backupFolderText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
453
//
454
//		backupNow = new Button(backupComposite, SWT.NONE);
455
//		backupNow.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
456
//		backupNow.setText("Backup Now");
457
//		backupNow.addSelectionListener(new SelectionAdapter() {
458
//
459
//			@Override
460
//			public void widgetSelected(SelectionEvent e) {
461
//				TasksUiPlugin.getBackupManager().backupNow(true);
462
//			}
463
//		});
464
	}
433
	}
465
434
466
	private void createSchedulingGroup(Composite container) {
435
	private void createSchedulingGroup(Composite container) {
Lines 485-555 Link Here
485
		weekStartCombo.add(CommonMessages.Saturday);
454
		weekStartCombo.add(CommonMessages.Saturday);
486
		weekStartCombo.select(getPreferenceStore().getInt(ITasksUiPreferenceConstants.WEEK_START_DAY) - 1);
455
		weekStartCombo.select(getPreferenceStore().getInt(ITasksUiPreferenceConstants.WEEK_START_DAY) - 1);
487
456
488
//		 Label workWeekBeginLabel = new Label(group, SWT.NONE);
489
//		 workWeekBeginLabel.setText(START_DAY_LABEL);
490
//		 workWeekBegin = new Combo(group, SWT.READ_ONLY);
491
//		 // Calendar.SUNDAY = 1
492
//		 workWeekBegin.add("SUNDAY");
493
//		 workWeekBegin.add("MONDAY");
494
//		 workWeekBegin.add("TUESDAY");
495
//		 workWeekBegin.add("WEDNESDAY");
496
//		 workWeekBegin.add("THURSDAY");
497
//		 workWeekBegin.add("FRIDAY");
498
//		 workWeekBegin.add("SATURDAY");
499
//		 workWeekBegin.select(getPreferenceStore().getInt(TaskListPreferenceConstants.PLANNING_STARTDAY)
500
//		 - 1);
501
502
//		 Label workWeekEndLabel = new Label(group, SWT.NONE);
503
//		 workWeekEndLabel.setText(END_DAY_LABEL);
504
//		 workWeekEnd = new Combo(group, SWT.READ_ONLY);
505
//		 workWeekEnd.add("SUNDAY");
506
//		 workWeekEnd.add("MONDAY");
507
//		 workWeekEnd.add("TUESDAY");
508
//		 workWeekEnd.add("WEDNESDAY");
509
//		 workWeekEnd.add("THURSDAY");
510
//		 workWeekEnd.add("FRIDAY");
511
//		 workWeekEnd.add("SATURDAY");
512
//		 workWeekEnd.select(getPreferenceStore().getInt(TaskListPreferenceConstants.PLANNING_ENDDAY)
513
//		 - 1);
514
515
//		Label hourDayStartLabel = new Label(group, SWT.NONE);
516
//		hourDayStartLabel.setText(START_HOUR_LABEL);
517
//		hourDayStart = new Spinner(group, SWT.BORDER);
518
//		hourDayStart.setDigits(0);
519
//		hourDayStart.setIncrement(1);
520
//		hourDayStart.setMaximum(23);
521
//		hourDayStart.setMinimum(0);
522
//		hourDayStart.setSelection(getPreferenceStore().getInt(TasksUiPreferenceConstants.PLANNING_STARTHOUR));
523
//		hourDayStart.addSelectionListener(new SelectionAdapter() {
524
//
525
//			@Override
526
//			public void widgetSelected(SelectionEvent e) {
527
//				updateRefreshGroupEnablements();
528
//			}
529
//
530
//		});
531
//
532
//		Label spacer = new Label(group, SWT.NONE);
533
//		GridDataFactory.fillDefaults().hint(40, SWT.DEFAULT).applyTo(spacer);
534
//
535
//		Label hourDayEndLabel = new Label(group, SWT.NONE);
536
//		hourDayEndLabel.setText(END_HOUR_LABEL);
537
//
538
//		hourDayEnd = new Spinner(group, SWT.BORDER);
539
//		hourDayEnd.setDigits(0);
540
//		hourDayEnd.setIncrement(1);
541
//		hourDayEnd.setMaximum(23);
542
//		hourDayEnd.setMinimum(0);
543
//		hourDayEnd.setSelection(getPreferenceStore().getInt(TasksUiPreferenceConstants.PLANNING_ENDHOUR));
544
//		hourDayEnd.addSelectionListener(new SelectionAdapter() {
545
//
546
//			@Override
547
//			public void widgetSelected(SelectionEvent e) {
548
//				updateRefreshGroupEnablements();
549
//			}
550
//
551
//		});
552
553
	}
457
	}
554
458
555
	private void createTaskActivityGroup(Composite container) {
459
	private void createTaskActivityGroup(Composite container) {
Lines 558-566 Link Here
558
		group.setLayout(new GridLayout(3, false));
462
		group.setLayout(new GridLayout(3, false));
559
		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
463
		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
560
464
465
		boolean activityTrackingEnabled = MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
466
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED);
467
561
		boolean timeoutEnabled = MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
468
		boolean timeoutEnabled = MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
562
				ActivityContextManager.ACTIVITY_TIMEOUT_ENABLED);
469
				ActivityContextManager.ACTIVITY_TIMEOUT_ENABLED);
563
470
471
		activityTrackingEnabledButton = new Button(group, SWT.CHECK);
472
		activityTrackingEnabledButton.setText("Track time spent on active task within Eclipse");
473
		activityTrackingEnabledButton.setSelection(activityTrackingEnabled);
474
		activityTrackingEnabledButton.setToolTipText("Track the time spent within Eclipse");
475
		activityTrackingEnabledButton.addSelectionListener(new SelectionAdapter() {
476
			@Override
477
			public void widgetSelected(SelectionEvent e) {
478
				updateRefreshGroupEnablements();
479
			}
480
		});
481
		GridDataFactory.swtDefaults().span(3, 1).applyTo(activityTrackingEnabledButton);
482
564
		timeoutEnabledButton = new Button(group, SWT.CHECK);
483
		timeoutEnabledButton = new Button(group, SWT.CHECK);
565
		timeoutEnabledButton.setText(Messages.TasksUiPreferencePage_Enable_inactivity_timeouts);
484
		timeoutEnabledButton.setText(Messages.TasksUiPreferencePage_Enable_inactivity_timeouts);
566
		timeoutEnabledButton.setSelection(timeoutEnabled);
485
		timeoutEnabledButton.setSelection(timeoutEnabled);
Lines 596-711 Link Here
596
		timeoutLabel = new Label(group, SWT.NONE);
515
		timeoutLabel = new Label(group, SWT.NONE);
597
		timeoutLabel.setText(Messages.TasksUiPreferencePage_minutes_of_inactivity);
516
		timeoutLabel.setText(Messages.TasksUiPreferencePage_minutes_of_inactivity);
598
517
599
//		Label spacer = new Label(group, SWT.NONE);
518
	}
600
//		GridDataFactory.fillDefaults().hint(40, SWT.DEFAULT).applyTo(spacer);
601
//
602
//		Label hourDayEndLabel = new Label(group, SWT.NONE);
603
//		hourDayEndLabel.setText(END_HOUR_LABEL);
604
//
605
//		hourDayEnd = new Spinner(group, SWT.BORDER);
606
//		hourDayEnd.setDigits(0);
607
//		hourDayEnd.setIncrement(1);
608
//		hourDayEnd.setMaximum(23);
609
//		hourDayEnd.setMinimum(0);
610
//		hourDayEnd.setSelection(getPreferenceStore().getInt(TasksUiPreferenceConstants.PLANNING_ENDHOUR));
611
//		hourDayEnd.addSelectionListener(new SelectionAdapter() {
612
//
613
//			@Override
614
//			public void widgetSelected(SelectionEvent e) {
615
//				updateRefreshGroupEnablements();
616
//			}
617
//
618
//		});
619
620
	}
621
622
//	private void createSchedulingGroup(Composite container) {
623
//		Group group = new Group(container, SWT.SHADOW_ETCHED_IN);
624
//		group.setText(GROUP_WORK_WEEK_LABEL);
625
//		group.setLayout(new GridLayout(5, false));
626
//		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
627
//
628
//		// Label workWeekBeginLabel = new Label(group, SWT.NONE);
629
//		// workWeekBeginLabel.setText(START_DAY_LABEL);
630
//		// workWeekBegin = new Combo(group, SWT.READ_ONLY);
631
//		// // Calendar.SUNDAY = 1
632
//		// workWeekBegin.add("SUNDAY");
633
//		// workWeekBegin.add("MONDAY");
634
//		// workWeekBegin.add("TUESDAY");
635
//		// workWeekBegin.add("WEDNESDAY");
636
//		// workWeekBegin.add("THURSDAY");
637
//		// workWeekBegin.add("FRIDAY");
638
//		// workWeekBegin.add("SATURDAY");
639
//		// workWeekBegin.select(getPreferenceStore().getInt(TaskListPreferenceConstants.PLANNING_STARTDAY)
640
//		// - 1);
641
//		//		
642
//		// Label workWeekEndLabel = new Label(group, SWT.NONE);
643
//		// workWeekEndLabel.setText(END_DAY_LABEL);
644
//		// workWeekEnd = new Combo(group, SWT.READ_ONLY);
645
//		// workWeekEnd.add("SUNDAY");
646
//		// workWeekEnd.add("MONDAY");
647
//		// workWeekEnd.add("TUESDAY");
648
//		// workWeekEnd.add("WEDNESDAY");
649
//		// workWeekEnd.add("THURSDAY");
650
//		// workWeekEnd.add("FRIDAY");
651
//		// workWeekEnd.add("SATURDAY");
652
//		// workWeekEnd.select(getPreferenceStore().getInt(TaskListPreferenceConstants.PLANNING_ENDDAY)
653
//		// - 1);
654
//
655
//		Label hourDayStartLabel = new Label(group, SWT.NONE);
656
//		hourDayStartLabel.setText(START_HOUR_LABEL);
657
//		hourDayStart = new Spinner(group, SWT.BORDER);
658
//		hourDayStart.setDigits(0);
659
//		hourDayStart.setIncrement(1);
660
//		hourDayStart.setMaximum(23);
661
//		hourDayStart.setMinimum(0);
662
//		hourDayStart.setSelection(getPreferenceStore().getInt(TasksUiPreferenceConstants.PLANNING_STARTHOUR));
663
//		hourDayStart.addSelectionListener(new SelectionAdapter() {
664
//
665
//			@Override
666
//			public void widgetSelected(SelectionEvent e) {
667
//				updateRefreshGroupEnablements();
668
//			}
669
//
670
//		});
671
//
672
//		Label spacer = new Label(group, SWT.NONE);
673
//		GridDataFactory.fillDefaults().hint(40, SWT.DEFAULT).applyTo(spacer);
674
//
675
//		Label hourDayEndLabel = new Label(group, SWT.NONE);
676
//		hourDayEndLabel.setText(END_HOUR_LABEL);
677
//
678
//		hourDayEnd = new Spinner(group, SWT.BORDER);
679
//		hourDayEnd.setDigits(0);
680
//		hourDayEnd.setIncrement(1);
681
//		hourDayEnd.setMaximum(23);
682
//		hourDayEnd.setMinimum(0);
683
//		hourDayEnd.setSelection(getPreferenceStore().getInt(TasksUiPreferenceConstants.PLANNING_ENDHOUR));
684
//		hourDayEnd.addSelectionListener(new SelectionAdapter() {
685
//
686
//			@Override
687
//			public void widgetSelected(SelectionEvent e) {
688
//				updateRefreshGroupEnablements();
689
//			}
690
//
691
//		});
692
//
693
//	}
694
519
695
	public void updateRefreshGroupEnablements() {
520
	public void updateRefreshGroupEnablements() {
696
		String errorMessage = null;
521
		String errorMessage = null;
697
522
698
//		try {
699
//			long number = Integer.parseInt(backupScheduleTimeText.getText());
700
//			if (number <= 0) {
701
//				errorMessage = "Backup schedule time must be > 0";
702
//			} else if (backupFolderText.getText() == "") {
703
//				errorMessage = "Backup destination folder must be specified";
704
//			}
705
//		} catch (NumberFormatException e) {
706
//			errorMessage = "Backup schedule time must be valid integer";
707
//		}
708
709
		if (enableBackgroundSynch.getSelection()) {
523
		if (enableBackgroundSynch.getSelection()) {
710
			try {
524
			try {
711
				long number = Long.parseLong(synchScheduleTime.getText());
525
				long number = Long.parseLong(synchScheduleTime.getText());
Lines 717-732 Link Here
717
			}
531
			}
718
		}
532
		}
719
533
720
//		if (hourDayEnd.getSelection() <= hourDayStart.getSelection()) {
721
//			errorMessage = "Planning: Work day start must be before end.";
722
//		}
723
724
		setErrorMessage(errorMessage);
534
		setErrorMessage(errorMessage);
725
		setValid(errorMessage == null);
535
		setValid(errorMessage == null);
726
536
727
		synchScheduleTime.setEnabled(enableBackgroundSynch.getSelection());
537
		if (activityTrackingEnabledButton.getSelection()) {
728
538
729
		timeoutMinutes.setEnabled(timeoutEnabledButton.getSelection());
539
			timeoutEnabledButton.setEnabled(true);
540
541
			synchScheduleTime.setEnabled(enableBackgroundSynch.getSelection());
542
543
			timeoutMinutes.setEnabled(timeoutEnabledButton.getSelection());
544
		} else {
545
			timeoutEnabledButton.setEnabled(false);
546
547
			synchScheduleTime.setEnabled(false);
548
549
			timeoutMinutes.setEnabled(false);
550
		}
730
551
731
	}
552
	}
732
553
(-)src/org/eclipse/mylyn/internal/tasks/ui/TaskActivityMonitor.java (-5 / +6 lines)
Lines 19-24 Link Here
19
import org.eclipse.mylyn.context.core.AbstractContextListener;
19
import org.eclipse.mylyn.context.core.AbstractContextListener;
20
import org.eclipse.mylyn.context.core.ContextChangeEvent;
20
import org.eclipse.mylyn.context.core.ContextChangeEvent;
21
import org.eclipse.mylyn.internal.context.core.InteractionContextManager;
21
import org.eclipse.mylyn.internal.context.core.InteractionContextManager;
22
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
22
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
23
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
23
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
24
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
24
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
25
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
Lines 48-58 Link Here
48
		public void contextChanged(ContextChangeEvent event) {
49
		public void contextChanged(ContextChangeEvent event) {
49
			switch (event.getEventKind()) {
50
			switch (event.getEventKind()) {
50
			case INTEREST_CHANGED:
51
			case INTEREST_CHANGED:
51
				List<InteractionEvent> events = contextManager.getActivityMetaContext().getInteractionHistory();
52
					List<InteractionEvent> events = contextManager.getActivityMetaContext().getInteractionHistory();
52
				if (events.size() > 0) {
53
					if (events.size() > 0) {
53
					InteractionEvent interactionEvent = events.get(events.size() - 1);
54
						InteractionEvent interactionEvent = events.get(events.size() - 1);
54
					parseInteractionEvent(interactionEvent, false);
55
						parseInteractionEvent(interactionEvent, false);
55
				}
56
					}
56
				break;
57
				break;
57
			}
58
			}
58
		}
59
		}
(-)src/org/eclipse/mylyn/internal/context/core/ContextCorePlugin.java (+11 lines)
Lines 64-69 Link Here
64
64
65
	private final InteractionContextScaling commonContextScaling = new InteractionContextScaling();
65
	private final InteractionContextScaling commonContextScaling = new InteractionContextScaling();
66
66
67
	private boolean activityTrackingEnabled;
68
67
	private static final AbstractContextStructureBridge DEFAULT_BRIDGE = new AbstractContextStructureBridge() {
69
	private static final AbstractContextStructureBridge DEFAULT_BRIDGE = new AbstractContextStructureBridge() {
68
70
69
		@Override
71
		@Override
Lines 471-474 Link Here
471
	public IInteractionContextScaling getCommonContextScaling() {
473
	public IInteractionContextScaling getCommonContextScaling() {
472
		return commonContextScaling;
474
		return commonContextScaling;
473
	}
475
	}
476
477
	public void setActivityTrackingEnabled(boolean b) {
478
		this.activityTrackingEnabled = b;
479
	}
480
481
	public boolean isActivityTrackingEnabled() {
482
		return activityTrackingEnabled;
483
	}
484
474
}
485
}
(-)src/org/eclipse/mylyn/internal/context/core/SaxContextWriter.java (-4 / +15 lines)
Lines 15-20 Link Here
15
import java.io.IOException;
15
import java.io.IOException;
16
import java.io.OutputStream;
16
import java.io.OutputStream;
17
import java.text.SimpleDateFormat;
17
import java.text.SimpleDateFormat;
18
import java.util.Date;
18
import java.util.Locale;
19
import java.util.Locale;
19
20
20
import javax.xml.transform.Transformer;
21
import javax.xml.transform.Transformer;
Lines 184-191 Link Here
184
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_DELTA, //$NON-NLS-1$
185
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_DELTA, //$NON-NLS-1$
185
				InteractionContextExternalizer.ATR_DELTA, "", //$NON-NLS-1$
186
				InteractionContextExternalizer.ATR_DELTA, "", //$NON-NLS-1$
186
				org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(ie.getDelta()));
187
				org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(ie.getDelta()));
187
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_END_DATE, //$NON-NLS-1$
188
		if (ie.getKind().equals(InteractionEvent.Kind.ATTENTION)
188
				InteractionContextExternalizer.ATR_END_DATE, "", dateFormat.format(ie.getEndDate())); //$NON-NLS-1$
189
				|| (ie.getStructureKind().equals(InteractionContextManager.ACTIVITY_STRUCTUREKIND_ACTIVATION))) {
190
			if (ContextCorePlugin.getDefault().isActivityTrackingEnabled()) {
191
				ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_START_DATE, //$NON-NLS-1$
192
						InteractionContextExternalizer.ATR_START_DATE, "", dateFormat.format(ie.getDate())); //$NON-NLS-1$
193
				ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_END_DATE, //$NON-NLS-1$
194
						InteractionContextExternalizer.ATR_END_DATE, "", dateFormat.format(ie.getEndDate())); //$NON-NLS-1$
195
			} else {
196
				ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_START_DATE, //$NON-NLS-1$
197
						InteractionContextExternalizer.ATR_START_DATE, "", dateFormat.format(new Date(0))); //$NON-NLS-1$
198
				ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_END_DATE, //$NON-NLS-1$
199
						InteractionContextExternalizer.ATR_END_DATE, "", dateFormat.format(new Date(0))); //$NON-NLS-1$
200
			}
201
		}
189
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_INTEREST, //$NON-NLS-1$
202
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_INTEREST, //$NON-NLS-1$
190
				InteractionContextExternalizer.ATR_INTEREST, "", Float.toString(ie.getInterestContribution())); //$NON-NLS-1$
203
				InteractionContextExternalizer.ATR_INTEREST, "", Float.toString(ie.getInterestContribution())); //$NON-NLS-1$
191
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_KIND, InteractionContextExternalizer.ATR_KIND, //$NON-NLS-1$
204
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_KIND, InteractionContextExternalizer.ATR_KIND, //$NON-NLS-1$
Lines 196-203 Link Here
196
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_ORIGIN_ID, //$NON-NLS-1$
209
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_ORIGIN_ID, //$NON-NLS-1$
197
				InteractionContextExternalizer.ATR_ORIGIN_ID, "", //$NON-NLS-1$
210
				InteractionContextExternalizer.ATR_ORIGIN_ID, "", //$NON-NLS-1$
198
				org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(ie.getOriginId()));
211
				org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(ie.getOriginId()));
199
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_START_DATE, //$NON-NLS-1$
200
				InteractionContextExternalizer.ATR_START_DATE, "", dateFormat.format(ie.getDate())); //$NON-NLS-1$
201
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_STRUCTURE_HANDLE, //$NON-NLS-1$
212
		ieAttributes.addAttribute("", InteractionContextExternalizer.ATR_STRUCTURE_HANDLE, //$NON-NLS-1$
202
				InteractionContextExternalizer.ATR_STRUCTURE_HANDLE, "", //$NON-NLS-1$
213
				InteractionContextExternalizer.ATR_STRUCTURE_HANDLE, "", //$NON-NLS-1$
203
				org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(ie.getStructureHandle()));
214
				org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(ie.getStructureHandle()));

Return to bug 291084