uDIG
  1. uDIG
  2. UDIG-1699

Modal tool Icons disappear from toolbar

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: UDIG 1.2.RC3
    • Fix Version/s: UDIG 1.2.0
    • Component/s: tools and editing
    • Labels:
      None

      Description

      I noticed this behavior both in the latest win32 uDig 1.2-SNAPSHOT, and also in my custom application built on uDig SDK 1.2-RC3:
      If you have a map editor open, and you reset your perspective, the modal tool icons disappear, leaving blank buttons in their place. The icons usually come back if you click on one of the blank spots.
      I see that the modal tools are added in udig.project.ui.internal.MapEditorActionBarContributor, but this code doesn't get called when you reset the perspective while a map is open.

        Activity

        Hide
        Jody Garnett added a comment -
        Moovida has an easier way to reproduce this one:

        I experienced the same on the 1.2snapshot on lin64 without changing
        perspective. It is enough to maximize the table (or any) view and
        bring it back to normal again. The icons disappear and all that's left
        is the down arrow that shows that there are tools.

        With that in mind I don't think this is a problem with reseting the perspective. I note that UDIG-1686 (ie tool activation) is not fixed yet so I doubt that is to blame either.
        Show
        Jody Garnett added a comment - Moovida has an easier way to reproduce this one: I experienced the same on the 1.2snapshot on lin64 without changing perspective. It is enough to maximize the table (or any) view and bring it back to normal again. The icons disappear and all that's left is the down arrow that shows that there are tools. With that in mind I don't think this is a problem with reseting the perspective. I note that UDIG-1686 (ie tool activation) is not fixed yet so I doubt that is to blame either.
        Hide
        Jody Garnett added a comment -
        The method causing trouble is in AbstractToolbarContributionItem ..

         protected void setCurrentTool( final ModalItem tool ) {
        // if( currentTool==tool )
        // return;
                currentTool = tool;
                if( Display.getCurrent()==null ){
                    Display.getDefault().asyncExec(new Runnable(){
                        public void run() {
                            setWidgetState(tool);

                        }
                    });
                }else
                    setWidgetState(tool);

            }

        I have commented out the first two lines as shown above as a temp fix.

        The first two lines are trying to prevent some extra work; however when the toolbar is being restored to the screen and and it has already been set up once and has the correct "currentTool" the code prevents setWidgetState from being called. And we want it called so the widget shows the correct icon.

        I am going to go modify the fill method that is calling this to set currentTool to null prior to calling this method; I imagine that will a) work and b) not disrupt normal use.

        Show
        Jody Garnett added a comment - The method causing trouble is in AbstractToolbarContributionItem ..  protected void setCurrentTool( final ModalItem tool ) { // if( currentTool==tool ) // return;         currentTool = tool;         if( Display.getCurrent()==null ){             Display.getDefault().asyncExec(new Runnable(){                 public void run() {                     setWidgetState(tool);                 }             });         }else             setWidgetState(tool);     } I have commented out the first two lines as shown above as a temp fix. The first two lines are trying to prevent some extra work; however when the toolbar is being restored to the screen and and it has already been set up once and has the correct "currentTool" the code prevents setWidgetState from being called. And we want it called so the widget shows the correct icon. I am going to go modify the fill method that is calling this to set currentTool to null prior to calling this method; I imagine that will a) work and b) not disrupt normal use.
        Hide
        Jody Garnett added a comment -
        That worked.
        Show
        Jody Garnett added a comment - That worked.
        Hide
        Silvia Franceschi added a comment -
        Modal icons also disappear if:
        1. have a layer visualized in the Map view
        2. go to the Table view
        3. maximize the Table view
        4. restore the original window visualization
        There will be nothing in the modal toolbar, if you need the icons then you have to Reset Perspective or restart uDig
        Show
        Silvia Franceschi added a comment - Modal icons also disappear if: 1. have a layer visualized in the Map view 2. go to the Table view 3. maximize the Table view 4. restore the original window visualization There will be nothing in the modal toolbar, if you need the icons then you have to Reset Perspective or restart uDig
        Hide
        Jody Garnett added a comment -
        I can reproduce what you are seeing Silivia; this time it is not a bug - simply the fact that the workbench does not have a current editor. When you select the editor the toolbars for that editor are still present.

        Long term I would like to make use of the a Palette to handle tools which can be either the palette view; or made directly part of the editor.
        Show
        Jody Garnett added a comment - I can reproduce what you are seeing Silivia; this time it is not a bug - simply the fact that the workbench does not have a current editor. When you select the editor the toolbars for that editor are still present. Long term I would like to make use of the a Palette to handle tools which can be either the palette view; or made directly part of the editor.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jesse Varner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: