org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow Java Examples
The following examples show how to use
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.
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: BasePage.java From nextreports-server with Apache License 2.0 | 6 votes |
public BasePage(PageParameters parameters) { super(parameters); cssContainer = new WebMarkupContainer("cssPath"); cssContainer.add(new AttributeModifier("href", ThemesManager.getInstance().getThemeRelativePathCss())); add(cssContainer); headerPanel = new HeaderPanel("headerPanel"); headerPanel.setRenderBodyOnly(true); add(headerPanel); footerPanel = new FooterPanel("footerPanel"); footerPanel.setRenderBodyOnly(true); add(footerPanel); add(new AjaxBusyIndicator()); dialog = new ModalWindow("dialog"); add(dialog); }
Example #3
Source File: ModalGeoPickerPage.java From ontopia with Apache License 2.0 | 6 votes |
public ModalGeoPickerPage(ModalWindow dialog, Topic thetopic) { super(dialog.getContentId()); this.dialog = dialog; this.thetopic = new TopicModel<Topic>(thetopic); //setInitialHeight(700); final WebMarkupContainer popupContent = new WebMarkupContainer("popupContent"); popupContent.setOutputMarkupId(true); add(popupContent); popupContent.add(new Label("title", new Model<String>("Pick location for '"+ thetopic.getName() + "'"))); behave = new ReceiveRequest(this); this.add(behave); // using a label to provide the callback URI to the JavaScript code // in the page. unfortunately, we don't know the URI here, so we set // things up, then insert it later. ajaxurlmodel = new Model<String>("// and the url is ..."); ajaxurllabel = new Label("ajaxurl", ajaxurlmodel); ajaxurllabel.setEscapeModelStrings(false); popupContent.add(ajaxurllabel); }
Example #4
Source File: AnalysisPanel.java From nextreports-server with Apache License 2.0 | 6 votes |
private AjaxLink<Analysis> getPaginateLink() { return new ToolbarLink<Analysis>("paginate", "PaginatePanel.title", 200) { @Override protected FormContentPanel<Analysis> createPanel() { return new PaginatePanel(AnalysisPanel.this.getModel()) { private static final long serialVersionUID = 1L; @Override public void onOk(AjaxRequestTarget target) { ModalWindow.closeCurrent(target); changeDataProvider(AnalysisPanel.this.getModel(), target); } }; } }; }
Example #5
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 #6
Source File: AddOArtifactCommand.java From Orienteer with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") @Override protected void initializeContent(ModalWindow modal) { modal.setOutputMarkupPlaceholderTag(true); modal.setTitle(new ResourceModel(MODAL_WINDOW_TITLE)); modal.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { return modalWindowPage; } }); modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget target) { target.add(table); } }); modal.setAutoSize(true); modal.setMinimalWidth(800); modal.setMinimalHeight(600); modalWindowPage.setModalWindow(modal); }
Example #7
Source File: AbstractUploadFilePanel.java From Orienteer with Apache License 2.0 | 6 votes |
public AbstractUploadFilePanel(String id, final ModalWindow modal,final AbstractModalWindowCommand<?> command) { super(id); modal.setMinimalHeight(300); modal.showUnloadConfirmation(false); Form<?> uploadForm = new Form<Object>("uploadForm"); final FileUploadField inputFile = new FileUploadField("inputFile"); uploadForm.add(inputFile); uploadForm.add(new AjaxButton("loadFile",getLoadButtonTitle(),uploadForm) { private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target) { FileUpload file = inputFile.getFileUpload(); if (file!=null){ onLoadFile(file); command.onAfterModalSubmit(); modal.close(target); } } }); add(uploadForm); }
Example #8
Source File: AddRuleDialog.java From Orienteer with Apache License 2.0 | 5 votes |
public AddRuleDialog(ModalWindow modal) { super(modal); form.add(new DropDownChoice<ORule.ResourceGeneric>("resource", resourceModel, Arrays.asList(ORule.ResourceGeneric.values()), new ChoiceRenderer<ORule.ResourceGeneric>("name")) .setNullValid(true)); form.add(new TextField<String>("specific", specificModel)); addCommand(new AjaxFormCommand<Void>(newCommandId(), "command.submit") { @Override public void onSubmit(AjaxRequestTarget target) { onRuleEntered(target, resourceModel.getObject(), specificModel.getObject()); } }.setBootstrapType(BootstrapType.PRIMARY)); }
Example #9
Source File: AbstractFormModalWindowCommand.java From Orienteer with Apache License 2.0 | 5 votes |
@Override protected void onInitialize() { super.onInitialize(); modal = new ModalWindow("modal"); modal.setAutoSize(true); add(modal); initializeContent(modal); setAutoNotify(false); }
Example #10
Source File: AbstractCheckBoxEnabledModalWindowCommand.java From Orienteer with Apache License 2.0 | 5 votes |
@Override protected void onInitialize() { super.onInitialize(); modal = new ModalWindow("modal"); modal.setAutoSize(true); add(modal); initializeContent(modal); }
Example #11
Source File: ThreadDumpLink.java From JPPF with Apache License 2.0 | 5 votes |
/** * @param form . */ public ThreadDumpLink(final Form<String> form) { super(HealthConstants.THREAD_DUMP_ACTION, Model.of("Thread dump")); imageName = "thread_dump.gif"; setEnabled(false); modal = new ModalWindow("health.threaddump.dialog"); form.add(modal); }
Example #12
Source File: AbstractModalOMethod.java From Orienteer with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") @Override public Command<?> createCommand(String id) { if (displayComponent==null){ IModel<Object> model = (IModel<Object>) getContext().getDisplayObjectModel(); displayComponent = new AbstractModalWindowCommand<Object>(id, getTitleModel(),model) { private static final long serialVersionUID = 1L; @Override protected void onInitialize() { super.onInitialize(); applyVisualSettings(this); } @Override protected void initializeContent(ModalWindow modal) { modal.setTitle(getTitleModel()); modal.setContent(getModalContent(modal.getContentId(),modal,this)); } @Override public void onAfterModalSubmit() { sendActionPerformed(); } }; applyBehaviors(displayComponent); } return displayComponent; }
Example #13
Source File: SystemInfoLink.java From JPPF with Apache License 2.0 | 5 votes |
/** * @param form . */ public SystemInfoLink(final Form<String> form) { super(TopologyConstants.SYSTEM_INFO_ACTION, Model.of("System info")); imageName = "info.gif"; setEnabled(false); modal = new ModalWindow("topology.info.dialog"); form.add(modal); }
Example #14
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 #15
Source File: SelectDialogPanel.java From Orienteer with Apache License 2.0 | 5 votes |
public SelectDialogPanel(String id, final ModalWindow modal, IModel<OClass> initialClass, boolean isMultiValue) { super(id, Model.of("")); this.modal = modal; this.modal.setMinimalHeight(400); this.modal.setMinimalWidth(800); add(createSearchPanel("searchPanel", initialClass, isMultiValue)); }
Example #16
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 #17
Source File: LogDialogContent.java From inception with Apache License 2.0 | 5 votes |
public LogDialogContent(String aId, final ModalWindow aModalWindow, IModel<List<LogMessageGroup>> aModel) { super(aId, aModel); setOutputMarkupId(true); modalWindow = aModalWindow; add(createMessageSetsView(getModel())); add(new LambdaAjaxLink("close", this::actionCancel)); }
Example #18
Source File: OpenDocumentDialogPanel.java From webanno with Apache License 2.0 | 5 votes |
public OpenDocumentDialogPanel(String aId, AnnotatorState aState, ModalWindow aModalWindow, IModel<List<DecoratedObject<Project>>> aProjects, SerializableBiFunction<Project, User, List<DecoratedObject<SourceDocument>>> aDocListProvider) { super(aId); modalWindow = aModalWindow; state = aState; projects = aProjects; docListProvider = aDocListProvider; projectListChoice = createProjectListChoice(aState); userListChoice = createUserListChoice(aState); docListChoice = createDocListChoice(); Form<Void> form = new Form<>("form"); form.setOutputMarkupId(true); form.add(projectListChoice); form.add(docListChoice); form.add(userListChoice); buttonsContainer = new WebMarkupContainer("buttons"); buttonsContainer.setOutputMarkupId(true); LambdaAjaxSubmitLink openButton = new LambdaAjaxSubmitLink("openButton", OpenDocumentDialogPanel.this::actionOpenDocument); openButton.add(enabledWhen(() -> docListChoice.getModelObject() != null)); buttonsContainer.add(openButton); buttonsContainer.add( new LambdaAjaxLink("cancelButton", OpenDocumentDialogPanel.this::actionCancel)); form.add(buttonsContainer); form.setDefaultButton(openButton); add(form); }
Example #19
Source File: GuidelinesDialogContent.java From webanno with Apache License 2.0 | 5 votes |
public GuidelinesDialogContent(String aId, final ModalWindow modalWindow, final IModel<AnnotatorState> aModel) { super(aId); // Overall progress by Projects RepeatingView guidelineRepeater = new RepeatingView("guidelineRepeater"); add(guidelineRepeater); for (String guidelineFileName : projectService .listGuidelines(aModel.getObject().getProject())) { AbstractItem item = new AbstractItem(guidelineRepeater.newChildId()); guidelineRepeater.add(item); // Add a popup window link to display annotation guidelines PopupSettings popupSettings = new PopupSettings(RESIZABLE | SCROLLBARS) .setHeight(500) .setWidth(700); IResourceStream stream = new FileResourceStream(projectService .getGuideline(aModel.getObject().getProject(), guidelineFileName)); ResourceStreamResource resource = new ResourceStreamResource(stream); ResourceLink<Void> rlink = new ResourceLink<>("guideine", resource); rlink.setPopupSettings(popupSettings); item.add(new Label("guidelineName", guidelineFileName)); item.add(rlink); } add(new LambdaAjaxLink("cancel", (target) -> modalWindow.close(target))); }
Example #20
Source File: AbstractModalWindowCommand.java From Orienteer with Apache License 2.0 | 5 votes |
@Override protected void onInitialize() { super.onInitialize(); modal = new ModalWindow("modal"); modal.setAutoSize(true); add(modal); initializeContent(modal); setAutoNotify(false); }
Example #21
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 #22
Source File: AbstractDialog.java From Orienteer with Apache License 2.0 | 5 votes |
public AbstractDialog(String id, IModel<T> model, final ModalWindow modal) { super(id, model); this.modal = modal; if(modal!=null) { modal.setMinimalWidth(400); } }
Example #23
Source File: StudentAssignmentStatisticsPanel.java From sakai with Educational Community License v2.0 | 5 votes |
public StudentAssignmentStatisticsPanel(final String id, final IModel<Assignment> model, final ModalWindow window, String studentGrade) { super(id, model); this.window = window; this.studentGrade = studentGrade; }
Example #24
Source File: OArchitectEditorWidget.java From Orienteer with Apache License 2.0 | 5 votes |
private ModalWindow createModalWindow(String id) { ModalWindow modal = new ModalWindow(id); modal.setOutputMarkupId(true); modal.setInitialWidth(MODAL_WINDOW_WIDTH); modal.setInitialHeight(MODAL_WINDOW_HEIGHT); modal.setMinimalWidth(MODAL_WINDOW_WIDTH); modal.setMinimalHeight(MODAL_WINDOW_HEIGHT); modal.setWindowClosedCallback(t -> t.appendJavaScript(OArchitectJsUtils.switchPageScroll(false))); return modal; }
Example #25
Source File: AnalysisPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
private AjaxLink<Analysis> getFilterLink() { return new ToolbarLink<Analysis>("filterRows", "FilterPanel.title", 400) { @Override protected FormContentPanel<Analysis> createPanel() { return new FilterPanel(AnalysisPanel.this.getModel()) { private static final long serialVersionUID = 1L; @Override public void onOk(AjaxRequestTarget target) { if (isEdit()) { error(getString("editMode")); target.add(getFeedbackPanel()); return; } ModalWindow.closeCurrent(target); Analysis analysis = AnalysisPanel.this.getModel().getObject(); analysis.setFilters(getFilters()); dataProvider.reset(); target.add(AnalysisPanel.this); } }; } }; }
Example #26
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 #27
Source File: ConfirmationDialogModal.java From pm-wicket-utils with GNU Lesser General Public License v3.0 | 5 votes |
@SuppressWarnings("serial") public ConfirmationDialogModal(String id) { super(id); setResizable(false); setHeightUnit("px"); setWidthUnit("px"); setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { confirmed(target, Result.CANCELED); } }); }
Example #28
Source File: StudentAssignmentStatisticsPanel.java From sakai with Educational Community License v2.0 | 5 votes |
public StudentAssignmentStatisticsPanel(final String id, final IModel<Assignment> model, final ModalWindow window, String studentGrade) { super(id, model); this.window = window; this.studentGrade = studentGrade; }
Example #29
Source File: GbModalWindow.java From sakai with Educational Community License v2.0 | 4 votes |
@Override public ModalWindow setContent(final Component component) { component.setOutputMarkupId(true); return super.setContent(component); }
Example #30
Source File: BasePage.java From nextreports-server with Apache License 2.0 | 4 votes |
public ModalWindow getDialog() { return dialog; }