org.apache.wicket.markup.html.form.Button.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.wicket.markup.html.form.Button.<init>()方法的一些代码示例,展示了Button.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.<init>()方法的具体详情如下:
包路径:org.apache.wicket.markup.html.form.Button
类名称:Button
方法名:<init>

Button.<init>介绍

[英]Constructor without a model. Buttons without models leave the markup attribute "value". Provide a model if you want to set the button's label dynamically.
[中]没有模型的构造函数。没有模型的按钮保留标记属性“值”。如果要动态设置按钮的标签,请提供模型。

代码示例

代码示例来源:origin: de.alpharogroup/wicket-bootstrap3

/**
 * Factory method for create a new {@link Button}. This method is invoked in the constructor
 * from the derived classes and can be overridden so users can provide their own version of a
 * new {@link Button}.
 *
 * @param id
 *            the id
 * @return the new {@link Button}
 */
protected Component newnavbarBrandButton(final String id)
{
  return new Button(id);
}

代码示例来源:origin: org.opensingular/singular-form-wicket

private Button buildModelTrigger() {
  final Button modalTrigger = new Button(MODAL_TRIGGER_ID);
  modalTrigger.add(new AjaxEventBehavior("click") {
    @Override
    protected void onEvent(AjaxRequestTarget target) {
      target.add(ctx.getExternalContainer());
      getModal().show(target);
    }
  });
  return modalTrigger;
}

代码示例来源:origin: org.opensingular/form-wicket

private Button buildModelTrigger() {
  final Button modalTrigger = new Button(MODAL_TRIGGER_ID);
  modalTrigger.add(new AjaxEventBehavior("click") {
    @Override
    protected void onEvent(AjaxRequestTarget target) {
      modal.show(target);
    }
  });
  return modalTrigger;
}

代码示例来源:origin: org.opensingular/singular-wicket-utils

private void addExportButton() {
  exportButton = new Button("export");
  form.add(exportButton);
}

代码示例来源:origin: micromata/projectforge

public ButtonPanel(final String id, final String label, final ButtonType... buttonTypes)
{
 super(id);
 button = new Button(BUTTON_ID, new Model<String>(label));
 button.add(new Label("title", label));
 for (final ButtonType buttonType : buttonTypes) {
  button.add(AttributeModifier.append("class", buttonType.getClassAttrValue()));
 }
 add(button);
}

代码示例来源:origin: org.jabylon/rest.ui

private Component buildAddNewLink(IModel<Project> model) {
  Project project = model.getObject();
  if (project.cdoState() == CDOState.NEW || project.cdoState() == CDOState.TRANSIENT) {
    // it's a new project, we can't add anything yet
    Button link = new Button("addNew");
    link.setEnabled(false);
    return link;
  }
  PageParameters parameters = WicketUtil.buildPageParametersFor(project);
  parameters.add(SettingsPanel.QUERY_PARAM_CREATE, PropertiesPackage.Literals.PROJECT_VERSION.getName());
  return new BookmarkablePageLink<Void>("addNew", SettingsPage.class, parameters);
}

代码示例来源:origin: org.jabylon/rest.ui

private Component buildAddNewLink(IModel<UserManagement> model) {
  PageParameters params = new PageParameters();
  UserManagement project = model.getObject();
  if (project.cdoState() == CDOState.NEW || project.cdoState() == CDOState.TRANSIENT) {
    // it's a new project, we can't add anything yet
    Button link = new Button("addNew");
    link.setEnabled(false);
    return link;
  }
  params.set(0, "security");
  params.add(SettingsPanel.QUERY_PARAM_CREATE, UsersPackage.Literals.ROLE.getName());
  params.add(SettingsPanel.QUERY_PARAM_NAMESPACE, UsersPackage.eNS_URI);
  return new BookmarkablePageLink<Void>("addNew", SettingsPage.class, params);
}

代码示例来源:origin: org.jabylon/rest.ui

private Component buildAddNewLink(IModel<UserManagement> model) {
  PageParameters params = new PageParameters();
  UserManagement project = model.getObject();
  if (project.cdoState() == CDOState.NEW || project.cdoState() == CDOState.TRANSIENT) {
    // it's a new project, we can't add anything yet
    Button link = new Button("addNew");
    link.setEnabled(false);
    return link;
  }
  params.set(0, "security");
  params.add(SettingsPanel.QUERY_PARAM_CREATE, UsersPackage.Literals.USER.getName());
  params.add(SettingsPanel.QUERY_PARAM_NAMESPACE, UsersPackage.eNS_URI);
  return new BookmarkablePageLink<Void>("addNew", SettingsPage.class, params);
}

代码示例来源:origin: org.jabylon/rest.ui

private Component buildAddNewLink(IModel<UserManagement> model) {
  PageParameters params = new PageParameters();
  UserManagement project = model.getObject();
  if (project.cdoState() == CDOState.NEW || project.cdoState() == CDOState.TRANSIENT) {
    // it's a new project, we can't add anything yet
    Button link = new Button("addNew");
    link.setEnabled(false);
    return link;
  }
  params.set(0, "security");
  params.add(SettingsPanel.QUERY_PARAM_CREATE, UsersPackage.Literals.ROLE.getName());
  params.add(SettingsPanel.QUERY_PARAM_NAMESPACE, UsersPackage.eNS_URI);
  return new BookmarkablePageLink<Void>("addNew", SettingsPage.class, params);
}

代码示例来源:origin: micromata/projectforge

private Button createDeleteButton()
{
 final Button deleteButton = new Button("deleteButton");
 deleteButton.add(new AjaxEventBehavior("click")
 {
  @Override
  protected void onEvent(AjaxRequestTarget target)
  {
   // open dialog only if an attr row is selected
   if (selectedAttrRowModel.getObject() != null) {
    deleteDialog.open(target);
   }
  }
 });
 deleteButton.setMarkupId(attrGroup.getName() + "-deleteButton").setOutputMarkupId(true);
 return deleteButton;
}

代码示例来源:origin: net.ontopia/ontopoly-editor

public AssociationTransformFunctionBoxPanel(String id, final TopicModel<Topic> topicModel) {
 super(id);
 add(new Label("title", new ResourceModel("transform.association.instances")));   
 
 Button addButton = new Button("button", new ResourceModel("transform"));
 addButton.add(new AjaxFormComponentUpdatingBehavior("onclick") {
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
   Topic instance = topicModel.getTopic();
   Map<String,String> pageParametersMap = new HashMap<String,String>();
   pageParametersMap.put("topicMapId", instance.getTopicMap().getId());
   pageParametersMap.put("topicId", instance.getId());
   setResponsePage(AssociationTransformPage.class, new PageParameters(pageParametersMap));
  }          
 });
 add(addButton);
}

代码示例来源:origin: ops4j/org.ops4j.pax.wicket

public Homepage() {
    // Wiquery Example
    final Dialog dialog = new Dialog("dialog");
    add(dialog);
    Button button = new Button("open-dialog");
    button.add(new WiQueryEventBehavior(new Event(MouseEvent.DBLCLICK) {
      @Override
      public JsScope callback() {
        return JsScope.quickScope(dialog.open().render());
      }
    }));
    add(button);
  }
}

代码示例来源:origin: ontopia/ontopia

public AssociationTransformFunctionBoxPanel(String id, final TopicModel<Topic> topicModel) {
 super(id);
 add(new Label("title", new ResourceModel("transform.association.instances")));   
 
 Button addButton = new Button("button", new ResourceModel("transform"));
 addButton.add(new AjaxFormComponentUpdatingBehavior("onclick") {
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
   Topic instance = topicModel.getTopic();
   Map<String,String> pageParametersMap = new HashMap<String,String>();
   pageParametersMap.put("topicMapId", instance.getTopicMap().getId());
   pageParametersMap.put("topicId", instance.getId());
   setResponsePage(AssociationTransformPage.class, new PageParameters(pageParametersMap));
  }          
 });
 add(addButton);
}

代码示例来源:origin: ontopia/ontopia

public ModalInstancePage(String id, TopicModel<Topic> topicModel, TopicTypeModel topicTypeModel, FieldsViewModel fieldsViewModel) {
 super(id);
 this.topicModel = topicModel;
 this.topicTypeModel = topicTypeModel;
 this.fieldsViewModel = fieldsViewModel;
 
 // page is read-only if topic type is read-only
 this.isReadOnly = ((topicTypeModel != null && topicTypeModel.getTopicType().isReadOnly()) || (Objects.equals(getRequest().getParameter("ro"), "true")));
 this.popupContent = new WebMarkupContainer("popupContent");
 popupContent.setOutputMarkupId(true);
 add(popupContent);
 
 popupContent.add(createInstancePanel("instancePanel"));
 
 Button closeOkButton = new Button("closeOK");
 closeOkButton.add(new AjaxFormComponentUpdatingBehavior("onclick") {
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
   onCloseOk(target);
  }
 });
 popupContent.add(closeOkButton);
}

代码示例来源:origin: net.ontopia/ontopoly-editor

public ModalInstancePage(String id, TopicModel<Topic> topicModel, TopicTypeModel topicTypeModel, FieldsViewModel fieldsViewModel) {
 super(id);
 this.topicModel = topicModel;
 this.topicTypeModel = topicTypeModel;
 this.fieldsViewModel = fieldsViewModel;
 
 // page is read-only if topic type is read-only
 this.isReadOnly = ((topicTypeModel != null && topicTypeModel.getTopicType().isReadOnly()) || (ObjectUtils.equals(getRequest().getParameter("ro"), "true")));
 this.popupContent = new WebMarkupContainer("popupContent");
 popupContent.setOutputMarkupId(true);
 add(popupContent);
 
 popupContent.add(createInstancePanel("instancePanel"));
 
 Button closeOkButton = new Button("closeOK");
 closeOkButton.add(new AjaxFormComponentUpdatingBehavior("onclick") {
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
   onCloseOk(target);
  }
 });
 popupContent.add(closeOkButton);
}

代码示例来源:origin: org.apache.oodt/oodt-webapp-components

/**
 * @param id
 *          The wicket:id component ID of this form.
 */
public AddCriteriaForm(String id) {
 super(id, new CompoundPropertyModel<ElementCrit>(new ElementCrit()));
 List<Element> ptypeElements = fm.safeGetElementsForProductType(type);
 Collections.sort(ptypeElements, new Comparator<Element>() {
  public int compare(Element e1, Element e2) {
   return e1.getElementName().compareTo(e2.getElementName());
  }
 });
 add(new DropDownChoice<Element>("criteria_list", new PropertyModel(
   getDefaultModelObject(), "elem"), new ListModel<Element>(
   ptypeElements), new ChoiceRenderer<Element>("elementName",
   "elementId")));
 add(new TextField<TermQueryCriteria>(
   "criteria_form_add_element_value",
   new PropertyModel<TermQueryCriteria>(getDefaultModelObject(), "value")));
 add(new Button("criteria_elem_add"));
}

代码示例来源:origin: org.jbehave.web/jbehave-web-runner

public StoryForm(final String id) {
  super(id, new CompoundPropertyModel<ValueMap>(new ValueMap()));
  add(new TextArea<String>("input", new PropertyModel<String>(storyContext, "input")).setType(String.class));
  add(new TextArea<String>("metaFilter", new PropertyModel<String>(storyContext, "metaFilter"))
      .setType(String.class));
  add(new Button("runButton"));
  add(new BookmarkablePageLink<String>("viewLink", ViewStory.class, new PageParameters()));
}

代码示例来源:origin: jbehave/jbehave-web

public StoryForm(final String id) {
  super(id, new CompoundPropertyModel<ValueMap>(new ValueMap()));
  add(new TextArea<String>("input", new PropertyModel<String>(storyContext, "input")).setType(String.class));
  add(new TextArea<String>("metaFilter", new PropertyModel<String>(storyContext, "metaFilter"))
      .setType(String.class));
  add(new Button("runButton"));
  add(new BookmarkablePageLink<String>("viewLink", ViewStory.class, new PageParameters()));
}

代码示例来源:origin: jbehave/jbehave-web

public StoryForm(final String id) {
  super(id, new CompoundPropertyModel<ValueMap>(new ValueMap()));
  add(new TextArea<String>("input", new PropertyModel<String>(storyContext, "input")).setType(String.class));
  add(new TextArea<String>("metaFilter", new PropertyModel<String>(storyContext, "metaFilter"))
      .setType(String.class));
  add(new NoMarkupMultiLineLabel("output", new PropertyModel<String>(storyContext, "output"), "brush: plain"));
  add(new NoMarkupMultiLineLabel("failure", new PropertyModel<String>(storyContext, "failureStackTrace"),
      "brush: java; gutter: false; collapse: true"));
  add(new Button("runButton"));
}

代码示例来源:origin: org.jbehave.web/jbehave-web-runner

public StoryForm(final String id) {
  super(id, new CompoundPropertyModel<ValueMap>(new ValueMap()));
  add(new TextArea<String>("input", new PropertyModel<String>(storyContext, "input")).setType(String.class));
  add(new TextArea<String>("metaFilter", new PropertyModel<String>(storyContext, "metaFilter"))
      .setType(String.class));
  add(new NoMarkupMultiLineLabel("output", new PropertyModel<String>(storyContext, "output"), "brush: plain"));
  add(new NoMarkupMultiLineLabel("failure", new PropertyModel<String>(storyContext, "failureStackTrace"),
      "brush: java; gutter: false; collapse: true"));
  add(new Button("runButton"));
}

相关文章