当前位置: 首页>>代码示例>>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;未经允许,请勿转载。