KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > subscriber > WorkspaceUpdateAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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.ccvs.ui.subscriber;
12
13 import org.eclipse.compare.structuremergeviewer.IDiffElement;
14 import org.eclipse.jface.viewers.ISelectionProvider;
15 import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
16 import org.eclipse.team.core.synchronize.SyncInfo;
17 import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
18 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
19 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
20 import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
21
22 public class WorkspaceUpdateAction extends CVSParticipantAction {
23     
24     private boolean promptBeforeUpdate;
25
26     public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration) {
27         super(configuration);
28         setId(ICVSUIConstants.CMD_UPDATE);
29         setActionDefinitionId(ICVSUIConstants.CMD_UPDATE);
30     }
31
32     public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration, ISelectionProvider provider, String JavaDoc bundleKey) {
33         super(configuration, provider, bundleKey);
34         setId(ICVSUIConstants.CMD_UPDATE_ALL);
35         setActionDefinitionId(ICVSUIConstants.CMD_UPDATE_ALL);
36     }
37
38     /* (non-Javadoc)
39      * @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
40      */

41     protected FastSyncInfoFilter getSyncInfoFilter() {
42         return new SyncInfoDirectionFilter(new int[] {SyncInfo.INCOMING, SyncInfo.CONFLICTING});
43     }
44
45     /* (non-Javadoc)
46      * @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
47      */

48     protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
49         return new WorkspaceUpdateOperation(configuration, elements, promptBeforeUpdate);
50     }
51
52     public void setPromptBeforeUpdate(boolean prompt) {
53         promptBeforeUpdate = prompt;
54     }
55 }
56
Popular Tags