Class PrintButton

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<Button>
com.storedobject.ui.PrintButton
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

public final class PrintButton extends com.vaadin.flow.component.Composite<Button>
A "print button" is created automatically by ObjectEditors and ObjectBrowsers if one or more PrintLogicDefinitions exist for the StoredObject class. The "print button" may be a single button if there is only one PrintLogicDefinition defined, or it can contain multiple buttons.

The most common use-case of PrintButton is to define logic for printing. For defining such logic, either the PDFObjectReport or the ODTObjectReport may be extended. If the ODTObjectReport is extended, the ODT template may be specified in the PrintLogicDefinition.

The "printing logic" that is defined in the PrintLogicDefinition should have a constructor that takes a Device and a StoredObject instance as its parameters. (Have a look at the constructors - PDFObjectReport(Device, StoredObject) and ODTObjectReport(Device, StoredObject)

Usage as a generic button: PrintButton may be used to invoke non-printing logic too by defining any generic logic in the PrintLogicDefinition. The logic must implement Runnable and must have a constructor that takes a Device and a StoredObject instance as its parameters.

In ObjectEditor, by default, the PrintButton will be hidden if the object instance is null. However, you can control this behaviour and control the visibility of it or its individual buttons by overriding the ObjectEditor.enablePrintButtons(boolean) method.

Author:
Syam
See Also: