本文整理汇总了Java中com.vaadin.ui.Window.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Window.addStyleName方法的具体用法?Java Window.addStyleName怎么用?Java Window.addStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Window
的用法示例。
在下文中一共展示了Window.addStyleName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLayout
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void createLayout() {
final HorizontalLayout footer = new HorizontalLayout();
footer.setSizeUndefined();
footer.addStyleName("confirmation-window-footer");
footer.setSpacing(true);
footer.setMargin(false);
footer.addComponents(closeBtn);
footer.setComponentAlignment(closeBtn, Alignment.TOP_CENTER);
final VerticalLayout uploadResultDetails = new VerticalLayout();
uploadResultDetails.setWidth(SPUIDefinitions.MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH + "px");
uploadResultDetails.addStyleName("confirmation-popup");
uploadResultDetails.addComponent(uploadResultTable);
uploadResultDetails.setComponentAlignment(uploadResultTable, Alignment.MIDDLE_CENTER);
uploadResultDetails.addComponent(footer);
uploadResultDetails.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);
uploadResultsWindow = new Window();
uploadResultsWindow.setContent(uploadResultDetails);
uploadResultsWindow.setResizable(Boolean.FALSE);
uploadResultsWindow.setClosable(Boolean.FALSE);
uploadResultsWindow.setDraggable(Boolean.TRUE);
uploadResultsWindow.setModal(true);
uploadResultsWindow.setCaption(SPUILabelDefinitions.UPLOAD_RESULT);
uploadResultsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
}
示例2: buildLayout
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void buildLayout() {
final HorizontalLayout footer = getFooterLayout();
uploadArtifactDetails = new VerticalLayout();
uploadArtifactDetails.setWidth(SPUIDefinitions.MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH + "px");
uploadArtifactDetails.addStyleName("confirmation-popup");
uploadArtifactDetails.addComponent(uploadDetailsTable);
uploadArtifactDetails.setComponentAlignment(uploadDetailsTable, Alignment.MIDDLE_CENTER);
uploadArtifactDetails.addComponent(footer);
uploadArtifactDetails.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);
window = new Window();
window.setContent(uploadArtifactDetails);
window.setResizable(Boolean.FALSE);
window.setClosable(Boolean.TRUE);
window.setDraggable(Boolean.TRUE);
window.setModal(true);
window.addCloseListener(event -> onPopupClose());
window.setCaption(i18n.getMessage("header.caption.upload.details"));
window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
}
示例3: showArtifactDetailsWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showArtifactDetailsWindow(final Long itemId, final String nameVersionStr) {
final Window artifactDtlsWindow = new Window();
artifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId(nameVersionStr));
artifactDtlsWindow.setCaptionAsHtml(true);
artifactDtlsWindow.setClosable(true);
artifactDtlsWindow.setResizable(true);
artifactDtlsWindow.setImmediate(true);
artifactDtlsWindow.setWindowMode(WindowMode.NORMAL);
artifactDtlsWindow.setModal(true);
artifactDtlsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
artifactDetailsLayout.setFullWindowMode(false);
artifactDetailsLayout.populateArtifactDetails(itemId, nameVersionStr);
/* Now add table to the window */
artifactDetailsLayout.getArtifactDetailsTable().setWidth(700, Unit.PIXELS);
artifactDetailsLayout.getArtifactDetailsTable().setHeight(500, Unit.PIXELS);
artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());
/* Create maximized view of the table */
artifactDtlsWindow.addWindowModeChangeListener(
event -> {
if (event.getWindowMode() == WindowMode.MAXIMIZED) {
artifactDtlsWindow.setSizeFull();
artifactDetailsLayout.setFullWindowMode(true);
artifactDetailsLayout.createMaxArtifactDetailsTable();
artifactDetailsLayout.getMaxArtifactDetailsTable().setWidth(100, Unit.PERCENTAGE);
artifactDetailsLayout.getMaxArtifactDetailsTable().setHeight(100, Unit.PERCENTAGE);
artifactDtlsWindow.setContent(artifactDetailsLayout.getMaxArtifactDetailsTable());
} else {
artifactDtlsWindow.setSizeUndefined();
artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable());
}
});
/* display the window */
UI.getCurrent().addWindow(artifactDtlsWindow);
}
示例4: decorateWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void decorateWindow(final Window window) {
if (id != null) {
window.setId(id);
}
if (SPUIDefinitions.CONFIRMATION_WINDOW.equals(type)) {
window.setDraggable(false);
window.setClosable(true);
window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
} else if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
window.setDraggable(true);
window.setClosable(true);
}
}
示例5: createNotificationWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void createNotificationWindow() {
notificationsWindow = new Window();
notificationsWindow.setWidth(300.0F, Unit.PIXELS);
notificationsWindow.addStyleName(STYLE_POPUP);
notificationsWindow.addStyleName(STYLE_NO_CLOSEBOX);
notificationsWindow.setClosable(true);
notificationsWindow.setResizable(false);
notificationsWindow.setDraggable(false);
notificationsWindow.setId(UIComponentIdProvider.NOTIFICATION_UNREAD_POPUP_ID);
notificationsWindow.addCloseListener(event -> refreshCaption());
notificationsWindow.addBlurListener(this::closeWindow);
}
示例6: ConfirmationDialog
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Constructor for configuring confirmation dialog.
*
* @param caption
* the dialog caption.
* @param question
* the question.
* @param okLabel
* the Ok button label.
* @param cancelLabel
* the cancel button label.
* @param callback
* the callback.
* @param icon
* the icon of the dialog
* @param id
* the id of the confirmation dialog
*/
public ConfirmationDialog(final String caption, final String question, final String okLabel,
final String cancelLabel, final ConfirmationDialogCallback callback, final Resource icon, final String id) {
window = new Window(caption);
if (!StringUtils.isEmpty(id)) {
window.setId(id);
}
window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
if (icon != null) {
window.setIcon(icon);
}
okButton = SPUIComponentProvider.getButton(UIComponentIdProvider.OK_BUTTON, okLabel, "",
ValoTheme.BUTTON_PRIMARY, false, null, SPUIButtonStyleTiny.class);
okButton.addClickListener(this);
final Button cancelButton = SPUIComponentProvider.getButton(null, cancelLabel, "", null, false, null,
SPUIButtonStyleTiny.class);
cancelButton.addClickListener(this);
cancelButton.setId(UIComponentIdProvider.CANCEL_BUTTON);
window.setModal(true);
window.addStyleName(SPUIStyleDefinitions.CONFIRMBOX_WINDOW_SYLE);
if (this.callback == null) {
this.callback = callback;
}
final VerticalLayout vLayout = new VerticalLayout();
if (question != null) {
final Label questionLbl = new Label(String.format("<p>%s</p>", question.replaceAll("\n", "<br/>")),
ContentMode.HTML);
questionLbl.addStyleName(SPUIStyleDefinitions.CONFIRMBOX_QUESTION_LABEL);
vLayout.addComponent(questionLbl);
}
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);
vLayout.addComponent(hButtonLayout);
vLayout.setComponentAlignment(hButtonLayout, Alignment.BOTTOM_CENTER);
window.setContent(vLayout);
window.setResizable(false);
}
示例7: check
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public void check() {
steps[currentStep].answered = true;
steps[currentStep].correct = exec.isCorrect(currentStep);
navigator.setCheckButtonEnabled(retriable);
if (currentStep < steps.length - 1) {
navigator.setNextButtonEnabled(true);
navigator.focusNext();
} else {
final Window confirm = new Window(localizer
.getUIText(UIConstants.SUBMIT_QUESTION));
confirm.setModal(true);
confirm.setWidth("600px");
confirm.setHeight("330px");
confirm.setCaption("");
confirm.setStyleName("opaque");
confirm.addStyleName("unclosable-window");
confirm.setClosable(false);
confirm.addStyleName("submit-window");
VerticalLayout content = new VerticalLayout();
content.setSizeFull();
content.setMargin(true);
Label question = new Label(localizer
.getUIText(UIConstants.SUBMIT_QUESTION));
question.setContentMode(ContentMode.HTML);
question.addStyleName("big-text-white");
question.setSizeUndefined();
content.addComponent(question);
content.setComponentAlignment(question,
Alignment.TOP_CENTER);
confirm.setContent(content);
// Button holder (back to round, replay, next)
HorizontalLayout buttons = new HorizontalLayout();
buttons.addStyleName("submit-buttons-container");
buttons.setWidth("100%");
buttons.setSpacing(true);
content.addComponent(buttons);
content.setComponentAlignment(buttons,
Alignment.TOP_CENTER);
Button submit = StandardUIFactory
.getRoundButton(Icon.SUBMIT);
submit.setDescription(
localizer.getUIText(UIConstants.SUBMIT));
Button cancel = StandardUIFactory
.getRoundButton(Icon.CLOSE);
cancel.setDescription(
localizer.getUIText(UIConstants.CLOSE));
buttons.addComponents(submit, cancel);
buttons.setComponentAlignment(submit,
Alignment.MIDDLE_CENTER);
buttons.setComponentAlignment(cancel,
Alignment.MIDDLE_CENTER);
submit.addClickListener(e -> {
exec.askSubmit(StandardSubmissionType.NORMAL);
confirm.close();
});
cancel.addClickListener(e -> confirm.close());
UI.getCurrent().addWindow(confirm);
}
}