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

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ui/synchronize/SubscriberRefreshSchedule.java (-7 / +92 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2006 IBM Corporation and others.
2
 * Copyright (c) 2003, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-16 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Trevor S. Kaufman <endante@gmail.com> - bug 156152
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.team.internal.ui.synchronize;
12
package org.eclipse.team.internal.ui.synchronize;
12
13
13
import com.ibm.icu.text.DateFormat;
14
import java.util.Date;
14
import java.util.Date;
15
15
16
import org.eclipse.core.runtime.jobs.Job;
16
import org.eclipse.core.runtime.jobs.Job;
Lines 20-25 Link Here
20
import org.eclipse.ui.IMemento;
20
import org.eclipse.ui.IMemento;
21
import org.eclipse.ui.actions.ActionFactory;
21
import org.eclipse.ui.actions.ActionFactory;
22
22
23
import com.ibm.icu.text.DateFormat;
24
import com.ibm.icu.util.Calendar;
25
23
/**
26
/**
24
 * Schedule to refresh a subscriber at a specified interval. The schedule can be disabled or enabled
27
 * Schedule to refresh a subscriber at a specified interval. The schedule can be disabled or enabled
25
 * and will create the refresh job.
28
 * and will create the refresh job.
Lines 28-33 Link Here
28
 */
31
 */
29
public class SubscriberRefreshSchedule {
32
public class SubscriberRefreshSchedule {
30
	private long refreshInterval = 3600; // 1 hour default
33
	private long refreshInterval = 3600; // 1 hour default
34
	private Date refreshStart;
35
	private boolean runOnce = false;
31
	
36
	
32
	private boolean enabled = false;
37
	private boolean enabled = false;
33
	
38
	
Lines 46-51 Link Here
46
	 * Key for schedule in memento
51
	 * Key for schedule in memento
47
	 */
52
	 */
48
	private static final String CTX_REFRESHSCHEDULE_ENABLED = TeamUIPlugin.ID + ".CTX_REFRESHSCHEDULE_ENABLED"; //$NON-NLS-1$
53
	private static final String CTX_REFRESHSCHEDULE_ENABLED = TeamUIPlugin.ID + ".CTX_REFRESHSCHEDULE_ENABLED"; //$NON-NLS-1$
54
	
55
	/**
56
	 * Key for start date in memento
57
	 */
58
	private static final String CTX_REFRESHSCHEDULE_START = TeamUIPlugin.ID + ".CTX_REFRESHSCHEDULE_START"; //$NON-NLS-1$
59
	
60
	/**
61
	 * Key for run once in memento
62
	 */
63
	private static final String CTX_REFRESHSCHEDULE_RUNONCE = TeamUIPlugin.ID + ".CTX_REFRESHSCHEDULE_RUNONCE"; //$NON-NLS-1$
49
		
64
		
50
	private IRefreshSubscriberListener refreshSubscriberListener = new IRefreshSubscriberListener() {
65
	private IRefreshSubscriberListener refreshSubscriberListener = new IRefreshSubscriberListener() {
51
		public void refreshStarted(IRefreshEvent event) {
66
		public void refreshStarted(IRefreshEvent event) {
Lines 69-74 Link Here
69
	public SubscriberRefreshSchedule(IRefreshable refreshable) {
84
	public SubscriberRefreshSchedule(IRefreshable refreshable) {
70
		this.refreshable = refreshable;
85
		this.refreshable = refreshable;
71
		RefreshParticipantJob.addRefreshListener(refreshSubscriberListener);
86
		RefreshParticipantJob.addRefreshListener(refreshSubscriberListener);
87
		
88
//		Calendar cal = Calendar.getInstance();
89
//		cal.clear();
90
//		refreshStart = cal.getTime();
72
	}
91
	}
73
92
74
	/**
93
	/**
Lines 80-85 Link Here
80
99
81
	/**
100
	/**
82
	 * @param enabled The enabled to set.
101
	 * @param enabled The enabled to set.
102
	 * @param allowedToStart Is the job allowed to start.
83
	 */
103
	 */
84
	public void setEnabled(boolean enabled, boolean allowedToStart) {
104
	public void setEnabled(boolean enabled, boolean allowedToStart) {
85
		boolean wasEnabled = isEnabled();
105
		boolean wasEnabled = isEnabled();
Lines 111-116 Link Here
111
		if(refreshInterval != getRefreshInterval()) {
131
		if(refreshInterval != getRefreshInterval()) {
112
			stopJob();
132
			stopJob();
113
			this.refreshInterval = refreshInterval;
133
			this.refreshInterval = refreshInterval;
134
			runOnce = false;
114
			if(isEnabled()) {
135
			if(isEnabled()) {
115
				startJob();
136
				startJob();
116
			}
137
			}
Lines 126-134 Link Here
126
		}
147
		}
127
		job.setRefreshInterval(getRefreshInterval());
148
		job.setRefreshInterval(getRefreshInterval());
128
		job.setRestartOnCancel(true);
149
		job.setRestartOnCancel(true);
129
		job.setReschedule(true);
150
		job.setReschedule(!runOnce);
130
		// Schedule delay is in mills.
151
		if (refreshStart != null) {
131
		job.schedule(getRefreshInterval() * 1000);		
152
			job.schedule(getJobDelay());
153
		} else {
154
			job.schedule();
155
		}
156
	}
157
158
	/**
159
	 * @return schedule delay in milliseconds
160
	 */
161
	private long getJobDelay() {
162
		Calendar now = Calendar.getInstance();
163
		Calendar start = Calendar.getInstance();
164
		start.setTime(refreshStart);
165
		if (now.after(start)) {
166
			start.add(Calendar.DATE, 1); // tomorrow
167
		}
168
		return start.getTimeInMillis() - now.getTimeInMillis();
132
	}
169
	}
133
	
170
	
134
	protected void stopJob() {
171
	protected void stopJob() {
Lines 148-153 Link Here
148
	public void saveState(IMemento memento) {
185
	public void saveState(IMemento memento) {
149
		memento.putString(CTX_REFRESHSCHEDULE_ENABLED, Boolean.toString(enabled));
186
		memento.putString(CTX_REFRESHSCHEDULE_ENABLED, Boolean.toString(enabled));
150
		memento.putInteger(CTX_REFRESHSCHEDULE_INTERVAL, (int)refreshInterval);
187
		memento.putInteger(CTX_REFRESHSCHEDULE_INTERVAL, (int)refreshInterval);
188
		if (refreshStart != null)
189
			memento.putString(CTX_REFRESHSCHEDULE_START, Long.toString(refreshStart.getTime()));
190
		memento.putString(CTX_REFRESHSCHEDULE_RUNONCE, Boolean.toString(runOnce));
151
	}
191
	}
152
192
153
	public static SubscriberRefreshSchedule init(IMemento memento, IRefreshable refreshable) {
193
	public static SubscriberRefreshSchedule init(IMemento memento, IRefreshable refreshable) {
Lines 155-161 Link Here
155
		if(memento != null) {
195
		if(memento != null) {
156
			String enabled = memento.getString(CTX_REFRESHSCHEDULE_ENABLED);
196
			String enabled = memento.getString(CTX_REFRESHSCHEDULE_ENABLED);
157
			int interval = memento.getInteger(CTX_REFRESHSCHEDULE_INTERVAL).intValue();
197
			int interval = memento.getInteger(CTX_REFRESHSCHEDULE_INTERVAL).intValue();
198
			String startString = memento.getString(CTX_REFRESHSCHEDULE_START);
199
			String runOnce = memento.getString(CTX_REFRESHSCHEDULE_RUNONCE);
200
			if (startString != null) {
201
				long start = Long.parseLong(startString);
202
				schedule.setRefreshStartTime(new Date(start));
203
			}
158
			schedule.setRefreshInterval(interval);
204
			schedule.setRefreshInterval(interval);
205
			schedule.setRunOnce("true".equals(runOnce) ? true : false); //$NON-NLS-1$
159
			schedule.setEnabled("true".equals(enabled) ? true : false, false /* don't start job */); //$NON-NLS-1$
206
			schedule.setEnabled("true".equals(enabled) ? true : false, false /* don't start job */); //$NON-NLS-1$
160
		}
207
		}
161
		// Use the defaults if a schedule hasn't been saved or can't be found.
208
		// Use the defaults if a schedule hasn't been saved or can't be found.
Lines 190-195 Link Here
190
	}
237
	}
191
	
238
	
192
	private String getRefreshIntervalAsString() {
239
	private String getRefreshIntervalAsString() {
240
		if (runOnce)
241
			return TeamUIMessages.RefreshSchedule_16;
193
		boolean hours = false;
242
		boolean hours = false;
194
		long seconds = getRefreshInterval();
243
		long seconds = getRefreshInterval();
195
		if(seconds <= 60) {
244
		if(seconds <= 60) {
Lines 202-210 Link Here
202
		}		
251
		}		
203
		String unit;
252
		String unit;
204
		if(minutes >= 1) {
253
		if(minutes >= 1) {
205
			unit = (hours ? TeamUIMessages.RefreshSchedule_9 : TeamUIMessages.RefreshSchedule_10); // 
254
			unit = (hours ? TeamUIMessages.RefreshSchedule_9 : TeamUIMessages.RefreshSchedule_10); 
206
		} else {
255
		} else {
207
			unit = (hours ? TeamUIMessages.RefreshSchedule_11 : TeamUIMessages.RefreshSchedule_12); // 
256
			unit = (hours ? TeamUIMessages.RefreshSchedule_11 : TeamUIMessages.RefreshSchedule_12); 
208
		}
257
		}
209
		return NLS.bind(TeamUIMessages.RefreshSchedule_13, new String[] { Long.toString(minutes), unit }); 
258
		return NLS.bind(TeamUIMessages.RefreshSchedule_13, new String[] { Long.toString(minutes), unit }); 
210
	}
259
	}
Lines 212-215 Link Here
212
	public IRefreshable getRefreshable() {
261
	public IRefreshable getRefreshable() {
213
		return refreshable;
262
		return refreshable;
214
	}
263
	}
264
265
	/**
266
	 * @return The time when the job should start or <code>null</code> when it
267
	 *         should be run immediately.
268
	 */
269
	public Date getRefreshStartTime() {
270
		return refreshStart;
271
	}
272
	
273
	public void setRefreshStartTime(Date refreshStart) {
274
		if(refreshStart==null || refreshStart != getRefreshStartTime()) {
275
			stopJob();
276
			this.refreshStart = refreshStart;
277
			if(isEnabled()) {
278
				startJob();
279
			}
280
		}
281
	}
282
	
283
	/**
284
	 * @return Return <code>false</code> if the job should be run again when
285
	 *         finished, or <code>true</code> otherwise.
286
	 */
287
	public boolean getRunOnce() {
288
		return runOnce;
289
	}
290
	
291
	public void setRunOnce(boolean runOnce) {
292
		if (runOnce != getRunOnce()) {
293
			stopJob();
294
			this.runOnce = runOnce;
295
			if (isEnabled()) {
296
				startJob();
297
			}
298
		}
299
	}
215
}
300
}
(-)src/org/eclipse/team/internal/ui/synchronize/ConfigureSynchronizeScheduleComposite.java (-35 / +105 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 8-19 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Sebastian Davids <sdavids@gmx.de> - bug 54630
10
 *     Sebastian Davids <sdavids@gmx.de> - bug 54630
11
 *     Trevor S. Kaufman <endante@gmail.com> - bug 156152
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.team.internal.ui.synchronize;
13
package org.eclipse.team.internal.ui.synchronize;
13
14
15
import java.util.Date;
16
17
import org.eclipse.jface.dialogs.*;
14
import org.eclipse.jface.dialogs.Dialog;
18
import org.eclipse.jface.dialogs.Dialog;
15
import org.eclipse.jface.dialogs.IDialogConstants;
16
import org.eclipse.jface.dialogs.MessageDialog;
17
import org.eclipse.jface.resource.JFaceResources;
19
import org.eclipse.jface.resource.JFaceResources;
18
import org.eclipse.osgi.util.NLS;
20
import org.eclipse.osgi.util.NLS;
19
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.SWT;
Lines 22-36 Link Here
22
import org.eclipse.swt.graphics.GC;
24
import org.eclipse.swt.graphics.GC;
23
import org.eclipse.swt.layout.GridData;
25
import org.eclipse.swt.layout.GridData;
24
import org.eclipse.swt.layout.GridLayout;
26
import org.eclipse.swt.layout.GridLayout;
25
import org.eclipse.swt.widgets.Button;
27
import org.eclipse.swt.widgets.*;
26
import org.eclipse.swt.widgets.Combo;
27
import org.eclipse.swt.widgets.Composite;
28
import org.eclipse.swt.widgets.Label;
29
import org.eclipse.swt.widgets.Text;
30
import org.eclipse.team.internal.ui.TeamUIMessages;
28
import org.eclipse.team.internal.ui.TeamUIMessages;
31
import org.eclipse.team.internal.ui.Utils;
29
import org.eclipse.team.internal.ui.Utils;
32
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
30
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
33
31
32
import com.ibm.icu.util.Calendar;
33
34
/**
34
/**
35
 * A composite that allows editing a subscriber refresh schedule. A validator can be used to allow
35
 * A composite that allows editing a subscriber refresh schedule. A validator can be used to allow
36
 * containers to show page completion.
36
 * containers to show page completion.
Lines 42-50 Link Here
42
	private SubscriberRefreshSchedule schedule;
42
	private SubscriberRefreshSchedule schedule;
43
	private Button userRefreshOnly;
43
	private Button userRefreshOnly;
44
	private Button enableBackgroundRefresh;
44
	private Button enableBackgroundRefresh;
45
	private Text time;
45
	private Text timeInterval;
46
	private Combo hoursOrSeconds;
46
	private Combo hoursOrMinutes;
47
	private IPageValidator validator;
47
	private IPageValidator validator;
48
	private DateTime startTime;
49
	private Button immediately;
50
	private Button runOnce;
48
	
51
	
49
	public ConfigureSynchronizeScheduleComposite(Composite parent, SubscriberRefreshSchedule schedule, IPageValidator validator) {
52
	public ConfigureSynchronizeScheduleComposite(Composite parent, SubscriberRefreshSchedule schedule, IPageValidator validator) {
50
		super(parent, SWT.NONE);
53
		super(parent, SWT.NONE);
Lines 71-78 Link Here
71
			minutes = minutes / 60;
74
			minutes = minutes / 60;
72
			hours = true;
75
			hours = true;
73
		}		
76
		}		
74
		hoursOrSeconds.select(hours ? 0 : 1);
77
		hoursOrMinutes.select(hours ? 0 : 1);
75
		time.setText(Long.toString(minutes));
78
		timeInterval.setText(Long.toString(minutes));
79
		runOnce.setSelection(schedule.getRunOnce());
80
		
81
		Date start = schedule.getRefreshStartTime();
82
		if (start!=null) {
83
			Calendar cal = Calendar.getInstance();
84
			cal.setTime(start);
85
			startTime.setTime(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
86
		} else {
87
			// ran immediately, no startTime available
88
		}
89
		
76
	}
90
	}
77
91
78
	/* (non-Javadoc)
92
	/* (non-Javadoc)
Lines 135-141 Link Here
135
			gridData.horizontalSpan = 2;
149
			gridData.horizontalSpan = 2;
136
			composite.setLayoutData(gridData);
150
			composite.setLayoutData(gridData);
137
			final GridLayout gridLayout_1 = new GridLayout();
151
			final GridLayout gridLayout_1 = new GridLayout();
138
			gridLayout_1.numColumns = 3;
152
			gridLayout_1.numColumns = 4;
139
			gridLayout_1.marginWidth = 0;
153
			gridLayout_1.marginWidth = 0;
140
			gridLayout_1.marginHeight = 0;
154
			gridLayout_1.marginHeight = 0;
141
			gridLayout_1.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_SPACING);
155
			gridLayout_1.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_SPACING);
Lines 143-161 Link Here
143
			composite.setLayout(gridLayout_1);
157
			composite.setLayout(gridLayout_1);
144
			{
158
			{
145
				final Label label = new Label(composite, SWT.NONE);
159
				final Label label = new Label(composite, SWT.NONE);
160
				label.setText(TeamUIMessages.ConfigureRefreshScheduleDialog_3a);
161
			}
162
			{
163
				startTime = new DateTime(composite, SWT.TIME | SWT.BORDER);
164
				final GridData gridData_1 = new GridData();
165
				gridData_1.horizontalSpan = 2;
166
				startTime.setLayoutData(gridData_1);
167
				
168
			}
169
			{
170
				immediately = new Button(composite, SWT.CHECK);
171
				immediately.setText(TeamUIMessages.ConfigureRefreshScheduleDialog_3b);
172
				immediately.addSelectionListener(new SelectionAdapter() {
173
					public void widgetSelected(SelectionEvent e) {
174
						updateEnablements();
175
					}
176
				});
177
			}
178
			{
179
				final Label label = new Label(composite, SWT.NONE);
146
				label.setText(TeamUIMessages.ConfigureRefreshScheduleDialog_4); 
180
				label.setText(TeamUIMessages.ConfigureRefreshScheduleDialog_4); 
147
			}
181
			}
148
			{
182
			{
149
				time = new Text(composite, SWT.BORDER | SWT.RIGHT);
183
				timeInterval = new Text(composite, SWT.BORDER | SWT.RIGHT);
150
				final GridData gridData_1 = new GridData();
184
				final GridData gridData_1 = new GridData();
151
				gridData_1.widthHint = 35;
185
				gridData_1.widthHint = 35;
152
				time.setLayoutData(gridData_1);
186
				timeInterval.setLayoutData(gridData_1);
153
				time.addModifyListener(new ModifyListener() {
187
				timeInterval.addModifyListener(new ModifyListener() {
154
					public void modifyText(ModifyEvent e) {
188
					public void modifyText(ModifyEvent e) {
155
						updateEnablements();
189
						updateEnablements();
156
					}
190
					}
157
				});
191
				});
158
				time.addVerifyListener(new VerifyListener() {
192
				timeInterval.addVerifyListener(new VerifyListener() {
159
					public void verifyText(VerifyEvent e) {
193
					public void verifyText(VerifyEvent e) {
160
						String string = e.text;
194
						String string = e.text;
161
						char [] chars = new char [string.length ()];
195
						char [] chars = new char [string.length ()];
Lines 170-199 Link Here
170
				});
204
				});
171
			}
205
			}
172
			{
206
			{
173
				hoursOrSeconds = new Combo(composite, SWT.READ_ONLY);
207
				hoursOrMinutes = new Combo(composite, SWT.READ_ONLY);
174
				hoursOrSeconds.setItems(new String[] { TeamUIMessages.ConfigureRefreshScheduleDialog_5, TeamUIMessages.ConfigureRefreshScheduleDialog_6 }); // 
208
				hoursOrMinutes.setItems(new String[] { TeamUIMessages.ConfigureRefreshScheduleDialog_5, TeamUIMessages.ConfigureRefreshScheduleDialog_6 }); // 
175
				hoursOrSeconds.setLayoutData(new GridData());
209
				hoursOrMinutes.setLayoutData(new GridData());
210
			}
211
			{
212
				runOnce = new Button(composite, SWT.CHECK);
213
				runOnce.setText(TeamUIMessages.ConfigureRefreshScheduleDialog_8);
214
				runOnce.addSelectionListener(new SelectionAdapter() {
215
					public void widgetSelected(SelectionEvent e) {
216
						updateEnablements();
217
					}
218
				});				
176
			}
219
			}
177
		}
220
		}
178
		initializeValues();
221
		initializeValues();
222
		updateEnablements();
179
	}
223
	}
180
	
224
	
181
	/* (non-Javadoc)
225
	/* (non-Javadoc)
182
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
226
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
183
	 */
227
	 */
184
	public void saveValues() {
228
	public void saveValues() {
185
		int hours = hoursOrSeconds.getSelectionIndex();
229
		if (!runOnce.getSelection()) {		
186
		try {
230
			int hours = hoursOrMinutes.getSelectionIndex();
187
			long seconds = Long.parseLong(time.getText());
231
			try {
188
			if(hours == 0) {
232
				long seconds = Long.parseLong(timeInterval.getText());
189
				seconds = seconds * 3600;
233
				if(hours == 0) {
190
			} else {
234
					seconds = seconds * 3600;
191
				seconds = seconds * 60;
235
				} else {
192
			}
236
					seconds = seconds * 60;
193
			schedule.setRefreshInterval(seconds);
237
				}
194
		} catch (NumberFormatException e) {
238
				schedule.setRefreshInterval(seconds);
195
			// keep old value
239
			} catch (NumberFormatException e) {
240
				// keep old value
241
			}
242
		} else {
243
			schedule.setRunOnce(runOnce.getSelection() /* true */);
244
		}
245
		
246
		if (!immediately.getSelection()) {
247
			Calendar cal = Calendar.getInstance();
248
			cal.set(Calendar.HOUR_OF_DAY, startTime.getHours());
249
			cal.set(Calendar.MINUTE, startTime.getMinutes());
250
			cal.set(Calendar.SECOND, startTime.getSeconds());
251
			schedule.setRefreshStartTime(cal.getTime());
252
		} else {
253
			schedule.setRefreshStartTime(null);
196
		}
254
		}
255
		
197
		if(schedule.isEnabled() != enableBackgroundRefresh.getSelection()) {
256
		if(schedule.isEnabled() != enableBackgroundRefresh.getSelection()) {
198
			schedule.setEnabled(enableBackgroundRefresh.getSelection(), true /* allow to start */);
257
			schedule.setEnabled(enableBackgroundRefresh.getSelection(), true /* allow to start */);
199
		}
258
		}
Lines 216-233 Link Here
216
			validator.setComplete(null);
275
			validator.setComplete(null);
217
		} else {
276
		} else {
218
			try {
277
			try {
219
				long number = Long.parseLong(time.getText());
278
				long number = Long.parseLong(timeInterval.getText());
220
				if(number <= 0) {
279
				if(number <= 0) {
221
					validator.setComplete(TeamUIMessages.ConfigureRefreshScheduleDialog_7); 
280
					validator.setComplete(TeamUIMessages.ConfigureRefreshScheduleDialog_7); 
222
				} else {
281
				} else {
223
					validator.setComplete(null);
282
					validator.setComplete(null);
224
				}
283
				}
225
			} catch (NumberFormatException e) {
284
			} catch (NumberFormatException e) {
226
				validator.setComplete(TeamUIMessages.ConfigureRefreshScheduleDialog_8); 
285
				validator.setComplete(TeamUIMessages.ConfigureRefreshScheduleDialog_7); 
227
			}	
286
			}	
228
		}
287
		}
229
		time.setEnabled(enableBackgroundRefresh.getSelection());
288
		timeInterval.setEnabled(enableBackgroundRefresh.getSelection());
230
		hoursOrSeconds.setEnabled(enableBackgroundRefresh.getSelection());
289
		hoursOrMinutes.setEnabled(enableBackgroundRefresh.getSelection());
290
		runOnce.setEnabled(enableBackgroundRefresh.getSelection());
291
		if (runOnce.isEnabled()) {
292
			timeInterval.setEnabled(!runOnce.getSelection());
293
			hoursOrMinutes.setEnabled(!runOnce.getSelection());
294
		}
295
		
296
		startTime.setEnabled(enableBackgroundRefresh.getSelection());
297
		immediately.setEnabled(enableBackgroundRefresh.getSelection());
298
		if (immediately.isEnabled()) {
299
			startTime.setEnabled(!immediately.getSelection());
300
		}
231
	}
301
	}
232
	
302
	
233
	private Label createWrappingLabel(Composite parent, String text, int indent, int horizontalSpan) {
303
	private Label createWrappingLabel(Composite parent, String text, int indent, int horizontalSpan) {
(-)src/org/eclipse/team/internal/ui/messages.properties (-4 / +8 lines)
Lines 7-12 Link Here
7
#
7
#
8
# Contributors:
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
#     Trevor S. Kaufman - <endante@gmail.com> - bug 156152
10
###############################################################################
11
###############################################################################
11
###############################################
12
###############################################
12
# Message catalog for org.eclipse.team.ui
13
# Message catalog for org.eclipse.team.ui
Lines 237-249 Link Here
237
ConfigureRefreshScheduleDialog_1a=The last synchronize occurred at: {0}
238
ConfigureRefreshScheduleDialog_1a=The last synchronize occurred at: {0}
238
ConfigureMultipleProjectsWizard_0=Unshared Projects
239
ConfigureMultipleProjectsWizard_0=Unshared Projects
239
ConfigureMultipleProjectsWizard_1=There are still projects that have not been shared. Finishing the wizard now will leave them in that state.
240
ConfigureMultipleProjectsWizard_1=There are still projects that have not been shared. Finishing the wizard now will leave them in that state.
240
ConfigureRefreshScheduleDialog_2=Do not schedule the synchronize operation to run periodically.
241
ConfigureRefreshScheduleDialog_2=&Do not schedule the synchronize operation to run periodically.
241
ConfigureRefreshScheduleDialog_3=Using the following schedule:
242
ConfigureRefreshScheduleDialog_3=&Using the following schedule:
242
ConfigureRefreshScheduleDialog_4=Every:
243
ConfigureRefreshScheduleDialog_3a=Synchronize &at:
244
ConfigureRefreshScheduleDialog_3b=&Immediately
245
ConfigureRefreshScheduleDialog_4=&Repeat Every:
243
ConfigureRefreshScheduleDialog_5=hour(s)
246
ConfigureRefreshScheduleDialog_5=hour(s)
244
ConfigureRefreshScheduleDialog_6=minute(s)
247
ConfigureRefreshScheduleDialog_6=minute(s)
245
ConfigureRefreshScheduleDialog_7=Number must be a positive number greater than 0
248
ConfigureRefreshScheduleDialog_7=Number must be a positive number greater than 0
246
ConfigureRefreshScheduleDialog_8=Number must be a positive number greater than 0
249
ConfigureRefreshScheduleDialog_8=Run &Once
247
RefreshSchedule_changesSingular=\ ({0} change found)
250
RefreshSchedule_changesSingular=\ ({0} change found)
248
RefreshSchedule_changesPlural=\ ({0} changes found)
251
RefreshSchedule_changesPlural=\ ({0} changes found)
249
RefreshSchedule_7=\ (No changes found)
252
RefreshSchedule_7=\ (No changes found)
Lines 254-259 Link Here
254
RefreshSchedule_13=Every {0} {1}
257
RefreshSchedule_13=Every {0} {1}
255
RefreshSchedule_14=Scheduled Synchronize
258
RefreshSchedule_14=Scheduled Synchronize
256
RefreshSchedule_15={0} {1}
259
RefreshSchedule_15={0} {1}
260
RefreshSchedule_16=Run Once
257
ChangesSection_8=Show Errors
261
ChangesSection_8=Show Errors
258
ChangesSection_9=Reset View
262
ChangesSection_9=Reset View
259
ChangesSection_10=Errors have occurred calculating the synchronization state for {0}
263
ChangesSection_10=Errors have occurred calculating the synchronization state for {0}
(-)src/org/eclipse/team/internal/ui/TeamUIMessages.java (+4 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 * IBM - Initial API and implementation
9
 * IBM - Initial API and implementation
10
 * Trevor S. Kaufman - <endante@gmail.com> - bug 156152
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.team.internal.ui;
12
package org.eclipse.team.internal.ui;
12
13
Lines 412-417 Link Here
412
	public static String ConfigureRefreshScheduleDialog_1a;
413
	public static String ConfigureRefreshScheduleDialog_1a;
413
	public static String ConfigureRefreshScheduleDialog_2;
414
	public static String ConfigureRefreshScheduleDialog_2;
414
	public static String ConfigureRefreshScheduleDialog_3;
415
	public static String ConfigureRefreshScheduleDialog_3;
416
	public static String ConfigureRefreshScheduleDialog_3a;
417
	public static String ConfigureRefreshScheduleDialog_3b;
415
	public static String ConfigureRefreshScheduleDialog_4;
418
	public static String ConfigureRefreshScheduleDialog_4;
416
	public static String ConfigureRefreshScheduleDialog_5;
419
	public static String ConfigureRefreshScheduleDialog_5;
417
	public static String ConfigureRefreshScheduleDialog_6;
420
	public static String ConfigureRefreshScheduleDialog_6;
Lines 427-432 Link Here
427
	public static String RefreshSchedule_13;
430
	public static String RefreshSchedule_13;
428
	public static String RefreshSchedule_14;
431
	public static String RefreshSchedule_14;
429
	public static String RefreshSchedule_15;
432
	public static String RefreshSchedule_15;
433
	public static String RefreshSchedule_16;
430
	public static String ChangesSection_8;
434
	public static String ChangesSection_8;
431
	public static String ChangesSection_9;
435
	public static String ChangesSection_9;
432
	public static String ChangesSection_10;
436
	public static String ChangesSection_10;

Return to bug 156152