mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-165089 improve validation for empty name of schemes
This commit is contained in:
+3
-1
@@ -32,6 +32,8 @@ import java.awt.event.*;
|
||||
import java.util.Collection;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static com.intellij.openapi.util.text.StringUtil.isEmptyOrSpaces;
|
||||
|
||||
public class EditableSchemesCombo<T extends Scheme> {
|
||||
|
||||
// region Message constants
|
||||
@@ -210,7 +212,7 @@ public class EditableSchemesCombo<T extends Scheme> {
|
||||
@Nullable
|
||||
private String validateSchemeName(@NotNull String name, boolean isProjectScheme) {
|
||||
if (myNameEditData != null && name.equals(myNameEditData.initialName)) return null;
|
||||
if (name.isEmpty()) {
|
||||
if (isEmptyOrSpaces(name)) {
|
||||
return EMPTY_NAME_MESSAGE;
|
||||
}
|
||||
else if (mySchemesPanel.getModel().containsScheme(name, isProjectScheme)) {
|
||||
|
||||
Reference in New Issue
Block a user