Interface Layouts


  • public interface Layouts
    API for managing Glue Desktop layouts.
    • Method Detail

      • save

        CompletionStage<Void> save​(Consumer<NewLayoutOptions.Builder<?>> layout)
        Saves the currently setup layout. It uses a Consumer with parameters for the new layout. The only mandatory parameter is a name. If a name has not been specified a random name will be generated instead.
        Parameters:
        layout - Consumer with parameters for the new Layout
        Returns:
        CompletionStage to indicate a signal for completion.
      • delete

        CompletionStage<Void> delete​(LayoutType type,
                                     String name)
        Delete a layout via its name and type
        Parameters:
        type - type of the layout
        name - name of the layout
        Returns:
        CompletionStage to indicate completion
      • importLayouts

        CompletionStage<Void> importLayouts​(Collection<Layout> layouts,
                                            LayoutImportMode mode)
        Imports layouts by either merging them or replacing them.
        Parameters:
        layouts - collection of layouts to import
        mode - mode of import - merge or replace
        Returns:
        CompletionStage to indicate completion or problems
      • addSaveListener

        <T> CompletionStage<AsynchronousCloseable> addSaveListener​(LayoutSaveHandler<T> handler)
        Registers a handler to provide additional context to be saved with the layout state. Currently the only supported type for the state is Map<String, Object>.
        Type Parameters:
        T - type of the state
        Parameters:
        handler - handler of type LayoutSaveHandler
        Since:
        1.4.2
      • addSaveListener

        <T> CompletionStage<AsynchronousCloseable> addSaveListener​(String instanceId,
                                                                   LayoutSaveHandler<T> handler)
        Registers a handler to provide additional context to be saved with the layout state of a specific instance. Currently the only supported type for the state is Map<String, Object>.
        Type Parameters:
        T - type of the state
        Parameters:
        instanceId - application instance id
        handler - handler of type LayoutSaveHandler, must not be null
        Since:
        1.4.2