当前位置: 首页>>代码示例>>Java>>正文


Java Form类代码示例

本文整理汇总了Java中com.vaadin.ui.Form的典型用法代码示例。如果您正苦于以下问题:Java Form类的具体用法?Java Form怎么用?Java Form使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Form类属于com.vaadin.ui包,在下文中一共展示了Form类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initAlfrescoComponent

import com.vaadin.ui.Form; //导入依赖的package包/类
protected void initAlfrescoComponent() {
  alfrescoForm = new Form();
  alfrescoForm.setDescription(i18nManager.getMessage(Messages.ALFRESCO_DESCRIPTION));
  
  final TextField alfrescoServer = new TextField(i18nManager.getMessage(Messages.ALFRESCO_SERVER));
  alfrescoForm.getLayout().addComponent(alfrescoServer);
  
  final TextField alfrescoUserName = new TextField(i18nManager.getMessage(Messages.ALFRESCO_USERNAME));
  alfrescoForm.getLayout().addComponent(alfrescoUserName);
  
  final PasswordField alfrescoPassword = new PasswordField(i18nManager.getMessage(Messages.ALFRESCO_PASSWORD));
  alfrescoForm.getLayout().addComponent(alfrescoPassword);
  
  // Matching listener
  alfrescoClickListener = new ClickListener() {
    public void buttonClick(ClickEvent event) {
      Map<String, Object> accountDetails = createAccountDetails(
              "alfresco", 
              alfrescoUserName.getValue().toString(), 
              alfrescoPassword.getValue().toString(),
              "server", alfrescoServer.getValue().toString()
              ); 
      fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
    }
  };
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:AccountSelectionPopup.java

示例2: FileAttachmentEditorComponent

import com.vaadin.ui.Form; //导入依赖的package包/类
public FileAttachmentEditorComponent(Attachment attachment, String taskId, String processInstanceId) {
  this.attachment = attachment;
  this.taskId = taskId;
  this.processInstanceId = processInstanceId;
  
  this.i18nManager = ExplorerApp.get().getI18nManager();
  taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
  
  form = new Form();
  form.setDescription(i18nManager.getMessage(Messages.RELATED_CONTENT_TYPE_FILE_HELP));
  setSizeFull();
  addComponent(form);
  initSuccessIndicator();
  initFileUpload();
  initName();
  initDescription();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:18,代码来源:FileAttachmentEditorComponent.java

示例3: WkdXmlConfigDialog

import com.vaadin.ui.Form; //导入依赖的package包/类
public WkdXmlConfigDialog(WkdXmlConfig config) {
    form = new Form();
    addComponent(form);
    beanItem = new BeanItem<WkdXmlConfig>(config);
    form.setImmediate(true);
    form.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            Field f = super.createField(item, propertyId, uiContext);
            f.setRequired(true);
            f.setWidth(500,UNITS_PIXELS);
            return f;
        }
    });
    form.setItemDataSource(beanItem);
    form.focus();
}
 
开发者ID:lodms,项目名称:lodms-plugins,代码行数:18,代码来源:WkdXmlConfigDialog.java

示例4: build

import com.vaadin.ui.Form; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public Form build() {
	Form form = new Form();
	
	if (layout != null)
		form.setLayout(layout);
	if (formFieldFactory != null)
		form.setFormFieldFactory(formFieldFactory);
	if (visibleProperties != null)
		form.setVisibleItemProperties(visibleProperties);
	if (width != null)
		form.setWidth(width);
	if (height != null)
		form.setHeight(height);
	
	return form;
}
 
开发者ID:chelu,项目名称:jdal,代码行数:20,代码来源:ConfigurableFormBuilder.java

示例5: buttonClick

import com.vaadin.ui.Form; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@SuppressWarnings("rawtypes")
@Override
public void buttonClick(ClickEvent event) {
	PageableTable<?> table = (PageableTable<?>) getTable();
	Filter filter = (Filter) table.getFilter();
	
	if (filter == null)
		return;
	
	filter.clear();
	
	if (table.getFilterForm() instanceof Form) {
		Form form = (Form) table.getFilterForm();
		form.discard();
	}
	else if (table.getFilterForm() instanceof View) {
		((View) table.getFilterForm()).refresh();
	}
	
	table.getPaginator().firstPage();
}
 
开发者ID:chelu,项目名称:jdal,代码行数:25,代码来源:ClearFilterAction.java

示例6: initForm

import com.vaadin.ui.Form; //导入依赖的package包/类
protected void initForm() {
  form = new Form();
  form.setSizeFull();
  
  addComponent(form);
  setComponentAlignment(form, Alignment.TOP_CENTER);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:FormPropertiesComponent.java

示例7: initForm

import com.vaadin.ui.Form; //导入依赖的package包/类
protected void initForm() {
  form = new Form();
  form.setValidationVisibleOnCommit(true);
  form.setImmediate(true);
  addComponent(form);
  
  initInputFields();
  initCreateButton();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:NewUserPopupWindow.java

示例8: initForm

import com.vaadin.ui.Form; //导入依赖的package包/类
protected void initForm() {
  form = new Form();
  form.setValidationVisibleOnCommit(true);
  form.setImmediate(true);
  addComponent(form);
  
  // name
  nameField = new TextField(i18nManager.getMessage(Messages.TASK_NAME));
  nameField.focus();
  nameField.setRequired(true);
  nameField.setRequiredError(i18nManager.getMessage(Messages.TASK_NAME_REQUIRED));
  form.addField("name", nameField);
  
  // description
  descriptionArea = new TextArea(i18nManager.getMessage(Messages.TASK_DESCRIPTION));
  descriptionArea.setColumns(25);
  form.addField("description", descriptionArea);
  
  // duedate
  dueDateField = new DateField(i18nManager.getMessage(Messages.TASK_DUEDATE));
  dueDateField.setResolution(DateField.RESOLUTION_DAY);
  form.addField("duedate", dueDateField);
  
  // priority
  priorityComboBox = new PriorityComboBox(i18nManager);
  form.addField("priority", priorityComboBox);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:28,代码来源:NewCasePopupWindow.java

示例9: FossaLoginScreen

import com.vaadin.ui.Form; //导入依赖的package包/类
public FossaLoginScreen(FossaApplication app, FossaAuthorizer authorizer, String error) {
	super(app);
	setStyleName("login");
	
	this.authorizer = authorizer;
	setCaption("Bitte melden Sie sich an!");
	setWidth("500px");
	center();
	CustomLayout layout = new CustomLayout("./login/loginScreen");
	setContent(layout);

	Label errorlabel = new Label(error);
	formLoginScreen = new Form();
	
	formLoginScreen.addField(username, username);
    username.focus();
	formLoginScreen.addField(password, password);
	formLoginScreen.getField(username).setRequired(true);
	formLoginScreen.getField(password).setRequired(true);
	
	layout.addComponent(formLoginScreen, "form");
	layout.addComponent(errorlabel, "errorlabel");

	Button login = new Button("Anmelden");
	layout.addComponent(login, "login");
	login.addListener((Button.ClickListener) this);
	login.setClickShortcut(KeyCode.ENTER);

}
 
开发者ID:fossaag,项目名称:rolp,代码行数:30,代码来源:FossaLoginScreen.java

示例10: renameGroup

import com.vaadin.ui.Form; //导入依赖的package包/类
private static void renameGroup(GraphContainer graphContainer, Vertex group, String newLabel) {
	RenameGroupOperation operation = new RenameGroupOperation();
	OperationContext context = getOperationContext(graphContainer);
	// Execute the operation on the single vertex
	operation.execute(Collections.singletonList((VertexRef)group), context);

	// Grab the window, put a value into the form field, and commit the form to complete
	// the operation.
	Window window = context.getMainWindow();
	assertEquals(1, window.getChildWindows().size());
	Window prompt = window.getChildWindows().iterator().next();

	for (Iterator<Component> itr = prompt.getComponentIterator(); itr.hasNext();) {
		Component component = itr.next();
		try {
			Form form = (Form)component;
			Field field = form.getField("Group Label");
			field.setValue(newLabel);
			// Make sure that the value was set, Vaadin will ignore the value
			// if, for instance, the specified value is not in the Select list
			assertEquals(newLabel, field.getValue());
			form.commit();
		} catch (ClassCastException e) {
			LoggerFactory.getLogger(GroupOperationsTest.class).info("Not a Form: " + component.getClass());
		}
	}
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:28,代码来源:GroupOperationsTest.java

示例11: SPARQLUpdateTransformDialog

import com.vaadin.ui.Form; //导入依赖的package包/类
public SPARQLUpdateTransformDialog(SPARQLUpdateTransformConfig oldConfig) {
    this.config = oldConfig;
    queryForm = new Form();
    queryForm.setSizeFull();
    queryForm.setFormFieldFactory(new FormFieldFactory() {

        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            if (propertyId.equals("query")) {
                TextArea query = new TextArea("SPARQL Query");
                query.setSizeFull();
                query.setRows(25);
                query.addValidator(new AbstractStringValidator("Must be a valid UPDATE query!") {

                    @Override
                    protected boolean isValidString(String value) {
                        SPARQLParser parser = new SPARQLParser();
                        try {
                            ParsedUpdate parsed = parser.parseUpdate(value, null);
                        } catch (Exception ex) {
                            setErrorMessage(ex.getMessage());
                            return false;
                        }
                        return true;
                    }
                });
                return query;
            }
            return null;
        }
    });
    queryForm.setItemDataSource(new BeanItem<SPARQLUpdateTransformConfig>(config));
    addComponent(queryForm);
}
 
开发者ID:lodms,项目名称:lodms-plugins,代码行数:35,代码来源:SPARQLUpdateTransformDialog.java

示例12: addOKCancelButtons

import com.vaadin.ui.Form; //导入依赖的package包/类
/**
 * Add a default commit/discard buttons to a form
 * @param f the Form
 */
public static void addOKCancelButtons(Form f) {
	Button ok = newOKButton(f);
	Button cancel = newCancelButton(f);
	HorizontalLayout hl = new HorizontalLayout();
	hl.setSpacing(true);
	hl.addComponent(ok);
	hl.addComponent(cancel);
	HorizontalLayout  footer = new HorizontalLayout();
	footer.setWidth("100%");
	footer.addComponent(hl);
	footer.setComponentAlignment(hl, Alignment.TOP_CENTER);
	f.setFooter(footer);
}
 
开发者ID:chelu,项目名称:jdal,代码行数:18,代码来源:FormUtils.java

示例13: newCancelButton

import com.vaadin.ui.Form; //导入依赖的package包/类
/**
 * Creates a new cancel button
 * @param f form holding the button
 * @return new cancel button
 */
private static Button newCancelButton(final Form f) {
	Button cancel = new Button(StaticMessageSource.getMessage("cancel"));
	cancel.addClickListener(new ClickListener() {
		
		public void buttonClick(ClickEvent event) {
			f.discard();
		}
	});
	
	return cancel;
}
 
开发者ID:chelu,项目名称:jdal,代码行数:17,代码来源:FormUtils.java

示例14: newOKButton

import com.vaadin.ui.Form; //导入依赖的package包/类
/**
 * Creates a new OK Button
 * @param f form holding the button
 * @return new OK Button
 */
private static Button newOKButton(final Form f) {
	Button ok = new Button(StaticMessageSource.getMessage("ok"));
	ok.addClickListener(new ClickListener() {
		
		public void buttonClick(ClickEvent event) {
			f.commit();
		}
	});
	
	return ok;
}
 
开发者ID:chelu,项目名称:jdal,代码行数:17,代码来源:FormUtils.java

示例15: createForm

import com.vaadin.ui.Form; //导入依赖的package包/类
private Form createForm() {
	Form form = new Form();
	form.setFormFieldFactory(this.formFieldFactory);
	return form;
}
 
开发者ID:frincon,项目名称:openeos,代码行数:6,代码来源:VaadinTabImpl.java


注:本文中的com.vaadin.ui.Form类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。