Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-05-02 21:04:22 +0000
committerJean Michel-Lemieux2002-05-02 21:04:22 +0000
commit4502202592efef427fe8e6ed994b80d5edb78219 (patch)
treeb9040a4ae96e1e7a032b11cba122d360ddba7ce2
parent31b9003c14e300345bec7c4753cb8d789d0bab26 (diff)
downloadeclipse.platform.team-4502202592efef427fe8e6ed994b80d5edb78219.tar.gz
eclipse.platform.team-4502202592efef427fe8e6ed994b80d5edb78219.tar.xz
eclipse.platform.team-4502202592efef427fe8e6ed994b80d5edb78219.zip
Enablement problems in branch and tag dialogs fixed.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/BranchPromptDialog.java17
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DetailsDialog.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java34
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
4 files changed, 50 insertions, 16 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/BranchPromptDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/BranchPromptDialog.java
index 0a33d744d..c416f72f5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/BranchPromptDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/BranchPromptDialog.java
@@ -152,6 +152,17 @@ public class BranchPromptDialog extends DetailsDialog {
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setFont(parent.getFont());
+ Label label = new Label(composite, SWT.WRAP);
+ label.setText(Policy.bind("BranchWizardPage.existingVersionsAndBranches"));
+ GridData data = new GridData(
+ GridData.GRAB_HORIZONTAL |
+ GridData.GRAB_VERTICAL |
+ GridData.HORIZONTAL_ALIGN_FILL |
+ GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);;
+ label.setLayoutData(data);
+ label.setFont(composite.getFont());
+
tagTree = createTree(composite);
tagTree.setInput(new ProjectElement(folder, false /*show HEAD tag*/));
Runnable refresh = new Runnable() {
@@ -194,9 +205,10 @@ public class BranchPromptDialog extends DetailsDialog {
*/
protected void updateEnablements() {
String message = null;
+ boolean complete = false;
if (branchTag.length() == 0) {
- message = null;
+ message = "";
} else {
IStatus status = CVSTag.validateTagName(branchTag);
if (!status.isOK()) {
@@ -207,7 +219,7 @@ public class BranchPromptDialog extends DetailsDialog {
if (!status.isOK()) {
message = Policy.bind("BranchWizard.versionNameWarning", status.getMessage()); //$NON-NLS-1$
} else {
- if(versionTag.equals(branchTag)) {
+ if(versionTag.length() != 0 && versionTag.equals(branchTag)) {
message = Policy.bind("BranchWizard.branchAndVersionMustBeDifferent"); //$NON-NLS-1$
} else {
if(doesTagNameExists(versionTag)) {
@@ -220,6 +232,7 @@ public class BranchPromptDialog extends DetailsDialog {
}
}
}
+ setPageComplete(message == null);
setErrorMessage(message);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DetailsDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DetailsDialog.java
index 1a223864b..1a2d38a1b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DetailsDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DetailsDialog.java
@@ -107,6 +107,7 @@ abstract public class DetailsDialog extends Dialog {
okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false);
+ updateEnablements();
}
/* (non-Javadoc)
@@ -127,8 +128,6 @@ abstract public class DetailsDialog extends Dialog {
errorMessageLabel.setFont(parent.getFont());
errorMessageLabel.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_RED));
- updateEnablements();
-
return composite;
}
@@ -171,17 +170,21 @@ abstract public class DetailsDialog extends Dialog {
}
final protected void setErrorMessage(String error) {
- if(errorMessageLabel != null && okButton != null) {
+ if(errorMessageLabel != null) {
if(error == null || error.length() == 0) {
errorMessageLabel.setText("");
- okButton.setEnabled(true);
} else {
errorMessageLabel.setText(error);
- okButton.setEnabled(false);
}
errorMessageLabel.update();
}
}
+ final protected void setPageComplete(boolean complete) {
+ if(okButton != null ) {
+ okButton.setEnabled(complete);
+ }
+ }
+
abstract protected void updateEnablements();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java
index d7c81c0d2..44d10c1ac 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java
@@ -47,7 +47,7 @@ public class TagAsVersionDialog extends DetailsDialog {
private Text tagText;
- private String tagName;
+ private String tagName = "";
private static final int TABLE_HEIGHT_HINT = 150;
@@ -117,6 +117,17 @@ public class TagAsVersionDialog extends DetailsDialog {
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setFont(parent.getFont());
+ Label label = new Label(composite, SWT.WRAP);
+ label.setText(Policy.bind("TagAction.existingVersions"));
+ GridData data = new GridData(
+ GridData.GRAB_HORIZONTAL |
+ GridData.GRAB_VERTICAL |
+ GridData.HORIZONTAL_ALIGN_FILL |
+ GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);;
+ label.setLayoutData(data);
+ label.setFont(composite.getFont());
+
existingVersionTable = createTable(composite);
existingVersionTable.setContentProvider(new WorkbenchContentProvider());
existingVersionTable.setLabelProvider(new WorkbenchLabelProvider());
@@ -175,16 +186,21 @@ public class TagAsVersionDialog extends DetailsDialog {
* Validates tag name
*/
protected void updateEnablements() {
- IStatus status = CVSTag.validateTagName(tagName);
String message = null;
- if (!status.isOK()) {
- message = status.getMessage();
- }
-
- boolean exists = doesTagNameExists(tagName);
- if(exists) {
- message = Policy.bind("TagAction.tagAlreadyExists"); //$NON-NLS-1$
+ if(tagName.length() == 0) {
+ message = "";
+ } else {
+ IStatus status = CVSTag.validateTagName(tagName);
+ if (!status.isOK()) {
+ message = status.getMessage();
+ }
+
+ boolean exists = doesTagNameExists(tagName);
+ if(exists) {
+ message = Policy.bind("TagAction.tagAlreadyExists"); //$NON-NLS-1$
+ }
}
+ setPageComplete(message == null);
setErrorMessage(message);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index f8a408a29..bd7bf27c7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -42,6 +42,7 @@ BranchWizard.branchNameWarning=Branch name: {0}
BranchWizard.branchAndVersionMustBeDifferent=The branch name and version name must be different.
BranchWizard.branchNameAlreadyExists=Branch name already exists.
BranchWizard.versionNameAlreadyExists=Version name already exists.
+BranchWizardPage.existingVersionsAndBranches=Existing Versions and Branches:
ConsolePreferencePage.consoleColorSettings=Console text color settings.
ConsolePreferencePage.commandColor=Command &Line:
@@ -511,6 +512,7 @@ TagAction.enterTag=Please enter a version tag:
TagAction.uncommittedChangesTitle=Confirm Uncommitted Changes
TagAction.uncommittedChanges=You are tagging ''{0}'' that has uncommitted changes. These changes are not in the repository and will not be included in the version you are creating. Do you still want to tag this resource?
TagAction.tagAlreadyExists=Version tag already exists.
+TagAction.existingVersions=Existing Versions:
UpdateAction.update=Problems encountered performing update
UpdateAction.updating=Updating...

Back to the top