本文整理汇总了Java中org.vaadin.viritin.layouts.MHorizontalLayout类的典型用法代码示例。如果您正苦于以下问题:Java MHorizontalLayout类的具体用法?Java MHorizontalLayout怎么用?Java MHorizontalLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MHorizontalLayout类属于org.vaadin.viritin.layouts包,在下文中一共展示了MHorizontalLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setMargin(true);
root.setSpacing(true);
setContent(root);
MHorizontalLayout horizontalLayout = new MHorizontalLayout();
for (MenuEntry menuEntry : menuEntries) {
horizontalLayout.addComponent(new MButton(menuEntry.getName(), event -> {
navigator.navigateTo(menuEntry.getNavigationTarget());
}));
}
root.addComponent(horizontalLayout);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
root.addComponent(springViewDisplay);
root.setExpandRatio(springViewDisplay, 1.0f);
}
开发者ID:dve,项目名称:spring-boot-plugins-example,代码行数:21,代码来源:VaadinUI.java
示例2: layout
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
/**
* Do the application layout that is optimized for the screen size.
* <p>
* Like in Java world in general, Vaadin developers can modularize their
* helpers easily and re-use existing code. E.g. In this method we are using
* extended versions of Vaadins basic layout that has "fluent API" and this
* way we get bit more readable code. Check out vaadin.com/directory for a
* huge amount of helper libraries and custom components. They might be
* valuable for your productivity.
* </p>
*/
private void layout() {
removeAllComponents();
if (ScreenSize.getScreenSize() == ScreenSize.LARGE) {
addComponents(
new MHorizontalLayout(header, filter, addButton)
.expand(header)
.alignAll(Alignment.MIDDLE_LEFT),
mainContent
);
filter.setSizeUndefined();
} else {
addComponents(
header,
new MHorizontalLayout(filter, addButton)
.expand(filter)
.alignAll(Alignment.MIDDLE_LEFT),
mainContent
);
}
setMargin(new MarginInfo(false, true, true, true));
expand(mainContent);
}
开发者ID:IBM-Cloud,项目名称:onprem-integration-demo,代码行数:35,代码来源:CustomerListView.java
示例3: createContent
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected Component createContent() {
return new MVerticalLayout(
getToolbar(),
new MHorizontalLayout(
new MFormLayout(
name,
number,
email,
birthDate,
sendChristmasCard
).withMargin(false),
groupsGrid
),
addresses
).withMargin(new MMarginInfo(false, true));
}
开发者ID:mstahv,项目名称:jpa-addressbook,代码行数:18,代码来源:PhoneBookEntryForm.java
示例4: init
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@PostConstruct
void init() {
// Add some event listners, e.g. to hook filter input to actually
// filter the displayed entries
filter.addValueChangeListener(e -> {
listEntries(e.getValue());
});
entryList.asSingleSelect().addValueChangeListener(this::entrySelected);
form.setSavedHandler(this::entrySaved);
form.setResetHandler(this::entryEditCanceled);
addComponents(
new MVerticalLayout(
new Header("PhoneBook"),
new MHorizontalLayout(addNew, delete, filter),
new MHorizontalLayout(entryList, form)
)
);
// List all entries and select first entry in the list
listEntries();
entryList.select(service.getGroups().get(0));
}
开发者ID:mstahv,项目名称:jpa-addressbook,代码行数:24,代码来源:GroupsView.java
示例5: init
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@PostConstruct
void init() {
// Add some event listners, e.g. to hook filter input to actually
// filter the displayed entries
filter.addValueChangeListener(e -> {
listEntries(e.getValue());
});
entryList.asSingleSelect().addValueChangeListener(this::entrySelected);
form.setSavedHandler(this::entrySaved);
form.setResetHandler(this::entryEditCanceled);
addComponents(
new MVerticalLayout(
new MHorizontalLayout(addNew, delete, filter),
new MHorizontalLayout(entryList, form)
)
);
// List all entries and select first entry in the list
listEntries();
form.setVisible(false);
}
开发者ID:mstahv,项目名称:jpa-addressbook,代码行数:23,代码来源:MainView.java
示例6: initContent
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected Component initContent() {
MHorizontalLayout layout = new MHorizontalLayout().withFullWidth();
final PrefixNameComboBox prefixSelect = new PrefixNameComboBox();
prefixSelect.setValue(attachForm.getBean().getPrefixname());
layout.addComponent(prefixSelect);
prefixSelect.addValueChangeListener(event -> attachForm.getBean().setPrefixname((String) prefixSelect.getValue()));
TextField firstnameTxtField = new TextField();
firstnameTxtField.setWidth("100%");
firstnameTxtField.setNullRepresentation("");
layout.addComponent(firstnameTxtField);
layout.setExpandRatio(firstnameTxtField, 1.0f);
// binding field group
fieldGroup.bind(prefixSelect, "prefixname");
fieldGroup.bind(firstnameTxtField, "firstname");
return layout;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:23,代码来源:LeadEditFormFieldFactory.java
示例7: AboutWindow
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
public AboutWindow() {
MHorizontalLayout content = new MHorizontalLayout().withMargin(true).withFullWidth();
this.setContent(content);
Image about = new Image("", new ExternalResource(StorageUtils.generateAssetRelativeLink(WebResourceIds._about)));
MVerticalLayout rightPanel = new MVerticalLayout();
ELabel versionLbl = ELabel.h2(String.format("MyCollab Community Edition %s", Version.getVersion()));
Label javaNameLbl = new Label(String.format("%s, %s", System.getProperty("java.vm.name"),
System.getProperty("java.runtime.version")));
Label homeFolderLbl = new Label("Home folder: " + FileUtils.getHomeFolder().getAbsolutePath());
WebBrowser browser = Page.getCurrent().getWebBrowser();
Label osLbl = new Label(String.format("%s, %s", System.getProperty("os.name"),
browser.getBrowserApplication()));
osLbl.addStyleName(UIConstants.LABEL_WORD_WRAP);
Div licenseDiv = new Div().appendChild(new Text("Powered by: "))
.appendChild(new A("https://www.mycollab.com")
.appendText("MyCollab")).appendChild(new Text(". Open source under GPL license"));
Label licenseLbl = ELabel.html(licenseDiv.write());
Label copyRightLbl = ELabel.html(String.format("© %s - %s MyCollab Ltd. All rights reserved", "2011",
new GregorianCalendar().get(Calendar.YEAR) + ""));
rightPanel.with(versionLbl, javaNameLbl, osLbl, homeFolderLbl, licenseLbl, copyRightLbl)
.withAlign(copyRightLbl, Alignment.BOTTOM_LEFT);
content.with(about, rightPanel).expand(rightPanel);
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:26,代码来源:AboutWindow.java
示例8: buildCell
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
public GridCellWrapper buildCell(String caption, String contextHelp, int columns, int rows, int colSpan, String width, Alignment alignment) {
if (StringUtils.isNotBlank(caption)) {
ELabel captionLbl = new ELabel(caption).withStyleName(UIConstants.LABEL_WORD_WRAP).withDescription(caption);
MHorizontalLayout captionWrapper = new MHorizontalLayout().withSpacing(false).withMargin(true)
.withWidth(defaultCaptionWidth).withFullHeight().withStyleName("gridform-caption").with(captionLbl).expand(captionLbl)
.withAlign(captionLbl, alignment);
if (StringUtils.isNotBlank(contextHelp)) {
ELabel contextHelpLbl = ELabel.html(" " + FontAwesome.QUESTION_CIRCLE.getHtml())
.withStyleName(WebThemes.INLINE_HELP).withDescription(contextHelp).withWidthUndefined();
captionWrapper.with(contextHelpLbl);
}
layout.addComponent(captionWrapper, 2 * columns, rows);
}
GridCellWrapper fieldWrapper = new GridCellWrapper();
fieldWrapper.setWidth(width);
layout.addComponent(fieldWrapper, 2 * columns + 1, rows, 2 * (columns + colSpan - 1) + 1, rows);
layout.setColumnExpandRatio(2 * columns + 1, 1.0f);
if (StringUtils.isNotBlank(caption)) {
fieldCaptionMappings.put(caption, fieldWrapper);
}
return fieldWrapper;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:24,代码来源:GridFormLayoutHelper.java
示例9: buildControlsLayout
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
private ComponentContainer buildControlsLayout() {
MHorizontalLayout viewControlsLayout = new MHorizontalLayout().withStyleName(WebThemes.TABLE_ACTION_CONTROLS).withFullWidth();
selectOptionButton = new SelectionOptionButton(tableItem);
selectOptionButton.setSizeUndefined();
tableActionControls = createActionControls();
MHorizontalLayout leftContainer = new MHorizontalLayout(selectOptionButton, tableActionControls, selectedItemsNumberLabel);
leftContainer.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
extraControlsLayout = new ButtonGroup();
buildExtraControls();
viewControlsLayout.with(leftContainer, extraControlsLayout).withAlign(leftContainer, Alignment.MIDDLE_LEFT)
.withAlign(extraControlsLayout, Alignment.MIDDLE_RIGHT);
return viewControlsLayout;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:18,代码来源:AbstractListItemComp.java
示例10: createButtonControls
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected ComponentContainer createButtonControls() {
MButton editBtn = new MButton("", clickEvent -> EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoEdit(this, beanItem)))
.withIcon(FontAwesome.EDIT).withStyleName(UIConstants.CIRCLE_BOX)
.withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS));
MButton deleteBtn = new MButton("", clickEvent -> ConfirmDialog.show(UI.getCurrent(),
UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_SINGLE_ITEM_MESSAGE),
UserUIContext.getMessage(GenericI18Enum.ACTION_YES),
UserUIContext.getMessage(GenericI18Enum.ACTION_NO),
dialog -> {
if (dialog.isConfirmed()) {
ProjectMemberService projectMemberService = AppContextUtil.getSpringBean(ProjectMemberService.class);
projectMemberService.removeWithSession(beanItem, UserUIContext.getUsername(), AppUI.getAccountId());
EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoList(this, CurrentProjectVariables.getProjectId()));
}
})).withIcon(FontAwesome.TRASH).withStyleName(UIConstants.CIRCLE_BOX)
.withVisible(CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.USERS));
return new MHorizontalLayout(editBtn, deleteBtn);
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:22,代码来源:ProjectMemberReadViewImpl.java
示例11: buildSearchTitle
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected ComponentContainer buildSearchTitle() {
if (canSwitchToAdvanceLayout) {
savedFilterComboBox = new BugSavedFilterComboBox();
savedFilterComboBox.addQuerySelectListener(new SavedFilterComboBox.QuerySelectListener() {
@Override
public void querySelect(SavedFilterComboBox.QuerySelectEvent querySelectEvent) {
List<SearchFieldInfo<BugSearchCriteria>> fieldInfos = querySelectEvent.getSearchFieldInfos();
BugSearchCriteria criteria = SearchFieldInfo.buildSearchCriteria(BugSearchCriteria.class, fieldInfos);
criteria.setProjectId(new NumberSearchField(CurrentProjectVariables.getProjectId()));
EventBusFactory.getInstance().post(new BugEvent.SearchRequest(BugSearchPanel.this, criteria));
EventBusFactory.getInstance().post(new ShellEvent.AddQueryParam(this, fieldInfos));
}
});
ELabel taskIcon = ELabel.h2(ProjectAssetsManager.getAsset(ProjectTypeConstants.BUG).getHtml()).withWidthUndefined();
return new MHorizontalLayout(taskIcon, savedFilterComboBox).expand(savedFilterComboBox).alignAll(Alignment.MIDDLE_LEFT);
} else {
return null;
}
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:21,代码来源:BugSearchPanel.java
示例12: getLayout
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
public AbstractComponent getLayout() {
final VerticalLayout layout = new VerticalLayout();
informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(2, 2);
layout.addComponent(informationLayout.getLayout());
final MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
.withStyleName(WebThemes.BUTTON_OPTION);
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
if (EditForm.this.validateForm()) {
PageService pageService = AppContextUtil.getSpringBean(PageService.class);
pageService.createFolder(folder, UserUIContext.getUsername());
folder.setCreatedTime(new GregorianCalendar());
folder.setCreatedUser(UserUIContext.getUsername());
GroupPageAddWindow.this.close();
EventBusFactory.getInstance().post(new PageEvent.GotoList(GroupPageAddWindow.this, folder.getPath()));
}
}).withIcon(FontAwesome.SAVE).withStyleName(WebThemes.BUTTON_ACTION);
final MHorizontalLayout controlsBtn = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(new MarginInfo(true, true, true, false));
layout.addComponent(controlsBtn);
layout.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT);
return layout;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:26,代码来源:GroupPageAddWindow.java
示例13: displayFileName
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
private void displayFileName(File file, final String fileName) {
final MHorizontalLayout fileAttachmentLayout = new MHorizontalLayout().withFullWidth();
MButton removeBtn = new MButton("", clickEvent -> {
File tmpFile = fileStores.get(fileName);
if (tmpFile != null) {
tmpFile.delete();
}
fileStores.remove(fileName);
rowWrap.removeComponent(fileAttachmentLayout);
}).withIcon(FontAwesome.TRASH_O).withStyleName(MobileUIConstants.BUTTON_LINK);
ELabel fileLbl = ELabel.html(fileName).withDescription(fileName).withStyleName(UIConstants.TEXT_ELLIPSIS);
fileAttachmentLayout.with(ELabel.fontIcon(FileAssetsUtil.getFileIconResource(fileName)).withWidthUndefined(),
fileLbl, new ELabel(" - " + FileUtils.getVolumeDisplay(file.length()))
.withStyleName(UIConstants.META_INFO).withWidthUndefined(), removeBtn).expand(fileLbl);
rowWrap.addComponent(fileAttachmentLayout);
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:18,代码来源:ProjectFormAttachmentUploadField.java
示例14: initUI
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
private void initUI() {
MVerticalLayout mainLayout = new MVerticalLayout().withMargin(new MarginInfo(false, false, true, false)).withFullWidth();
GridFormLayoutHelper passInfo = GridFormLayoutHelper.defaultFormLayoutHelper(1, 4);
passInfo.addComponent(txtWebsite, UserUIContext.getMessage(UserI18nEnum.FORM_WEBSITE), 0, 0);
passInfo.addComponent(txtCompany, UserUIContext.getMessage(UserI18nEnum.FORM_COMPANY), 0, 1);
passInfo.addComponent(cboCountry, UserUIContext.getMessage(UserI18nEnum.FORM_COUNTRY), 0, 2);
txtWebsite.setValue(MoreObjects.firstNonNull(user.getWebsite(), ""));
txtCompany.setValue(MoreObjects.firstNonNull(user.getCompany(), ""));
cboCountry.setValue(MoreObjects.firstNonNull(user.getCountry(), ""));
mainLayout.with(passInfo.getLayout()).withAlign(passInfo.getLayout(), Alignment.TOP_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
.withStyleName(WebThemes.BUTTON_OPTION);
MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changeInfo())
.withStyleName(WebThemes.BUTTON_ACTION).withIcon(FontAwesome.SAVE).withClickShortcut(ShortcutAction.KeyCode.ENTER);
MHorizontalLayout buttonControls = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(new MarginInfo(false, true, false, true));
mainLayout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT);
this.setModal(true);
this.setContent(mainLayout);
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:27,代码来源:AdvancedInfoChangeWindow.java
示例15: constructTableActionControls
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
private ComponentContainer constructTableActionControls() {
final CssLayout layoutWrapper = new CssLayout();
layoutWrapper.setWidth("100%");
MHorizontalLayout layout = new MHorizontalLayout();
layoutWrapper.addStyleName(WebThemes.TABLE_ACTION_CONTROLS);
layoutWrapper.addComponent(layout);
this.selectOptionButton = new SelectionOptionButton(this.tableItem);
layout.addComponent(this.selectOptionButton);
tableActionControls = new DefaultMassItemActionHandlerContainer();
if (CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.VERSIONS)) {
tableActionControls.addDeleteActionItem();
}
tableActionControls.addMailActionItem();
tableActionControls.addDownloadPdfActionItem();
tableActionControls.addDownloadExcelActionItem();
tableActionControls.addDownloadCsvActionItem();
layout.with(tableActionControls, selectedItemsNumberLabel).withAlign(selectedItemsNumberLabel, Alignment.MIDDLE_CENTER);
return layoutWrapper;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:25,代码来源:VersionListViewImpl.java
示例16: constructBody
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_CENTER);
this.myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox).withAlign(myItemCheckbox, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);
MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);
return basicSearchBody;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:25,代码来源:ContactSearchPanel.java
示例17: initContent
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected Component initContent() {
MHorizontalLayout layout = new MHorizontalLayout().withFullWidth();
layout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
MButton browseBtn = new MButton("", clickEvent -> {
CampaignSelectionWindow campaignWindow = new CampaignSelectionWindow(CampaignSelectionField.this);
UI.getCurrent().addWindow(campaignWindow);
campaignWindow.show();
}).withIcon(FontAwesome.ELLIPSIS_H).withStyleName(WebThemes.BUTTON_OPTION, WebThemes.BUTTON_SMALL_PADDING);
MButton clearBtn = new MButton("", clickEvent -> {
campaignName.setValue("");
internalValue = null;
}).withIcon(FontAwesome.TRASH_O).withStyleName(WebThemes.BUTTON_OPTION, WebThemes.BUTTON_SMALL_PADDING);
layout.with(campaignName, browseBtn, clearBtn).expand(campaignName);
return layout;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:20,代码来源:CampaignSelectionField.java
示例18: createLegendBox
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected final ComponentContainer createLegendBox() {
final CssLayout mainLayout = new CssLayout();
mainLayout.setWidth("100%");
mainLayout.addStyleName("legendBoxContent");
final List series = dataSet.getSeries();
for (int i = 0; i < series.size(); i++) {
final MHorizontalLayout layout = new MHorizontalLayout().withMargin(new MarginInfo(false, false, false, true));
layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
final TimeSeries key = (TimeSeries) series.get(i);
int colorIndex = i % CHART_COLOR_STR.size();
final String color = "<div style = \" width:13px;height:13px;background: #" + CHART_COLOR_STR.get(colorIndex) + "\" />";
final ELabel lblCircle = ELabel.html(color);
String captionBtn = UserUIContext.getMessage(StatusI18nEnum.class, (String) key.getKey());
final MButton btnLink = new MButton(StringUtils.trim(captionBtn, 30, true)).withDescription
(captionBtn).withStyleName(WebThemes.BUTTON_LINK);
layout.with(lblCircle, btnLink);
mainLayout.addComponent(layout);
}
return mainLayout;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:26,代码来源:TicketCloseTrendChartWidget.java
示例19: initContent
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected Component initContent() {
layout = new MHorizontalLayout(resolutionComboBox);
fieldGroup.bind(resolutionComboBox, BugWithBLOBs.Field.resolution.name());
resolutionComboBox.addValueChangeListener(valueChangeEvent -> {
String value = (String) resolutionComboBox.getValue();
if (BugResolution.Duplicate.name().equals(value)) {
bugSelectionField = new BugSelectionField();
layout.with(new Label(" with "), bugSelectionField);
} else {
if (layout.getComponentCount() > 1) {
layout.removeComponent(layout.getComponent(1));
layout.removeComponent(layout.getComponent(1));
}
}
});
return layout;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:19,代码来源:ResolvedInputForm.java
示例20: initContent
import org.vaadin.viritin.layouts.MHorizontalLayout; //导入依赖的package包/类
@Override
protected Component initContent() {
componentsText = new TextField();
componentsText.setNullRepresentation("");
componentsText.setReadOnly(true);
componentsText.addStyleName("noBorderRight");
componentsText.setWidth("100%");
componentPopupSelection = new PopupButton();
componentPopupSelection.addStyleName(WebThemes.MULTI_SELECT_BG);
componentPopupSelection.setDirection(Alignment.BOTTOM_LEFT);
componentPopupSelection.addClickListener(clickEvent -> initContentPopup());
popupContent = new OptionPopupContent();
componentPopupSelection.setContent(popupContent);
MHorizontalLayout content = new MHorizontalLayout(componentsText).withAlign(componentsText, Alignment.MIDDLE_LEFT);
MHorizontalLayout multiSelectComp = new MHorizontalLayout(componentsText, componentPopupSelection)
.withSpacing(false).expand(componentsText);
content.with(multiSelectComp);
return content;
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:23,代码来源:SavedFilterComboBox.java
注:本文中的org.vaadin.viritin.layouts.MHorizontalLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论