KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.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.OrSyncInfoFilter;
18 import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
19 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
20 import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
21
22
23 public class MergeUpdateAction extends CVSParticipantAction {
24     
25     public MergeUpdateAction(ISynchronizePageConfiguration configuration) {
26         super(configuration);
27     }
28
29     public MergeUpdateAction(ISynchronizePageConfiguration configuration, ISelectionProvider provider, String JavaDoc bundleKey) {
30         super(configuration, provider, bundleKey);
31     }
32     
33     private boolean promptBeforeUpdate;
34
35     /* (non-Javadoc)
36      * @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
37      */

38     protected FastSyncInfoFilter getSyncInfoFilter() {
39         // Update works for all incoming and conflicting nodes
40
return new OrSyncInfoFilter(new FastSyncInfoFilter[] {
41             new SyncInfoDirectionFilter(SyncInfo.INCOMING),
42             new SyncInfoDirectionFilter(SyncInfo.CONFLICTING)
43         });
44     }
45
46     /* (non-Javadoc)
47      * @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
48      */

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