Java Code Examples for org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#setContent()
The following examples show how to use
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#setContent() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UnhideWidgetCommand.java From Orienteer with Apache License 2.0 | 7 votes |
@Override protected void initializeContent(final ModalWindow modal) { modal.setTitle(new ResourceModel("command.unhide")); modal.setContent(new UnhideWidgetDialog<T>(modal.getContentId()) { private static final long serialVersionUID = 1L; @Override protected void onSelectWidget(AbstractWidget<T> widget, Optional<AjaxRequestTarget> targetOptional) { targetOptional.ifPresent(modal::close); widget.setHidden(false); DashboardPanel<T> dashboard = getDashboardPanel(); targetOptional.ifPresent(target -> dashboard.getDashboardSupport().ajaxAddWidget(widget, target)); } }); modal.setAutoSize(true); modal.setMinimalWidth(300); }
Example 2
Source File: AddTabCommand.java From Orienteer with Apache License 2.0 | 6 votes |
@Override protected void initializeContent(final ModalWindow modal) { modal.setTitle(new ResourceModel("command.add.tab")); modal.setContent(new AddTabDialog<T>(modal.getContentId()) { private static final long serialVersionUID = 1L; @Override protected void onCreateTab(String name, Optional<AjaxRequestTarget> targetOptional) { targetOptional.ifPresent(modal::close); if(Strings.isEmpty(name)) { name = getLocalizer().getString("command.add.tab.modal.defaultname", null); } AbstractWidgetPage<T> page = (AbstractWidgetPage<T>)findPage(); page.getCurrentDashboard().setModeObject(DisplayMode.VIEW); //Close action on current tab page.addTab(name); page.selectTab(name, targetOptional); send(page, Broadcast.DEPTH, new SwitchDashboardTabEvent(targetOptional)); page.getCurrentDashboard().setModeObject(DisplayMode.EDIT); //Open action on new tab targetOptional.ifPresent(target -> target.add(page.getCurrentDashboardComponent())); } }); modal.setAutoSize(true); modal.setMinimalWidth(300); }
Example 3
Source File: AddWidgetCommand.java From Orienteer with Apache License 2.0 | 6 votes |
@Override protected void initializeContent(final ModalWindow modal) { modal.setTitle(new ResourceModel("command.add.widget")); modal.setContent(new AddWidgetDialog<T>(modal.getContentId()) { private static final long serialVersionUID = 1L; @Override protected void onSelectWidgetType(IWidgetType<T> type, Optional<AjaxRequestTarget> targetOptional) { targetOptional.ifPresent(modal::close); DashboardPanel<T> dashboard = getDashboardPanel(); AbstractWidget<T> widget = dashboard.addWidget(type); targetOptional.ifPresent(target-> dashboard.getDashboardSupport().ajaxAddWidget(widget, target)); } }); modal.setAutoSize(true); modal.setMinimalWidth(300); }
Example 4
Source File: WidgetPopupMenuModel.java From nextreports-server with Apache License 2.0 | 6 votes |
private AjaxLink createEmbedCodeLink(final IModel<Widget> model) { AjaxLink<Void> link = new AjaxLink<Void>(MenuPanel.LINK_ID) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { final Widget widget = model.getObject(); ModalWindow dialog = findParent(BasePage.class).getDialog(); dialog.setTitle(new StringResourceModel("WidgetPopupMenu.embeddedCode", null).getString()); dialog.setInitialWidth(550); dialog.setUseInitialHeight(false); dialog.setContent(new WidgetEmbedCodePanel(dialog.getContentId(), widget.getId())); dialog.show(target); } }; return link; }
Example 5
Source File: LinkToSocialNetwork.java From Orienteer with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public Command<?> createCommand(String id) { IModel<ODocument> model = (IModel<ODocument>) getContext().getDisplayObjectModel(); IModel<OrienteerUser> userModel = new ODocumentWrapperModel<>(new OrienteerUser(model.getObject())); return new AbstractModalWindowCommand<OrienteerUser>(id, getTitleModel(), userModel) { @Override protected void onInitialize() { super.onInitialize(); applyVisualSettings(this); applyBehaviors(this); } @Override protected void onConfigure() { super.onConfigure(); OrienteerUser user = getModelObject(); setVisible(user.getSocialNetworks().size() < OAuth2Repository.getOAuth2Services().size()); } @Override protected void initializeContent(ModalWindow modal) { modal.setTitle(getTitleModel()); modal.setMinimalWidth(520); modal.setMinimalHeight(250); modal.setContent(new LinkToSocialNetworkPanel(modal.getContentId(), getModel())); } @Override public void onAfterModalSubmit() { sendActionPerformed(); } }; }
Example 6
Source File: ImportOSchemaCommand.java From Orienteer with Apache License 2.0 | 5 votes |
@Override protected void initializeContent(ModalWindow modal) { modal.setTitle(new ResourceModel("command.import.modal.title")); modal.setContent(new ImportDialogPanel(modal.getContentId(), modal) { @Override public void onImportFinished(AjaxRequestTarget target) { sendActionPerformed(); } }); }
Example 7
Source File: CreateODocumentCommand.java From Orienteer with Apache License 2.0 | 5 votes |
@Override protected void initializeContent(ModalWindow modal) { modal.setTitle(new ResourceModel("dialog.select.class")); modal.setAutoSize(true); modal.setMinimalWidth(300); modal.setContent(new SelectSubOClassDialogPage(modal, classModel) { @Override protected void onSelect(AjaxRequestTarget target, OClass selectedOClass) { redirectToCreateODocumentPage(target, selectedOClass); } }); }
Example 8
Source File: ViewUMLCommand.java From Orienteer with Apache License 2.0 | 5 votes |
@Override protected void initializeContent(ModalWindow modal) { modal.setTitle(new ResourceModel("command.viewUml.modal.title")); modal.setContent(new ViewUMLDialogPanel(modal.getContentId(), new PropertyModel<String>(this, "uml"))); modal.setAutoSize(true); modal.setMinimalWidth(600); modal.setMinimalHeight(400); }
Example 9
Source File: AnalysisPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
@Override public void onClick(AjaxRequestTarget target) { ModalWindow dialog = findParent(BasePage.class).getDialog(); dialog.setTitle(getString(title)); dialog.setInitialWidth(dialogWidth); dialog.setUseInitialHeight(false); FormContentPanel<Analysis> panel = createPanel(); FormPanel<Analysis> formPanel = new FormPanel<Analysis>(dialog.getContentId(), panel, true); formPanel.add(AttributeModifier.append("class", "analysisForm")); dialog.setContent(formPanel); dialog.show(target); }
Example 10
Source File: EmbedCodeActionLink.java From nextreports-server with Apache License 2.0 | 5 votes |
public void executeAction(AjaxRequestTarget target) { Entity entity = getActionContext().getEntity(); ModalWindow dialog = findParent(BasePage.class).getDialog(); dialog.setTitle(new StringResourceModel("WidgetPopupMenu.embeddedCode", null).getString()); dialog.setInitialWidth(550); dialog.setUseInitialHeight(false); dialog.setContent(new DashboardEmbedCodePanel(dialog.getContentId(), entity.getId())); dialog.show(target); }
Example 11
Source File: OpenModalWindowEvent.java From Orienteer with Apache License 2.0 | 4 votes |
@Override public void execute(ModalWindow modalWindow) { modalWindow.setContent(contentGenerator.apply(modalWindow.getContentId())); modalWindow.setTitle(titleModel); modalWindow.show(target); }
Example 12
Source File: InnerReportsPanel.java From nextreports-server with Apache License 2.0 | 4 votes |
private void click(InnerReport ir, AjaxRequestTarget target) { final ModalWindow dialog = findParent(BasePage.class).getDialog(); dialog.setTitle(getString("Section.Audit.innerReports." + ir.toString())); int width = 500; FormContentPanel panel; if (ir.toString().equals(InnerReport.RIGHTS.toString())) { panel = new RightsPanel() { @Override public void onOk(AjaxRequestTarget target) { TableData data = getResults(getAuditRights()); displayResults(dialog, InnerReport.RIGHTS.toString(), data, getLinkColumns(), getTitle(), target); } }; } else if (ir.toString().equals(InnerReport.RUN.toString())) { width = 350; panel = new RunPanel() { @Override public void onOk(AjaxRequestTarget target) { TableData data = getResults(getAuditRun()); displayResults(dialog, InnerReport.RUN.toString(), data, getLinkColumns(), getTitle(), target); } }; } else if (ir.toString().equals(InnerReport.LIST.toString())) { width = 250; panel = new ListPanel() { @Override public void onOk(AjaxRequestTarget target) { TableData data = getResults(getAuditList()); displayResults(dialog, InnerReport.LIST.toString(), data, null, getTitle(), target); } }; } else { panel = new FormContentPanel(FormPanel.CONTENT_ID); } dialog.setInitialWidth(width); dialog.setUseInitialHeight(false); dialog.setContent(new FormPanel(dialog.getContentId(), panel, true)); dialog.show(target); }