/** * Set the button's label, removing any previous label's * * @param characters * (May be null) The button's label as a string. */ public void setValue(String characters) throws WingException { Value value = this.setValue(); value.addContent(characters); }
/** * Add a button input control that when activated by the user will submit * the form, including all the fields, back to the server for processing. * * @param name * (Required) a non-unique local identifier used to differentiate * the element from its siblings within an interactive division. * This is the name of the field use when data is submitted back * to the server. * @param rend * (May be null) a rendering hint used to override the default * display of the element. * @return A new button field. */ public Button addButton(String name, String rend) throws WingException { Button button = new Button(context, name, rend); contents.add(button); return button; }
/** * Set the button's label, removing any previous label's * * @return A button label's value. */ public Value setValue() throws WingException { removeValueOfType(Value.TYPE_RAW); Value value = new Value(context, Value.TYPE_RAW); values.add(value); return value; }
/** * Add a disabled button with a "not allowed" notice * @param item * @param buttonName * @param buttonLabel * @throws WingException * @throws SQLException */ private void addNotAllowedButton(org.dspace.app.xmlui.wing.element.Item item, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = item.addButton(buttonName); button.setValue(buttonLabel); button.setDisabled(); item.addHighlight("fade").addContent(T_not_allowed); }
Button upButton = cell.addButton("submit_order_" + bundle.getID() + "_" + bitstream.getID() + "_up", ((bitstreamIndex == 0) ? "disabled" : "") + " icon-button arrowUp "); if((bitstreamIndex == 0)){ upButton.setDisabled(); upButton.setValue(T_order_up); upButton.setHelp(T_order_up); Button downButton = cell.addButton("submit_order_" + bundle.getID() + "_" + bitstream.getID() + "_down", (bitstreamIndex == (bitstreams.length - 1) ? "disabled" : "") + " icon-button arrowDown "); if(bitstreamIndex == (bitstreams.length - 1)){ downButton.setDisabled(); downButton.setValue(T_order_down); downButton.setHelp(T_order_down); actions.addButton("submit_update_order", "hidden").setValue(T_submit_reorder); actions.addButton("submit_delete").setValue(T_submit_delete); button.setValue(T_submit_delete); button.setDisabled(); actions.addButton("submit_return").setValue(T_submit_return);
addLang.setSize(6); addForm.addItem().addButton("submit_add").setValue(T_submit_add); actions.addButton("submit_update").setValue(T_submit_update); actions.addButton("submit_return").setValue(T_submit_return); unlock.setHelp(T_unlock); actions.addButton("submit_update").setValue(T_submit_update); actions.addButton("submit_return").setValue(T_submit_return);
private void addAdministratorOnlyButton(Cell cell, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = cell.addButton(buttonName); button.setValue(buttonLabel); if (!AuthorizeManager.isAdmin(context)) { // Only admins can create or delete button.setDisabled(); cell.addHighlight("fade").addContent(T_sysadmins_only); } } }
button.setLabel("Button"); button.setValue("When you touch me I do things, lots of things"); if (help) button.setHelp("Submit buttons allow the user to submit the form."); button.addError("This button is in error."); actions.addButton("submit_save").setValue("Save"); actions.addButton("submit_cancel").setValue("Cancel"); buttons.addButton("submit_save2").setValue("Save"); buttons.addButton("submit_cancel2").setValue("Cancel");
/** * Set the button's label, removing any previous labels. * * @param translated * (Required) A key into the i18n catalogue for translation into * the user's preferred language. */ public void setValue(Message translated) throws WingException { Value value = this.setValue(); value.addContent(translated); } }
private void addCollectionAdminOnlyButton(org.dspace.app.xmlui.wing.element.Item item, Collection collection, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = item.addButton(buttonName); button.setValue(buttonLabel); if (!AuthorizeManager.isAdmin(context, collection)) { // Only admins can create or delete button.setDisabled(); item.addHighlight("fade").addContent(T_collectionadmins_only); } }
actions.addButton(AbstractProcessingStep.PREVIOUS_BUTTON).setValue(T_previous); actions.addButton(AbstractProcessingStep.CANCEL_BUTTON).setValue(T_save); actions.addButton(AbstractProcessingStep.NEXT_BUTTON).setValue(T_complete); actions.addButton(AbstractProcessingStep.NEXT_BUTTON).setValue(T_next);
private void addAdministratorOnlyButton(Cell cell, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = cell.addButton(buttonName); button.setValue(buttonLabel); if (!AuthorizeManager.isAdmin(context)) { // Only admins can create or delete button.setDisabled(); cell.addHighlight("fade").addContent(T_sysadmins_only); } } }
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { Collection collection = submission.getCollection(); String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue"; Division div = body.addInteractiveDivision("submit-save-or-cancel",actionURL, Division.METHOD_POST,"primary submission"); div.setHead(T_submission_head); addSubmissionProgressList(div); List saveOrCancel = div.addList("submit-review", List.TYPE_FORM); saveOrCancel.setHead(T_head); saveOrCancel.addItem(T_info1); org.dspace.app.xmlui.wing.element.Item actions = saveOrCancel.addItem(); actions.addButton("submit_back").setValue(T_submit_back); actions.addButton("submit_save").setValue(T_submit_save); actions.addButton("submit_remove").setValue(T_submit_remove); } }
actions.addButton("submit_unmap").setValue(T_submit_unmap); actions.addButton("submit_return").setValue(T_submit_return); button.setValue(T_submit_unmap); button.setDisabled(); actions.addButton("submit_return").setValue(T_submit_return); actions.addButton("submit_unmap").setValue(T_submit_unmap); actions.addButton("submit_return").setValue(T_submit_return); button.setValue(T_submit_unmap); button.setDisabled(); actions.addButton("submit_return").setValue(T_submit_return);
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { Division search = body.addInteractiveDivision("front-page-search",contextPath+"/discover",Division.METHOD_GET,"primary"); search.setHead(T_head); search.addPara(T_para1); Para fields = search.addPara(); fields.addText("query"); fields.addButton("submit").setValue(T_go); } }
Text query = queryItem.addText("query"); Button button = queryItem.addButton("submit_author"); button.setValue(T_submit_search); if (!AuthorizeManager.authorizeActionBoolean(context, collection, Constants.ADD)) button.setDisabled(); queryItem.addHighlight("fade").addContent(T_no_add); actions.addButton("submit_browse").setValue(T_submit_browse); actions.addButton("submit_return").setValue(T_submit_return);
private void renderMainPage(Division div) throws WingException { Table table = div.addTable("workflow-actions", 1, 1); table.setHead(T_info1); // Approve task Row row = table.addRow(); row.addCellContent(T_approve_help); row.addCell().addButton("submit_approve").setValue(T_approve_submit); // Edit metadata row = table.addRow(); row.addCellContent(T_edit_help); row.addCell().addButton("submit_edit").setValue(T_edit_submit); // Everyone can just cancel row = table.addRow(); row.addCell(0, 2).addButton("submit_leave").setValue(T_submit_cancel); div.addHidden("page").setValue(ReviewAction.MAIN_PAGE); } }
button.setValue(T_submit_upload); if (bundleCount == 0) { button.setDisabled(); actions.addButton("submit_cancel").setValue(T_submit_cancel);
private void renderMainPage(Division div) throws WingException { Table table = div.addTable("workflow-actions", 1, 1); table.setHead(T_info1); // Approve task Row row = table.addRow(); row.addCellContent(T_approve_help); row.addCell().addButton("submit_approve").setValue(T_approve_submit); // Reject item row = table.addRow(); row.addCellContent(T_reject_help); row.addCell().addButton("submit_reject").setValue(T_reject_submit); // Everyone can just cancel row = table.addRow(); row.addCell(0, 2).addButton("submit_leave").setValue(T_cancel_submit); div.addHidden("page").setValue(org.dspace.xmlworkflow.state.actions.processingaction.ReviewAction.MAIN_PAGE); }