Here are the examples of the java api com.vaadin.ui.Alignment.TOP_CENTER taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
26 Examples
19
View Complete Implementation : CommonDialogWindow.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private final void init() {
if (content instanceof AbstractOrderedLayout) {
((AbstractOrderedLayout) content).setSpacing(true);
((AbstractOrderedLayout) content).setMargin(true);
}
if (content instanceof GridLayout) {
addStyleName("marginTop");
}
if (content != null) {
mainLayout.addComponent(content);
mainLayout.setExpandRatio(content, 1.0F);
}
createMandatoryLabel();
final HorizontalLayout buttonLayout = createActionButtonsLayout();
mainLayout.addComponent(buttonLayout);
mainLayout.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER);
setCaption(caption);
setCaptionAsHtml(true);
setContent(mainLayout);
setResizable(false);
center();
setModal(true);
addStyleName("fontsize");
setOrginaleValues();
addComponentListeners();
}
19
View Complete Implementation : AutoCompleteTextFieldComponent.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
/**
* Constructor.
*/
@PostConstruct
void init() {
queryTextField = createSearchField();
validationIcon = createStatusIcon();
setSizeUndefined();
setSpacing(true);
addStyleName("custom-search-layout");
addComponents(validationIcon, queryTextField);
setComponentAlignment(validationIcon, Alignment.TOP_CENTER);
eventBus.subscribe(this);
new TextFieldSuggestionBox(rsqlValidationOracle, this).extend(queryTextField);
}
18
View Complete Implementation : DashBoardView.java
Copyright GNU General Public License v3.0
Author : rlsutton1
Copyright GNU General Public License v3.0
Author : rlsutton1
void postLoad() {
VerticalLayout sliderHolder = new VerticalLayout();
sliderHolder.setWidth("80%");
sliderHolder.setHeight("40");
addComponent(sliderHolder);
setComponentAlignment(sliderHolder, Alignment.TOP_CENTER);
dashboardsSlider = new SliderPanelBuilder(dashboardPanels()).expanded(false).mode(SliderMode.TOP).tabPosition(SliderTabPosition.MIDDLE).style(style).caption("Dashboards").animationDuration(400).tabSize(30).autoCollapseSlider(true).build();
sliderHolder.addComponent(dashboardsSlider);
Tblportallayout portalLayout = findDefaultPortal();
createDashboard(portalLayout);
dashBoardSelector.select(portalLayout);
dashBoardHolderPanel.setSizeFull();
addComponent(dashBoardHolderPanel);
setExpandRatio(dashBoardHolderPanel, 1);
}
17
View Complete Implementation : UploadArtifactView.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private VerticalLayout createDetailsAndUploadLayout() {
detailAndUploadLayout = new VerticalLayout();
detailAndUploadLayout.addComponent(artifactDetailsLayout);
detailAndUploadLayout.setComponentAlignment(artifactDetailsLayout, Alignment.TOP_CENTER);
detailAndUploadLayout.setExpandRatio(artifactDetailsLayout, 1.0F);
if (permChecker.hasCreateRepositoryPermission()) {
detailAndUploadLayout.addComponent(dropAreaLayout.getDropAreaWrapper());
}
detailAndUploadLayout.setSizeFull();
detailAndUploadLayout.addStyleName("group");
detailAndUploadLayout.setSpacing(true);
return detailAndUploadLayout;
}
17
View Complete Implementation : DashBoardView.java
Copyright GNU General Public License v3.0
Author : rlsutton1
Copyright GNU General Public License v3.0
Author : rlsutton1
private Component dashboardPanels() {
HorizontalLayout layout = new HorizontalLayout();
layout.setMargin(true);
layout.setSpacing(true);
Component dashboardManagement = dashboardManagement();
layout.addComponent(dashboardManagement);
layout.setComponentAlignment(dashboardManagement, Alignment.TOP_CENTER);
toolbarHolder = new VerticalLayout();
layout.addComponent(toolbarHolder);
layout.setComponentAlignment(toolbarHolder, Alignment.TOP_CENTER);
return layout;
}
16
View Complete Implementation : LogLayout.java
Copyright Apache License 2.0
Author : apache
Copyright Apache License 2.0
Author : apache
private void addLogArea() {
logArea = new TextArea("Coordinator Logs");
// TODO make this file point configurable
file = new File("/var/log/chop-webapp.log");
try {
r = new RandomAccessFile(file, "r");
} catch (FileNotFoundException e) {
LOG.error("Error while accessing file {}: {}", file, e);
}
logArea.setHeight("100%");
logArea.setWidth("100%");
getApplicationLog();
addComponent(logArea);
this.setComponentAlignment(logArea, Alignment.TOP_CENTER);
this.setExpandRatio(logArea, 0.95f);
}
16
View Complete Implementation : FormUtils.java
Copyright Apache License 2.0
Author : chelu
Copyright Apache License 2.0
Author : chelu
/**
* 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);
}
16
View Complete Implementation : AbstractFilterLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS);
setStyleName("filter-btns-main-layout");
setHeight(100.0F, Unit.PERCENTAGE);
setSpacing(false);
setMargin(false);
addComponents(filterHeader, filterButtons);
setComponentAlignment(filterHeader, Alignment.TOP_CENTER);
setComponentAlignment(filterButtons, Alignment.TOP_CENTER);
setExpandRatio(filterButtons, 1.0F);
}
16
View Complete Implementation : AbstractTargetTagFilterLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS);
setStyleName("filter-btns-main-layout");
setHeight(100.0F, Unit.PERCENTAGE);
setSpacing(false);
setMargin(false);
addComponents(filterHeader, multipleFilterTabs);
setComponentAlignment(filterHeader, Alignment.TOP_CENTER);
setComponentAlignment(multipleFilterTabs, Alignment.TOP_CENTER);
setExpandRatio(multipleFilterTabs, 1.0F);
}
16
View Complete Implementation : AbstractView.java
Copyright Apache License 2.0
Author : Hack23
Copyright Apache License 2.0
Author : Hack23
/**
* Creates the basic layout with panel and footer.
*
* @param panelName
* the panel name
*/
protected final void createBasicLayoutWithPanelAndFooter(final String panelName) {
final VerticalLayout layout = createFullSizeVerticalLayout();
final VerticalLayout pageModeContent = createFullSizeVerticalLayout(false, false);
layout.addComponent(pageModeContent);
final HorizontalLayout topHeader = new HorizontalLayout();
addLogoToHeader(topHeader);
createTopreplacedleHeader(topHeader);
topHeaderRightPanel.removeAllComponents();
topHeader.addComponent(topHeaderRightPanel);
topHeader.setComponentAlignment(topHeaderRightPanel, Alignment.MIDDLE_RIGHT);
topHeader.setExpandRatio(topHeaderRightPanel, ContentRatio.LARGE);
createTopHeaderActionsForUserContext();
topHeaderRightPanel.setWidth("100%");
topHeaderRightPanel.setHeight("50px");
topHeader.setWidth("100%");
topHeader.setHeight("50px");
pageModeContent.addComponent(topHeader);
pageModeContent.setComponentAlignment(topHeader, Alignment.TOP_CENTER);
pageModeContent.addComponent(getBarmenu());
pageModeContent.setComponentAlignment(getBarmenu(), Alignment.TOP_CENTER);
panel = new Panel(panelName);
panel.addStyleName("v-panel-page-panel");
panel.setSizeFull();
pageModeContent.addComponent(panel);
pageModeContent.setExpandRatio(panel, ContentRatio.FULL_SIZE);
pageModeContent.addComponent(pageLinkFactory.createMainViewPageLink());
setContent(layout);
setWidth(100, Unit.PERCENTAGE);
setHeight(100, Unit.PERCENTAGE);
setSizeFull();
}
14
View Complete Implementation : AbstractTableHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
final HorizontalLayout replacedleFilterIconsLayout = createHeaderFilterIconLayout();
replacedleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon, showFilterButtonLayout);
replacedleFilterIconsLayout.setComponentAlignment(headerCaption, Alignment.TOP_LEFT);
replacedleFilterIconsLayout.setComponentAlignment(searchField, Alignment.TOP_RIGHT);
replacedleFilterIconsLayout.setComponentAlignment(searchResetIcon, Alignment.TOP_RIGHT);
replacedleFilterIconsLayout.setComponentAlignment(showFilterButtonLayout, Alignment.TOP_RIGHT);
if (hasCreatePermission() && isAddNewItemAllowed()) {
replacedleFilterIconsLayout.addComponent(addIcon);
replacedleFilterIconsLayout.setComponentAlignment(addIcon, Alignment.TOP_RIGHT);
}
if (hasCreatePermission() && isBulkUploadAllowed()) {
replacedleFilterIconsLayout.addComponent(bulkUploadIcon);
replacedleFilterIconsLayout.setComponentAlignment(bulkUploadIcon, Alignment.TOP_RIGHT);
}
replacedleFilterIconsLayout.addComponent(maxMinIcon);
replacedleFilterIconsLayout.setComponentAlignment(maxMinIcon, Alignment.TOP_RIGHT);
replacedleFilterIconsLayout.setExpandRatio(headerCaption, 0.4F);
replacedleFilterIconsLayout.setExpandRatio(searchField, 0.6F);
addComponent(replacedleFilterIconsLayout);
final HorizontalLayout dropHintDropFilterLayout = new HorizontalLayout();
dropHintDropFilterLayout.addStyleName("filter-drop-hint-layout");
dropHintDropFilterLayout.setWidth(100, Unit.PERCENTAGE);
if (isDropFilterRequired()) {
filterDroppedInfo = new HorizontalLayout();
filterDroppedInfo.setImmediate(true);
filterDroppedInfo.setStyleName("target-dist-filter-info");
filterDroppedInfo.setHeightUndefined();
filterDroppedInfo.setSizeUndefined();
displayFilterDropedInfoOnLoad();
final DragAndDropWrapper dropFilterLayout = new DragAndDropWrapper(filterDroppedInfo);
dropFilterLayout.setId(getDropFilterId());
dropFilterLayout.setDropHandler(getDropFilterHandler());
dropHintDropFilterLayout.addComponent(dropFilterLayout);
dropHintDropFilterLayout.setComponentAlignment(dropFilterLayout, Alignment.TOP_CENTER);
dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0F);
}
addComponent(dropHintDropFilterLayout);
setComponentAlignment(dropHintDropFilterLayout, Alignment.TOP_CENTER);
addStyleName("bordered-layout");
addStyleName("no-border-bottom");
}
14
View Complete Implementation : WizardView.java
Copyright GNU General Public License v3.0
Author : rlsutton1
Copyright GNU General Public License v3.0
Author : rlsutton1
public void enter(ViewChangeEvent event) {
recipientStep = new SelectRecipientsStep<Child>(this);
filterStep = new SelectFilterStep<Parent, Child>(this);
confirmStep = new ConfirmDetailsStep(this);
send = new ShowProgressStep<Child>(this);
// create the Wizard component and add the steps
wizard = new Wizard();
wizard.setUriFragmentEnabled(true);
wizard.addListener(this);
wizard.addStep(filterStep, "filter");
wizard.addStep(recipientStep, "select");
wizard.addStep(confirmStep, "confirm");
wizard.addStep(send, "send");
wizard.setSizeFull();
wizard.setUriFragmentEnabled(true);
/* Main layout */
this.setMargin(true);
this.setSpacing(true);
this.addComponent(wizard);
this.setComponentAlignment(wizard, Alignment.TOP_CENTER);
this.setSizeFull();
}
13
View Complete Implementation : ConfirmationDialog.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private HorizontalLayout createButtonLayout(final Button cancelButton) {
final HorizontalLayout hButtonLayout = new HorizontalLayout();
hButtonLayout.setSpacing(true);
hButtonLayout.addComponent(okButton);
hButtonLayout.addComponent(cancelButton);
hButtonLayout.setSizeUndefined();
hButtonLayout.setComponentAlignment(okButton, Alignment.TOP_CENTER);
hButtonLayout.setComponentAlignment(cancelButton, Alignment.TOP_CENTER);
return hButtonLayout;
}
13
View Complete Implementation : AbstractTableDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
protected void buildLayout() {
nameEditLayout = new HorizontalLayout();
nameEditLayout.setWidth(100.0F, Unit.PERCENTAGE);
nameEditLayout.addComponent(caption);
nameEditLayout.setComponentAlignment(caption, Alignment.TOP_LEFT);
if (hasEditPermission()) {
nameEditLayout.addComponent(editButton);
nameEditLayout.setComponentAlignment(editButton, Alignment.TOP_RIGHT);
nameEditLayout.addComponent(manageMetadataBtn);
nameEditLayout.setComponentAlignment(manageMetadataBtn, Alignment.TOP_RIGHT);
}
nameEditLayout.setExpandRatio(caption, 1.0F);
nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_replacedLE);
addComponent(nameEditLayout);
setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
addComponent(detailsTab);
setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
setSizeFull();
setHeightUndefined();
addStyleName(SPUIStyleDefinitions.WIDGET_STYLE);
}
13
View Complete Implementation : WizardsDemoApplication.java
Copyright Apache License 2.0
Author : tehapo
Copyright Apache License 2.0
Author : tehapo
@Override
protected void init(VaadinRequest request) {
// setup the main window
mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setMargin(true);
setContent(mainLayout);
// create the Wizard component and add the steps
wizard = new Wizard();
wizard.setUriFragmentEnabled(true);
wizard.addListener(this);
wizard.addStep(new IntroStep(), "intro");
wizard.addStep(new SetupStep(), "setup");
wizard.addStep(new ListenStep(), "listen");
wizard.addStep(new LastStep(wizard), "last");
wizard.setHeight("600px");
wizard.setWidth("800px");
mainLayout.addComponent(wizard);
mainLayout.setComponentAlignment(wizard, Alignment.TOP_CENTER);
}
12
View Complete Implementation : FormUtils.java
Copyright Apache License 2.0
Author : chelu
Copyright Apache License 2.0
Author : chelu
/**
* Show a YES/NO confirm dialog
* @param window Window to attach the dialog
* @param msg the msg
*/
public static void showConfirmDialog(UI ui, final Command command, String msg) {
final Window dlg = new Window("Please Confirm");
VerticalLayout vl = new VerticalLayout();
vl.setSizeFull();
vl.setSpacing(true);
vl.setMargin(true);
Label label = new Label(msg, Label.CONTENT_XHTML);
vl.addComponent(label);
HorizontalLayout hl = new HorizontalLayout();
hl.setSpacing(true);
Button ok = new Button(StaticMessageSource.getMessage("yes"));
ok.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
command.execute(null);
closeWindow(dlg);
}
});
Button cancel = new Button(StaticMessageSource.getMessage("no"));
cancel.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
closeWindow(dlg);
}
});
hl.setSpacing(true);
hl.addComponent(ok);
hl.addComponent(cancel);
hl.setSizeFull();
vl.addComponent(hl);
vl.setComponentAlignment(hl, Alignment.TOP_CENTER);
dlg.setContent(vl);
dlg.setModal(true);
vl.setSizeUndefined();
ui.addWindow(dlg);
}
11
View Complete Implementation : FilterManagementView.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void viewListView() {
removeAllComponents();
final VerticalLayout tableListViewLayout = new VerticalLayout();
tableListViewLayout.setSizeFull();
tableListViewLayout.setSpacing(false);
tableListViewLayout.setMargin(false);
tableListViewLayout.setStyleName("table-layout");
tableListViewLayout.addComponent(targetFilterHeader);
tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER);
tableListViewLayout.addComponent(targetFilterTable);
tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER);
tableListViewLayout.setExpandRatio(targetFilterTable, 1.0F);
addComponent(tableListViewLayout);
}
9
View Complete Implementation : TestUI.java
Copyright Apache License 2.0
Author : bsblabs
Copyright Apache License 2.0
Author : bsblabs
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.setMargin(true);
layout.setSpacing(true);
final Button hello = new Button("Hello");
hello.addClickListener(new Button.ClickListener() {
public void buttonClick(Button.ClickEvent event) {
final Notification n = new Notification("Yes, hello", Notification.Type.HUMANIZED_MESSAGE);
n.setDelayMsec(-1);
n.show(Page.getCurrent());
}
});
layout.addComponent(hello);
layout.setComponentAlignment(hello, Alignment.TOP_CENTER);
setContent(layout);
}
9
View Complete Implementation : FormDialog.java
Copyright Apache License 2.0
Author : chelu
Copyright Apache License 2.0
Author : chelu
public void init() {
setContent(form);
getContent().setSizeUndefined();
center();
acceptButtonListener = new AcceptButtonListener();
cancelButtonListener = new CancelButtonListener();
HorizontalLayout buttonLayout = new HorizontalLayout();
Button acceptButton = FormUtils.newButton(acceptButtonListener);
Button cancelButton = FormUtils.newButton(cancelButtonListener);
buttonLayout.setSpacing(true);
buttonLayout.addComponent(acceptButton);
buttonLayout.addComponent(cancelButton);
HorizontalLayout footer = new HorizontalLayout();
footer.addComponent(buttonLayout);
footer.setSizeFull();
footer.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER);
form.setFooter(footer);
form.setSizeFull();
form.getLayout().setSizeFull();
}
9
View Complete Implementation : UploadDropAreaLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private VerticalLayout createDropAreaLayout() {
final VerticalLayout dropAreaLayout = new VerticalLayout();
final Label dropHereLabel = new Label(i18n.getMessage(UIMessageIdProvider.LABEL_DROP_AREA_UPLOAD));
dropHereLabel.setWidth(null);
final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML);
dropIcon.addStyleName("drop-icon");
dropIcon.setWidth(null);
dropAreaLayout.addComponent(dropIcon);
dropAreaLayout.setComponentAlignment(dropIcon, Alignment.TOP_CENTER);
dropAreaLayout.addComponent(dropHereLabel);
dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER);
uploadButtonLayout.setWidth(null);
uploadButtonLayout.addStyleName("upload-button");
dropAreaLayout.addComponent(uploadButtonLayout);
dropAreaLayout.setComponentAlignment(uploadButtonLayout, Alignment.BOTTOM_CENTER);
dropAreaLayout.setSizeFull();
dropAreaLayout.setStyleName("upload-drop-area-layout-info");
dropAreaLayout.setSpacing(false);
return dropAreaLayout;
}
9
View Complete Implementation : AbstractGridComponentLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
/**
* Layouts header, grid and optional footer.
*/
protected void buildLayout() {
setSizeFull();
setSpacing(true);
setMargin(false);
setStyleName("group");
final VerticalLayout gridHeaderLayout = new VerticalLayout();
gridHeaderLayout.setSizeFull();
gridHeaderLayout.setSpacing(false);
gridHeaderLayout.setMargin(false);
gridHeaderLayout.setStyleName("table-layout");
gridHeaderLayout.addComponent(gridHeader);
gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
gridHeaderLayout.addComponent(grid);
gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
gridHeaderLayout.setExpandRatio(grid, 1.0F);
addComponent(gridHeaderLayout);
setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
setExpandRatio(gridHeaderLayout, 1.0F);
if (hasFooterSupport()) {
final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
addComponent(footerLayout);
setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
}
}
9
View Complete Implementation : FilterManagementView.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildFilterDetailOrCreateView() {
removeAllComponents();
final VerticalLayout tableHeaderLayout = new VerticalLayout();
tableHeaderLayout.setSizeFull();
tableHeaderLayout.setSpacing(false);
tableHeaderLayout.setMargin(false);
tableHeaderLayout.setStyleName("table-layout");
tableHeaderLayout.addComponent(createNewFilterHeader);
tableHeaderLayout.setComponentAlignment(createNewFilterHeader, Alignment.TOP_CENTER);
tableHeaderLayout.addComponent(createNewFilterTable);
tableHeaderLayout.setComponentAlignment(createNewFilterTable, Alignment.TOP_CENTER);
tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0F);
addComponent(tableHeaderLayout);
setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
setExpandRatio(tableHeaderLayout, 1.0F);
final HorizontalLayout targetsCountmessageLabelLayout = addTargetFilterMessageLabel();
addComponent(targetsCountmessageLabelLayout);
setComponentAlignment(targetsCountmessageLabelLayout, Alignment.BOTTOM_CENTER);
}
8
View Complete Implementation : EditFlowPalette.java
Copyright GNU General Public License v3.0
Author : JumpMind
Copyright GNU General Public License v3.0
Author : JumpMind
protected void addItemToFlowPanelSection(String labelName, String componentType, VerticalLayout componentLayout, StreamResource icon, String componentId) {
FlowPaletteItem paletteItem = new FlowPaletteItem(labelName);
if (componentId != null) {
paletteItem.setShared(true);
paletteItem.setComponentId(componentId);
} else {
paletteItem.setComponentType(componentType);
paletteItem.setShared(false);
}
paletteItem.setIcon(icon);
paletteItem.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
paletteItem.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
paletteItem.addStyleName("leftAligned");
paletteItem.setWidth(100, Unit.PERCENTAGE);
DragAndDropWrapper wrapper = new DragAndDropWrapper(paletteItem);
wrapper.setSizeUndefined();
wrapper.setDragStartMode(DragStartMode.WRAPPER);
componentLayout.addComponent(wrapper);
componentLayout.setComponentAlignment(wrapper, Alignment.TOP_CENTER);
}
3
View Complete Implementation : AbstractTableLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
Copyright Eclipse Public License 1.0
Author : eclipse
private void buildLayout() {
setSizeFull();
setSpacing(true);
setMargin(false);
setStyleName("group");
final VerticalLayout tableHeaderLayout = new VerticalLayout();
tableHeaderLayout.setSizeFull();
tableHeaderLayout.setSpacing(false);
tableHeaderLayout.setMargin(false);
tableHeaderLayout.setStyleName("table-layout");
tableHeaderLayout.addComponent(tableHeader);
tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER);
if (isShortCutKeysRequired()) {
final Panel tablePanel = new Panel();
tablePanel.setStyleName("table-panel");
tablePanel.setHeight(100.0F, Unit.PERCENTAGE);
tablePanel.setContent(table);
tablePanel.addActionHandler(getShortCutKeysHandler(i18n));
tablePanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
tableHeaderLayout.addComponent(tablePanel);
tableHeaderLayout.setComponentAlignment(tablePanel, Alignment.TOP_CENTER);
tableHeaderLayout.setExpandRatio(tablePanel, 1.0F);
} else {
tableHeaderLayout.addComponent(table);
tableHeaderLayout.setComponentAlignment(table, Alignment.TOP_CENTER);
tableHeaderLayout.setExpandRatio(table, 1.0F);
}
addComponent(tableHeaderLayout);
addComponent(detailsLayout);
setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
setComponentAlignment(detailsLayout, Alignment.TOP_CENTER);
setExpandRatio(tableHeaderLayout, 1.0F);
}
3
View Complete Implementation : UserProjectDashboardViewImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public void lazyLoadView() {
removeAllComponents();
ProjectService projectService = AppContextUtil.getSpringBean(ProjectService.clreplaced);
List<Integer> prjKeys = projectService.getOpenProjectKeysUserInvolved(UserUIContext.getUsername(), AppUI.getAccountId());
if (CollectionUtils.isNotEmpty(prjKeys)) {
ResponsiveLayout contentWrapper = new ResponsiveLayout(ResponsiveLayout.ContainerType.FIXED);
contentWrapper.setSizeFull();
addComponent(contentWrapper);
ResponsiveRow row = new ResponsiveRow();
AllMilestoneTimelineWidget milestoneTimelineWidget = new AllMilestoneTimelineWidget();
TicketOverdueWidget ticketOverdueWidget = new TicketOverdueWidget();
ActivityStreamComponent activityStreamComponent = new ActivityStreamComponent();
UserUnresolvedTicketWidget unresolvedreplacedignmentThisWeekWidget = new UserUnresolvedTicketWidget();
UserUnresolvedTicketWidget unresolvedreplacedignmentNextWeekWidget = new UserUnresolvedTicketWidget();
ResponsiveColumn column1 = new ResponsiveColumn(12, 12, 6, 6);
MVerticalLayout leftPanel = new MVerticalLayout(milestoneTimelineWidget, unresolvedreplacedignmentThisWeekWidget, unresolvedreplacedignmentNextWeekWidget, ticketOverdueWidget).withMargin(new MarginInfo(true, true, false, false)).withFullWidth();
column1.setComponent(leftPanel);
ResponsiveColumn column2 = new ResponsiveColumn(12, 12, 6, 6);
column2.setComponent(activityStreamComponent);
row.addColumn(column1);
row.addColumn(column2);
contentWrapper.addRow(row);
activityStreamComponent.showFeeds(prjKeys);
milestoneTimelineWidget.display(prjKeys);
ticketOverdueWidget.showTicketsByStatus(prjKeys);
unresolvedreplacedignmentThisWeekWidget.displayUnresolvedreplacedignmentsThisWeek(prjKeys);
unresolvedreplacedignmentNextWeekWidget.displayUnresolvedreplacedignmentsNextWeek(prjKeys);
} else {
this.with(ELabel.h1(VaadinIcons.TASKS.getHtml()).withUndefinedWidth());
this.with(ELabel.h2(UserUIContext.getMessage(GenericI18Enum.VIEW_NO_ITEM_replacedLE)).withUndefinedWidth());
if (UserUIContext.canWrite(RolePermissionCollections.CREATE_NEW_PROJECT)) {
MButton newProjectBtn = new MButton(UserUIContext.getMessage(ProjectI18nEnum.NEW), clickEvent -> UI.getCurrent().addWindow(ViewManager.getCacheComponent(AbstractProjectAddWindow.clreplaced))).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.PLUS);
with(newProjectBtn);
}
alignAll(Alignment.TOP_CENTER);
}
}
0
View Complete Implementation : ReportContainerImpl.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public void showDashboard() {
body.removeAllComponents();
body.with(ELabel.h2(VaadinIcons.PIE_CHART.getHtml() + " " + UserUIContext.getMessage(ProjectCommonI18nEnum.VIEW_REPORTS)));
MCssLayout contentLayout = new MCssLayout().withStyleName(WebThemes.FLEX_DISPLAY);
MVerticalLayout standupConsole = new MVerticalLayout().withWidth("300px").withStyleName("member-block");
standupConsole.setDefaultComponentAlignment(Alignment.TOP_CENTER);
standupConsole.addComponent(ELabel.fontIcon(VaadinIcons.CALENDAR_CLOCK).withStyleName("icon-38px"));
A standupReportLink = new A(ProjectLinkGenerator.generateStandupDashboardLink()).appendText(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_STANDUP));
standupConsole.addComponent(ELabel.h3(standupReportLink.write()).withUndefinedWidth());
standupConsole.addComponent(new ELabel(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_STANDUP_HELP)).withFullWidth());
contentLayout.addComponent(standupConsole);
MVerticalLayout userWorkloadReport = new MVerticalLayout().withWidth("300px").withStyleName("member-block");
userWorkloadReport.setDefaultComponentAlignment(Alignment.TOP_CENTER);
userWorkloadReport.addComponent(ELabel.fontIcon(VaadinIcons.CALENDAR_CLOCK).withStyleName("icon-38px"));
A userWorkloadReportLink = new A(ProjectLinkGenerator.generateUsersWorkloadReportLink()).appendText(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_TICKET_replacedIGNMENT));
userWorkloadReport.addComponent(ELabel.h3(userWorkloadReportLink.write()).withUndefinedWidth());
userWorkloadReport.addComponent(new ELabel(UserUIContext.getMessage(ProjectReportI18nEnum.REPORT_TICKET_replacedIGNMENT_HELP)).withFullWidth());
contentLayout.addComponent(userWorkloadReport);
body.with(contentLayout).expand(contentLayout).withAlign(contentLayout, Alignment.TOP_LEFT);
}