KickJava   Java API By Example, From Geeks To Geeks.

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


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.jface.action.IAction;
14 import org.eclipse.team.internal.ccvs.core.CVSException;
15 import org.eclipse.team.internal.ccvs.core.ICVSResource;
16
17 /**
18  * This action shows the CVS workspace participant into a model dialog. For single file
19  * selection, the compare editor is shown instead.
20  *
21  * @since 3.0
22  */

23 public class CompareWithRemoteAction extends SyncAction {
24     
25     /*
26      * Update the text label for the action based on the tags in the selection.
27      * @see TeamAction#setActionEnablement(org.eclipse.jface.action.IAction)
28      */

29     protected void setActionEnablement(IAction action) {
30         super.setActionEnablement(action);
31         action.setText(calculateActionTagValue());
32     }
33     
34     /**
35      * Enable for resources that are managed (using super) or whose parent is a CVS folder.
36      *
37      * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForCVSResource(org.eclipse.team.internal.ccvs.core.ICVSResource)
38      */

39     protected boolean isEnabledForCVSResource(ICVSResource cvsResource) throws CVSException {
40         return super.isEnabledForCVSResource(cvsResource) || cvsResource.getParent().isCVSFolder();
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForNonExistantResources()
45      */

46     protected boolean isEnabledForNonExistantResources() {
47         return true;
48     }
49 }
50
Popular Tags