void () { if (myValue.getKey().contains("color") && ColorUtil.fromHex(myValue.asString(), null) != null) { Color color = ColorChooserService.getInstance().showDialog(IdeFrameImpl.getActiveFrame(), "Change Color For '" + myValue.getKey() + "'", ColorUtil.fromHex(myValue.asString())); if (color != null) { myValue.setValue(ColorUtil.toHex(color)); } } else { String s = Messages.showInputDialog((Project)null, "Enter new value for '" + myValue.getKey() + "'", "Change Registry Value", null, myValue.asString(), new InputValidatorEx() { @Override public @Nullable String getErrorText(String inputString) { return canClose(inputString) ? null : "Should not be empty"; } @Override public boolean checkInput(String inputString) { return canClose(inputString); } @Override public boolean canClose(String inputString) { return !StringUtil.isEmpty(inputString); } }); if (s != null) { myValue.setValue(s); } } }