當前位置: 首頁>>代碼示例>>Java>>正文


Java Button類代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.form.Button的典型用法代碼示例。如果您正苦於以下問題:Java Button類的具體用法?Java Button怎麽用?Java Button使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Button類屬於org.apache.wicket.markup.html.form包,在下文中一共展示了Button類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: AssociationTransformFunctionBoxPanel

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
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);
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:18,代碼來源:AssociationTransformFunctionBoxPanel.java

示例2: addLoginButton

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
private void addLoginButton() {
	final Button applyButton = new Button("loginButton") {
		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit() {
			final String email = LoginPage.this.emailInput.getValue();
			final String password = LoginPage.this.passwordInput.getValue();
			if (LoginPage.this.login(email, password)) {
				this.setResponsePage(LoginPage.class);
			}
		}

	};
	this.loginForm.add(applyButton);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:17,代碼來源:LoginPage.java

示例3: LoginForm

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public LoginForm(String markupId) {
    super(markupId);
    this.setDefaultModel(new CompoundPropertyModel<Object>(this));

    this.add(new TextField("username").setRequired(true));
    this.add(new PasswordTextField("password").setRequired(true));

    Button submitBtn = new AjaxButton("loginBtn", Model.of("Sign In")) {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            if (AuthenticatedWebSession.get().signIn(username, password))
                setResponsePage(DiscoverItemsPage.class);
            else {
                target.add(ComponentUtils.displayBlock(alert));
            }
        }
    };
    this.add(submitBtn);
    this.setDefaultButton(submitBtn);
}
 
開發者ID:citlab,項目名稱:Intercloud,代碼行數:21,代碼來源:LoginPanel.java

示例4: selectMessage

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
private void selectMessage(long id, AjaxRequestTarget target) {
	PrivateMessage msg = getBean(PrivateMessageDao.class).get(id);
	selectedMessage.addOrReplace(new Label("from", msg == null ? "" : getEmail(msg.getFrom())));
	selectedMessage.addOrReplace(new Label("to", msg == null ? "" : getEmail(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) {
		Room r = msg.getRoom();
		if (r != null) {
			Appointment a = getBean(AppointmentDao.class).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);
	}
}
 
開發者ID:apache,項目名稱:openmeetings,代碼行數:22,代碼來源:MessagesContactsPanel.java

示例5: ConfirmPanel

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public ConfirmPanel(final String id, String message) {
    super(id);
    Form cform = new Form("cform");
    cform.add(new Label("message", message));
    cform.add(new Button("confirm") {
        @Override
        public void onSubmit() {
            onConfirm();
        }
    });
    cform.add(new Button("cancel") {
        @Override
        public void onSubmit() {
            ConfirmPanel.this.setVisible(false);
        }
    });
    add(cform);
}
 
開發者ID:payneteasy,項目名稱:superfly,代碼行數:19,代碼來源:ConfirmPanel.java

示例6: EditRolePage

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public EditRolePage(PageParameters parameters) {
    super(ListRolesPage.class, parameters);
     long roleId = parameters.get("id").toLong(-1L);
     final UIRole role  = roleService.getRole(roleId);
     setDefaultModel(new CompoundPropertyModel<UIRole>(role));
     Form form = new Form("form"){

        @Override
        protected void onSubmit() {
        roleService.updateRole(role);
        setResponsePage(ListRolesPage.class);
        }

     };
     add(form);
     form.add(new LabelValueRow<String>("role-name", new Model<String>(role.getRoleName()), "role.create.name"));
     form.add(new LabelTextFieldRow<String>(role, "principalName", "role.create.principal-name", true));
     form.add(new Button("form-submit"));
     form.add(new BookmarkablePageLink<Page>("form-cancel", ListRolesPage.class));
}
 
開發者ID:payneteasy,項目名稱:superfly,代碼行數:21,代碼來源:EditRolePage.java

示例7: LoginPageForm

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public LoginPageForm( String id )
{
    super( id );
    HttpServletRequest servletReq = ( HttpServletRequest ) getRequest().getContainerRequest();
    Principal principal = servletReq.getUserPrincipal();
    if ( principal != null )
    {
        LOG.info( "user already logged in, route to launch page instead" );
        setResponsePage( LaunchPage.class );
    }
    add( new Button( "login" ) );
    TextField userId = new TextField( "userId", new PropertyModel<String>( this, "userId" ) );
    add( userId );
    PasswordTextField pw = new PasswordTextField( "pswdField", new PropertyModel<String>( this, "pswdField" ) );
    pw.setRequired( false );
    add( pw );
}
 
開發者ID:apache,項目名稱:directory-fortress-commander,代碼行數:18,代碼來源:LoginPage.java

示例8: ModalInstancePage

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
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);
}
 
開發者ID:ontopia,項目名稱:ontopia,代碼行數:25,代碼來源:ModalInstancePage.java

示例9: initExcluirButton

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
/**
 * Exclui um artigo
 */
private void initExcluirButton() {
	Button btn = new Button("excluir") {
		@Override
		public void onSubmit() {
			try {
				WikiLegisServiceUtil.excluiArtigo(EdicaoArtigoPage.this.getModelObject().getArtigoId());
			} catch (Exception e) {
				LOG.error("Erro ao excluir artigo", e);
			}
			setResponsePage(HomePage.class);
			setRedirect(true);
		}
	};
	btn.setDefaultFormProcessing(false);
	form.add(btn);
}
 
開發者ID:camaradosdeputadosoficial,項目名稱:edemocracia,代碼行數:20,代碼來源:EdicaoArtigoPage.java

示例10: Kunde_KartePanel

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public Kunde_KartePanel(String id, IModel<?> model) {
    super(id, model);
    GeneratedBinding generatedBinding = new GeneratedBinding(this);
    generatedBinding.withInterceptors(new BindingInterceptor() {
        @Override
        public Component createButton(ButtonElement e) {
            if (e.getWicketId().equals(Kunde_KarteConstants.pruefen)) {
                Button button = new GeneratedButton(e) {
                    @Override
                    protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                        super.onSubmit(target, form);
                        System.err.println("Button call intercepted");
                    }
                };
                return button;

            }
            return super.createButton(e);
        }
    });
    generatedBinding.bind();
}
 
開發者ID:Nocket,項目名稱:nocket,代碼行數:23,代碼來源:Kunde_KartePanel.java

示例11: UploadForm

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public UploadForm(String id) {
            super(id);

            setMultiPart(true);
            setMaxSize(Bytes.megabytes(2));

            fileUploadField = new FileUploadField("upload");
            add(fileUploadField);

            add(new Button("continuebutton"));

            Button cancel = new Button("cancelbutton"){
                public void onSubmit() {
//                    info("Cancel was pressed!");
                    setResponsePage(new GradebookPage());
                }
            };
            cancel.setDefaultFormProcessing(false);
            add(cancel);
        }
 
開發者ID:steveswinsburg,項目名稱:gradebookNG,代碼行數:21,代碼來源:GradeImportUploadStep.java

示例12: LoginPage

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public LoginPage() {
	final Form<User> form = new Form<User>("loginForm",
			new CompoundPropertyModel<User>(user));
	TextField<String> nameField = new TextField<String>(User.NAME);
	form.add(nameField);
	PasswordTextField passwordField = new PasswordTextField(User.PASSWORD);
	form.add(passwordField);

	Button submit = new Button("loginButton") {
		@Override
		public void onSubmit() {
			User dbUser = userDAO.findByUsername(user.getName());
			if (dbUser != null
					&& dbUser.getPassword().equals(user.getPassword())) {
				LoginPage.this.getSession().setUser(dbUser);
				setResponsePage(NotesPage.class);
			} else {
				form.error("Invalid login");
			}
		};
	};
	submit.add(new ButtonBehavior());
	form.add(submit);
	add(form);
}
 
開發者ID:r-h,項目名稱:wicket-notes-demo,代碼行數:26,代碼來源:LoginPage.java

示例13: AddCriteriaForm

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
/**
 * @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"));
}
 
開發者ID:apache,項目名稱:oodt,代碼行數:23,代碼來源:TypeBrowser.java

示例14: EditForm

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public EditForm(String id, final IModel<Setting> setting) {
	super(id, new CompoundPropertyModel<Setting>(setting));
	add(new LocalFeedbackPanel("feedback", this));
	value = new RequiredTextField<String>("value");
	value.add(new SettingValidator(setting.getObject().getName()));
	add(value);
	add(new Button("save") {
		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit() {
			if (!value.hasErrorMessage()) {
				BlogServiceHolder.get().updateSetting(EditForm.this.getModelObject());
				getSession().info("Setting saved");
				setRedirect(true);
				setResponsePage(SettingsPage.class);
			}
		}
	});
	add(new CancelButton("cancel", SettingsPage.class));
}
 
開發者ID:rla,項目名稱:old-blog,代碼行數:22,代碼來源:SettingEditPage.java

示例15: LoginForm

import org.apache.wicket.markup.html.form.Button; //導入依賴的package包/類
public LoginForm(String id) {
	super(id, new CompoundPropertyModel<LoginFormModel>(new LoginFormModel()));
	
	add(new LocalFeedbackPanel("feedback", this));
	add(new PasswordTextField("password"));
	add(new Button("submit") {
		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit() {
			if (BlogServiceHolder.get().isOwnerPasswordMatch(LoginForm.this.getModelObject().getPassword())) {
				((BlogSession) getSession()).setAuthenticated(true);
				setResponsePage(IndexPage.class);
			} else {
				error("Wrong password");
			}
		}
	});
}
 
開發者ID:rla,項目名稱:old-blog,代碼行數:20,代碼來源:LoginPage.java


注:本文中的org.apache.wicket.markup.html.form.Button類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。