KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > ConfigureRefreshScheduleDialog


1 /*******************************************************************************
2  * Copyright (c) 2003, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ui.synchronize;
12
13 import org.eclipse.jface.dialogs.Dialog;
14 import org.eclipse.osgi.util.NLS;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Shell;
17 import org.eclipse.team.internal.ui.*;
18 import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
19
20 /**
21  * Dialog that allows configuring a subscriber refresh schedule.
22  *
23  * @since 3.0
24  */

25 public class ConfigureRefreshScheduleDialog extends DetailsDialog {
26
27     private ConfigureSynchronizeScheduleComposite scheduleComposite;
28     private SubscriberRefreshSchedule schedule;
29
30     public ConfigureRefreshScheduleDialog(Shell parentShell, SubscriberRefreshSchedule schedule) {
31         super(parentShell, NLS.bind(TeamUIMessages.ConfigureRefreshScheduleDialog_0, new String JavaDoc[] { Utils.getTypeName(schedule.getParticipant()) }));
32         this.schedule = schedule;
33     }
34
35     /* (non-Javadoc)
36      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
37      */

38     protected void createMainDialogArea(Composite parent) {
39         IPageValidator validator = new IPageValidator() {
40             public void setComplete(String JavaDoc errorMessage) {
41                 setPageComplete(errorMessage == null);
42                 setErrorMessage(errorMessage);
43             }
44         };
45         scheduleComposite = new ConfigureSynchronizeScheduleComposite(parent, schedule, validator);
46         Dialog.applyDialogFont(parent);
47     }
48     
49     /* (non-Javadoc)
50      * @see org.eclipse.jface.dialogs.Dialog#okPressed()
51      */

52     protected void okPressed() {
53         scheduleComposite.saveValues();
54         super.okPressed();
55     }
56     
57     /* (non-Javadoc)
58      * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#includeDetailsButton()
59      */

60     protected boolean includeDetailsButton() {
61         return false;
62     }
63
64     /* (non-Javadoc)
65      * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#createDropDownDialogArea(org.eclipse.swt.widgets.Composite)
66      */

67     protected Composite createDropDownDialogArea(Composite parent) {
68         return null;
69     }
70
71     /* (non-Javadoc)
72      * @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#updateEnablements()
73      */

74     protected void updateEnablements() {
75     }
76     
77     protected String JavaDoc getHelpContextId() {
78         return IHelpContextIds.CONFIGURE_REFRESH_SCHEDULE_DIALOG;
79     }
80 }
81
Popular Tags