/** * @see org.projectforge.web.wicket.AbstractListForm#init() */ @Override protected void init() { super.init(); final Button skillTreeButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("treeView")) { private static final long serialVersionUID = -8763718088111525575L; @Override public void onSubmit() { parentPage.onTreeViewSubmit(); } }; actionButtons.add(2, new SingleButtonPanel(actionButtons.newChildId(), skillTreeButton, "Tree View", SingleButtonPanel.NORMAL)); }
public MenuBarPanel(final String id) { super(id); contentMenu = new MyComponentsRepeater<ContentMenuEntryPanel>("repeater"); add(contentMenu.getRepeatingView()); }
@Override public void onBeforeRender() { super.onBeforeRender(); actionButtons.render(); }
public MenuBarPanel addMenuEntry(final ContentMenuEntryPanel menuEntry) { if (this.extendedMenuEntry != null) { // Don't append entry after extended menu (should be the last entry). final int size = contentMenu.size(); contentMenu.add(size - 1, menuEntry); } else { contentMenu.add(menuEntry); } return this; }
/** * Add all the components to the repeating view (if not already added). Should be used e. g. in onBeforeRender(). */ public void render() { if (rendered == false) { if (hasEntries() == false) { setVisibility(false); } else { setVisibility(true); if (components.size() > 0) { for (final T component : this.components) { this.repeatingView.add(component); } } } rendered = true; } } }
actionButtons = new MyComponentsRepeater<SingleButtonPanel>("buttons"); add(actionButtons.getRepeatingView()); final SingleButtonPanel cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"), SingleButtonPanel.CANCEL); actionButtons.add(cancelButtonPanel); final SingleButtonPanel updateAllButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), updateAllButton, getString("updateAll"), SingleButtonPanel.DEFAULT_SUBMIT); updateAllButton.add(AttributeModifier.replace("onclick", "return showUpdateQuestionDialog()")); actionButtons.add(updateAllButtonPanel); setDefaultButton(updateAllButton);
public ContentMenuEntryPanel addSubMenuEntry(final ContentMenuEntryPanel menuEntry) { subMenu.add(menuEntry); return this; }
public String getNewActionButtonChildId() { return this.actionButtons.newChildId(); }
/** * @param id */ @SuppressWarnings("serial") public ModalDialog(final String id) { super(id); actionButtons = new MyComponentsRepeater<Component>("actionButtons"); mainContainer = new WebMarkupContainer("mainContainer"); add(mainContainer.setOutputMarkupId(true)); mainContainer.add(mainSubContainer = new WebMarkupContainer("mainSubContainer")); gridContentContainer = new WebMarkupContainer("gridContent"); gridContentContainer.setOutputMarkupId(true); buttonBarContainer = new WebMarkupContainer("buttonBar"); buttonBarContainer.setOutputMarkupId(true); closeBehavior = new AjaxEventBehavior("hidden.bs.modal") { @Override protected void onEvent(final AjaxRequestTarget target) { handleCloseEvent(target); } @Override protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setEventPropagation(AjaxRequestAttributes.EventPropagation.BUBBLE); } }; }
buttonBarContainer.add(actionButtons.getRepeatingView()); form.setDefaultButton(closeButtonPanel.getButton()); if (autoGenerateGridBuilder == true) {
/** * @see org.apache.wicket.Component#isVisible() */ @Override public boolean isVisible() { return actionButtons.hasEntries(); } };
actionButtons = new MyComponentsRepeater<SingleButtonPanel>("buttons"); add(actionButtons.getRepeatingView()); final SingleButtonPanel cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"), SingleButtonPanel.CANCEL); actionButtons.add(cancelButtonPanel); markAsDeletedButton.setMarkupId("markAsDeleted").setOutputMarkupId(true); markAsDeletedButton.add(AttributeModifier.replace("onclick", "return showDeleteQuestionDialog();")); markAsDeletedButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), markAsDeletedButton, getString("markAsDeleted"), SingleButtonPanel.DELETE); actionButtons.add(markAsDeletedButtonPanel); deleteButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), deleteButton, getString("delete"), SingleButtonPanel.DELETE); deleteButton.setDefaultFormProcessing(false); actionButtons.add(deleteButtonPanel); final SingleButtonPanel resetButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), resetButton, getString("reset"), SingleButtonPanel.RESET); resetButtonPanel.setVisible(false); actionButtons.add(resetButtonPanel); updateButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), updateButton, getString("update")); actionButtons.add(updateButtonPanel);
public void addActionButton(final Component entry) { this.actionButtons.add(entry); }
public String newChildId() { return contentMenu.newChildId(); }
/** * @see org.apache.wicket.Component#isVisible() */ @Override public boolean isVisible() { return contentMenu.hasEntries(); } }
protected SingleButtonPanel addCancelButton(final Button cancelButton) { cancelButton.setDefaultFormProcessing(false); // No validation of the form. final SingleButtonPanel cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"), SingleButtonPanel.CANCEL); actionButtons.add(cancelButtonPanel); return cancelButtonPanel; }
updateEntryRows(); actionButtons = new MyComponentsRepeater<SingleButtonPanel>("buttons"); add(actionButtons.getRepeatingView()); final SingleButtonPanel refreshButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), refreshButton, "refresh", SingleButtonPanel.DEFAULT_SUBMIT); actionButtons.add(refreshButtonPanel); setDefaultButton(refreshButton);
public void prependActionButton(final Component entry) { this.actionButtons.add(0, entry); }
public String newSubMenuChildId() { return subMenu.newChildId(); }
private ContentMenuEntryPanel(final String id) { super(id); add(li = new WebMarkupContainer("li")); add(li); li.setMarkupId("addEntry").setOutputMarkupId(true); dropDownMenu = new WebMarkupContainer("dropdownMenu"); li.add(dropDownMenu); subMenu = new MyComponentsRepeater<ContentMenuEntryPanel>("subMenu"); dropDownMenu.add(subMenu.getRepeatingView()); }