Package com.tick42.glue.desktop.layouts
Interface Layouts
-
public interface LayoutsAPI for managing Glue Desktop layouts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLayouts.SaveRequestListenerDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description <T> CompletionStage<AsynchronousCloseable>addSaveListener(LayoutSaveHandler<T> handler)Registers a handler to provide additional context to be saved with the layout state.<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.CompletionStage<Void>delete(LayoutType type, String name)Delete a layout via its name and typeCompletionStage<Collection<Layout>>exportLayouts()Exports the layouts of this user for external use.CompletionStage<Void>importLayouts(Collection<Layout> layouts, LayoutImportMode mode)Imports layouts by either merging them or replacing them.Collection<Layout>list()Lists available layouts.default voidonSave(Layouts.SaveRequestListener listener)Deprecated.CompletionStage<Void>restore(LayoutRestoreOptions options)Restore a layout viaLayoutRestoreOptions.CompletionStage<Void>save(Consumer<NewLayoutOptions.Builder<?>> layout)Saves the currently setup layout.
-
-
-
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.
-
restore
CompletionStage<Void> restore(LayoutRestoreOptions options)
Restore a layout viaLayoutRestoreOptions.- Parameters:
options- options used to pick layout to restore.- Returns:
- CompletionStage to indicate completion.
-
delete
CompletionStage<Void> delete(LayoutType type, String name)
Delete a layout via its name and type- Parameters:
type- type of the layoutname- name of the layout- Returns:
- CompletionStage to indicate completion
-
list
Collection<Layout> list()
Lists available layouts.- Returns:
- Collection
-
importLayouts
CompletionStage<Void> importLayouts(Collection<Layout> layouts, LayoutImportMode mode)
Imports layouts by either merging them or replacing them.- Parameters:
layouts- collection of layouts to importmode- mode of import - merge or replace- Returns:
- CompletionStage to indicate completion or problems
-
exportLayouts
CompletionStage<Collection<Layout>> exportLayouts()
Exports the layouts of this user for external use.- Returns:
- Collection of all
Layoutinstances.
-
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 isMap<String, Object>.- Type Parameters:
T- type of the state- Parameters:
handler- handler of typeLayoutSaveHandler- 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 isMap<String, Object>.- Type Parameters:
T- type of the state- Parameters:
instanceId- application instance idhandler- handler of typeLayoutSaveHandler, must not benull- Since:
- 1.4.2
-
onSave
@Deprecated default void onSave(Layouts.SaveRequestListener listener)
Deprecated.Provides additional context to be saved with the layout.- Parameters:
listener- typeLayouts.SaveRequestListener
-
-