use of org.linkki.framework.ui.dialogs.PmoBasedDialogFactory in project linkki by linkki-framework.
the class PlaygroundApplicationHeader method addHelpMenuItems.
@Override
protected void addHelpMenuItems(MenuItem helpMenu) {
super.addHelpMenuItems(helpMenu);
helpMenu.getSubMenu().addItem("Locale", i -> {
new PmoBasedDialogFactory().newOkDialog("Browser Locale", new LocaleInfoPmo()).open();
});
helpMenu.getSubMenu().addItem("Toogle Dark Mode", i -> {
ThemeList themeList = UI.getCurrent().getElement().getThemeList();
if (themeList.contains(Lumo.DARK)) {
themeList.remove(Lumo.DARK);
} else {
themeList.add(Lumo.DARK);
}
});
}
use of org.linkki.framework.ui.dialogs.PmoBasedDialogFactory in project linkki by linkki-framework.
the class PlaygroundApplicationHeader method createRightMenuBar.
// tag::applicationheader-createRightMenuBar[]
@Override
protected MenuBar createRightMenuBar() {
MenuBar rightMenuBar = super.createRightMenuBar();
MenuItem settings = rightMenuBar.addItem(VaadinIcon.COG.create());
settings.setId("appmenu-settings");
addThemeVariantToggles(settings, ThemeVariantToggleMenuItemDefinition.LUMO_DARK, ThemeVariantToggleMenuItemDefinition.LINKKI_CARD, ThemeVariantToggleMenuItemDefinition.LINKKI_COMPACT);
// end::applicationheader-createRightMenuBar[]
new ApplicationMenuItemDefinition("Locale", "appmenu-locale", () -> new PmoBasedDialogFactory().newOkDialog("Browser Locale", new LocaleInfoPmo()).open()).createItem(settings.getSubMenu());
return rightMenuBar;
}
use of org.linkki.framework.ui.dialogs.PmoBasedDialogFactory in project linkki by linkki-framework.
the class DialogWithCustomSizePmo method showDialog.
@UIButton(position = 40, label = "Opens a dialog with a custom size", caption = "Open dialog")
public void showDialog() {
var dialog = new PmoBasedDialogFactory().newOkDialog("Dialog with a custom size");
dialog.setSize(width, height);
dialog.open();
}
use of org.linkki.framework.ui.dialogs.PmoBasedDialogFactory in project linkki by linkki-framework.
the class OkCancelDialogMessagePmo method button.
@UIButton(position = 0, caption = "Open dialog")
public void button() {
FieldValidationPmo validationDialogPmo = new FieldValidationPmo();
OkCancelDialog dialog = new PmoBasedDialogFactory(validationDialogPmo::validate).openOkCancelDialog("Validation Dialog PMO", Handler.NOP_HANDLER, validationDialogPmo);
dialog.setWidth("600px");
}
use of org.linkki.framework.ui.dialogs.PmoBasedDialogFactory in project linkki by linkki-framework.
the class SetFormItemLabelWidthDialogPmo method showDialog.
@UIButton(position = 40, label = "Opens a dialog with a custom label width", caption = "Open dialog")
public void showDialog() {
var dialog = new PmoBasedDialogFactory().newOkDialog("Custom label width dialog", new LabelTextfieldPmo());
ComponentStyles.setFormItemLabelWidth(dialog, width);
dialog.open();
}
Aggregations