uDIG
  1. uDIG
  2. UDIG-1836

DEL button deletes Maps from Projects

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: UDIG 1.2.2
    • Fix Version/s: UDIG 1.3.0
    • Component/s: application
    • Labels:
      None
    • Environment:
      Linux 64 bit + Windows 7 64 bits

      Description

      If you select a feature in the Map view and press Canc button on keyboard to delete this feature, all the Map will be deleted from the filesystem.

        Activity

        Hide
        Jody Garnett added a comment - - edited
        Okay I am gradually finding out the limits on this problem:
        - the delete key does the correct thing from the layers view (DEL removes a layer)
        - it does NOT do the correct thing from the projects view (i.e. Project Explorer)

        In comparing the two implementations; the LayersView takes a few extra steps with the creation of its own Delete action (rather than recycling the one from ToolbarManager).

        I am going to make them work the same and then test.

        Update: Okay that did not work out (i.e. no effect other than consistent code).
        -------
        Looking at UDIGGenericAction (the super class of Delete) now. The base UDIGGenericAction class it checks the current workbench selection; and dispatches accordingly.

        1) The selection (for a Map) comes from ReplaceableSelectionProvider.
        2) For the Zoom and Pan tools that class delegates to MapEditorSelectionProvider - which has the Map as the selected item

        So for the zoom and pan tools considers the map to be the current selection (incase people want to look at properties or something). So the delete key is correctly deleting the current selection ... what can we do about that.
        Show
        Jody Garnett added a comment - - edited Okay I am gradually finding out the limits on this problem: - the delete key does the correct thing from the layers view (DEL removes a layer) - it does NOT do the correct thing from the projects view (i.e. Project Explorer) In comparing the two implementations; the LayersView takes a few extra steps with the creation of its own Delete action (rather than recycling the one from ToolbarManager). I am going to make them work the same and then test. Update: Okay that did not work out (i.e. no effect other than consistent code). ------- Looking at UDIGGenericAction (the super class of Delete) now. The base UDIGGenericAction class it checks the current workbench selection; and dispatches accordingly. 1) The selection (for a Map) comes from ReplaceableSelectionProvider. 2) For the Zoom and Pan tools that class delegates to MapEditorSelectionProvider - which has the Map as the selected item So for the zoom and pan tools considers the map to be the current selection (incase people want to look at properties or something). So the delete key is correctly deleting the current selection ... what can we do about that.
        Hide
        Jody Garnett added a comment - - edited
        Okay I have made delete action have a creation flag to indicate if it can delete project elements or not. The ToolManager copy of Delete cannot do this; but the one created int the Projects Explorer can.

        I also cleaned up a lot of the code to be explicit with its return type of Pair<boolean,Int> and fixed a few NPE and was explicit about checking Window.CANCEL.

        Will submit a pull request now:
        - https://github.com/uDig/udig-platform/pull/80
        Show
        Jody Garnett added a comment - - edited Okay I have made delete action have a creation flag to indicate if it can delete project elements or not. The ToolManager copy of Delete cannot do this; but the one created int the Projects Explorer can. I also cleaned up a lot of the code to be explicit with its return type of Pair<boolean,Int> and fixed a few NPE and was explicit about checking Window.CANCEL. Will submit a pull request now: - https://github.com/uDig/udig-platform/pull/80
        Hide
        Jody Garnett added a comment -
        So my pull request is fine; in that it fixes the symptom. The real problem here is the tool selection is being given to the ToolProxy; but the ReplaceableSelectionProvider used by the Map is not correctly delegating to the ToolProxy.
        Show
        Jody Garnett added a comment - So my pull request is fine; in that it fixes the symptom. The real problem here is the tool selection is being given to the ToolProxy; but the ReplaceableSelectionProvider used by the Map is not correctly delegating to the ToolProxy.
        Hide
        Jody Garnett added a comment -
        So my pull request is fine; in that it fixes the symptom. The real problem here is the tool selection is being given to the ToolProxy; but the ReplaceableSelectionProvider used by the Map is not correctly delegating to the ToolProxy.
        Show
        Jody Garnett added a comment - So my pull request is fine; in that it fixes the symptom. The real problem here is the tool selection is being given to the ToolProxy; but the ReplaceableSelectionProvider used by the Map is not correctly delegating to the ToolProxy.
        Hide
        Jody Garnett added a comment -
        Okay I have introduced additional methods into MapEditorPart interface; and cleaned up the code that handled selection to work against this interface.
        Show
        Jody Garnett added a comment - Okay I have introduced additional methods into MapEditorPart interface; and cleaned up the code that handled selection to work against this interface.

          People

          • Assignee:
            Jody Garnett
            Reporter:
            Silvia Franceschi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: