[OS-JIRA] Created: (CAY-424) Tooltips for all toolbar buttons in Modeler

From: jira-norepl..bjectstyle.org
Date: Thu Jan 26 2006 - 11:24:37 EST

  • Next message: jira-norepl..bjectstyle.org: "[OS-JIRA] Created: (CAY-425) ObjEntityTab.java--add tooltip to "Sync" button; correct button size in layout"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-424

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-424
        Summary: Tooltips for all toolbar buttons in Modeler
           Type: Improvement

         Status: Assigned
       Priority: Minor

        Project: Cayenne
     Components:
                 CayenneModeler GUI
       Versions:
                 1.2 [DEV]

       Assignee: Andrus Adamchik
       Reporter: Paul Furbacher

        Created: Thu, 26 Jan 2006 11:24 AM
        Updated: Thu, 26 Jan 2006 11:24 AM
    Environment: Windows XP (rather irrelevant, though), JDK 1.5.03_b07 (that which ships with JBuilder 2006; also irrelevant to this case)

    Description:
    Tooltips may be annoying for the seasoned user of any application, but are helpful to newcomers. And, since in a number of places Cayenne Modeler uses tooltips, it would seem to be of some value to implement tooltips for all of the toolbar buttons, and in general, any CayenneAction (or subclass thereof).

    To effect this improvement, the following small changes need to be made to org.objectstyle.cayenne.modeler.util.CayenneAction:

    1. Constructor enhancements:instead of offering just the single two argument constructor, do the following:

      /**
       * Creates a named CayenneAction.
       */
      public CayenneAction(String name, Application application) {
        this(name, application, name);
      }

      /**
       * Creates a named CayenneAction.
       */
      public CayenneAction(String name, Application application, String longDescription) {
        super(name);
        super.putValue(Action.DEFAULT, name);

        this.application = application;

        Icon icon = createIcon();
        if (icon != null) {
          super.putValue(Action.SMALL_ICON, icon);
        }

        KeyStroke accelerator = getAcceleratorKey();
        if (accelerator != null) {
          super.putValue(Action.ACCELERATOR_KEY, accelerator);
        }
        
        if ( longDescription != null && longDescription.length() > 0 ) {
          super.putValue(Action.LONG_DESCRIPTION, longDescription);
        }

        setEnabled(false);
      }

    That is, move the actual construction to a new three parameter
    constructor, adding the longDescription parameter as show. The
    Action.LONG_DESCRIPTION value is used later on to assign text to the button's tooltip text.

    2. Assign tooltip text: in the constructor for the nested class "CayenneAction.CayenneToolbarButton", enhance the constructor to
    read as follows:

       /**
        * Constructor for CayenneMenuItem.
        */
       public CayenneToolbarButton(Action a) {
         super();
          setAction(a);
          setToolTipText((String)a.getValue(Action.LONG_DESCRIPTION));
       }

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Thu Jan 26 2006 - 11:24:38 EST