/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
/** * @see PromptSupport#setPrompt(String, javax.swing.text.JTextComponent) */ public void setPrompt(String labelText) { PromptSupport.setPrompt(labelText, this); }
public static void addPromptSupport(JComponent component, String text) { if (JTextComponent.class.isAssignableFrom(component.getClass())) { JTextComponent castedComponent = (JTextComponent) component; PromptSupport.setPrompt(text, castedComponent); PromptSupport.setFocusBehavior(PromptSupport.FocusBehavior.HIDE_PROMPT, castedComponent); } }
public ValidationView() { super("validView", "Validation view", "View with validation,"); jPanel = new JPanel(new MigLayout()); tf = new JTextField(20); PromptSupport.setPrompt("Enter name with uppercase", tf); JLabel jLabel = new JLabel("Name: "); jLabel.setDisplayedMnemonic('m'); jLabel.setLabelFor(tf); jPanel.add(jLabel); jPanel.add(tf); }
public ValidationView2() { super("validView", "Validation view 2", "View with validation,"); jPanel = new JPanel(new MigLayout()); tfName = new JTextField(20); PromptSupport.setPrompt("Enter name with uppercase", tfName); JLabel labelName = new JLabel("Name: "); labelName.setDisplayedMnemonic('m'); labelName.setLabelFor(tfName); tfAge = new JTextField(20); PromptSupport.setPrompt("Enter age", tfAge); JLabel ageLabel = new JLabel("Age: "); ageLabel.setDisplayedMnemonic('a'); ageLabel.setLabelFor(tfAge); jPanel.add(labelName); jPanel.add(tfName, "wrap"); jPanel.add(ageLabel); jPanel.add(tfAge, "wrap"); }
/** * <p> * Convenience method to set the <code>promptText</code> and * <code>promptTextColor</code> on a {@link JTextComponent}. * </p> * <p> * If <code>stayOnUIChange</code> is true, The prompt support will stay * installed, even when the text components UI changes. See * {@link #install(JTextComponent, boolean)}. * </p> * * @param promptText * @param promptForeground * @param promptBackground * @param textComponent */ public static void init(String promptText, Color promptForeground, Color promptBackground, final JTextComponent textComponent) { if (promptText != null && promptText.length() > 0) { setPrompt(promptText, textComponent); } if (promptForeground != null) { setForeground(promptForeground, textComponent); } if (promptBackground != null) { setBackground(promptBackground, textComponent); } }
/** * <p> * Convenience method to set the <code>promptText</code> and * <code>promptTextColor</code> on a {@link JTextComponent}. * </p> * <p> * If <code>stayOnUIChange</code> is true, The prompt support will stay * installed, even when the text components UI changes. See * {@link #install(JTextComponent, boolean)}. * </p> * * @param promptText * @param promptForeground * @param promptBackground * @param textComponent */ public static void init(String promptText, Color promptForeground, Color promptBackground, final JTextComponent textComponent) { if (promptText != null && promptText.length() > 0) { setPrompt(promptText, textComponent); } if (promptForeground != null) { setForeground(promptForeground, textComponent); } if (promptBackground != null) { setBackground(promptBackground, textComponent); } }
/** * <p> * Convenience method to set the <code>promptText</code> and * <code>promptTextColor</code> on a {@link JTextComponent}. * </p> * <p> * If <code>stayOnUIChange</code> is true, The prompt support will stay * installed, even when the text components UI changes. See * {@link #install(JTextComponent, boolean)}. * </p> * * @param promptText * @param promptForeground * @param promptBackground * @param textComponent */ public static void init(String promptText, Color promptForeground, Color promptBackground, final JTextComponent textComponent) { if (promptText != null && promptText.length() > 0) { setPrompt(promptText, textComponent); } if (promptForeground != null) { setForeground(promptForeground, textComponent); } if (promptBackground != null) { setBackground(promptBackground, textComponent); } }
/** * <p> * Convenience method to set the <code>promptText</code> and * <code>promptTextColor</code> on a {@link JTextComponent}. * </p> * <p> * If <code>stayOnUIChange</code> is true, The prompt support will stay * installed, even when the text components UI changes. See * {@link #install(JTextComponent, boolean)}. * </p> * * @param promptText * @param promptForeground * @param promptBackground * @param textComponent */ public static void init(String promptText, Color promptForeground, Color promptBackground, final JTextComponent textComponent) { if (promptText != null && promptText.length() > 0) { setPrompt(promptText, textComponent); } if (promptForeground != null) { setForeground(promptForeground, textComponent); } if (promptBackground != null) { setBackground(promptBackground, textComponent); } }
public static void addPromptSupport(JComponent component, Property property, String promptText) { if (JTextComponent.class.isAssignableFrom(component.getClass())) { JTextComponent castedComponent = (JTextComponent) component; String text; if (File.class.isAssignableFrom(property.getType())) { text = promptText != null ? promptText : String.format(FILE_FIELD_PROMPT, separateWords(property.getName())); } else { if (promptText == null) { text = property.getDescriptor().getDescription(); if (StringUtils.isNullOrEmpty(text)) { text = String.format(TEXT_FIELD_PROMPT, separateWords(property.getName())); } } else { text = promptText; } } PromptSupport.setPrompt(text, castedComponent); PromptSupport.setFocusBehavior(PromptSupport.FocusBehavior.HIDE_PROMPT, castedComponent); } }