本文整理了Java中com.vaadin.ui.Layout.addComponent()
方法的一些代码示例,展示了Layout.addComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layout.addComponent()
方法的具体详情如下:
包路径:com.vaadin.ui.Layout
类名称:Layout
方法名:addComponent
暂无
代码示例来源:origin: org.aperteworkflow/gui-commons
@Override
public void attachToLayout(Layout layout) {
layout.addComponent(new Label("no help loaded"));
}
代码示例来源:origin: jpos/jPOS-EE
@Override
protected void addFields(Layout l) {
super.addFields(l);
selectedU = getInstance();
if (getInstance().getId() != null && getInstance().getId().equals(getApp().getUser().getId())) {
changePassBtn = createChangePasswordButton();
l.addComponents(changePassBtn, createPasswordPanel());
}
if (getInstance().hasPermission("sysadmin") && !isNewView()) {
resetPassBtn = createResetPasswordButton();
l.addComponent(resetPassBtn);
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
@Override
public void populate(T item) {
binder.readBean(item);
if (!optionsField.getSelectedItem().isPresent()) {
defaultSelectedOptionDefinition().ifPresent(optionsField::setSelectedItem);
}
optionsField.getSelectedItem().ifPresent(optionDefinition -> {
EditorView<T> subForm = subForm(optionDefinition);
subFormItemProvider(optionDefinition).read().ifPresent(subForm::populate);
layout.addComponent(subForm.asVaadinComponent());
});
}
代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin
public void refresh() {
try {
panel.removeComponent(m_attachmentsTable);
} catch (NullPointerException e) {
// ignore NPEs
}
m_attachmentsTable = getAttachmentsTable(getFilter(getPermissionManager(),m_currentPid));
panel.addComponent(m_attachmentsTable);
}
代码示例来源:origin: org.opennms.features/jmxconfiggenerator.webui
public HeaderPanel() {
Layout layout = new VerticalLayout();
label = new Label();
label.setContentMode(ContentMode.HTML);
layout.addComponent(label);
setContent(layout);
}
代码示例来源:origin: org.opennms.features/jmxconfiggenerator.webui
public IntroductionView(JmxConfigGeneratorApplication app) {
this.app = app;
Button next = UIHelper.createButton("next", IconProvider.BUTTON_NEXT, this);
setSizeFull();
setContent(new VerticalLayout());
getContent().setSizeFull();
Layout layout = new VerticalLayout();
layout.addComponent(new Label(UIHelper.loadContentFromFile(getClass(), "/descriptions/IntroductionView.html"),
ContentMode.HTML));
layout.addComponent(next);
setContent(layout);
}
代码示例来源:origin: org.activiti/activiti-explorer
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));
}
};
}
代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin
@PostConstruct
public void init() {
main = new VerticalLayout();
setContent(main);
setModal(true);
// main.setStyleName(Panel.STYLE_LIGHT);
main.setWidth(getWindowWidth());
main.setHeight(getWindowHeight());
panel = new VerticalLayout();
// main.setMargin(true);
main.addComponent(panel);
setCaption(m_messageSourceAccessor.getMessage("audit", "Audit"));
}
代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin
@PostConstruct
public void init() {
main = new VerticalLayout();
setContent(main);
setModal(true);
// main.setStyleName(Panel.STYLE_LIGHT);
main.setWidth(getWindowWidth());
main.setHeight(getWindowHeight());
panel = new VerticalLayout();
// main.setMargin(true);
main.addComponent(panel);
setCaption(m_messageSourceAccessor.getMessage("attachments", "Attachments"));
}
@SuppressWarnings("serial")
代码示例来源:origin: com.haulmont.addon.dashboard/dashboard-web
@Override
public void init(Map<String, Object> params) {
super.init(params);
layout = (DashboardLayout) params.get(WIDGET);
int initWeight = layout.getWeight();
weightSlider.setValue((double) initWeight);
weightSlider.setCaption(formatMessage("dashboard.weight", initWeight));
weightSlider.setWidth(100, Sizeable.Unit.PERCENTAGE);
weightSlider.setCaptionAsHtml(true);
weightSlider.addValueChangeListener((Property.ValueChangeListener) event ->
weightSlider.setCaption(formatMessage("dashboard.weight", weightSlider.getValue().intValue()))
);
weightSlider.focus();
sliderBox.unwrap(Layout.class).addComponent(weightSlider);
}
代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin
@PostConstruct
public void init() {
main = new VerticalLayout();
setContent(main);
setModal(true);
main.setWidth(getWindowWidth());
main.setHeight(getWindowHeight());
panel = new VerticalLayout();
main.addComponent(panel);
setCaption(m_messageSourceAccessor.getMessage("attachment", "Attachment"));
this.addCloseListener(new CloseListener(){
private static final long serialVersionUID = 1L;
@Override
public void windowClose(CloseEvent e) {
fireEvent(new AttachmentEvent(panel));
}});
}
public void load(final long pid) {
代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin
@PostConstruct
public void init() {
main = new VerticalLayout();
setContent(main);
setModal(true);
this.setWidth(getWindowWidth());
this.setHeight(getWindowHeight());
panel = new VerticalLayout();
panel.setMargin(true);
// main.setStyleName(Panel.STYLE_LIGHT);
main.addComponent(panel);
panel.addComponent(getInitialLayout());
setCaption(m_messageSourceAccessor.getMessage("launch.wizard", "Launch Wizard"));
}
代码示例来源:origin: org.activiti/activiti-explorer
protected void initCreateButton() {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setWidth(100, UNITS_PERCENTAGE);
form.getFooter().setWidth(100, UNITS_PERCENTAGE);
form.getFooter().addComponent(buttonLayout);
Button createButton = new Button(i18nManager.getMessage(Messages.USER_CREATE));
buttonLayout.addComponent(createButton);
buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
createButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
handleFormSubmit();
}
});
}
代码示例来源:origin: org.activiti/activiti-explorer
protected void initCreateTaskButton() {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setWidth(100, UNITS_PERCENTAGE);
form.getFooter().setWidth(100, UNITS_PERCENTAGE);
form.getFooter().addComponent(buttonLayout);
Button createButton = new Button(i18nManager.getMessage(Messages.BUTTON_CREATE));
buttonLayout.addComponent(createButton);
buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
createButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
handleFormSubmit();
}
});
}
代码示例来源:origin: org.activiti/activiti-explorer
protected void initCreateButton() {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setWidth(100, UNITS_PERCENTAGE);
form.getFooter().setWidth(100, UNITS_PERCENTAGE);
form.getFooter().addComponent(buttonLayout);
Button createButton = new Button(i18nManager.getMessage(Messages.GROUP_CREATE));
buttonLayout.addComponent(createButton);
buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
createButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
handleFormSubmit();
}
});
}
代码示例来源:origin: fi.vm.sade.organisaatio/organisaatio-ui-widgets
private void initializeComponents() {
root = new Panel();
Layout horizontalLayout = new HorizontalLayout();
searchField = new TextField();
horizontalLayout.addComponent(searchField);
searchField.setImmediate(true);
searchField.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
searchTextChanged((String) searchField.getValue());
}
});
root.addComponent(horizontalLayout);
root.addComponent(organizationTree);
organizationTree.setItemCaptionPropertyId("caption");
organizationTree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY);
organizationTree.setImmediate(true);
addComponent(root);
}
代码示例来源:origin: org.activiti/activiti-explorer
protected void addFields() {
form = new Form();
form.setCaption(i18nManager.getMessage(Messages.PROCESS_COPY_POPUP_CAPTION));
form.getLayout().setMargin(true);
nameTextField = new TextField(i18nManager.getMessage(Messages.TASK_NAME));
nameTextField.setWidth(20, Sizeable.UNITS_EM);
nameTextField.setRequired(true);
nameTextField.setValue(modelData.getName());
form.getLayout().addComponent(nameTextField);
nameTextField.focus();
descriptionTextArea = new TextArea(i18nManager.getMessage(Messages.TASK_DESCRIPTION));
descriptionTextArea.setRows(8);
descriptionTextArea.setWidth(20, Sizeable.UNITS_EM);
form.getLayout().addComponent(descriptionTextArea);
addComponent(form);
// Some empty space
Label emptySpace = new Label(" ", Label.CONTENT_XHTML);
addComponent(emptySpace);
}
代码示例来源:origin: nz.co.senanque/madura-workflow-vaadin
@PostConstruct
public void init() {
main = new VerticalLayout();
setContent(main);
setModal(true);
this.setWidth(getWindowWidth());
this.setHeight(getWindowHeight());
tabSheet = new TabSheet();
formPanel = new VerticalLayout();
tabSheet.addTab(formPanel,m_messageSourceAccessor.getMessage("formwizard.form"));
processPanel = new VerticalLayout();
tabSheet.addTab(processPanel,m_messageSourceAccessor.getMessage("formwizard.process"));
auditPanel = new VerticalLayout();
tabSheet.addTab(auditPanel,m_messageSourceAccessor.getMessage("formwizard.audit"));
main.addComponent(tabSheet);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
private void initialize() {
optionsField = formFieldFactory.createField(definition.getField(), locale);
layout.addComponent(optionsField);
optionsField.addValueChangeListener(e -> {
if (e.getOldValue() == null || e.getOldValue() == null) {
return;
}
EditorView<T> oldView = subForm(e.getOldValue());
EditorView<T> newView = subForm(e.getValue());
layout.replaceComponent(oldView.asVaadinComponent(), newView.asVaadinComponent());
});
definition.getForms().forEach(formDefinition -> {
ItemProviderStrategy<T> subFormProviderStrategy = create(((ComplexPropertyDefinition<T>) formDefinition).getItemProvider(), formDefinition, itemProviderStrategy);
EditorView<T> subForm = getViewProvider().create(formDefinition);
subForms.put(formDefinition.getName(), Pair.of(subForm, subFormProviderStrategy));
});
binder = ConfiguredBinder.withPropertySet(propertySetFactory.fromFieldDefinitions(Collections.singletonList(definition.getField()), locale));
binder.forField(optionsField)
.withConverter(new StringToOptionDefinitionConverter(definition.getField()))
.bind(resolvePropertyNameByLocale(definition.getField().getName(), locale, definition.getField().isI18n()));
}
代码示例来源:origin: org.aperteworkflow/editor
@Override
public void addPermissionWrapper(PermissionWrapper permissionWrapper) {
// ensure the privilege name
permissionWrapper.setPrivilegeName(permissionDefinition.getKey());
PermissionWrapperBox box = getPermissionWrapperBoxByRoleName(permissionWrapper.getRoleName());
if (box == null) {
box = new PermissionWrapperBox(permissionWrapper, this);
roleNameLayout.addComponent(box);
}
if (roleNameComboBox.containsId(permissionWrapper.getRoleName())) {
roleNameComboBox.removeItem(permissionWrapper.getRoleName());
}
Permission permission = new Permission();
permission.setPrivilegeName(permissionWrapper.getPrivilegeName());
permission.setRoleName(permissionWrapper.getRoleName());
provider.addPermission(permission);
}
内容来源于网络,如有侵权,请联系作者删除!