use of com.vaadin.navigator.ViewChangeListener.ViewChangeEvent in project opencms-core by alkacon.
the class CmsSitemapEditorConfiguration method openSitemapEditor.
/**
* Opens the sitemap editor for the current site.<p>
*/
void openSitemapEditor() {
CmsObject cms = A_CmsUI.getCmsObject();
String siteRoot = cms.getRequestContext().getSiteRoot();
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(siteRoot)) {
String path = getPath(cms, A_CmsUI.get().getHttpSession());
if (path != null) {
try {
CmsAppWorkplaceUi ui = CmsAppWorkplaceUi.get();
if (ui.beforeViewChange(new ViewChangeEvent(ui.getNavigator(), ui.getCurrentView(), null, APP_ID, null))) {
CmsResource res = cms.readResource(CmsADEManager.PATH_SITEMAP_EDITOR_JSP);
String link = OpenCms.getLinkManager().substituteLink(cms, res);
A_CmsUI.get().getPage().setLocation(link + "?path=" + path);
}
return;
} catch (CmsException e) {
LOG.debug("Unable to open sitemap editor.", e);
}
}
}
Notification.show(CmsVaadinUtils.getMessageText(Messages.GUI_SITEMAP_NOT_AVAILABLE_0), Type.WARNING_MESSAGE);
}
use of com.vaadin.navigator.ViewChangeListener.ViewChangeEvent in project unity by unity-idm.
the class CredentialRequirementsView method enter.
@Override
public void enter(ViewChangeEvent event) {
HorizontalLayout buttonsBar = StandardButtonsHelper.buildTopButtonsBar(StandardButtonsHelper.build4AddAction(msg, e -> NavigationHelper.goToView(NewCredentialRequirementsView.VIEW_NAME)));
credList = new GridWithActionColumn<>(msg, getActionsHandlers(), false);
credList.addComponentColumn(c -> {
if (!c.isReadOnly()) {
return StandardButtonsHelper.buildLinkButton(c.getName(), e -> gotoEdit(c));
} else {
return new Label(c.getName());
}
}, msg.getMessage("CredentialReqView.nameCaption"), 5).setSortable(true).setComparator((cr1, cr2) -> {
return cr1.getName().compareTo(cr2.getName());
}).setId("name");
credList.addSortableColumn(c -> String.join(", ", c.getRequiredCredentials()), msg.getMessage("CredentialReqView.credentialsCaption"), 10);
credList.addSortableColumn(c -> c.getDescription(), msg.getMessage("CredentialReqView.descriptionCaption"), 10);
credList.setItems(getCredentials());
credList.sort("name");
VerticalLayout main = new VerticalLayout();
main.addComponent(buttonsBar);
main.addComponent(credList);
main.setWidth(100, Unit.PERCENTAGE);
main.setMargin(false);
setCompositionRoot(main);
}
use of com.vaadin.navigator.ViewChangeListener.ViewChangeEvent in project unity by unity-idm.
the class NewAuthenticatorView method enter.
@Override
public void enter(ViewChangeEvent event) {
editor = controller.getEditor(null, this, e -> {
displayedName = msg.getMessage("New") + " " + AuthenticatorTypeLabelHelper.getAuthenticatorTypeLabel(msg, e.getValue()).toLowerCase();
refreshBreadCrumbs();
});
mainView = new VerticalLayout();
mainView.setMargin(false);
mainView.addComponent(editor);
mainView.addComponent(StandardButtonsHelper.buildConfirmNewButtonsBar(msg, () -> onConfirm(), () -> onCancel()));
setMainView(mainView);
refreshBreadCrumbs();
}
use of com.vaadin.navigator.ViewChangeListener.ViewChangeEvent in project unity by unity-idm.
the class AttributeClassesView method enter.
@Override
public void enter(ViewChangeEvent event) {
HorizontalLayout buttonsBar = StandardButtonsHelper.buildTopButtonsBar(StandardButtonsHelper.build4AddAction(msg, e -> NavigationHelper.goToView(NewAttributeClassView.VIEW_NAME)));
attributeClassGrid = new GridWithActionColumn<>(msg, getRowActionsHandlers(), false, false);
attributeClassGrid.addShowDetailsColumn(a -> getDetailsComponent(a));
attributeClassGrid.addComponentColumn(a -> StandardButtonsHelper.buildLinkButton(a.getName(), e -> gotoEdit(a)), msg.getMessage("AttributeClassesView.nameCaption"), 10).setSortable(true).setComparator((a1, a2) -> {
return a1.getName().compareTo(a2.getName());
}).setId("name");
attributeClassGrid.addSortableColumn(a -> String.join(", ", a.getAllowed()), msg.getMessage("AttributeClassesView.allowedCaption"), 10);
attributeClassGrid.addSortableColumn(a -> String.join(", ", a.getMandatory()), msg.getMessage("AttributeClassesView.mandatoryCaption"), 10);
attributeClassGrid.addByClickDetailsComponent(a -> getDetailsComponent(a));
attributeClassGrid.setSizeFull();
attributeClassGrid.setItems(getAttributeClasses());
VerticalLayout main = new VerticalLayout();
main.addComponent(buttonsBar);
main.addComponent(attributeClassGrid);
main.setWidth(100, Unit.PERCENTAGE);
main.setMargin(false);
setCompositionRoot(main);
}
use of com.vaadin.navigator.ViewChangeListener.ViewChangeEvent in project unity by unity-idm.
the class AuthenticationRealmsView method enter.
@Override
public void enter(ViewChangeEvent event) {
HorizontalLayout buttonsBar = StandardButtonsHelper.buildTopButtonsBar(StandardButtonsHelper.build4AddAction(msg, e -> NavigationHelper.goToView(NewAuthenticationRealmView.VIEW_NAME)));
realmsGrid = new GridWithActionColumn<>(msg, getActionsHandlers(), false);
realmsGrid.addShowDetailsColumn(r -> getDetailsComponent(r));
realmsGrid.addComponentColumn(r -> StandardButtonsHelper.buildLinkButton(r.realm.getName(), e -> gotoEdit(r)), msg.getMessage("AuthenticationRealmsView.nameCaption"), 10).setSortable(true).setComparator((r1, r2) -> {
return r1.realm.getName().compareTo(r2.realm.getName());
}).setId("name");
realmsGrid.setItems(getRealms());
realmsGrid.sort("name");
realmsGrid.setHeightByRows(false);
realmsGrid.setHeight(100, Unit.PERCENTAGE);
VerticalLayout main = new VerticalLayout();
main.addComponent(buttonsBar);
main.addComponent(realmsGrid);
main.setWidth(100, Unit.PERCENTAGE);
main.setMargin(false);
setCompositionRoot(main);
}
Aggregations