org.apache.wicket.markup.html.WebMarkupContainer Java Examples
The following examples show how to use
org.apache.wicket.markup.html.WebMarkupContainer.
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: SakaiInfinitePagingDataTableNavigationToolbar.java From sakai with Educational Community License v2.0 | 7 votes |
@Override public void onInitialize() { super.onInitialize(); WebMarkupContainer span = new WebMarkupContainer("span"); add(span); span.add(AttributeModifier.replace("colspan", new AbstractReadOnlyModel<String>() { @Override public String getObject() { return String.valueOf(table.getColumns().size()); } })); final Form<?> form = new Form<>("navForm"); form.add(newPagingNavigator("navigator", table, form).setRenderBodyOnly(true)); form.add(newNavigatorLabel("navigatorLabel", table).setRenderBodyOnly(true)); span.add(form); }
Example #2
Source File: JiraIssuesPanel.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
public JiraIssuesPanel(final String id, final IModel<String> model) { super(id); setRenderBodyOnly(true); if (WicketUtils.isJIRAConfigured() == false) { final WebMarkupContainer dummy = new WebMarkupContainer("issues"); setVisible(false); dummy.add(new ExternalLink("jiraLink", "dummy")); add(dummy); return; } final RepeatingView jiraIssuesRepeater = new RepeatingView("issues"); add(jiraIssuesRepeater); final String[] jiraIssues = JiraUtils.checkForJiraIssues(model.getObject()); if (jiraIssues == null) { jiraIssuesRepeater.setVisible(false); } else { for (final String issue : jiraIssues) { final WebMarkupContainer item = new WebMarkupContainer(jiraIssuesRepeater.newChildId()); item.setRenderBodyOnly(true); jiraIssuesRepeater.add(item); item.add(new ExternalLink("jiraLink", JiraUtils.buildJiraIssueBrowseLinkUrl(issue), issue)); } } }
Example #3
Source File: ContactEntryPanel.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
/** * @see org.apache.wicket.Component#onInitialize() */ @Override protected void onInitialize() { super.onInitialize(); newEntryValue = new ContactEntryDO().setStreet(DEFAULT_ENTRY_VALUE).setCity(DEFAULT_CITY_VALUE) // .setZipCode(DEFAULT_ZIPCODE_VALUE).setCountry(DEFAULT_COUNTRY_VALUE).setState(DEFAULT_STATE_VALUE).setContactType(ContactType.PRIVATE) // .setContact(model.getObject()); formChoiceRenderer = new LabelValueChoiceRenderer<ContactType>(this, ContactType.values()); mainContainer = new WebMarkupContainer("main"); add(mainContainer.setOutputMarkupId(true)); entrysRepeater = new RepeatingView("liRepeater"); mainContainer.add(entrysRepeater); rebuildEntrys(); addNewEntryContainer = new WebMarkupContainer("liAddNewEntry"); mainContainer.add(addNewEntryContainer); init(addNewEntryContainer); entrysRepeater.setVisible(true); }
Example #4
Source File: MessagesContactsPanel.java From openmeetings with Apache License 2.0 | 6 votes |
private void selectFolder(WebMarkupContainer folder, Long id, AjaxRequestTarget target) { selectedFolder = folder; selectedFolderModel.setObject(id); setDefaultFolderClass(); selectFolder(folder); emptySelection(target); selectDropDown.setModelObject(SELECT_CHOOSE); moveDropDown.setModelObject(NOT_MOVE_FOLDER); deleteBtn.add(AttributeModifier.replace("value", Application.getString(TRASH_FOLDER_ID.equals(id) ? "1256" : "80"))); readBtn.setEnabled(false); unreadBtn.setEnabled(false); if (target != null) { updateTable(target); target.add(folders, unread, selectDropDown, moveDropDown); target.add(dataContainer.getContainer(), dataContainer.getNavigator()); target.add(dataContainer.getLinks()); } }
Example #5
Source File: ModalPanel.java From onedev with MIT License | 6 votes |
@Override protected void onBeforeRender() { if (!inited) { WebMarkupContainer dialog = new WebMarkupContainer("dialog"); add(dialog); dialog.add(newContent(CONTENT_ID)); String cssClass = getCssClass(); if (cssClass != null) dialog.add(AttributeAppender.append("class", cssClass)); inited = true; } super.onBeforeRender(); }
Example #6
Source File: CSSFeedbackPanel.java From sakai with Educational Community License v2.0 | 6 votes |
public CSSFeedbackPanel(String id) { super(id); WebMarkupContainer feedbackul = (WebMarkupContainer) get("feedbackul"); if(feedbackul != null){ feedbackul.add(new AttributeModifier("class", true, new Model() { private static final long serialVersionUID = 1L; public Serializable getObject() { if(anyErrorMessage()){ return "alertMessage"; }else if(anyMessage()){ return "success"; }else{ return ""; } } })); feedbackul.add(new AttributeModifier("style", true, new Model("list-style-type:none"))); } }
Example #7
Source File: ImportExportPage.java From sakai with Educational Community License v2.0 | 6 votes |
public ImportExportPage() { defaultRoleChecksForInstructorOnlyPage(); disableLink(this.importExportPageLink); container = new WebMarkupContainer("gradebookImportExportContainer"); container.setOutputMarkupId(true); container.add(new GradeImportUploadStep("wizard")); add(container); // hide BasePage's feedback panel and use the error/nonError filtered feedback panels feedbackPanel.setVisibilityAllowed(false); add(nonErrorFeedbackPanel); add(errorFeedbackPanel); }
Example #8
Source File: BasePage.java From sakai with Educational Community License v2.0 | 6 votes |
/** * Helper to build a notification flag with a Bootstrap popover */ public WebMarkupContainer buildFlagWithPopover(final String componentId, final String message) { final WebMarkupContainer flagWithPopover = new WebMarkupContainer(componentId); flagWithPopover.add(new AttributeModifier("title", message)); flagWithPopover.add(new AttributeModifier("aria-label", message)); flagWithPopover.add(new AttributeModifier("data-toggle", "popover")); flagWithPopover.add(new AttributeModifier("data-trigger", "manual")); flagWithPopover.add(new AttributeModifier("data-placement", "bottom")); flagWithPopover.add(new AttributeModifier("data-html", "true")); flagWithPopover.add(new AttributeModifier("data-container", "#gradebookGrades")); flagWithPopover.add(new AttributeModifier("data-template", "<div class=\"gb-popover popover\" role=\"tooltip\"><div class=\"arrow\"></div><div class=\"popover-content\"></div></div>")); flagWithPopover.add(new AttributeModifier("data-content", generatePopoverContent(message))); flagWithPopover.add(new AttributeModifier("tabindex", "0")); return flagWithPopover; }
Example #9
Source File: ProductItemPanel.java From AppStash with Apache License 2.0 | 6 votes |
private Component productDetailImageLink() { Link<Void> detailPageLink = new Link<Void>("productDetailLink") { @Override public void onClick() { PageParameters pageParameters = new PageParameters(); pageParameters.set("urlname", productUrlModel.getObject()); setResponsePage(new ProductDetailPage(pageParameters)); } }; WebMarkupContainer image = new WebMarkupContainer("image"); image.add(new AttributeModifier("src", new ImageLinkModel(productInfoModel, this))); image.add(new AttributeModifier("title", new PropertyModel<String>(productInfoModel, "description"))); image.add(new AttributeModifier("alt", new PropertyModel<String>(productInfoModel, "name"))); image.setOutputMarkupId(true); detailPageLink.add(image); return detailPageLink; }
Example #10
Source File: ProductItemPanel.java From the-app with Apache License 2.0 | 6 votes |
private Component productDetailImageLink() { Link<Void> detailPageLink = new Link<Void>("productDetailLink") { @Override public void onClick() { PageParameters pageParameters = new PageParameters(); pageParameters.set("urlname", productUrlModel.getObject()); setResponsePage(new ProductDetailPage(pageParameters)); } }; WebMarkupContainer image = new WebMarkupContainer("image"); image.add(new AttributeModifier("src", new ImageLinkModel(productInfoModel, this))); image.add(new AttributeModifier("title", new PropertyModel<String>(productInfoModel, "description"))); image.add(new AttributeModifier("alt", new PropertyModel<String>(productInfoModel, "name"))); image.setOutputMarkupId(true); detailPageLink.add(image); return detailPageLink; }
Example #11
Source File: GeneralErrorPage.java From onedev with MIT License | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); WebMarkupContainer container = new WebMarkupContainer("error"); container.setOutputMarkupId(true); add(container); container.add(new Label("title", StringUtils.abbreviate(title, MAX_TITLE_LEN))); container.add(new ViewStateAwarePageLink<Void>("home", ProjectListPage.class)); container.add(new AjaxLink<Void>("showDetail") { @Override public void onClick(AjaxRequestTarget target) { Fragment fragment = new Fragment("detail", "detailFrag", GeneralErrorPage.this); fragment.add(new MultilineLabel("body", detailMessage)); container.replace(fragment); target.add(container); setVisible(false); } }); container.add(new WebMarkupContainer("detail")); }
Example #12
Source File: StartWidgetView.java From openmeetings with Apache License 2.0 | 6 votes |
@Override protected void onInitialize() { add(new WebMarkupContainer("step1").add(new PublicRoomsEventBehavior())); add(new WebMarkupContainer("step2").add(new PublicRoomsEventBehavior())); add(new WebMarkupContainer("step3").add(new WebMarkupContainer("avTest").add(AttributeModifier.append("href" , RequestCycle.get().urlFor(HashPage.class, new PageParameters().add(APP, APP_TYPE_SETTINGS)).toString())))); add(new WebMarkupContainer("step4").add(new PublicRoomsEventBehavior())); add(new Label("123msg", Application.getString("widget.start.desc")) //Application here is used to substitute {0} .setEscapeModelStrings(false)); add(new BootstrapButton("start", new ResourceModel("788"), Buttons.Type.Outline_Primary).add(new PublicRoomsEventBehavior())); add(new BootstrapButton("calendar", new ResourceModel("291"), Buttons.Type.Outline_Primary).add(new AjaxEventBehavior(EVT_CLICK) { private static final long serialVersionUID = 1L; @Override protected void onEvent(AjaxRequestTarget target) { ((MainPage)getPage()).updateContents(CALENDAR, target); } })); super.onInitialize(); }
Example #13
Source File: LogsITCase.java From syncope with Apache License 2.0 | 6 votes |
@Test public void updateConsoleLogs() { TESTER.clickLink("body:content:tabbedPanel:tabs-container:tabs:1:link"); TESTER.assertComponent(CONTAINER_PATH, WebMarkupContainer.class); Component result = searchLog(KEY, CONTAINER_PATH, "org.apache.wicket"); assertNotNull(result); TESTER.getRequest().setMethod(Form.METHOD_GET); TESTER.getRequest().addParameter( result.getPageRelativePath() + ":fields:1:field:dropDownChoiceField", "6"); TESTER.assertComponent( result.getPageRelativePath() + ":fields:1:field:dropDownChoiceField", DropDownChoice.class); TESTER.executeAjaxEvent( result.getPageRelativePath() + ":fields:1:field:dropDownChoiceField", Constants.ON_CHANGE); assertSuccessMessage(); }
Example #14
Source File: DefaultTreeTablePanel.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
private WebMarkupContainer createTreeRow(final T node) { final WebMarkupContainer row = new WebMarkupContainer(rowRepeater.newChildId(), new Model<TreeTableNode>(node)); row.setOutputMarkupId(true); row.add(AttributeModifier.replace("class", "even")); if (clickRows == true) { WicketUtils.addRowClick(row); } rowRepeater.add(row); final RepeatingView colBodyRepeater = new RepeatingView("cols"); row.add(colBodyRepeater); final String cssStyle = getCssStyle(node); // Column: browse icons final TreeIconsActionPanel< ? extends TreeTableNode> treeIconsActionPanel = createTreeIconsActionPanel(node); addColumn(row, treeIconsActionPanel, cssStyle); treeIconsActionPanel.init(this, node); treeIconsActionPanel.add(AttributeModifier.append("style", new Model<String>("white-space: nowrap;"))); addColumns(colBodyRepeater, cssStyle, node); return row; }
Example #15
Source File: MyNamePronunciationDisplay.java From sakai with Educational Community License v2.0 | 6 votes |
private void addNameRecord() { WebMarkupContainer nameRecordingContainer = new WebMarkupContainer("nameRecordingContainer"); nameRecordingContainer.add(new Label("nameRecordingLabel", new ResourceModel("profile.name.recording"))); WebMarkupContainer audioPlayer = new WebMarkupContainer("audioPlayer"); final String slash = Entity.SEPARATOR; final StringBuilder path = new StringBuilder(); path.append(slash); path.append("direct"); path.append(slash); path.append("profile"); path.append(slash); path.append(userProfile.getUserUuid()); path.append(slash); path.append("pronunciation"); path.append("?v="); path.append(RandomStringUtils.random(8, true, true)); audioPlayer.add(new AttributeModifier("src", path.toString())); nameRecordingContainer.add(audioPlayer); add(nameRecordingContainer); if (profileLogic.getUserNamePronunciation(userProfile.getUserUuid()) == null) nameRecordingContainer.setVisible(false); else visibleFieldCount++; }
Example #16
Source File: SideBar.java From onedev with MIT License | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); add(newHead("head")); add(new Tabbable("tabs", newTabs())); add(new WebMarkupContainer("miniToggle").setVisible(miniCookieKey!=null)); add(AttributeAppender.append("class", "sidebar")); if (miniCookieKey != null) { add(AttributeAppender.append("class", "minimizable")); WebRequest request = (WebRequest) RequestCycle.get().getRequest(); Cookie miniCookie = request.getCookie(miniCookieKey); if (miniCookie != null) { if ("yes".equals(miniCookie.getValue())) add(AttributeAppender.append("class", "minimized")); } else if (WicketUtils.isDevice()) { add(AttributeAppender.append("class", "minimized")); } } }
Example #17
Source File: Domains.java From syncope with Apache License 2.0 | 5 votes |
public Domains(final PageParameters parameters) { super(parameters); body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class)); WebMarkupContainer content = new WebMarkupContainer("content"); content.setOutputMarkupId(true); content.setMarkupId("domains"); content.add(new DomainDirectoryPanel("domainPanel", getPageReference())); body.add(content); }
Example #18
Source File: DrawerManager.java From pm-wicket-utils with GNU Lesser General Public License v3.0 | 5 votes |
public ListItem(String id, final AbstractDrawer drawer, DrawerManager drawerManager, String css) { super(id); setOutputMarkupId(true); manager = drawerManager; item = new WebMarkupContainer("item"); if (null != css) { item.add(new AttributeAppender("class", Model.of(css), " ")); } add(item); this.drawer = drawer; item.add(drawer); add(new EmptyPanel("next").setOutputMarkupId(true)); item.add(new AjaxEventBehavior("hide-modal") { private static final long serialVersionUID = -6423164614673441582L; @Override protected void onEvent(AjaxRequestTarget target) { manager.eventPop(ListItem.this.drawer, target); } @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setPreventDefault(true); } }); }
Example #19
Source File: FormPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public FormPanel(String id, FormContentPanel<T> contentPanel, boolean useByDialog) { super(id); setOutputMarkupId(true); this.contentPanel = contentPanel; WebMarkupContainer container = new WebMarkupContainer("form-parent"); add(container); feedbackPanel = new FeedbackPanel("feedback"); feedbackPanel.setOutputMarkupId(true); container.add(feedbackPanel); form = new Form<T>("form", contentPanel.getModel()); form.add(contentPanel); container.add(form); cancelButton = createCancelButton(); form.add(cancelButton); applyButton = createApplyButton(); applyButton.setVisible(false); form.add(applyButton); okButton = createOkButton(); form.add(okButton); if (useByDialog) { container.add(AttributeModifier.append("class", "form-container form-container-dialog")); } }
Example #20
Source File: ActionTabLink.java From onedev with MIT License | 5 votes |
protected WebMarkupContainer newLink(String id, final ActionTab tab) { return new Link<Void>(id) { @Override public void onClick() { tab.selectTab(this); } }; }
Example #21
Source File: DivTextPanel.java From projectforge-webapp with GNU General Public License v3.0 | 5 votes |
public DivTextPanel(final String id, final IModel<String> text, final Behavior... behaviors) { super(id); add(div = new WebMarkupContainer("div")); label = new Label(WICKET_ID, text); init(behaviors); }
Example #22
Source File: WicketUtils.java From onedev with MIT License | 5 votes |
public static int getChildIndex(WebMarkupContainer parent, Component child) { int index = 0; for (Component each: parent) { if (each == child) return index; index++; } return -1; }
Example #23
Source File: WicketUtilsTest.java From projectforge-webapp with GNU General Public License v3.0 | 5 votes |
@Test public void isParent() { new WicketTester(new WebApplication() { @Override public Class< ? extends Page> getHomePage() { return null; } }); final WebMarkupContainer c1 = new WebMarkupContainer("c1"); final WebMarkupContainer c2 = new WebMarkupContainer("c2"); c1.add(c2); final WebMarkupContainer c3 = new WebMarkupContainer("c3"); c2.add(c3); final Label l1 = new Label("l1", "l1"); c3.add(l1); final Label l2 = new Label("l2", "l2"); c1.add(l2); final Label l3 = new Label("l3", "l3"); assertFalse(WicketUtils.isParent(c1, c1)); assertTrue(WicketUtils.isParent(c1, c2)); assertFalse(WicketUtils.isParent(c2, c1)); assertTrue(WicketUtils.isParent(c1, c3)); assertTrue(WicketUtils.isParent(c1, l1)); assertTrue(WicketUtils.isParent(c2, l1)); assertTrue(WicketUtils.isParent(c3, l1)); assertTrue(WicketUtils.isParent(c1, l2)); assertFalse(WicketUtils.isParent(c2, l2)); assertFalse(WicketUtils.isParent(c1, l3)); }
Example #24
Source File: DestinationsPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
private void init() { container = new WebMarkupContainer("container"); container.setOutputMarkupId(true); add(container); addTable(); addDestinationType(); container.add(new EmptyPanel("destinationPanel")); }
Example #25
Source File: SourceEditPanel.java From onedev with MIT License | 5 votes |
@Override protected WebMarkupContainer newEditOptions(String componentId) { sourceFormat = new SourceFormatPanel(componentId, new OptionChangeCallback() { @Override public void onOptioneChange(AjaxRequestTarget target) { String script = String.format("onedev.server.sourceEdit.onIndentTypeChange('%s', '%s');", getEditor().getMarkupId(), sourceFormat.getIndentType()); target.appendJavaScript(script); } }, new OptionChangeCallback() { @Override public void onOptioneChange(AjaxRequestTarget target) { String script = String.format("onedev.server.sourceEdit.onTabSizeChange('%s', %s);", getEditor().getMarkupId(), sourceFormat.getTabSize()); target.appendJavaScript(script); } }, new OptionChangeCallback() { @Override public void onOptioneChange(AjaxRequestTarget target) { String script = String.format("onedev.server.sourceEdit.onLineWrapModeChange('%s', '%s');", getEditor().getMarkupId(), sourceFormat.getLineWrapMode()); target.appendJavaScript(script); } }); return sourceFormat; }
Example #26
Source File: FieldListEditPanel.java From onedev with MIT License | 5 votes |
@SuppressWarnings("unchecked") @Override protected List<Serializable> convertInputToValue() throws ConversionException { List<Serializable> value = new ArrayList<>(); for (Component container: (WebMarkupContainer)get("fields")) { Label label = (Label) container.get("name"); FieldSupply field = new FieldSupply(); field.setName((String) label.getDefaultModelObject()); FieldSpec fieldSpec = Preconditions.checkNotNull(getFieldSpecs().get(field.getName())); field.setSecret(fieldSpec instanceof SecretField); if (container.get("value") instanceof PropertyEditor) { PropertyEditor<Serializable> propertyEditor = (PropertyEditor<Serializable>) container.get("value"); Class<?> valueProviderClass = (Class<?>) container.getDefaultModelObject(); if (valueProviderClass == SpecifiedValue.class) { SpecifiedValue specifiedValue = new SpecifiedValue(); Object propertyValue = propertyEditor.getConvertedInput(); specifiedValue.setValue(fieldSpec.convertToStrings(propertyValue)); field.setValueProvider(specifiedValue); } else { ScriptingValue scriptingValue = new ScriptingValue(); scriptingValue.setScriptName((String) propertyEditor.getConvertedInput()); field.setValueProvider(scriptingValue); } } else { field.setValueProvider(new Ignore()); } value.add(field); } return value; }
Example #27
Source File: SakaiNavigationToolBar.java From sakai with Educational Community License v2.0 | 5 votes |
/** * Constructor * * @param table * data table this toolbar will be attached to */ public SakaiNavigationToolBar(final DataTable table) { super(table); WebMarkupContainer span = (WebMarkupContainer) get("span"); span.add(new AttributeModifier("colspan", new Model(String.valueOf(table.getColumns().size())))); span.get("navigator").replaceWith(newPagingNavigator("navigator", table)); span.get("navigatorLabel").replaceWith(newNavigatorLabel("navigatorLabel", table)); }
Example #28
Source File: SCIMConfPage.java From syncope with Apache License 2.0 | 5 votes |
private WebMarkupContainer updateSCIMGeneralConfContent(final SCIMConf scimConf) { if (scimConf == null) { return content; } content.addOrReplace(new SCIMConfPanel("body", scimConf, SCIMConfPage.this.getPageReference()) { private static final long serialVersionUID = 8221398624379357183L; @Override protected void setWindowClosedReloadCallback(final BaseModal<?> modal) { modal.setWindowClosedCallback(target -> { if (modal.getContent() instanceof ResultPage) { Serializable result = ResultPage.class.cast(modal.getContent()).getResult(); try { SCIMConfRestClient.set(MAPPER.readValue(result.toString(), SCIMConf.class)); SyncopeConsoleSession.get().success(getString(Constants.OPERATION_SUCCEEDED)); modal.show(false); target.add(content); } catch (Exception e) { LOG.error("While setting SCIM configuration", e); SyncopeConsoleSession.get().onException(e); } ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } }); } }); return content; }
Example #29
Source File: IssueOperationsPanel.java From onedev with MIT License | 5 votes |
private void newEmptyActionOptions(@Nullable AjaxRequestTarget target) { WebMarkupContainer actionOptions = new WebMarkupContainer(ACTION_OPTIONS_ID); actionOptions.setOutputMarkupPlaceholderTag(true); actionOptions.setVisible(false); if (target != null) { replace(actionOptions); target.add(actionOptions); } else { addOrReplace(actionOptions); } }
Example #30
Source File: IssueActivitiesPanel.java From onedev with MIT License | 5 votes |
private Component newActivityRow(String id, IssueActivity activity) { WebMarkupContainer row = new WebMarkupContainer(id, Model.of(activity)); row.setOutputMarkupId(true); String anchor = activity.getAnchor(); if (anchor != null) row.setMarkupId(anchor); if (activity.getUser() != null) { row.add(new UserIdentPanel("avatar", activity.getUser(), Mode.AVATAR)); row.add(AttributeAppender.append("class", "with-avatar")); } else { row.add(new WebMarkupContainer("avatar").setVisible(false)); } row.add(activity.render("content", new DeleteCallback() { @Override public void onDelete(AjaxRequestTarget target) { row.remove(); target.appendJavaScript(String.format("$('#%s').remove();", row.getMarkupId())); } })); row.add(AttributeAppender.append("class", activity.getClass().getSimpleName())); return row; }