Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2011-01-21 23:11:09 +0000
committerChris Goldthorpe2011-01-21 23:11:09 +0000
commit9770411bd45afca7da34ad8e5bdffd5e84afce2c (patch)
treef7fbfa74bff24d325408c4ce02d99005863f2a2d /org.eclipse.help.ui/src
parent24e8a48d36b3b7419ad20b4d9fe430490516e254 (diff)
downloadeclipse.platform.ua-9770411bd45afca7da34ad8e5bdffd5e84afce2c.tar.gz
eclipse.platform.ua-9770411bd45afca7da34ad8e5bdffd5e84afce2c.tar.xz
eclipse.platform.ua-9770411bd45afca7da34ad8e5bdffd5e84afce2c.zip
Bug 335039 - [Help] In help view check for empty string when setting scopev20110121
Diffstat (limited to 'org.eclipse.help.ui/src')
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java1
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.properties1
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java27
3 files changed, 21 insertions, 8 deletions
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java
index 22a6a7d2e..96ec41590 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java
@@ -92,6 +92,7 @@ public final class Messages extends NLS {
public static String NewDialog_wtitle;
public static String RenameDialog_label;
public static String RenameDialog_validationError;
+ public static String RenameDialog_emptyName;
public static String EngineResultSection_progress2;
public static String EngineResultSection_canceling;
public static String EngineResultSection_progressError;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.properties b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.properties
index b42e3e58a..aad239529 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.properties
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.properties
@@ -110,6 +110,7 @@ RenameDialog_wtitle = Rename Scope Set
NewDialog_wtitle = New Scope Set
RenameDialog_label = Scope Set &Name:
RenameDialog_validationError = Name has already been used.
+RenameDialog_emptyName = Name may not be empty.
EngineResultSection_progress2=Search in progress...
EngineResultSection_canceling=Canceling...
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java
index 3dbdaf5e8..bd9851e56 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -116,24 +116,35 @@ public class RenameDialog extends SelectionStatusDialog {
if((isCaseSensitive && text.equals(oldNames.get(i))) ||
(!isCaseSensitive && text.equalsIgnoreCase(oldNames.get(i).toString()))){
if (setStatus) {
- status = new Status(
- IStatus.ERROR,
- HelpUIPlugin.PLUGIN_ID,
- IStatus.ERROR,
- Messages.RenameDialog_validationError,
- null);
- updateStatus(status);
+ setErrorStatus(Messages.RenameDialog_validationError);
}
okButton.setEnabled(false);
return;
}
}
+ if (text.length() == 0 ) {
+ if (setStatus) {
+ setErrorStatus(Messages.RenameDialog_emptyName);
+ }
+ okButton.setEnabled(false);
+ return;
+ }
okButton.setEnabled(true);
if (setStatus) {
setOkStatus();
}
}
+ private void setErrorStatus(String errorMessage) {
+ status = new Status(
+ IStatus.ERROR,
+ HelpUIPlugin.PLUGIN_ID,
+ IStatus.ERROR,
+ errorMessage,
+ null);
+ updateStatus(status);
+ }
+
private void setOkStatus() {
status = new Status(
IStatus.OK,

Back to the top