Here are the examples of the java api com.vaadin.ui.Alignment.MIDDLE_RIGHT taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7 Examples
18
Source : AbstractEntityListPanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
protected Alignment alignmentForProperty(String propertyId) {
if (propertyId.matches("(is|should|has)[A-Z].*")) {
return Alignment.MIDDLE_LEFT;
}
if (propertyId.matches("(cost|price|sum|amount|percent)")) {
return Alignment.MIDDLE_RIGHT;
}
if (propertyId.matches("(cost|price|sum|amount|percent)[A-Z].*")) {
return Alignment.MIDDLE_RIGHT;
}
if (propertyId.matches(".*(Cost|Price|Sum|Amount|Percent)")) {
return Alignment.MIDDLE_RIGHT;
}
return Alignment.MIDDLE_LEFT;
}
17
Source : AbstractEntityTablePanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
protected Alignment alignmentForProperty(String propertyId) {
if (propertyId.matches("(selected)")) {
return Alignment.MIDDLE_CENTER;
}
if (propertyId.matches("(is|should|has)[A-Z].*")) {
return Alignment.MIDDLE_LEFT;
}
if (propertyId.matches("(cost|price|sum|amount|percent)")) {
return Alignment.MIDDLE_RIGHT;
}
if (propertyId.matches("(cost|price|sum|amount|percent)[A-Z].*")) {
return Alignment.MIDDLE_RIGHT;
}
if (propertyId.matches(".*(Cost|Price|Sum|Amount|Percent)")) {
return Alignment.MIDDLE_RIGHT;
}
return Alignment.MIDDLE_LEFT;
}
14
Source : TRAbstractBaseForm.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
/**
* @return A default toolbar containing save/cancel/delete buttons
*/
public MHorizontalLayout getToolbar() {
MLabel spacer = new MLabel("").withFullWidth();
busyIndicator.setVisible(false);
busyIndicator.setIndeterminate(true);
MHorizontalLayout layout = new MHorizontalLayout().withSpacing(true).withDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
addButtonsToFooter(layout);
layout.addComponents(spacer, busyIndicator, getSaveButton(), getResetButton(), getDeleteButton());
layout.setExpandRatio(spacer, 1);
return layout;
}
13
Source : TRAbstractForm.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildFooter() {
if (footer == null) {
footer = new MHorizontalLayout();
MHorizontalLayout toolbar = getToolbar();
dismissButton = new MButton("Dismiss").withListener(event -> {
onDismissButtonClick();
}).withVisible(shouldShowDismissButton());
toolbar.addComponent(dismissButton);
footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
footer.addStyleName("popup-footer");
footer.setWidth(100.0f, Unit.PERCENTAGE);
footer.addComponent(toolbar);
footer.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT);
footer.setVisible(shouldShowFooter());
}
return footer;
}
11
Source : AbstractDashboardPanel.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildToolbar() {
toolbar = new MHorizontalLayout();
toolbar.addStyleName("toolbar");
toolbar.setVisible(true);
notificationButton = new MButton().withStyleName(ValoTheme.BUTTON_ICON_ONLY, ValoTheme.BUTTON_BORDERLESS).withIcon(FontAwesome.BELL);
notificationButton.addClickListener(event -> {
UI.getCurrent().getNavigator().navigateTo("notifications");
});
notificationBadge = new BadgeWrapper(notificationButton);
notificationBadge.setId(BadgeWrapper.NOTIFICATIONS_BADGE_ID);
GxAuthenticatedUser user = DashboardUtils.getLoggedInUser();
if (user != null && user.getUnreadNotificationCount() > 0) {
notificationBadge.setBadgeValue(user.getUnreadNotificationCount() + "");
} else {
notificationBadge.clearBadgeValue();
}
toolbar.addComponent(notificationBadge);
toolbar.setComponentAlignment(notificationBadge, Alignment.MIDDLE_RIGHT);
notificationBadge.setVisible(shouldShowNotifications());
DashboardEventBus.sessionInstance().register(this);
return toolbar;
}
8
Source : GiftcardUI.java
with Apache License 2.0
from AxonIQ
with Apache License 2.0
from AxonIQ
@Override
protected void init(VaadinRequest vaadinRequest) {
HorizontalLayout commandBar = new HorizontalLayout();
commandBar.setWidth("100%");
commandBar.addComponents(issuePanel(), bulkIssuePanel(), redeemPanel());
Grid summary = summaryGrid();
HorizontalLayout statusBar = new HorizontalLayout();
Label statusLabel = new Label("Status");
statusBar.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
statusBar.addComponent(statusLabel);
statusBar.setWidth("100%");
VerticalLayout layout = new VerticalLayout();
layout.addComponents(commandBar, summary, statusBar);
layout.setExpandRatio(summary, 1f);
layout.setSizeFull();
setContent(layout);
UI.getCurrent().setErrorHandler(new DefaultErrorHandler() {
@Override
public void error(com.vaadin.server.ErrorEvent event) {
Throwable cause = event.getThrowable();
logger.error("an error occured", cause);
while (cause.getCause() != null) {
cause = cause.getCause();
}
Notification.show("Error", cause.getMessage(), Notification.Type.ERROR_MESSAGE);
}
});
setPollInterval(1000);
int offset = Page.getCurrent().getWebBrowser().getTimezoneOffset();
// offset is in milliseconds
ZoneOffset instantOffset = ZoneOffset.ofTotalSeconds(offset / 1000);
StatusUpdater statusUpdater = new StatusUpdater(statusLabel, instantOffset);
updaterThread = Executors.newScheduledThreadPool(1).scheduleAtFixedRate(statusUpdater, 1000, 5000, TimeUnit.MILLISECONDS);
setPollInterval(1000);
getSession().getSession().setMaxInactiveInterval(30);
addDetachListener((DetachListener) detachEvent -> {
logger.warn("Closing UI");
updaterThread.cancel(true);
});
}
6
Source : AbstractCardComponent.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
protected AbstractCardComponent<T> buildFooter(T item) {
if (!isBuilt) {
MHorizontalLayout footer = new MHorizontalLayout();
MHorizontalLayout toolbar = getToolbar(enreplacedy);
addButtonsToFooter(toolbar);
if (shouldShowEditButton()) {
if (toolBar != null && editButton != null) {
editButton.setStyleName(ValoTheme.BUTTON_SMALL);
editButton.addStyleName(ValoTheme.BUTTON_QUIET);
editButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
toolBar.addComponent(editButton);
}
}
if (shouldShowDeleteButton()) {
if (toolBar != null && deleteButton != null) {
deleteButton.setStyleName(ValoTheme.BUTTON_SMALL);
deleteButton.addStyleName(ValoTheme.BUTTON_QUIET);
deleteButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
toolBar.addComponent(deleteButton);
}
}
footer.addStyleName("popup-footer");
footer.setWidth(100.0f, Unit.PERCENTAGE);
footer.addComponentAsFirst(toolbar);
footer.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT);
addComponent(footer);
setComponentAlignment(footer, Alignment.BOTTOM_LEFT);
setExpandRatio(footer, 0);
}
return this;
}