Ticket #18638: 18638.3.patch

File 18638.3.patch, 2.1 KB (added by taylor.smock, 3 months ago)

Actually initialize the actions (in LayerListDialog)

  • src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

     
    5454import org.openstreetmap.josm.gui.MapView;
    5555import org.openstreetmap.josm.gui.SideButton;
    5656import org.openstreetmap.josm.gui.dialogs.layer.ActivateLayerAction;
     57import org.openstreetmap.josm.gui.dialogs.layer.CycleLayerDownAction;
     58import org.openstreetmap.josm.gui.dialogs.layer.CycleLayerUpAction;
    5759import org.openstreetmap.josm.gui.dialogs.layer.DeleteLayerAction;
    5860import org.openstreetmap.josm.gui.dialogs.layer.DuplicateAction;
    5961import org.openstreetmap.josm.gui.dialogs.layer.LayerListTransferHandler;
     
    141143    private final ActivateLayerAction activateLayerAction;
    142144    private final ShowHideLayerAction showHideLayerAction;
    143145
     146    private final CycleLayerUpAction cycleLayerUpAction;
     147    private final CycleLayerDownAction cycleLayerDownAction;
     148
    144149    //TODO This duplicates ShowHide actions functionality
    145150    /** stores which layer index to toggle and executes the ShowHide action if the layer is present */
    146151    private final class ToggleLayerIndexVisibility extends AbstractAction {
     
    329334        // Show/Activate layer on Enter key press
    330335        InputMapUtils.addSpacebarAction(layerList, showHideLayerAction);
    331336
     337        // Cycle layer actions
     338        cycleLayerUpAction = new CycleLayerUpAction();
     339        cycleLayerDownAction = new CycleLayerDownAction();
     340
    332341        createLayout(layerList, true, Arrays.asList(
    333342                new SideButton(moveUpAction, false),
    334343                new SideButton(moveDownAction, false),
     
    388397        DISPLAY_NUMBERS.removeListener(visibilityWidthListener);
    389398        ExpertToggleAction.removeExpertModeChangeListener(visibilityWidthListener);
    390399        layerManager.removeLayerChangeListener(visibilityWidthListener);
     400        cycleLayerUpAction.destroy();
     401        cycleLayerDownAction.destroy();
    391402        super.destroy();
    392403        instance = null;
    393404    }