本文整理汇总了Java中com.vaadin.ui.GridLayout.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java GridLayout.setWidth方法的具体用法?Java GridLayout.setWidth怎么用?Java GridLayout.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.GridLayout
的用法示例。
在下文中一共展示了GridLayout.setWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildHorizontalSplitPanel
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
private HorizontalSplitPanel buildHorizontalSplitPanel() {
// common part: create layout
horizontalSplitPanel = new HorizontalSplitPanel();
horizontalSplitPanel.setImmediate(false);
horizontalSplitPanel.setWidth("100.0%");
horizontalSplitPanel.setHeight("100.0%");
horizontalSplitPanel.setMargin(false);
// gridLayout_1
gridLayoutCalendar = new GridLayout();
gridLayoutCalendar.setImmediate(true);
gridLayoutCalendar.setWidth("100.0%");
gridLayoutCalendar.setHeight("100.0%");
gridLayoutCalendar.setMargin(false);
gridLayoutCalendar.setColumns(4);
gridLayoutCalendar.setRows(3);
horizontalSplitPanel.setSecondComponent(gridLayoutCalendar);
return horizontalSplitPanel;
}
示例2: buildSubForm
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
private AbstractComponentContainer buildSubForm(SubForm subForm, Map<String, AbstractComponent> mapComponents,
List<String> fieldIdList, Map<String, Object> extraObjects) {
//panel.setCaption(formEditor.getName());
GridLayout layout = new GridLayout(subForm.getColumns(), subForm.getRows());
layout.setWidth("100%");
layout.setSpacing(true);
for (int row = 0; row < subForm.getRows(); row++) {
for (int column = 0; column < subForm.getColumns(); column++) {
Component component = subForm.getField(row, column);
if (component == null) {
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
} else if (component instanceof Field) {
Field editor = (Field) component;
if (editor != null) {
layout.addComponent(buildField(editor, mapComponents, fieldIdList, extraObjects));
}
} else {
buildComponent(component, mapComponents, fieldIdList, extraObjects);
}
}
}
return layout;
}
示例3: createInfoSectionLayout
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected GridLayout createInfoSectionLayout(int columns, int rows) {
GridLayout layout = new GridLayout(columns, rows);
layout.setSpacing(true);
layout.setWidth(100, UNITS_PERCENTAGE);
layout.setMargin(true, false, true, false);
infoPanelLayout.addComponent(layout);
return layout;
}
示例4: addDeploymentName
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void addDeploymentName() {
GridLayout taskDetails = new GridLayout(3, 2);
taskDetails.setWidth(100, UNITS_PERCENTAGE);
taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
taskDetails.setSpacing(true);
taskDetails.setMargin(false, false, true, false);
// Add image
Embedded image = new Embedded(null, Images.DEPLOYMENT_50);
taskDetails.addComponent(image, 0, 0, 0, 1);
// Add deployment name
Label nameLabel = new Label();
if(deployment.getName() != null) {
nameLabel.setValue(deployment.getName());
} else {
nameLabel.setValue(i18nManager.getMessage(Messages.DEPLOYMENT_NO_NAME));
}
nameLabel.addStyleName(Reindeer.LABEL_H2);
taskDetails.addComponent(nameLabel, 1, 0, 2, 0);
// Add deploy time
PrettyTimeLabel deployTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.DEPLOYMENT_DEPLOY_TIME),
deployment.getDeploymentTime(), null, true);
deployTimeLabel.addStyleName(ExplorerLayout.STYLE_DEPLOYMENT_HEADER_DEPLOY_TIME);
taskDetails.addComponent(deployTimeLabel, 1, 1);
taskDetails.setColumnExpandRatio(1, 1.0f);
taskDetails.setColumnExpandRatio(2, 1.0f);
addDetailComponent(taskDetails);
}
示例5: addHeader
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void addHeader() {
GridLayout taskDetails = new GridLayout(3, 2);
taskDetails.setWidth(100, UNITS_PERCENTAGE);
taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
taskDetails.setSpacing(true);
taskDetails.setMargin(false, false, true, false);
// Add image
Embedded image = new Embedded(null, Images.JOB_50);
taskDetails.addComponent(image, 0, 0, 0, 1);
// Add job name
Label nameLabel = new Label(getJobLabel(job));
nameLabel.addStyleName(Reindeer.LABEL_H2);
taskDetails.addComponent(nameLabel, 1, 0, 2, 0);
// Add due date
PrettyTimeLabel dueDateLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.JOB_DUEDATE),
job.getDuedate(), i18nManager.getMessage(Messages.JOB_NO_DUEDATE), false);
dueDateLabel.addStyleName(ExplorerLayout.STYLE_JOB_HEADER_DUE_DATE);
taskDetails.addComponent(dueDateLabel, 1, 1);
taskDetails.setColumnExpandRatio(1, 1.0f);
taskDetails.setColumnExpandRatio(2, 1.0f);
addDetailComponent(taskDetails);
}
示例6: addHeader
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void addHeader() {
GridLayout header = new GridLayout(3, 2);
header.setWidth(100, UNITS_PERCENTAGE);
header.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
header.setSpacing(true);
header.setMargin(false, false, true, false);
// Add image
Embedded image = new Embedded(null, Images.PROCESS_50);
header.addComponent(image, 0, 0, 0, 1);
// Add task name
Label nameLabel = new Label(getProcessDisplayName(processDefinition, processInstance));
nameLabel.addStyleName(Reindeer.LABEL_H2);
header.addComponent(nameLabel, 1, 0, 2, 0);
// Add start time
PrettyTimeLabel startTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.PROCESS_START_TIME),
historicProcessInstance.getStartTime(), null, true);
startTimeLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_START_TIME);
header.addComponent(startTimeLabel, 1, 1);
header.setColumnExpandRatio(1, 1.0f);
header.setColumnExpandRatio(2, 1.0f);
panelLayout.addComponent(header);
}
示例7: initHeader
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void initHeader() {
GridLayout details = new GridLayout(2, 2);
details.setWidth(100, UNITS_PERCENTAGE);
details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
details.setSpacing(true);
details.setMargin(false, false, true, false);
details.setColumnExpandRatio(1, 1.0f);
detailPanelLayout.addComponent(details);
// Image
Embedded image = new Embedded(null, Images.PROCESS_50);
details.addComponent(image, 0, 0, 0, 1);
// Name
Label nameLabel = new Label(getProcessDisplayName(processDefinition));
nameLabel.addStyleName(Reindeer.LABEL_H2);
details.addComponent(nameLabel, 1, 0);
// Properties
HorizontalLayout propertiesLayout = new HorizontalLayout();
propertiesLayout.setSpacing(true);
details.addComponent(propertiesLayout);
// Version
String versionString = i18nManager.getMessage(Messages.PROCESS_VERSION, processDefinition.getVersion());
Label versionLabel = new Label(versionString);
versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_VERSION);
propertiesLayout.addComponent(versionLabel);
// Add deploy time
PrettyTimeLabel deployTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.PROCESS_DEPLOY_TIME),
deployment.getDeploymentTime(), null, true);
deployTimeLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_DEPLOY_TIME);
propertiesLayout.addComponent(deployTimeLabel);
}
示例8: initSubTasksLayout
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void initSubTasksLayout() {
subTaskLayout = new GridLayout();
subTaskLayout.setColumns(3);
subTaskLayout.addStyleName(ExplorerLayout.STYLE_TASK_SUBTASKS_LIST);
subTaskLayout.setWidth(99, UNITS_PERCENTAGE);
subTaskLayout.setColumnExpandRatio(2, 1.0f);
subTaskLayout.setSpacing(true);
layout.addComponent(subTaskLayout);
}
示例9: initPeopleGrid
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void initPeopleGrid() {
peopleGrid = new GridLayout();
peopleGrid.setColumns(2);
peopleGrid.setSpacing(true);
peopleGrid.setMargin(true, false, false, false);
peopleGrid.setWidth(100, UNITS_PERCENTAGE);
peopleLayout.addComponent(peopleGrid);
}
示例10: initHeader
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void initHeader() {
GridLayout taskDetails = new GridLayout(2, 2);
taskDetails.setWidth(100, UNITS_PERCENTAGE);
taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
taskDetails.setSpacing(true);
taskDetails.setMargin(false, false, true, false);
taskDetails.setColumnExpandRatio(1, 1.0f);
centralLayout.addComponent(taskDetails);
// Add image
Embedded image = new Embedded(null, Images.TASK_50);
taskDetails.addComponent(image, 0, 0, 0, 1);
// Add task name
Label nameLabel = new Label(task.getName());
nameLabel.addStyleName(Reindeer.LABEL_H2);
taskDetails.addComponent(nameLabel, 1, 0);
taskDetails.setComponentAlignment(nameLabel, Alignment.MIDDLE_LEFT);
// Properties
HorizontalLayout propertiesLayout = new HorizontalLayout();
propertiesLayout.setSpacing(true);
taskDetails.addComponent(propertiesLayout);
propertiesLayout.addComponent(new DueDateComponent(task, i18nManager, taskService));
propertiesLayout.addComponent(new PriorityComponent(task, i18nManager, taskService));
initCreateTime(propertiesLayout);
}
示例11: initEventGrid
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void initEventGrid() {
eventGrid = new GridLayout();
eventGrid.setColumns(2);
eventGrid.setSpacing(true);
eventGrid.setMargin(true, false, false, false);
eventGrid.setWidth("100%");
eventGrid.setColumnExpandRatio(1, 1.0f);
eventGrid.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_GRID);
addComponent(eventGrid);
}
示例12: initPeopleGrid
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected void initPeopleGrid() {
peopleGrid = new GridLayout();
peopleGrid.setColumns(2);
peopleGrid.setSpacing(true);
peopleGrid.setMargin(true, false, false, false);
peopleGrid.setWidth(100, UNITS_PERCENTAGE);
layout.addComponent(peopleGrid);
populatePeopleGrid();
}
示例13: newPanel
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
protected Panel newPanel(String title)
{
Panel panel = new Panel(title);
GridLayout layout = new GridLayout(2, 2);
layout.setWidth(100.0f, Unit.PERCENTAGE);
layout.setMargin(true);
layout.setSpacing(true);
layout.setColumnExpandRatio(0, 0.2f);
layout.setColumnExpandRatio(1, 0.8f);
layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
panel.setContent(layout);
return panel;
}
示例14: buildCheckBoxLayout
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
private void buildCheckBoxLayout() {
// area with check boxes
GridLayout checkLayout = new GridLayout(3, 1);
checkLayout.setWidth("100%");
checkLayout.setHeight("-1px");
checkLayout.setSpacing(true);
this.mainLayout.addComponent(checkLayout);
this.checkGenerateNew = new CheckBox(this.ctx.tr("dialog.column.generate.new"));
this.checkGenerateNew.setDescription(this.ctx.tr("dialog.column.generate.new.description"));
checkLayout.addComponent(this.checkGenerateNew);
this.checkIgnoreBlankCell = new CheckBox(this.ctx.tr("dialog.ignore.blank"));
this.checkIgnoreBlankCell.setDescription(this.ctx.tr("dialog.ignore.blank.description"));
checkLayout.addComponent(this.checkIgnoreBlankCell);
this.checkAdvancedKeyColumn = new CheckBox(this.ctx.tr("dialog.column.advanced.key"));
this.checkAdvancedKeyColumn.setDescription(this.ctx.tr("dialog.column.advanced.key.description"));
checkLayout.addComponent(this.checkAdvancedKeyColumn);
this.checkGenerateRowTriple = new CheckBox(this.ctx.tr("dialog.row.generate.column"));
this.checkGenerateRowTriple.setDescription(this.ctx.tr("dialog.row.generate.column.description"));
checkLayout.addComponent(this.checkGenerateRowTriple);
this.checkTableSubject = new CheckBox(this.ctx.tr("dialog.table.subject"));
this.checkTableSubject.setDescription(this.ctx.tr("dialog.table.subject.description", TabularOntology.TABLE_HAS_ROW, TabularOntology.TABLE_SYMBOLIC_NAME));
checkLayout.addComponent(this.checkTableSubject);
this.checkAutoAsString = new CheckBox(this.ctx.tr("dialog.auto.type.string"));
this.checkAutoAsString.setDescription(this.ctx.tr("dialog.auto.type.string.description"));
checkLayout.addComponent(this.checkAutoAsString);
this.checkGenerateTableClass = new CheckBox(this.ctx.tr("dialog.table.row.class"));
this.checkGenerateRowTriple.setDescription(this.ctx.tr("dialog.table.row.class.description"));
checkLayout.addComponent(this.checkGenerateTableClass);
this.checkGenerateLabels = new CheckBox(this.ctx.tr("dialog.labels.generate"));
this.checkGenerateLabels.setDescription(this.ctx.tr("dialog.labels.generate.description"));
checkLayout.addComponent(this.checkGenerateLabels);
}
示例15: displayEntryPeople
import com.vaadin.ui.GridLayout; //导入方法依赖的package包/类
void displayEntryPeople(ValuedBean bean) {
this.removeAllComponents();
ELabel peopleInfoHeader = ELabel.html(FontAwesome.USER.getHtml() + " " +
UserUIContext.getMessage(ProjectCommonI18nEnum.SUB_INFO_PEOPLE)).withStyleName("info-hdr");
this.addComponent(peopleInfoHeader);
GridLayout layout = new GridLayout(2, 2);
layout.setWidth("100%");
layout.setMargin(new MarginInfo(false, false, false, true));
try {
ELabel createdLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_CREATED_PEOPLE)).withWidthUndefined();
layout.addComponent(createdLbl, 0, 0);
String createdUserName = (String) PropertyUtils.getProperty(bean, "createduser");
String createdUserAvatarId = (String) PropertyUtils.getProperty(bean, "logByAvatarId");
String createdUserDisplayName = (String) PropertyUtils.getProperty(bean, "logByFullName");
ProjectMemberLink createdUserLink = new ProjectMemberLink(createdUserName,
createdUserAvatarId, createdUserDisplayName);
layout.addComponent(createdUserLink, 1, 0);
layout.setColumnExpandRatio(1, 1.0f);
ELabel assigneeLbl = new ELabel(UserUIContext.getMessage(ProjectCommonI18nEnum.ITEM_ASSIGN_PEOPLE))
.withWidthUndefined();
layout.addComponent(assigneeLbl, 0, 1);
String assignUserName = (String) PropertyUtils.getProperty(bean, "assignuser");
String assignUserAvatarId = (String) PropertyUtils.getProperty(bean, "assignUserAvatarId");
String assignUserDisplayName = (String) PropertyUtils.getProperty(bean, "assignUserFullName");
ProjectMemberLink assignUserLink = new ProjectMemberLink(assignUserName, assignUserAvatarId, assignUserDisplayName);
layout.addComponent(assignUserLink, 1, 1);
} catch (Exception e) {
LOG.error("Can not build user link {} ", BeanUtility.printBeanObj(bean));
}
this.addComponent(layout);
}