Java Code Examples for org.apache.wicket.markup.html.form.Button

The following examples show how to use org.apache.wicket.markup.html.form.Button. These examples are extracted from open source projects. 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 Project: yes-cart   Source File: LogoutPanel.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Construct logout panel.
 * @param id component id.
 */
public LogoutPanel(final String id) {
    super(id);

    final StatelessForm form = new StatelessForm(LOGOFF_LINK);

    final Button submit = new Button("logoffCmd") {
        @Override
        public void onSubmit() {
            final Map<String, Object> cmd = new HashMap<>();
            cmd.put(ShoppingCartCommand.CMD_LOGOUT, ShoppingCartCommand.CMD_LOGOUT);
            shoppingCartCommandFactory.execute(ShoppingCartCommand.CMD_LOGOUT, getCurrentCart(), cmd);
            ((AbstractWebPage) getPage()).persistCartIfNecessary();
            LogoutPanel.this.setResponsePage(Application.get().getHomePage());
        }
    };

    submit.setDefaultFormProcessing(false);

    form.add(submit);

    add(form);

}
 
Example 2
Source Project: openmeetings   Source File: MessagesContactsPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void selectMessage(long id, AjaxRequestTarget target) {
	PrivateMessage msg = msgDao.get(id);
	selectedMessage.addOrReplace(new Label("from", msg == null ? "" : getDisplayName(msg.getFrom())));
	selectedMessage.addOrReplace(new Label("to", msg == null ? "" : getDisplayName(msg.getTo())));
	selectedMessage.addOrReplace(new Label("subj", msg == null ? "" : msg.getSubject()));
	selectedMessage.addOrReplace(new Label("body", msg == null ? "" : msg.getMessage()).setEscapeModelStrings(false));
	if (msg == null) {
		lastSelected = null;
	} else {
		lastSelected = id;
		Room r = msg.getRoom();
		if (r != null) {
			Appointment a = apptDao.getByRoom(r.getId());
			roomContainer.addOrReplace(new Label("start", a == null ? "" : getDateFormat().format(a.getStart())));
			roomContainer.addOrReplace(new Label("end", a == null ? "" : getDateFormat().format(a.getEnd())));
			roomContainer.addOrReplace(new Button("enter").add(new RoomEnterBehavior(r.getId())));
		}
		roomContainer.setVisible(r != null);
	}
	if (target != null) {
		target.add(selectedMessage);
		updateControls(target);
	}
}
 
Example 3
Source Project: ontopia   Source File: ModalInstancePage.java    License: Apache License 2.0 6 votes vote down vote up
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);
}
 
Example 4
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);
}
 
Example 5
Source Project: Orienteer   Source File: OrienteerBasePage.java    License: Apache License 2.0 6 votes vote down vote up
private WebMarkupContainer createPerspectivesContainer(String id, IModel<ODocument> perspectiveModel,
													   IModel<List<ODocument>> perspectivesModel) {
	return new WebMarkupContainer(id) {
		@Override
		protected void onInitialize() {
			super.onInitialize();
			add(createPerspectivesList("perspectives", perspectivesModel));
			Button perspectiveButton = new Button("perspectiveButton");

			perspectiveButton.add(new FAIcon("icon", new PropertyModel<>(perspectiveModel, "icon")));
			perspectiveButton.add(new Label("name", new ODocumentNameModel(perspectiveModel)));
			add(perspectiveButton);

			setOutputMarkupPlaceholderTag(true);
		}

		@Override
		protected void onConfigure() {
			super.onConfigure();
			List<ODocument> perspectives = perspectivesModel.getObject();
			setVisible(perspectives != null && perspectives.size() > 1);
		}
	};
}
 
Example 6
Source Project: oodt   Source File: TypeBrowser.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @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"));
}
 
Example 7
@SuppressWarnings("serial")
private MyButtonPanel(final String id, final String i18nKey)
{
  button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>()) {
    @Override
    public final void onSubmit()
    {
      MyButtonPanel.this.onSubmit();
    }

    /**
     * @see org.apache.wicket.Component#isVisible()
     */
    @Override
    public boolean isVisible()
    {
      return MyButtonPanel.this.isVisible();
    }
  };
  buttonPanel = new SingleButtonPanel(id, button, getString("system.admin.button." + i18nKey), SingleButtonPanel.NORMAL);
  WicketUtils.addTooltip(button, getString("system.admin.button." + i18nKey + ".tooltip"));
}
 
Example 8
public static void createLastLoginAndDeleteAllStayLogins(final GridBuilder gridBuilder, final PFUserDO user, final UserDao userDao,
    final Form< ? > form)
{
  // Last login and deleteAllStayLoggedInSessions
  final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("login.lastLogin")).suppressLabelForWarning();
  fs.add(new DivTextPanel(fs.newChildId(), DateTimeFormatter.instance().getFormattedDateTime(user.getLastLogin())));
  @SuppressWarnings("serial")
  final Button button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("invalidateStayLoggedInSessions")) {
    @Override
    public final void onSubmit()
    {
      userDao.renewStayLoggedInKey(user.getId());
      form.error(getString("login.stayLoggedIn.invalidateAllStayLoggedInSessions.successfullDeleted"));
    }
  };
  fs.add(new SingleButtonPanel(fs.newChildId(), button, gridBuilder.getString("login.stayLoggedIn.invalidateAllStayLoggedInSessions"),
      SingleButtonPanel.DANGER));
  WicketUtils.addTooltip(button, gridBuilder.getString("login.stayLoggedIn.invalidateAllStayLoggedInSessions.tooltip"));
}
 
Example 9
@Override
protected void init()
{
  super.init();
  // Task tree view
  @SuppressWarnings("serial")
  final Button taskTreeButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("listView")) {
    @Override
    public final void onSubmit()
    {
      parentPage.onTreeViewSubmit();
    }
  };
  actionButtons.add(2, new SingleButtonPanel(actionButtons.newChildId(), taskTreeButton, getString("task.tree.perspective"),
      SingleButtonPanel.NORMAL));
}
 
Example 10
/**
 * @param string
 * @return
 */
protected Button createButton(final String string)
{
  return new Button("button") {
    private static final long serialVersionUID = 1L;

    /**
     * @see org.apache.wicket.markup.html.form.Button#onSubmit()
     */
    @Override
    public void onSubmit()
    {
      IconButtonPanel.this.onSubmit();
    }

    /**
     * @see org.apache.wicket.Component#isVisible()
     */
    @Override
    public boolean isVisible()
    {
      return IconButtonPanel.this.isButtonVisible();
    }
  };
}
 
Example 11
/**
 * Adds a clone button (only if the data isn't new) and calls {@link AbstractEditPage#cloneData()}.
 */
@SuppressWarnings("serial")
protected void addCloneButton() {
  if (isNew() == false) {
    // Clone button for existing and not deleted invoices:
    final Button cloneButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("clone")) {
      @Override
      public final void onSubmit()
      {
        parentPage.cloneData();
      }
    };
    final SingleButtonPanel cloneButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cloneButton, getString("clone")) {
      /**
       * @see org.apache.wicket.Component#isVisible()
       */
      @Override
      public boolean isVisible()
      {
        return isNew() == false;
      }
    };
    actionButtons.add(2, cloneButtonPanel);
  }

}
 
Example 12
/**
 * @return this for chaining.
 */
@SuppressWarnings("serial")
protected AbstractImportForm<F, P, S> addClearButton(final FieldsetPanel fs)
{
  fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("clearStorage")) {
    @Override
    public final void onSubmit()
    {
      parentPage.clear();
    }
  }, getString("common.import.clearStorage"), SingleButtonPanel.RESET) {
    /**
     * @see org.apache.wicket.Component#isVisible()
     */
    @Override
    public boolean isVisible()
    {
      return storagePanel.isVisible();
    }
  });
  return this;
}
 
Example 13
/**
 * @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));
}
 
Example 14
Source Project: yes-cart   Source File: ShoppingCartItemsList.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Adjust quantity.
 *
 * @param productSkuCode sku code
 * @param supplier       supplier
 * @param qtyField       quantity input box  @return BookmarkablePageLink for remove one sku from cart command
 */
private Button createAddSeveralSkuButton(final String productSkuCode, final String supplier, final TextField<BigDecimal> qtyField) {
    final Button adjustQuantityButton = new Button(QUANTITY_ADJUST_BUTTON) {
        @Override
        public void onSubmit() {
            String qty = qtyField.getInput();
            if (StringUtils.isNotBlank(qty)) {
                qty = qty.replace(',', '.');
            }
            /*try {
                skuCode = URLEncoder.encode(productSkuCode, "UTF-8");
            } catch (UnsupportedEncodingException e) {
                skuCode = productSkuCode;
            }*/


            if (NumberUtils.isNumber(qty)) {
                qtyField.setConvertedInput(new BigDecimal(qty).setScale(Constants.MONEY_SCALE, BigDecimal.ROUND_HALF_UP));
                setResponsePage(
                        getPage().getPageClass(),
                        new PageParameters()
                                .add(ShoppingCartCommand.CMD_SETQTYSKU, productSkuCode)
                                .add(ShoppingCartCommand.CMD_P_SUPPLIER, supplier)
                                .add(ShoppingCartCommand.CMD_P_QTY, qty)
                );


            } else {
                qtyField.setConvertedInput(MoneyUtils.ONE);
                error(getLocalizer().getString("nonZeroDigits", this, "Need positive integer value"));
            }
        }
    };
    adjustQuantityButton.setDefaultFormProcessing(true);
    return adjustQuantityButton;
}
 
Example 15
Source Project: webanno   Source File: LoginPage.java    License: Apache License 2.0 5 votes vote down vote up
public LoginPage()
{
    setStatelessHint(true);
    setVersioned(false);
    
    add(form = new LoginForm("loginForm"));
    signInBtn = new Button("signInBtn");
    signInBtn.add(LambdaBehavior.enabledWhen(() -> !isTooManyUsers()));
    tooManyUsersLabel = new WebMarkupContainer("usersLabel");
    tooManyUsersLabel.add(LambdaBehavior.visibleWhen(this::isTooManyUsers));
    form.add(signInBtn);
    form.add(tooManyUsersLabel);
    form.add(LambdaBehavior.enabledWhen(() -> !isTooManyUsers()));
    
    redirectIfAlreadyLoggedIn();

    // Create admin user if there is no user yet
    if (userRepository.list().isEmpty()) {
        User admin = new User();
        admin.setUsername(ADMIN_DEFAULT_USERNAME);
        admin.setPassword(ADMIN_DEFAULT_PASSWORD);
        admin.setEnabled(true);
        admin.setRoles(EnumSet.of(Role.ROLE_ADMIN, Role.ROLE_USER));
        userRepository.create(admin);

        String msg = "No user accounts have been found. An admin account has been created: "
                + ADMIN_DEFAULT_USERNAME + "/" + ADMIN_DEFAULT_PASSWORD;
        // We log this as a warning so the message sticks on the screen. Success and info
        // messages are set to auto-close after a short time.
        warn(msg);
    }
}
 
Example 16
Source Project: webanno   Source File: ProjectMiraTemplatePanel.java    License: Apache License 2.0 5 votes vote down vote up
public MiraTemplateDetailForm(String id)
{
    super(id, new CompoundPropertyModel<>(new MiraTemplate()));

    add(new CheckBox("annotateAndRepeat"));

    add(new Button("save")
    {
        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit()
        {
            template = MiraTemplateDetailForm.this.getModelObject();
            if (isNull(template.getId())) {
                template.setTrainFeature(selectedFeature);
                automationService.createTemplate(template);
                featureModel.setObject(
                        MiraTemplateDetailForm.this.getModelObject().getTrainFeature());
            }
            template.setCurrentLayer(true);
            for (MiraTemplate tmp : automationService
                    .listMiraTemplates(ProjectMiraTemplatePanel.this.getModelObject())) {
                if (tmp.equals(template)) {
                    continue;
                }
                if (tmp.isCurrentLayer()) {
                    tmp.setCurrentLayer(false);
                }
            }
            updateForm();
        }
    });
}
 
Example 17
Source Project: wicket-spring-boot   Source File: CustomerCreatePage.java    License: Apache License 2.0 5 votes vote down vote up
private Component submitButton() {
	return new Button("submit"){
		@Override
		public void onSubmit() {
			service.save(customerModel.getObject());
			webSocketMessageBroadcaster.send(new CustomerChangedEvent(customerModel.getObject()));
			if(pageReferenceId != null){
				setResponsePage(new PageReference(pageReferenceId).getPage());
			} else {
				setResponsePage(CustomerListPage.class);
			}
		}
	};
}
 
Example 18
Source Project: sakai   Source File: SemesterPage.java    License: Educational Community License v2.0 5 votes vote down vote up
public SemesterForm(String id, Semester sem) {
     super(id, new CompoundPropertyModel<Semester>(sem));
     add(new RequiredTextField<String>(PROP_EID));
     add(new TextField<String>(PROP_TITLE));
     add(new TextField(PROP_START));
     add(new TextField(PROP_END));
     add(new TextField<String>(PROP_DESC){
    
private static final long serialVersionUID = 1L;

@Override
     	    protected boolean shouldTrimInput() {
     	        return false;
     	    }
     });	        
     add(new CheckBox(PROP_CURRENT));
     
     updateButtonModel = new ResourceModel(LABEL_BUTTON_SAVE);
     addButtonModel = new ResourceModel(LABEL_BUTTON_ADD);	        
     okButton = new Button("okbutton", addButtonModel); 
     add(okButton); 
     
     Button cancelButton = new Button("cancelbutton", new ResourceModel(LABEL_BUTTON_CANCEL)){	        
private static final long serialVersionUID = 1L;

@Override
     	public void onSubmit() {
     		clearForm();
     	}
     	
     	@Override
     	public boolean isVisible() {	        	
     		return updateEID != null; // only show when editing
     	}
     };
     cancelButton.setDefaultFormProcessing(false);
     add(cancelButton);
     
 }
 
Example 19
public SakaiNavigatorSearch(String id, final SortableSearchableDataProvider dataProvider) {
	super(id);
	this.dataProvider = dataProvider;

	setDefaultModel(new CompoundPropertyModel(this));

	Form form = new Form("searchForm");
	add(form);

	searchBox = new TextField("searchKeyword");
	form.add(searchBox);

	Button search = new Button("search") {
		@Override
		public void onSubmit() {
			String keyword = getSearchKeyword();
			if(keyword == null || "".equals(keyword)){
				dataProvider.clearSearchKeyword();
			}else{
				dataProvider.setSearchKeyword(keyword);
			}
			super.onSubmit();
		}
	};
	form.add(search);

	Button clear = new Button("clear") {
		@Override
		public void onSubmit() {
			dataProvider.clearSearchKeyword();
			super.onSubmit();
		}
	};
	form.add(clear);
}
 
Example 20
Source Project: sakai   Source File: SemesterPage.java    License: Educational Community License v2.0 5 votes vote down vote up
public SemesterForm(String id, Semester sem) {
     super(id, new CompoundPropertyModel<Semester>(sem));
     add(new RequiredTextField<String>(PROP_EID));
     add(new TextField<String>(PROP_TITLE));
     add(new TextField(PROP_START));
     add(new TextField(PROP_END));
     add(new TextField<String>(PROP_DESC){
    
private static final long serialVersionUID = 1L;

@Override
     	    protected boolean shouldTrimInput() {
     	        return false;
     	    }
     });	        
     add(new CheckBox(PROP_CURRENT));
     
     updateButtonModel = new ResourceModel(LABEL_BUTTON_SAVE);
     addButtonModel = new ResourceModel(LABEL_BUTTON_ADD);	        
     okButton = new Button("okbutton", addButtonModel); 
     add(okButton); 
     
     Button cancelButton = new Button("cancelbutton", new ResourceModel(LABEL_BUTTON_CANCEL)){	        
private static final long serialVersionUID = 1L;

@Override
     	public void onSubmit() {
     		clearForm();
     	}
     	
     	@Override
     	public boolean isVisible() {	        	
     		return updateEID != null; // only show when editing
     	}
     };
     cancelButton.setDefaultFormProcessing(false);
     add(cancelButton);
     
 }
 
Example 21
public SakaiNavigatorSearch(String id, final SortableSearchableDataProvider dataProvider) {
	super(id);
	this.dataProvider = dataProvider;

	setDefaultModel(new CompoundPropertyModel(this));

	Form form = new Form("searchForm");
	add(form);

	searchBox = new TextField("searchKeyword");
	form.add(searchBox);

	Button search = new Button("search") {
		@Override
		public void onSubmit() {
			String keyword = getSearchKeyword();
			if(keyword == null || "".equals(keyword)){
				dataProvider.clearSearchKeyword();
			}else{
				dataProvider.setSearchKeyword(keyword);
			}
			super.onSubmit();
		}
	};
	form.add(search);

	Button clear = new Button("clear") {
		@Override
		public void onSubmit() {
			dataProvider.clearSearchKeyword();
			super.onSubmit();
		}
	};
	form.add(clear);
}
 
Example 22
@Override
@SuppressWarnings("serial")
protected void init()
{
  add(createFeedbackPanel());
  final GridBuilder gridBuilder = newGridBuilder(this, "flowform");
  gridBuilder.newFormHeading(getString("import"));
  {
    // Upload dump file
    final FieldsetPanel fs = gridBuilder.newFieldset(getString("administration.setup.dumpFile"));
    fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
    fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
  }
  final RepeatingView actionButtons = new RepeatingView("buttons");
  add(actionButtons);
  {
    final Button importButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("import")) {
      @Override
      public final void onSubmit()
      {
        parentPage.upload();
      }
    };
    final SingleButtonPanel importButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), importButton, getString("import"),
        SingleButtonPanel.DEFAULT_SUBMIT);
    actionButtons.add(importButtonPanel);
  }
}
 
Example 23
@Override
@SuppressWarnings("serial")
protected void init()
{
  add(createFeedbackPanel());
  gridBuilder = newGridBuilder(this, "flowform");
  gridBuilder.newGridPanel();
  {
    final FieldsetPanel fs = gridBuilder.newFieldset("Show all");
    fs.add(new CheckBoxPanel(fs.newChildId(), new PropertyModel<Boolean>(this, "showOldUpdateScripts"), null, true) {
      /**
       * @see org.projectforge.web.wicket.flowlayout.CheckBoxPanel#onSelectionChanged(java.lang.Boolean)
       */
      @Override
      protected void onSelectionChanged(final Boolean newSelection)
      {
        parentPage.refresh();
      }
    });
  }
  scripts = new WebMarkupContainer("scripts");
  add(scripts);
  updateEntryRows();

  actionButtons = new MyComponentsRepeater<SingleButtonPanel>("buttons");
  add(actionButtons.getRepeatingView());
  {
    final Button refreshButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("refresh")) {
      @Override
      public final void onSubmit()
      {
        parentPage.refresh();
      }
    };
    final SingleButtonPanel refreshButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), refreshButton, "refresh",
        SingleButtonPanel.DEFAULT_SUBMIT);
    actionButtons.add(refreshButtonPanel);
    setDefaultButton(refreshButton);
  }
}
 
Example 24
@SuppressWarnings("serial")
public static void createAuthenticationToken(final GridBuilder gridBuilder, final PFUserDO user, final UserDao userDao,
    final Form< ? > form)
{
  // Authentication token
  final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.authenticationToken")).suppressLabelForWarning();
  fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
    @Override
    public String getObject()
    {
      if (PFUserContext.getUserId().equals(user.getId()) == true) {
        return userDao.getAuthenticationToken(user.getId());
      } else {
        // Administrators shouldn't see the token.
        return "*****";
      }
    }
  }));
  fs.addHelpIcon(gridBuilder.getString("user.authenticationToken.tooltip"));
  final Button button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("renewAuthenticationKey")) {
    @Override
    public final void onSubmit()
    {
      userDao.renewAuthenticationToken(user.getId());
      form.error(getString("user.authenticationToken.renew.successful"));
    }
  };
  button.add(WicketUtils.javaScriptConfirmDialogOnClick(form.getString("user.authenticationToken.renew.securityQuestion")));
  fs.add(new SingleButtonPanel(fs.newChildId(), button, gridBuilder.getString("user.authenticationToken.renew"), SingleButtonPanel.DANGER));
  WicketUtils.addTooltip(button, gridBuilder.getString("user.authenticationToken.renew.tooltip"));
}
 
Example 25
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);
}
 
Example 26
public ButtonPanel(final String id, final String title, final Button button, final ButtonType... buttonTypes)
{
  super(id);
  this.button = button;
  button.add(new Label("title", title));
  for (final ButtonType buttonType : buttonTypes) {
    button.add(AttributeModifier.append("class", buttonType.getClassAttrValue()));
  }
  add(button);
}
 
Example 27
public IconButtonPanel(final String id, final Button button, final IconType type, final String tooltip)
{
  super(id);
  this.button = button;
  add(button);
  init(type, tooltip);
}
 
Example 28
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;
}
 
Example 29
/**
 * 
 * @param id
 * @param button
 * @param label
 * @param classnames css class names
 */
public SingleButtonPanel(final String id, final Button button, final IModel<String> label, final String... classnames)
{
  super(id);
  this.button = button;
  add(button);
  button.add(new Label("label", label).setRenderBodyOnly(true));
  if (classnames != null) {
    button.add(AttributeModifier.append("class", StringHelper.listToString(" ", classnames)));
  }
}
 
Example 30
public void component(Component object, IVisit<Void> visit) {
	if (!visited.contains(object) && (object instanceof FormComponent) && !(object instanceof Button)) {
		final FormComponent<?> fc = (FormComponent<?>) object;
		visited.add(fc);
		if (!found && fc.isEnabled() && fc.isVisible()
				&& (fc instanceof DropDownChoice || fc instanceof AbstractTextComponent)) {
			found = true;
			fc.add(new DefaultFocusBehavior());
		}
	}
}