use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageObjectCollections method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ObjectCollectionType> table = new MainObjectListPanel<ObjectCollectionType>(ID_TABLE, ObjectCollectionType.class) {
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_OBJECTS_COLLECTION;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(createDeleteInlineMenu());
return menu;
}
@Override
protected List<IColumn<SelectableBean<ObjectCollectionType>, String>> createDefaultColumns() {
return ColumnUtils.getDefaultObjectColumns();
}
@Override
protected String getNothingSelectedMessage() {
return getString("pageObjectCollections.message.nothingSelected");
}
@Override
protected String getConfirmMessageKeyForSingleObject() {
return "pageObjectCollections.message.confirmationMessageForMultipleObject";
}
@Override
protected String getConfirmMessageKeyForMultiObject() {
return "pageObjectCollections.message.confirmationMessageForSingleObject";
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class ExportingPanel method initLayout.
private void initLayout() {
MidpointForm form = new MidpointForm<>(ID_MAIN_FORM, true);
MessagePanel warningMessage = new MessagePanel(ID_WARNING_MESSAGE, MessagePanel.MessagePanelType.WARN, getWarningMessageModel());
warningMessage.setOutputMarkupId(true);
warningMessage.add(new VisibleBehaviour(() -> getWarningMessageModel() != null));
form.add(warningMessage);
FeedbackAlerts feedbackList = new FeedbackAlerts(ID_FEEDBACK);
feedbackList.setOutputMarkupId(true);
feedbackList.setOutputMarkupPlaceholderTag(true);
form.add(feedbackList);
TextPanel<String> nameField = new TextPanel<>(ID_NAME, nameModel);
form.add(nameField);
BoxedTablePanel<SelectableBean<Integer>> table = createTable(ID_TABLE, dataTable);
form.add(table);
AjaxSubmitButton exportSelected = new AjaxSubmitButton(ID_EXPORT, getPageBase().createStringResource("ExportingPopupPanel.exportSelected")) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target) {
performSelectedColumns(table);
if (exportedColumnsIndex.isEmpty()) {
LOGGER.warn("None columns selected");
getPageBase().warn(getPageBase().createStringResource("ExportingPanel.message.error.selectColumn").getString());
target.add(feedbackList);
return;
}
((PageBase) getPage()).hideMainPopup(target);
exportPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
form.add(exportSelected);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL, new StringResourceModel("Button.cancel", this, null)) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
form.add(cancelButton);
add(form);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageResourceVisualization method initLayout.
private void initLayout() {
MidpointForm<?> form = new MidpointForm<>(ID_FORM);
add(form);
WebMarkupContainer dotContainer = new WebMarkupContainer(ID_DOT_CONTAINER);
dotContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visualizationModel.getObject().getSvg() == null;
}
});
form.add(dotContainer);
TextArea<String> dot = new TextArea<>(ID_DOT, new PropertyModel<>(visualizationModel, ResourceVisualizationDto.F_DOT));
dotContainer.add(dot);
Label error = new Label(ID_ERROR, new PropertyModel<String>(visualizationModel, ResourceVisualizationDto.F_EXCEPTION_AS_STRING));
dotContainer.add(error);
Label svg = new Label(ID_SVG, new PropertyModel<String>(visualizationModel, ResourceVisualizationDto.F_SVG));
svg.setEscapeModelStrings(false);
svg.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visualizationModel.getObject().getSvg() != null;
}
});
form.add(svg);
AjaxSubmitButton back = new AjaxSubmitButton(ID_BACK) {
@Override
public void onSubmit(AjaxRequestTarget ajaxRequestTarget) {
redirectBack();
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
};
form.add(back);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class PageResources method initLayout.
protected void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<ResourceType> table = new MainObjectListPanel<ResourceType>(ID_TABLE, ResourceType.class, getQueryOptions()) {
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, ResourceType object) {
clearSessionStorageForResourcePage();
super.objectDetailsPerformed(target, object);
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_RESOURCES;
}
@Override
protected List<IColumn<SelectableBean<ResourceType>, String>> createDefaultColumns() {
return PageResources.this.initResourceColumns();
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return PageResources.this.createRowMenuItems();
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
table.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_RESOURCE_BOX_CSS_CLASSES);
}
use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.
the class RunReportPopupPanel method initLayout.
protected void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
add(mainForm);
FeedbackAlerts feedback = new FeedbackAlerts(ID_POPUP_FEEDBACK);
ReportObjectsListPanel table = new ReportObjectsListPanel(ID_TABLE, getModel()) {
private final boolean checkViewAfterInitialize = true;
@Override
public Component getFeedbackPanel() {
return feedback;
}
@Override
protected boolean checkViewAfterInitialize() {
if (checkViewAfterInitialize) {
return true;
}
return super.checkViewAfterInitialize();
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
feedback.setFilter(new ComponentFeedbackMessageFilter(table) {
private static final long serialVersionUID = 1L;
@Override
public boolean accept(FeedbackMessage message) {
return true;
}
});
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
AjaxSubmitButton runButton = new AjaxSubmitButton(ID_RUN_BUTTON, createStringResource("runReportPopupContent.button.run")) {
private static final long serialVersionUID = 1L;
@Override
protected void onError(AjaxRequestTarget target) {
FeedbackAlerts feedback = (FeedbackAlerts) getForm().get(ID_POPUP_FEEDBACK);
target.add(feedback);
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
runConfirmPerformed(target);
}
};
runButton.setOutputMarkupId(true);
runButton.add(new VisibleBehaviour(() -> isRunnable));
mainForm.add(runButton);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("userBrowserDialog.button.cancelButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getPageBase().hideMainPopup(target);
}
};
cancelButton.setOutputMarkupId(true);
mainForm.add(cancelButton);
}
Aggregations