KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > actions > UpdateSilentAction


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.actions;
12
13 import java.lang.reflect.InvocationTargetException JavaDoc;
14
15 import org.eclipse.jface.action.IAction;
16 import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
17 import org.eclipse.team.internal.ccvs.core.client.Command;
18 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
19 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
20 import org.eclipse.team.internal.ccvs.ui.mappings.ModelUpdateOperation;
21 import org.eclipse.team.internal.ccvs.ui.operations.UpdateOperation;
22
23 /**
24  * Action that runs an update without prompting the user for a tag.
25  *
26  * @since 3.1
27  */

28 public class UpdateSilentAction extends WorkspaceTraversalAction {
29     
30     /*
31      * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForAddedResources()
32      */

33     protected boolean isEnabledForAddedResources() {
34         return false;
35     }
36
37     /* (non-Javadoc)
38      * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForNonExistantResources()
39      */

40     protected boolean isEnabledForNonExistantResources() {
41         return true;
42     }
43     
44     /* (non-Javadoc)
45      * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#execute(org.eclipse.jface.action.IAction)
46      */

47     public void execute(IAction action) throws InterruptedException JavaDoc, InvocationTargetException JavaDoc {
48         if (CVSUIPlugin.getPlugin().getPreferenceStore().getString(ICVSUIConstants.PREF_UPDATE_HANDLING).equals(ICVSUIConstants.PREF_UPDATE_HANDLING_TRADITIONAL)) {
49             new UpdateOperation(getTargetPart(), getCVSResourceMappings(), Command.NO_LOCAL_OPTIONS, null /* no tag */).run();
50         } else {
51             new ModelUpdateOperation(getTargetPart(), getSelectedResourceMappings(CVSProviderPlugin.getTypeId())).run();
52         }
53     }
54     
55     /* (non-Javadoc)
56      * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
57      */

58     public String JavaDoc getId() {
59         return ICVSUIConstants.CMD_UPDATE;
60     }
61 }
62
Popular Tags