swingx
  1. swingx
  2. SWINGX-306

Prompt values for JTextComponent, JTextField

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 1.6.1
    • Component/s: Misc Component
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      306

      Description

      Sometimes text fields will have a prototype value or label within the text field itself. For example:

      • Safari's Google search field has the "Google" prototype value
      • java.sun.com's search text field has the "Search" prototype value
      • in Mac Address Book, the name fields have prototypes "First" and "Last"

      SwingX should provide a simple class to make this easy. I'm going to attach my implementation of this
      feature, which I'd love to see you guys add to SwingX. It's called "PrototypeValueSupport" and it works
      with any JTextComponent. To use it, simply use the following code:
      JTextField myTextField = ...
      PrototypeValueSupport.install(myTextField, "Prototype Value");

      It also conveniently greys out the prototype value, which is commonly done in this pattern.

        Activity

        Hide
        jessewilson added a comment -

        Created an attachment (id=60)
        PrototypeValueSupport class to do suggested values in JTextFields

        Show
        jessewilson added a comment - Created an attachment (id=60) PrototypeValueSupport class to do suggested values in JTextFields
        Hide
        Karl Schaefer added a comment -

        This is very similar to the Prompt support that Peter mentioned in his XSwingX
        code. I have added Peter to the CC list.

        Peter are you still willing to donate your code to this project? If so, have
        you signed a JCA?

        Assigning to post 1.0 unless we get donated code.

        Show
        Karl Schaefer added a comment - This is very similar to the Prompt support that Peter mentioned in his XSwingX code. I have added Peter to the CC list. Peter are you still willing to donate your code to this project? If so, have you signed a JCA? Assigning to post 1.0 unless we get donated code.
        Hide
        Karl Schaefer added a comment -
        Show
        Karl Schaefer added a comment - Created tag for work to incorporate xswingx code. copy -rHEAD https://swingx.dev.java.net/svn/swingx/trunk https://swingx.dev.java.net/svn/swingx/tags/pre-issue-306
        Hide
        Karl Schaefer added a comment -

        Stupid tracker can't claim and start in one move....

        Show
        Karl Schaefer added a comment - Stupid tracker can't claim and start in one move....
        Hide
        Karl Schaefer added a comment -

        Issue 306: Integrated petw2815's work from the incubator. I have initially
        moved everything, including the convenience subclasses, though we might choose
        to back some of that out. Altered a few class names from their original
        incubator names to match with convention. Relocated several classes to place
        the relevant items in "better" locations. Created the prompt subpackage for
        isolating the prompt code.

        src/beaninfo/org/jdesktop/swingx/JXFormattedTextFieldBeanInfo.java
        src/beaninfo/org/jdesktop/swingx/JXPromptBeanInfo.java
        src/beaninfo/org/jdesktop/swingx/JXSearchFieldBeanInfo.java
        src/beaninfo/org/jdesktop/swingx/JXTextAreaBeanInfo.java
        src/beaninfo/org/jdesktop/swingx/JXTextFieldBeanInfo.java
        src/java/org/jdesktop/swingx/JXFormattedTextField.java
        src/java/org/jdesktop/swingx/JXSearchField.java
        src/java/org/jdesktop/swingx/JXTextArea.java
        src/java/org/jdesktop/swingx/JXTextField.java
        src/java/org/jdesktop/swingx/plaf/AbstractUIChangeHandler.java
        src/java/org/jdesktop/swingx/plaf/BuddyLayoutAndBorder.java
        src/java/org/jdesktop/swingx/plaf/BuddyTextFieldUI.java
        src/java/org/jdesktop/swingx/plaf/PromptTextAreaUI.java
        src/java/org/jdesktop/swingx/plaf/PromptTextFieldUI.java
        src/java/org/jdesktop/swingx/plaf/PromptTextUI.java
        src/java/org/jdesktop/swingx/plaf/SearchFieldAddon.java
        src/java/org/jdesktop/swingx/plaf/SearchFieldUI.java
        src/java/org/jdesktop/swingx/plaf/TextUIWrapper.java
        src/java/org/jdesktop/swingx/plaf/basic/resources/SearchField.properties
        src/java/org/jdesktop/swingx/plaf/basic/resources/SearchField_de.properties
        src/java/org/jdesktop/swingx/plaf/basic/resources/clear.gif
        src/java/org/jdesktop/swingx/plaf/basic/resources/clear_pressed.gif
        src/java/org/jdesktop/swingx/plaf/basic/resources/clear_rollover.gif
        src/java/org/jdesktop/swingx/plaf/basic/resources/search.gif
        src/java/org/jdesktop/swingx/plaf/basic/resources/search_popup.gif
        src/java/org/jdesktop/swingx/plaf/macosx/resources/clear.png
        src/java/org/jdesktop/swingx/plaf/macosx/resources/clear_pressed.png
        src/java/org/jdesktop/swingx/plaf/macosx/resources/clear_rollover.png
        swingx/src/java/org/jdesktop/swingx/plaf/macosx/resources/search.png
        src/java/org/jdesktop/swingx/plaf/macosx/resources/search_popup.png
        swingx/src/java/org/jdesktop/swingx/plaf/windows/resources/clear.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/clear_pressed.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/clear_rollover.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/search.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/search_popup.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/search_popup_pressed.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/search_popup_rollover.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/search_pressed.gif
        src/java/org/jdesktop/swingx/plaf/windows/resources/search_rollover.gif
        src/java/org/jdesktop/swingx/prompt
        src/java/org/jdesktop/swingx/prompt/BuddyButton.java
        src/java/org/jdesktop/swingx/prompt/BuddySupport.java
        src/java/org/jdesktop/swingx/prompt/PromptSupport.java
        src/java/org/jdesktop/swingx/search/NativeSearchFieldSupport.java
        src/java/org/jdesktop/swingx/search/RecentSearches.java
        src/test/org/jdesktop/swingx/JXSearchFieldTest.java
        src/test/org/jdesktop/swingx/plaf/AbstractUIChangeHandlerTest.java
        src/test/org/jdesktop/swingx/plaf/BuddyLayoutAndBorderTest.java
        src/test/org/jdesktop/swingx/plaf/PromptTextAreaUITest.java
        src/test/org/jdesktop/swingx/plaf/PromptTextFieldUITest.java
        src/test/org/jdesktop/swingx/plaf/PromptTextUITest.java
        src/test/org/jdesktop/swingx/plaf/TextUIWrapperTest.java
        src/test/org/jdesktop/swingx/plaf/basic/BasicSearchFieldUITest.java
        src/test/org/jdesktop/swingx/prompt
        src/test/org/jdesktop/swingx/prompt/BuddySupportTest.java
        src/test/org/jdesktop/swingx/prompt/PromptSupportTest.java
        src/test/org/jdesktop/swingx/search/NativeSearchFieldSupportTest.java
        src/test/org/jdesktop/swingx/search/RecentSearchesTest.java

        Committed revision 3582.

        Show
        Karl Schaefer added a comment - Issue 306: Integrated petw2815's work from the incubator. I have initially moved everything, including the convenience subclasses, though we might choose to back some of that out. Altered a few class names from their original incubator names to match with convention. Relocated several classes to place the relevant items in "better" locations. Created the prompt subpackage for isolating the prompt code. src/beaninfo/org/jdesktop/swingx/JXFormattedTextFieldBeanInfo.java src/beaninfo/org/jdesktop/swingx/JXPromptBeanInfo.java src/beaninfo/org/jdesktop/swingx/JXSearchFieldBeanInfo.java src/beaninfo/org/jdesktop/swingx/JXTextAreaBeanInfo.java src/beaninfo/org/jdesktop/swingx/JXTextFieldBeanInfo.java src/java/org/jdesktop/swingx/JXFormattedTextField.java src/java/org/jdesktop/swingx/JXSearchField.java src/java/org/jdesktop/swingx/JXTextArea.java src/java/org/jdesktop/swingx/JXTextField.java src/java/org/jdesktop/swingx/plaf/AbstractUIChangeHandler.java src/java/org/jdesktop/swingx/plaf/BuddyLayoutAndBorder.java src/java/org/jdesktop/swingx/plaf/BuddyTextFieldUI.java src/java/org/jdesktop/swingx/plaf/PromptTextAreaUI.java src/java/org/jdesktop/swingx/plaf/PromptTextFieldUI.java src/java/org/jdesktop/swingx/plaf/PromptTextUI.java src/java/org/jdesktop/swingx/plaf/SearchFieldAddon.java src/java/org/jdesktop/swingx/plaf/SearchFieldUI.java src/java/org/jdesktop/swingx/plaf/TextUIWrapper.java src/java/org/jdesktop/swingx/plaf/basic/resources/SearchField.properties src/java/org/jdesktop/swingx/plaf/basic/resources/SearchField_de.properties src/java/org/jdesktop/swingx/plaf/basic/resources/clear.gif src/java/org/jdesktop/swingx/plaf/basic/resources/clear_pressed.gif src/java/org/jdesktop/swingx/plaf/basic/resources/clear_rollover.gif src/java/org/jdesktop/swingx/plaf/basic/resources/search.gif src/java/org/jdesktop/swingx/plaf/basic/resources/search_popup.gif src/java/org/jdesktop/swingx/plaf/macosx/resources/clear.png src/java/org/jdesktop/swingx/plaf/macosx/resources/clear_pressed.png src/java/org/jdesktop/swingx/plaf/macosx/resources/clear_rollover.png swingx/src/java/org/jdesktop/swingx/plaf/macosx/resources/search.png src/java/org/jdesktop/swingx/plaf/macosx/resources/search_popup.png swingx/src/java/org/jdesktop/swingx/plaf/windows/resources/clear.gif src/java/org/jdesktop/swingx/plaf/windows/resources/clear_pressed.gif src/java/org/jdesktop/swingx/plaf/windows/resources/clear_rollover.gif src/java/org/jdesktop/swingx/plaf/windows/resources/search.gif src/java/org/jdesktop/swingx/plaf/windows/resources/search_popup.gif src/java/org/jdesktop/swingx/plaf/windows/resources/search_popup_pressed.gif src/java/org/jdesktop/swingx/plaf/windows/resources/search_popup_rollover.gif src/java/org/jdesktop/swingx/plaf/windows/resources/search_pressed.gif src/java/org/jdesktop/swingx/plaf/windows/resources/search_rollover.gif src/java/org/jdesktop/swingx/prompt src/java/org/jdesktop/swingx/prompt/BuddyButton.java src/java/org/jdesktop/swingx/prompt/BuddySupport.java src/java/org/jdesktop/swingx/prompt/PromptSupport.java src/java/org/jdesktop/swingx/search/NativeSearchFieldSupport.java src/java/org/jdesktop/swingx/search/RecentSearches.java src/test/org/jdesktop/swingx/JXSearchFieldTest.java src/test/org/jdesktop/swingx/plaf/AbstractUIChangeHandlerTest.java src/test/org/jdesktop/swingx/plaf/BuddyLayoutAndBorderTest.java src/test/org/jdesktop/swingx/plaf/PromptTextAreaUITest.java src/test/org/jdesktop/swingx/plaf/PromptTextFieldUITest.java src/test/org/jdesktop/swingx/plaf/PromptTextUITest.java src/test/org/jdesktop/swingx/plaf/TextUIWrapperTest.java src/test/org/jdesktop/swingx/plaf/basic/BasicSearchFieldUITest.java src/test/org/jdesktop/swingx/prompt src/test/org/jdesktop/swingx/prompt/BuddySupportTest.java src/test/org/jdesktop/swingx/prompt/PromptSupportTest.java src/test/org/jdesktop/swingx/search/NativeSearchFieldSupportTest.java src/test/org/jdesktop/swingx/search/RecentSearchesTest.java Committed revision 3582.
        Hide
        kleopatra added a comment -

        cleanup target milestone of fixed issues(from post to 1.x)

        Show
        kleopatra added a comment - cleanup target milestone of fixed issues(from post to 1.x)

          People

          • Assignee:
            Karl Schaefer
            Reporter:
            jessewilson
          • Votes:
            19 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: