Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-04-15 17:43:18 +0000
committerJean Michel-Lemieux2002-04-15 17:43:18 +0000
commit8e64d63bc725d2a3d5ecd21acf83a86a1bb2f640 (patch)
tree0224f6b1ad44612e2456d27d5359e1a3088a3ad5
parent403d2527453dca2f0bab5a727eea95f6de569907 (diff)
downloadeclipse.platform.team-8e64d63bc725d2a3d5ecd21acf83a86a1bb2f640.tar.gz
eclipse.platform.team-8e64d63bc725d2a3d5ecd21acf83a86a1bb2f640.tar.xz
eclipse.platform.team-8e64d63bc725d2a3d5ecd21acf83a86a1bb2f640.zip
Bug 13483: Branch wizard should show current version but grayed
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java22
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java43
2 files changed, 45 insertions, 20 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
index 4da4c60bb..5fd3218f4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
@@ -12,6 +12,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -28,6 +30,7 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
@@ -49,7 +52,24 @@ public class BranchWizard extends Wizard {
}
public void addPages() {
- mainPage = new BranchWizardPage("versionPage", Policy.bind("BranchWizard.createABranch"), areAllResourcesSticky(resources), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_WIZBAN_BRANCH)); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean allResourcesSticky = areAllResourcesSticky(resources);
+ String versionName = "";
+ try {
+ if(allResourcesSticky) {
+ IResource stickyResource = resources[0];
+ if(stickyResource.getType()==IResource.FILE) {
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile)stickyResource);
+ versionName = cvsFile.getSyncInfo().getTag().getName();
+ } else {
+ ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor((IContainer)stickyResource);
+ versionName = cvsFolder.getFolderSyncInfo().getTag().getName();
+ }
+ }
+ } catch(CVSException e) {
+ CVSUIPlugin.log(e.getStatus());
+ versionName = "";
+ }
+ mainPage = new BranchWizardPage("versionPage", Policy.bind("BranchWizard.createABranch"), allResourcesSticky, versionName, CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_WIZBAN_BRANCH)); //$NON-NLS-1$ //$NON-NLS-2$
addPage(mainPage);
}
public boolean performFinish() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java
index 655a92ebb..f74019536 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizardPage.java
@@ -24,12 +24,13 @@ public class BranchWizardPage extends CVSWizardPage {
String branchTag;
String versionTag;
+ String versionName;
boolean allStickyResources;
Text versionText;
Text branchText;
- public BranchWizardPage(String pageName,String title, boolean allStickyResources, ImageDescriptor titleImage) {
+ public BranchWizardPage(String pageName,String title, boolean allStickyResources, String versionName, ImageDescriptor titleImage) {
super(pageName, title, titleImage);
if(allStickyResources) {
setDescription(Policy.bind("BranchWizardPage.pageDescriptionVersion")); //$NON-NLS-1$
@@ -37,6 +38,7 @@ public class BranchWizardPage extends CVSWizardPage {
setDescription(Policy.bind("BranchWizardPage.pageDescription")); //$NON-NLS-1$
}
this.allStickyResources = allStickyResources;
+ this.versionName = versionName;
}
/*
@@ -73,25 +75,28 @@ public class BranchWizardPage extends CVSWizardPage {
check.setSelection(true);
update = true;
- if(!allStickyResources) {
- createLabel(composite, ""); //$NON-NLS-1$
- createLabel(composite, ""); //$NON-NLS-1$
+ createLabel(composite, ""); //$NON-NLS-1$
+ createLabel(composite, ""); //$NON-NLS-1$
- label = new Label(composite, SWT.WRAP);
- label.setText(Policy.bind("BranchWizardPage.specifyVersion")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalSpan = 2;
- data.widthHint = 350;
- label.setLayoutData(data);
+ label = new Label(composite, SWT.WRAP);
+ label.setText(Policy.bind("BranchWizardPage.specifyVersion")); //$NON-NLS-1$
+ data = new GridData();
+ data.horizontalSpan = 2;
+ data.widthHint = 350;
+ label.setLayoutData(data);
- createLabel(composite, Policy.bind("BranchWizardPage.versionName")); //$NON-NLS-1$
- versionText = createTextField(composite);
- versionText.addListener(SWT.Modify, new Listener() {
- public void handleEvent(Event event) {
- versionTag = versionText.getText();
- updateEnablement();
- }
- });
+ createLabel(composite, Policy.bind("BranchWizardPage.versionName")); //$NON-NLS-1$
+ versionText = createTextField(composite);
+ versionText.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event event) {
+ versionTag = versionText.getText();
+ updateEnablement();
+ }
+ });
+
+ if(allStickyResources) {
+ versionText.setEditable(false);
+ versionText.setText(versionName);
}
branchText.setFocus();
@@ -112,7 +117,7 @@ public class BranchWizardPage extends CVSWizardPage {
}
private void updateVersionName(String branchName) {
- if(versionText!=null) {
+ if(versionText!=null && !allStickyResources) {
versionText.setText(Policy.bind("BranchWizardPage.versionPrefix") + branchName); //$NON-NLS-1$
}
}

Back to the top