Class AbstractMergeAction

    • Constructor Detail

      • AbstractMergeAction

        protected AbstractMergeAction​(java.lang.String name,
                                      java.lang.String iconName,
                                      java.lang.String tooltip,
                                      Shortcut shortcut,
                                      boolean register)
        Constructs a new AbstractMergeAction.
        Parameters:
        name - the action's text as displayed on the menu (if it is added to a menu)
        iconName - the filename of the icon to use
        tooltip - a longer description of the action that will be displayed in the tooltip. Please note that html is not supported for menu actions on some platforms.
        shortcut - a ready-created shortcut object or null if you don't want a shortcut. But you always do want a shortcut, remember you can always register it with group=none, so you won't be assigned a shortcut unless the user configures one. If you pass null here, the user CANNOT configure a shortcut for your action.
        register - register this action for the toolbar preferences?
      • AbstractMergeAction

        protected AbstractMergeAction​(java.lang.String name,
                                      java.lang.String iconName,
                                      java.lang.String tooltip,
                                      Shortcut shortcut,
                                      boolean register,
                                      java.lang.String toolbar,
                                      boolean installAdapters)
        Constructs a new AbstractMergeAction.
        Parameters:
        name - the action's text as displayed on the menu (if it is added to a menu)
        iconName - the filename of the icon to use
        tooltip - a longer description of the action that will be displayed in the tooltip. Please note that html is not supported for menu actions on some platforms.
        shortcut - a ready-created shortcut object or null if you don't want a shortcut. But you always do want a shortcut, remember you can always register it with group=none, so you won't be assigned a shortcut unless the user configures one. If you pass null here, the user CANNOT configure a shortcut for your action.
        register - register this action for the toolbar preferences?
        toolbar - identifier for the toolbar preferences. The iconName is used, if this parameter is null
        installAdapters - false, if you don't want to install layer changed and selection changed adapters
    • Method Detail

      • askTargetLayer

        protected static AbstractMergeAction.TargetLayerDialogResult<LayeraskTargetLayer​(java.util.List<? extends Layer> targetLayers,
                                                                                           boolean showCheckbox,
                                                                                           java.lang.String checkbox,
                                                                                           boolean checkboxDefault,
                                                                                           java.lang.String buttonText)
        Ask user to choose the target layer and shows a checkbox.
        Parameters:
        targetLayers - list of candidate target layers.
        showCheckbox - whether the checkbox is shown
        checkbox - The text of the checkbox shown to the user.
        checkboxDefault - whether the checkbox is ticked by default
        buttonText - text of button used to select target layer
        Returns:
        The AbstractMergeAction.TargetLayerDialogResult containing the chosen target layer and the state of the checkbox
        Since:
        15450
      • askTargetLayer

        public static <T extends Layer> T askTargetLayer​(T[] targetLayers,
                                                         java.lang.String label,
                                                         java.lang.String title,
                                                         java.lang.String buttonText,
                                                         java.lang.String buttonIcon)
        Ask user to choose the target layer.
        Type Parameters:
        T - type of layer
        Parameters:
        targetLayers - array of proposed target layers
        label - label displayed in dialog
        title - title of dialog
        buttonText - text of button used to select target layer
        buttonIcon - icon name of button used to select target layer
        Returns:
        chosen target layer
      • askTargetLayer

        public static <T extends LayerAbstractMergeAction.TargetLayerDialogResult<T> askTargetLayer​(T[] targetLayers,
                                                                                                      java.lang.String label,
                                                                                                      java.lang.String checkbox,
                                                                                                      java.lang.String title,
                                                                                                      java.lang.String buttonText,
                                                                                                      java.lang.String buttonIcon,
                                                                                                      boolean showCheckbox,
                                                                                                      boolean checkboxDefault)
        Ask user to choose the target layer. Can show a checkbox.
        Type Parameters:
        T - type of layer
        Parameters:
        targetLayers - array of proposed target layers
        label - label displayed in dialog
        checkbox - text of the checkbox displayed
        title - title of dialog
        buttonText - text of button used to select target layer
        buttonIcon - icon name of button used to select target layer
        showCheckbox - whether the checkbox is shown
        checkboxDefault - whether the checkbox is ticked by default
        Returns:
        The AbstractMergeAction.TargetLayerDialogResult containing the chosen target layer and the state of the checkbox
        Since:
        14338
      • warnNoTargetLayersForSourceLayer

        protected void warnNoTargetLayersForSourceLayer​(Layer sourceLayer)
        Warns user when there no layers the source layer could be merged to.
        Parameters:
        sourceLayer - source layer