Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-12-10 00:10:09 -0500
committerJean Michel-Lemieux2003-12-10 00:10:09 -0500
commit2d6f81f2aa176032290820b394ad6a9755e4bfee (patch)
tree1422e81ad0c8b3dc5775ffda4919a0ca8f9d74d9
parent31cb8fc909f86e722e28244b52897c651295e932 (diff)
downloadeclipse.platform.team-2d6f81f2aa176032290820b394ad6a9755e4bfee.tar.gz
eclipse.platform.team-2d6f81f2aa176032290820b394ad6a9755e4bfee.tar.xz
eclipse.platform.team-2d6f81f2aa176032290820b394ad6a9755e4bfee.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java29
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshEvent.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SummarySection.java39
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncChangesTableViewer.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantComposite.java134
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/aa.java32
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncTreeViewer.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/ControlFactory.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/FormSection.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java46
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java2
16 files changed, 307 insertions, 64 deletions
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
new file mode 100644
index 000000000..b537cdcdc
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/TODO-syncview.txt
@@ -0,0 +1,10 @@
+- P3 schedule support by participant.
+ this requires changing the refresh jobs to accept scheduling different jobs. Essentially being able to have an
+ ordered queue of refreshes. Also, participant will need a schedule object to encapsulate the schedule logic.
+- P3 status message could be more precise instead of simply "Working". But to do this we need access to the job progress monitor
+ and it isn't available API from the UI.
+- P1 end of refresh prompt should be a property change notice, and let the participant decide what to do!
+- P1 mode switching at the end of a refresh to ensure that changes are shown if available
+- P2 need an event for adding roots to a subscriber to update the list shown
+- P1 support for table widget in changes page
+- remove duplicated tree/table viewers classes. the orignial ones simply have the INavigable behavior. \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index c16308606..6a0a44624 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -23,6 +23,8 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.ui.TeamImages;
+import org.eclipse.team.ui.synchronize.TeamSubscriberParticipant;
+import org.eclipse.ui.IWorkingSet;
public class Utils {
@@ -291,4 +293,29 @@ public class Utils {
a.setImageDescriptor(id);
}
}
-}
+
+ public static String modeToString(int mode) {
+ switch(mode) {
+ case TeamSubscriberParticipant.INCOMING_MODE:
+ return "Incoming";
+ case TeamSubscriberParticipant.OUTGOING_MODE:
+ return "Outgoing";
+ case TeamSubscriberParticipant.BOTH_MODE:
+ return "Incoming/Outgoing";
+ case TeamSubscriberParticipant.CONFLICTING_MODE:
+ return "Conflicting";
+ }
+ return "unknown mode";
+ }
+
+ public static String workingSetToString(IWorkingSet set, int maxLength) {
+ String text = Policy.bind("StatisticsPanel.noWorkingSet"); //$NON-NLS-1$
+ if (set != null) {
+ text = set.getName();
+ if (text.length() > maxLength) {
+ text = text.substring(0, maxLength - 3) + "..."; //$NON-NLS-1$
+ }
+ }
+ return text;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshEvent.java
new file mode 100644
index 000000000..50e2a5f18
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshEvent.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.jobs;
+
+public class RefreshEvent {
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java
index 72733971f..f32d3d2af 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java
@@ -83,7 +83,7 @@ public class RefreshSubscriberInputJob extends RefreshSubscriberJob {
// NOTE: It would be cleaner if this was done by a scheduling
// rule but at the time of writting, it is not possible due to
// the scheduling rule containment rules.
- lastTimeRun = System.currentTimeMillis();
+ long lastTimeRun = System.currentTimeMillis();
if(monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
@@ -93,6 +93,7 @@ public class RefreshSubscriberInputJob extends RefreshSubscriberJob {
monitor.setTaskName(Policy.bind(Policy.bind("RefreshSubscriberInputJob.1"), input.getParticipant().getName(), new Integer(input.workingSetRoots().length).toString())); //$NON-NLS-1$
TeamSubscriber subscriber = input.getSubscriber();
subscriber.refresh(input.workingSetRoots(), IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 100));
+ input.getParticipant().setLastRefreshTime(lastTimeRun);
}
} catch(TeamException e) {
status.merge(e.getStatus());
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
index 62922b90d..92541447e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
@@ -11,21 +11,17 @@
package org.eclipse.team.internal.ui.jobs;
import java.util.*;
-import java.util.ArrayList;
-import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.*;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.RefreshCompleteDialog;
@@ -62,11 +58,6 @@ public class RefreshSubscriberJob extends WorkspaceJob {
/* internal use only */ static long scheduleDelay = 20000;
/**
- * Time the job was run last in milliseconds.
- */
- protected long lastTimeRun = 0;
-
- /**
* The subscribers and roots to refresh. If these are changed when the job
* is running the job is cancelled.
*/
@@ -171,7 +162,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
// NOTE: It would be cleaner if this was done by a scheduling
// rule but at the time of writting, it is not possible due to
// the scheduling rule containment rules.
- lastTimeRun = System.currentTimeMillis();
+ long lastTimeRun = System.currentTimeMillis();
if(monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
@@ -179,6 +170,7 @@ public class RefreshSubscriberJob extends WorkspaceJob {
final ChangeListener listener = new ChangeListener(input);
subscriber.addListener(listener);
subscriber.refresh(roots, IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 100));
+ input.getParticipant().setLastRefreshTime(lastTimeRun);
subscriber.removeListener(listener);
TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
@@ -255,9 +247,5 @@ public class RefreshSubscriberJob extends WorkspaceJob {
public boolean shouldReschedule() {
return reschedule;
- }
-
- public long getLastTimeRun() {
- return lastTimeRun;
- }
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
index 379bf23ce..a5009e3df 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java
@@ -233,12 +233,12 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
private void updateLastRunTime(Label label) {
String text;
- long mills = TeamUIPlugin.getPlugin().getRefreshJob().getLastTimeRun();
+ long mills = 0;
if(mills == 0) {
String never = Policy.bind("SyncViewPreferencePage.lastRefreshRunNever"); //$NON-NLS-1$
text = Policy.bind("SyncViewPreferencePage.lastRefreshRun", never); //$NON-NLS-1$
} else {
- Date lastTimeRun = new Date(TeamUIPlugin.getPlugin().getRefreshJob().getLastTimeRun());
+ Date lastTimeRun = new Date(mills);
String sLastTimeRun = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(lastTimeRun);
text = Policy.bind("SyncViewPreferencePage.lastRefreshRun", sLastTimeRun); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
index 8ec6d3ae8..418e79dfb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
@@ -13,6 +13,8 @@ package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.sets.*;
import org.eclipse.team.internal.ui.synchronize.sets.ISyncSetChangedListener;
import org.eclipse.team.internal.ui.synchronize.sets.SyncSetChangedEvent;
import org.eclipse.team.internal.ui.widgets.FormSection;
@@ -85,7 +87,7 @@ public class ChangesSection extends FormSection {
if(participant.getInput().getFilteredSyncSet().size() == 0) {
TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
public void run() {
- setDescription("There are no changes to see! Move on now...");
+ setDescription(getEmptyChangesText());
}
});
} else {
@@ -100,6 +102,20 @@ public class ChangesSection extends FormSection {
}
}
+ private String getEmptyChangesText() {
+ SubscriberInput input = participant.getInput();
+ int changesInWorkspace = input.getSubscriberSyncSet().size();
+ int changesInWorkingSet = input.getWorkingSetSyncSet().size();
+ int changesInFilter = input.getFilteredSyncSet().size();
+ if(changesInFilter == 0 && changesInWorkingSet != 0) {
+ return "The current mode '" + Utils.modeToString(participant.getMode()) + "' doesn't contain any changes. Switch to another mode.";
+ } else if(changesInFilter == 0 && changesInWorkingSet == 0 && changesInWorkspace != 0) {
+ return "The current working set '" + Utils.workingSetToString(participant.getWorkingSet(), 50) + "' is hiding changes in your workspace. Remove working set.";
+ } else {
+ return "No changes in workspace";
+ }
+ }
+
public SyncChangesViewer getChangesViewer() {
return changesViewer;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SummarySection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SummarySection.java
index ed8ebb290..46329ba3e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SummarySection.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SummarySection.java
@@ -1,6 +1,8 @@
package org.eclipse.team.internal.ui.synchronize;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.widgets.FormSection;
import org.eclipse.team.ui.controls.IControlFactory;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
@@ -12,6 +14,7 @@ public class SummarySection extends FormSection {
private Composite parent;
private ParticipantComposite participantComposite;
private ISynchronizeView view;
+ private Composite client;
public SummarySection(Composite parent, TeamSubscriberParticipant participant, ISynchronizeView view) {
this.participant = participant;
@@ -19,7 +22,8 @@ public class SummarySection extends FormSection {
this.view = view;
setCollapsable(true);
setCollapsed(true);
- setHeaderRightText("Outgoing | No Working Set");
+ updateHeaderRightText();
+ participant.addPropertyChangeListener(this);
}
/*
@@ -36,7 +40,8 @@ public class SummarySection extends FormSection {
* org.eclipse.team.internal.ui.widgets.FormWidgetFactory)
*/
public Composite createClient(Composite parent, IControlFactory factory) {
- return participant.createOverviewComposite(parent, factory, view);
+ client = participant.createOverviewComposite(parent, factory, view);
+ return client;
}
protected void reflow() {
@@ -47,5 +52,31 @@ public class SummarySection extends FormSection {
parent.getParent().layout(true);
parent.setRedraw(true);
parent.getParent().setRedraw(true);
- }
-}
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.widgets.FormSection#dispose()
+ */
+ public void dispose() {
+ super.dispose();
+ client.dispose();
+ participant.removePropertyChangeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ //super.propertyChange(event);
+ String property = event.getProperty();
+ if(property.equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_MODE) ||
+ property.equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_WORKINGSET)) {
+ updateHeaderRightText();
+ }
+ }
+
+ public void updateHeaderRightText() {
+ setHeaderRightText(Utils.modeToString(participant.getMode()) + " | " + Utils.workingSetToString(participant.getWorkingSet(), 20));
+ reflow();
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncChangesTableViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncChangesTableViewer.java
index f738ac284..b64d3a7bf 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncChangesTableViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SyncChangesTableViewer.java
@@ -93,7 +93,6 @@ public class SyncChangesTableViewer extends SyncChangesStructuredViewer {
* @see org.eclipse.team.ui.synchronize.SyncChangesViewer#dispose()
*/
public void dispose() {
- // TODO Auto-generated method stub
-
+ // TODO Auto-generated method stub
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantComposite.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantComposite.java
index bfcfa0907..8b25f0c31 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantComposite.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantComposite.java
@@ -10,28 +10,77 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
+import java.text.DateFormat;
+import java.util.Date;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ui.Policy;
+import org.eclipse.team.internal.ui.jobs.IJobListener;
+import org.eclipse.team.internal.ui.jobs.JobStatusHandler;
import org.eclipse.team.ui.controls.IControlFactory;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.TeamSubscriberParticipant;
+import org.eclipse.team.ui.synchronize.actions.SubscriberAction;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
-public class TeamSubscriberParticipantComposite extends Composite {
+public class TeamSubscriberParticipantComposite extends Composite implements IPropertyChangeListener {
private TeamSubscriberParticipant participant;
private Color background;
private ISynchronizeView view;
private IControlFactory factory;
+ private Label lastSyncLabel;
+ private Label scheduleLabel;
+ private Label statusLabel;
+ private ListViewer rootsList;
+
+ private IJobListener jobListener = new IJobListener() {
+ public void started(QualifiedName jobType) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ synchronized (this) {
+ statusLabel.setText("Working...");
+ }
+ }
+ });
+ }
+ public void finished(QualifiedName jobType) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ synchronized (this) {
+ statusLabel.setText("Idle");
+ }
+ }
+ });
+
+ }
+ };
+
public TeamSubscriberParticipantComposite(Composite parent, IControlFactory factory, TeamSubscriberParticipant participant, ISynchronizeView view) {
super(parent, SWT.NONE);
this.factory = factory;
this.participant = participant;
this.view = view;
createComposite(this);
+ updateLastRefreshLabel();
+ updateStatusLabel();
+ participant.addPropertyChangeListener(this);
+
+ JobStatusHandler.addJobListener(jobListener, SubscriberAction.SUBSCRIBER_JOB_TYPE);
+ if(JobStatusHandler.hasRunningJobs(SubscriberAction.SUBSCRIBER_JOB_TYPE)) {
+ statusLabel.setText("Working...");
+ } else {
+ statusLabel.setText("Idle");
+ }
}
protected Composite createComposite(Composite area) {
@@ -41,48 +90,97 @@ public class TeamSubscriberParticipantComposite extends Composite {
area.setLayout(layout);
setBackground(factory.getBackgroundColor());
{
- final Composite composite_1 = factory.createComposite(this, SWT.NONE);
+ final Composite composite_1 = factory.createComposite(area, SWT.NONE);
GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL);
final GridLayout gridLayout_1 = new GridLayout();
gridLayout_1.numColumns = 2;
composite_1.setLayout(gridLayout_1);
+ composite_1.setLayoutData(gridData);
{
final Label label = factory.createLabel(composite_1, "Last Sync");
gridData = new GridData();
- gridData.verticalAlignment = GridData.END;
label.setLayoutData(gridData);
}
{
- final Label label = factory.createLabel(composite_1, "11/23/03 10:03:12");
+ lastSyncLabel = factory.createLabel(composite_1, "11/23/03 10:03:12");
gridData = new GridData();
- gridData.verticalAlignment = GridData.END;
- label.setLayoutData(gridData);
+ gridData.grabExcessHorizontalSpace = true;
+ lastSyncLabel.setLayoutData(gridData);
}
{
final Label label = factory.createLabel(composite_1, "Schedule");
gridData = new GridData();
- gridData.verticalAlignment = GridData.END;
label.setLayoutData(gridData);
}
{
- final Label label = factory.createLabel(composite_1, "Every Hour");
+ scheduleLabel = factory.createLabel(composite_1, "Every Hour");
gridData = new GridData();
- gridData.verticalAlignment = GridData.END;
- label.setLayoutData(gridData);
+ gridData.grabExcessHorizontalSpace = true;
+ scheduleLabel.setLayoutData(gridData);
}
{
final Label label = factory.createLabel(composite_1, "Status");
gridData = new GridData();
- gridData.verticalAlignment = GridData.END;
label.setLayoutData(gridData);
}
{
- final Label label = factory.createLabel(composite_1, "Idle");
+ statusLabel = factory.createLabel(composite_1, "Idle");
gridData = new GridData();
- gridData.verticalAlignment = GridData.END;
- label.setLayoutData(gridData);
+ gridData.grabExcessHorizontalSpace = true;
+ statusLabel.setLayoutData(gridData);
+ }
+ {
+ rootsList = new ListViewer(composite_1, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ gridData = new GridData(GridData.FILL_BOTH);
+ gridData.horizontalSpan = 2;
+ gridData.grabExcessHorizontalSpace = true;
+ rootsList.getList().setLayoutData(gridData);
+ rootsList.setLabelProvider(new WorkbenchLabelProvider());
+ rootsList.setContentProvider(new ArrayContentProvider());
+ rootsList.setInput(participant.getInput().subscriberRoots());
}
}
return area;
- }
-}
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Widget#dispose()
+ */
+ public void dispose() {
+ super.dispose();
+ participant.removePropertyChangeListener(this);
+ JobStatusHandler.removeJobListener(jobListener, SubscriberAction.SUBSCRIBER_JOB_TYPE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if(property.equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_LASTSYNC)) {
+ updateLastRefreshLabel();
+ } else if(property.equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_STATUS)) {
+ updateStatusLabel();
+ }
+ }
+
+ private void updateStatusLabel() {
+ statusLabel.setText(participant.getStatusText());
+ }
+
+ private void updateLastRefreshLabel() {
+ long mills = participant.getLastRefreshTime();
+ final String text;
+ if(mills <= 0) {
+ text = Policy.bind("SyncViewPreferencePage.lastRefreshRunNever"); //$NON-NLS-1$
+ } else {
+ Date lastTimeRun = new Date(mills);
+ text = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(lastTimeRun);
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ lastSyncLabel.setText(text);
+ }
+ });
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/aa.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/aa.java
new file mode 100644
index 000000000..5d86b839a
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/aa.java
@@ -0,0 +1,32 @@
+/*
+ * Created on Dec 10, 2003
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package org.eclipse.team.internal.ui.synchronize;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.widgets.*;
+
+/**
+ * @author Jean-Michel Lemieux
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class aa extends Dialog {
+
+ protected aa(Shell parentShell) {
+ super(parentShell);
+ }
+ protected Control createDialogArea(Composite parent) {
+ Composite area = (Composite) super.createDialogArea(parent);
+ return area;
+ }
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncTreeViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncTreeViewer.java
index 47f225d21..0c95de012 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncTreeViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncTreeViewer.java
@@ -252,16 +252,4 @@ public class SyncTreeViewer extends TreeViewer implements INavigableControl {
}
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.sync.views.INavigableControl#preserveState(int)
- */
- public void preserveState(int direction) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ui.sync.views.INavigableControl#restoreState(int)
- */
- public void restoreState(int direction) {
- }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/ControlFactory.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/ControlFactory.java
index 2fd7cc6f9..c0a4dbfd9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/ControlFactory.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/ControlFactory.java
@@ -20,8 +20,8 @@ import org.eclipse.swt.custom.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
-import org.eclipse.team.ui.*;
-import org.eclipse.team.ui.controls.*;
+import org.eclipse.team.ui.controls.IControlFactory;
+import org.eclipse.team.ui.controls.IHyperlinkListener;
import org.eclipse.ui.actions.ActionFactory;
public class ControlFactory implements IControlFactory {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/FormSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/FormSection.java
index 2f4ba4019..4926e13b2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/FormSection.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/widgets/FormSection.java
@@ -456,7 +456,7 @@ public abstract class FormSection implements IPropertyChangeListener {
public void setHeaderRightText(String newHeaderText) {
headerRightText = newHeaderText;
if (headerRightLabel != null)
- headerRightLabel.setText(headerText);
+ headerRightLabel.setText(headerRightText);
}
public void setHeightHint(int newHeightHint) {
heightHint = newHeightHint;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java
index 47e97a500..68a063feb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java
@@ -34,6 +34,8 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
private SubscriberInput input;
private int currentMode;
private int currentLayout;
+ private long lastRefreshTime = -1;
+ private String statusText = "Idle";
private IWorkingSet workingSet;
/**
@@ -47,11 +49,31 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
public static final String P_SYNCVIEWPAGE_WORKINGSET = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_WORKINGSET"; //$NON-NLS-1$
/**
+ * Property constant indicating the status of a page has changed.
+ */
+ public static final String P_SYNCVIEWPAGE_STATUS = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_STATUS"; //$NON-NLS-1$
+
+ /**
+ * Property constant indicating the last sync time of a page has changed.
+ */
+ public static final String P_SYNCVIEWPAGE_LASTSYNC = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_LASTSYNC"; //$NON-NLS-1$
+
+ /**
+ * Property constant indicating the schedule of a page has changed.
+ */
+ public static final String P_SYNCVIEWPAGE_SCHEDULE = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_SCHEDULE"; //$NON-NLS-1$
+
+ /**
* Property constant indicating the mode of a page has changed.
*/
public static final String P_SYNCVIEWPAGE_MODE = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_MODE"; //$NON-NLS-1$
/**
+ * Property constant indicating the mode of a page has changed.
+ */
+ public static final String P_SYNCVIEWPAGE_LAYOUT = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_LAYOUT"; //$NON-NLS-1$
+
+ /**
* Modes are direction filters for the view
*/
public final static int INCOMING_MODE = 0x1;
@@ -61,11 +83,6 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
public final static int ALL_MODES = INCOMING_MODE | OUTGOING_MODE | CONFLICTING_MODE | BOTH_MODE;
/**
- * Property constant indicating the mode of a page has changed.
- */
- public static final String P_SYNCVIEWPAGE_LAYOUT = TeamUIPlugin.ID + ".P_SYNCVIEWPAGE_LAYOUT"; //$NON-NLS-1$
-
- /**
* View type constant (value 0) indicating that the synchronize view will be shown
* as a tree.
*/
@@ -109,6 +126,25 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
return currentLayout;
}
+ public void setLastRefreshTime(long lastTimeRun) {
+ long oldRefreshTime = getLastRefreshTime();
+ lastRefreshTime = lastTimeRun;
+ firePropertyChange(this, P_SYNCVIEWPAGE_LASTSYNC, new Long(oldRefreshTime), new Long(lastRefreshTime));
+ }
+
+ public long getLastRefreshTime() {
+ return lastRefreshTime;
+ }
+
+ public void setStatusText(String text) {
+ statusText = text;
+ firePropertyChange(this, P_SYNCVIEWPAGE_STATUS, null, statusText);
+ }
+
+ public String getStatusText() {
+ return statusText;
+ }
+
public void setWorkingSet(IWorkingSet set) {
SubscriberInput input = getInput();
IWorkingSet oldSet = null;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
index 1959d9154..d04019ebe 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
@@ -174,6 +174,8 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
public void dispose() {
busyCursor.dispose();
statusLine.dispose();
+ changesSection.dispose();
+ participantSection.dispose();
}
/*

Back to the top