PL-7074 Assigning input prompt to desktop text field also changes its description

This commit is contained in:
Daniil Tsarev 2016-04-25 11:35:54 +04:00
parent aa15ff5137
commit cd8825eb58

View File

@ -95,7 +95,13 @@ public class DesktopTextField extends DesktopAbstractTextField<JTextComponent> i
this.inputPrompt = inputPrompt;
if (StringUtils.isNotBlank(inputPrompt)) {
// Save old tooltipText value to use it later
String toolTipText = this.impl.getToolTipText();
PromptSupport.setPrompt(inputPrompt, impl);
// Use old tooltipText value because it was overwritten in org.jdesktop.swingx.prompt.PromptSupport.setPrompt()
this.impl.setToolTipText(toolTipText);
} else {
PromptSupport.setPrompt(null, impl);
}