KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
14 import org.eclipse.team.internal.ccvs.core.ICVSResource;
15 import org.eclipse.team.internal.ccvs.ui.operations.ITagOperation;
16 import org.eclipse.team.internal.ccvs.ui.operations.TagInRepositoryOperation;
17 import org.eclipse.team.internal.ui.actions.TeamAction;
18
19 public class TagInRepositoryAction extends TagAction {
20
21     /**
22      * @see TeamAction#isEnabled()
23      */

24     public boolean isEnabled() {
25         ICVSResource[] resources = getSelectedCVSResources();
26         if (resources.length == 0) return false;
27         for (int i = 0; i < resources.length; i++) {
28             if (resources[i] instanceof ICVSRepositoryLocation) return false;
29         }
30         return true;
31     }
32     
33     /**
34      * @see CVSAction#needsToSaveDirtyEditors()
35      */

36     protected boolean needsToSaveDirtyEditors() {
37         return false;
38     }
39     
40     /**
41      * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#requiresLocalSyncInfo()
42      */

43     protected boolean requiresLocalSyncInfo() {
44         return false;
45     }
46
47     protected ITagOperation createTagOperation() {
48         return new TagInRepositoryOperation(getTargetPart(), getSelectedRemoteResources());
49     }
50 }
51
Popular Tags