Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 149482 Details for
Bug 291084
make time tracking optional and opt-in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
show scheduling information in header
clipboard.txt (text/plain), 12.59 KB, created by
Steffen Pingel
on 2009-10-13 17:34:54 EDT
(
hide
)
Description:
show scheduling information in header
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2009-10-13 17:34:54 EDT
Size:
12.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.monitor.ui >Index: src/org/eclipse/mylyn/internal/monitor/ui/MonitorUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.monitor.ui/src/org/eclipse/mylyn/internal/monitor/ui/MonitorUiPlugin.java,v >retrieving revision 1.19 >diff -u -r1.19 MonitorUiPlugin.java >--- src/org/eclipse/mylyn/internal/monitor/ui/MonitorUiPlugin.java 12 Oct 2009 23:14:12 -0000 1.19 >+++ src/org/eclipse/mylyn/internal/monitor/ui/MonitorUiPlugin.java 13 Oct 2009 21:37:29 -0000 >@@ -437,4 +437,11 @@ > return activityTrackingEnabled; > } > >+ /** >+ * Returns true, if other activity monitors than {@link WorkbenchUserActivityMonitor} have been registered. >+ */ >+ public boolean isTrackingOsTime() { >+ return monitors.size() > 1; >+ } >+ > } >#P org.eclipse.mylyn.commons.ui >Index: src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java,v >retrieving revision 1.12 >diff -u -r1.12 AbstractNotificationPopup.java >--- src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java 19 Aug 2009 07:39:36 -0000 1.12 >+++ src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java 13 Oct 2009 21:37:31 -0000 >@@ -12,10 +12,8 @@ > > package org.eclipse.mylyn.internal.provisional.commons.ui; > >-import org.eclipse.core.runtime.IProduct; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.jface.resource.JFaceResources; >@@ -153,13 +151,8 @@ > * @return the name to be used in the title of the popup. > */ > protected String getPopupShellTitle() { >- IProduct product = Platform.getProduct(); >- if (product != null) { >- String productName = product.getName(); >- String LABEL_SDK = "SDK"; //$NON-NLS-1$ >- if (productName.endsWith(LABEL_SDK)) { >- productName = productName.substring(0, productName.length() - LABEL_SDK.length()); >- } >+ String productName = CommonUiUtil.getProductName(); >+ if (productName != null) { > return productName + " " + LABEL_NOTIFICATION; //$NON-NLS-1$ > } else { > return LABEL_NOTIFICATION; >Index: src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java,v >retrieving revision 1.5 >diff -u -r1.5 CommonUiUtil.java >--- src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java 20 Sep 2009 07:14:42 -0000 1.5 >+++ src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java 13 Oct 2009 21:37:31 -0000 >@@ -14,9 +14,11 @@ > import java.lang.reflect.InvocationTargetException; > > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProduct; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.OperationCanceledException; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.jobs.ISchedulingRule; > import org.eclipse.jface.dialogs.DialogPage; >@@ -226,4 +228,24 @@ > public static String toLabel(String text) { > return (text != null) ? text.replaceAll("&", "&&") : null; // mask & from SWT //$NON-NLS-1$ //$NON-NLS-2$ > } >+ >+ public static String getProductName() { >+ return getProductName(null); >+ } >+ >+ public static String getProductName(String defaultName) { >+ IProduct product = Platform.getProduct(); >+ if (product != null) { >+ String productName = product.getName(); >+ if (productName != null) { >+ String LABEL_SDK = "SDK"; //$NON-NLS-1$ >+ if (productName.endsWith(LABEL_SDK)) { >+ productName = productName.substring(0, productName.length() - LABEL_SDK.length()).trim(); >+ } >+ return productName; >+ } >+ } >+ return defaultName; >+ } >+ > } >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorPlanningPart.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorPlanningPart.java,v >retrieving revision 1.30 >diff -u -r1.30 TaskEditorPlanningPart.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorPlanningPart.java 13 Oct 2009 00:57:59 -0000 1.30 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorPlanningPart.java 13 Oct 2009 21:37:33 -0000 >@@ -51,7 +51,9 @@ > part = new PlanningPart(ExpandableComposite.TWISTIE) { > @Override > protected void fillToolBar(ToolBarManager toolBarManager) { >- toolBarManager.add(new NotesAction()); >+ NotesAction notesAction = new NotesAction(); >+ notesAction.setEnabled(needsNotes()); >+ toolBarManager.add(notesAction); > } > }; > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java,v >retrieving revision 1.30 >diff -u -r1.30 PlanningPart.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java 13 Oct 2009 05:33:42 -0000 1.30 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java 13 Oct 2009 21:37:33 -0000 >@@ -28,10 +28,12 @@ > import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil; > import org.eclipse.mylyn.internal.provisional.commons.ui.DatePicker; > import org.eclipse.mylyn.internal.tasks.core.AbstractTask; >+import org.eclipse.mylyn.internal.tasks.core.DateRange; > import org.eclipse.mylyn.internal.tasks.core.DayDateRange; > import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener; > import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil; > import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; >+import org.eclipse.mylyn.internal.tasks.core.WeekDateRange; > import org.eclipse.mylyn.internal.tasks.ui.ScheduleDatePicker; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.internal.tasks.ui.util.PlatformUtil; >@@ -46,6 +48,7 @@ > import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorExtension; > import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; > import org.eclipse.mylyn.tasks.ui.editors.TaskFormPage; >+import org.eclipse.osgi.util.NLS; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.FocusEvent; > import org.eclipse.swt.events.FocusListener; >@@ -54,6 +57,7 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.layout.RowLayout; > import org.eclipse.swt.widgets.Composite; >@@ -196,6 +200,8 @@ > > private boolean activeTimeEnabled; > >+ private Label scheduledLabel; >+ > public PlanningPart(int sectionStyle) { > super(sectionStyle, Messages.PersonalPart_Personal_Planning); > this.activeTimeEnabled = true; >@@ -306,12 +312,12 @@ > > createEstimatedTime(toolkit, sectionClient); > >-// createActualTime(toolkit, composite); >- > if (needsNotes()) { > createNotesArea(toolkit, sectionClient, layout.numColumns); > } > >+ createActiveTime(toolkit, sectionClient, layout.numColumns); >+ > toolkit.paintBordersFor(sectionClient); > section.setClient(sectionClient); > CommonUiUtil.setMenu(sectionClient, section.getParent().getMenu()); >@@ -399,8 +405,9 @@ > > } > >- private void createActiveTimeControl(FormToolkit toolkit, Composite toolbarComposite) { >+ private void createActiveTime(FormToolkit toolkit, Composite toolbarComposite, int numColumns) { > activeTimeComposite = toolkit.createComposite(toolbarComposite); >+ GridDataFactory.fillDefaults().span(numColumns, SWT.DEFAULT).grab(false, false).applyTo(activeTimeComposite); > activeTimeComposite.setBackground(null); > activeTimeComposite.setBackgroundMode(SWT.INHERIT_FORCE); > RowLayout rowLayout = new RowLayout(); >@@ -411,7 +418,14 @@ > rowLayout.marginRight = 0; > activeTimeComposite.setLayout(rowLayout); > >- Label label = toolkit.createLabel(activeTimeComposite, Messages.TaskEditorPlanningPart_Active); >+ String labelString; >+ if (MonitorUiPlugin.getDefault().isTrackingOsTime()) { >+ labelString = "Active time:"; >+ } else { >+ String productName = CommonUiUtil.getProductName("Eclipse"); >+ labelString = NLS.bind("Active time spent in {0}:", productName); >+ } >+ Label label = toolkit.createLabel(activeTimeComposite, labelString); > label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); > label.setToolTipText(Messages.TaskEditorPlanningPart_Time_working_on_this_task); > label.setBackground(null); >@@ -450,6 +464,8 @@ > if (show && (elapsedTime > 0 || getTask().isActive())) { > if (activeTimeComposite != null && !activeTimeComposite.isVisible()) { > activeTimeComposite.setVisible(true); >+ ((GridData) activeTimeComposite.getLayoutData()).exclude = false; >+ activeTimeComposite.getParent().layout(); > } > String elapsedTimeString = DateUtil.getFormattedDurationShort(elapsedTime); > if (elapsedTimeString.equals("")) { //$NON-NLS-1$ >@@ -457,7 +473,9 @@ > } > activeTimeText.setText(elapsedTimeString); > } else { >- if (activeTimeComposite != null) { >+ if (activeTimeComposite != null && activeTimeComposite.isVisible()) { >+ ((GridData) activeTimeComposite.getLayoutData()).exclude = true; >+ activeTimeComposite.getParent().layout(); > activeTimeComposite.setVisible(false); > } > } >@@ -572,6 +590,7 @@ > > @Override > protected void setSection(FormToolkit toolkit, Section section) { >+ super.setSection(toolkit, section); > if (section.getTextClient() == null) { > Composite toolbarComposite = toolkit.createComposite(section); > toolbarComposite.setBackground(null); >@@ -583,7 +602,7 @@ > rowLayout.center = true; > toolbarComposite.setLayout(rowLayout); > >- createActiveTimeControl(toolkit, toolbarComposite); >+ createScheduledLabel(toolbarComposite, section, toolkit); > > ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT); > fillToolBar(toolBarManager); >@@ -598,8 +617,56 @@ > > section.setTextClient(toolbarComposite); > } >+ } > >- super.setSection(toolkit, section); >+ private void createScheduledLabel(Composite composite, Section section, FormToolkit toolkit) { >+ scheduledLabel = toolkit.createLabel(composite, ""); //$NON-NLS-1$ >+ scheduledLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); >+ scheduledLabel.setBackground(null); >+ updateScheduledLabel(section.isExpanded()); >+ section.addExpansionListener(new ExpansionAdapter() { >+ @Override >+ public void expansionStateChanging(ExpansionEvent event) { >+ updateScheduledLabel(event.getState()); >+ } >+ }); >+ } >+ >+ private void updateScheduledLabel(boolean sectionIsExpanded) { >+ if (scheduledLabel != null && !scheduledLabel.isDisposed()) { >+ if (!sectionIsExpanded && !getTask().isCompleted()) { >+ DateRange date = getTask().getScheduledForDate(); >+ if (date != null) { >+ scheduledLabel.setText(getLabel(date)); >+ } else { >+ scheduledLabel.setText(""); //$NON-NLS-1$ >+ } >+ if (!scheduledLabel.isVisible()) { >+ scheduledLabel.setVisible(true); >+ } >+ scheduledLabel.getParent().getParent().layout(true); >+ } else { >+ if (scheduledLabel.isVisible()) { >+ scheduledLabel.setVisible(false); >+ scheduledLabel.getParent().getParent().layout(true); >+ } >+ } >+ } >+ } >+ >+ private String getLabel(DateRange dateRange) { >+ if (dateRange.isPresent() && !(dateRange instanceof WeekDateRange)) { >+ return "Today"; >+ } >+ if (TaskActivityUtil.getCurrentWeek().includes(dateRange)) { >+ return "This Week"; >+ } >+ Calendar endNextWeek = TaskActivityUtil.getCalendar(); >+ endNextWeek.add(Calendar.DAY_OF_YEAR, 7); >+ if (TaskActivityUtil.getNextWeek().includes(dateRange) && dateRange.before(endNextWeek)) { >+ return "Next Week"; >+ } >+ return "Later"; > } > > protected void fillToolBar(ToolBarManager toolBarManager) { >@@ -631,6 +698,10 @@ > } > } > >+ if (scheduledLabel != null && !scheduledLabel.isDisposed()) { >+ updateScheduledLabel(getSection().isExpanded()); >+ } >+ > if (estimatedTimeSpinner != null && !estimatedTimeSpinner.isDisposed()) { > estimatedTimeSpinner.setSelection(getTask().getEstimatedTimeHours()); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 291084
:
149078
|
149079
|
149177
|
149178
|
149197
|
149198
|
149287
|
149345
|
149399
| 149482