本文整理汇总了Java中com.vaadin.ui.Window.setResizable方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setResizable方法的具体用法?Java Window.setResizable怎么用?Java Window.setResizable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Window
的用法示例。
在下文中一共展示了Window.setResizable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: buildWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Build window based on type.
*
* @return Window
*/
public Window buildWindow() {
final Window window = new Window(caption);
window.setContent(content);
window.setSizeUndefined();
window.setModal(true);
window.setResizable(false);
decorateWindow(window);
if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) {
window.setClosable(false);
}
return window;
}
示例4: attach
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void attach() {
super.attach();
loginWindow = new Window();
// create view bound form
VerticalLayout content = buildMainLayout();
content.setMargin(false);
loginWindow.setContent(content);
loginWindow.center();
loginWindow.setCaption(getI18N().getMessage("com.thingtrack.konekti.view.web.workbench.SecurityAccessView.loginWindow.caption"));
loginWindow.setModal(true);
loginWindow.setResizable(false);
loginWindow.setClosable(false);
User loginUser = new User();
BeanItem<User> userBean = new BeanItem<User>(loginUser);
viewBoundForm.setItemDataSource(userBean);
getWindow().addWindow(loginWindow);
}
示例5: showDetails
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showDetails(Product product) {
FreemarkerLayout productLayout = new FreemarkerLayout();
productLayout.setTemplateFileName("templates/product-details.html");
productLayout.setDataModel(product);
productLayout.addComponent(new Image(null, new ClassResource(product.getImage())), "image");
Window window = new Window("Details", productLayout);
window.setModal(true);
window.setResizable(false);
UI.getCurrent().addWindow(window);
}
示例6: 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);
}
示例7: 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);
}
示例8: shapeFileUploadedEvent
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void shapeFileUploadedEvent(final String filename, final ByteArrayInputStream input) {
final Window modal = new Window("Wait");
final Window mainWindow = (ExpressZipWindow) setupMapView.getApplication().getMainWindow();
final SetupMapPresenter presenter = this;
Thread spinner = new Thread(new Runnable() {
public void run() {
ProgressIndicator pi = new ProgressIndicator();
pi.setCaption("Processing Shapefile...");
modal.setModal(true);
modal.setClosable(false);
modal.setResizable(false);
modal.getContent().setSizeUndefined(); // trick to size around content
modal.getContent().addComponent(pi);
modal.setWidth(modal.getWidth(), modal.getWidthUnits());
mainWindow.addWindow(modal);
VectorLayer uploadedShapeFile = setupMapModel.shapeFileUploaded(filename, input);
if (uploadedShapeFile != null) {
shapeFileLayer = uploadedShapeFile;
mapModel.addVectorLayer(shapeFileLayer);
setupMapView.updateShapeLayer(shapeFileLayer);
mapModel.updateOpenLayersMap();
Bounds shpFileBounds = shapeFileLayer.getBoundsForLayer(mapModel.getCurrentProjection());
resetExtentLayer(shpFileBounds, presenter);
map.addLayer(boundingBoxLayer);
}
mainWindow.removeWindow(modal);
}
});
spinner.start();
}
示例9: startProcessor
import com.vaadin.ui.Window; //导入方法依赖的package包/类
protected void startProcessor() {
final ProgressBar progressBar = new ProgressBar();
progressBar.setWidth(400, Unit.PIXELS);
final Window progressWindow = new Window("Progress", progressBar);
progressWindow.setClosable(false);
progressWindow.setResizable(false);
progressWindow.center();
new Thread(new Runnable() {
@Override
public void run() {
new Processor(new ProgressListener() {
@Override
public void onProgress(final long progress) {
UI.getCurrent().access(new Runnable() {
@Override
public void run() {
// 0 .. 1
final float progressBarValue = (float) progress / Processor.MAX_PROGRESS;
progressBar.setValue(progressBarValue);
if (progress == Processor.MAX_PROGRESS) {
UI.getCurrent().setPollInterval(-1);
UI.getCurrent().removeWindow(progressWindow);
}
}
});
}
}).run();
}
}).start();
UI.getCurrent().setPollInterval(250);
UI.getCurrent().addWindow(progressWindow);
}
示例10: GridContainerCSVExport
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public GridContainerCSVExport(final String fileName, final Grid grid, final GridHeadingPropertySet<E> headingsSet)
{
this.grid = grid;
this.headingsSet = headingsSet;
final Window window = new Window();
window.setCaption("Download " + fileName + " CSV data");
window.center();
window.setHeight("100");
window.setWidth("300");
window.setResizable(false);
window.setModal(true);
final HorizontalLayout layout = new HorizontalLayout();
layout.setSizeFull();
layout.setMargin(true);
window.setContent(layout);
UI.getCurrent().addWindow(window);
window.setVisible(true);
final Button downloadButton = createDownloadButton(fileName, window);
layout.addComponent(downloadButton);
layout.setComponentAlignment(downloadButton, Alignment.MIDDLE_CENTER);
}
示例11: displayVaadinErrorWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void displayVaadinErrorWindow(final String causeClass, final String id, final Date time,
final String finalId, final String finalTrace, final String reference)
{
// generate screen shot!
final Window window = new Window();
final Screenshot screenshot = Screenshot.newBuilder().withLogging(true).withMimeType(ScreenshotMimeType.PNG)
.build();
screenshot.addScreenshotListener(new ScreenshotListener()
{
@Override
public void screenshotComplete(ScreenshotImage image)
{
image.getImageData();
showWindow(causeClass, id, time, finalId, finalTrace, reference, image.getImageData());
window.close();
}
});
window.setContent(screenshot);
window.setClosable(false);
window.setResizable(false);
UI.getCurrent().addWindow(window);
screenshot.setTargetComponent(null);
screenshot.takeScreenshot();
}
示例12: getDeleteConfirmWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private Window getDeleteConfirmWindow(DeviceDTO deviceDTO) {
final String[] exportFileName = {""};
Window confirmWindow = new Window("Delete");
confirmWindow.setResizable(false);
confirmWindow.setModal(true);
confirmWindow.setDraggable(false);
confirmWindow.setClosable(true);
confirmWindow.addCloseListener(e -> {
if (!exportFileName[0].isEmpty()) {
new File(exportFileName[0]).delete();
}
});
Label areYouSureLabel = new Label("Are you sure you want to delete the device?");
Label ifWantExport = new Label("If you wish, you can export all recorded data for the device.");
VerticalLayout contentLayout = new VerticalLayout(areYouSureLabel, ifWantExport);
Button saveAndDeleteButton = new Button("Export and Delete", event -> {
exportFileName[0] =
statisticDeviceDataService
.exportDataToCsv(deviceDTO.getDevId(), deviceDTO.getType(), deviceDTO.getName());
if (!exportFileName[0].isEmpty()) {
contentLayout.addComponent(new Link("Download export, click before exiting!",
new FileResource(new File(exportFileName[0]))));
deleteDevice(deviceDTO);
} else {
contentLayout.addComponent(
new Label("Export failed, please try again! The device has not been deleted."));
}
});
Button deleteOnly = new Button("Delete only", event -> {
deleteDevice(deviceDTO);
confirmWindow.close();
});
confirmWindow.setContent(
new VerticalLayout(contentLayout, new HorizontalLayout(saveAndDeleteButton, deleteOnly)));
return confirmWindow;
}
示例13: getExportWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private Window getExportWindow() {
final String[] fileName = {""};
Window selectWindow = new Window("Export data");
selectWindow.setClosable(true);
selectWindow.setDraggable(false);
selectWindow.setModal(true);
selectWindow.setResizable(false);
selectWindow.setWidth(300, Unit.PIXELS);
selectWindow.addCloseListener(e -> {
if (!fileName[0].isEmpty()) {
new File(fileName[0]).delete();
}
});
VerticalLayout windowRoot = new VerticalLayout();
ComboBox devicesComboBox = new ComboBox("Devices");
devicesComboBox.setWidth(100, Unit.PERCENTAGE);
devicesComboBox.setNullSelectionItemId(false);
devicesComboBox.setContainerDataSource(
new BeanItemContainer<>(
DeviceViewDTO.class,
deviceSetupService.getAllDeviceDtos().stream()
.map(deviceDTO ->
new DeviceViewDTO(deviceDTO.getDevId(), deviceDTO.getType(),
deviceDTO.getName()))
.collect(Collectors.toList())
)
);
windowRoot.addComponent(devicesComboBox);
Button toExportButton = new Button("Export", event -> {
DeviceViewDTO selectedDto = (DeviceViewDTO) devicesComboBox.getValue();
fileName[0] =
statisticDeviceDataService.exportDataToCsv(selectedDto.getDevId(), selectedDto.getType(),
selectedDto.getName());
if (!fileName[0].isEmpty()) {
windowRoot
.addComponent(new Link("Download CSV", new FileResource(new File(fileName[0]))));
} else {
windowRoot.addComponent(new Label("Export failed! Please Try again!"));
}
});
windowRoot.addComponent(toExportButton);
selectWindow.setContent(windowRoot);
return selectWindow;
}
示例14: showAddProjectDialog
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Zeige das Projekt-Hinzufuegen-Dialogfenster, bei dem ein Eingabefeld fuer
* den Namen des Projekts und ein Hinzfuege-Button vorhanden ist. Funktion
* bei geklicktem Button siehe Clicklistener in dieser Klasse. Das
* horizontale Layout zur Darstellung besitzt ein Formlayout und den Button,
* die nebeneinander dargestellt werden.
*
* @author Christian Scherer, Mirko Göpfrich
*/
@Override
public void showAddProjectDialog() {
addDialog = new Window("Projekt hinzufügen");
addDialog.setModal(true);
addDialog.setWidth(410, UNITS_PIXELS);
addDialog.setResizable(false);
addDialog.setDraggable(false);
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(false);
FormLayout formLayout = new FormLayout();
formLayout.setMargin(true);
formLayout.setSpacing(true);
//TextFeld für Name dem Formular hinzufügen
tfName = new TextField("Name wählen:");
tfName.setRequired(true);
tfName.addValidator(new StringLengthValidator(
"Der Projektname muss zwischen 2 und 20 Zeichen lang sein.", 2,
20, false));
tfName.setRequiredError("Pflichtfeld");
tfName.setSizeFull();
formLayout.addComponent(tfName);
//TextArea für Beschreibung dem Formular hinzufügen
taDescription = new TextArea("Beschreibung wählen");
taDescription.setSizeFull();
formLayout.addComponent(taDescription);
//Formular dem Layout hinzufügen
layout.addComponent(formLayout);
//Hinzufüge-Button erstllen und dem Layout hinzufügen
dialogAddBtn = new Button("Hinzufügen", this);
layout.addComponent(dialogAddBtn);
//Layout dem Dialog-Fenster hinzufügen
addDialog.addComponent(layout);
//Dialog dem Hauptfenster hinzufügen
getWindow().addWindow(addDialog);
logger.debug("Hinzufuege-Dialog erzeugt");
}
示例15: showEditProjectDialog
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**Methode zur Implementierung des Dialogfensters für Projekt-Änderungen.
*
*/
@Override
public void showEditProjectDialog(Project project) {
editDialog = new Window("Projekt bearbeiten");
editDialog.setModal(true);
editDialog.setWidth(410, UNITS_PIXELS);
editDialog.setResizable(false);
editDialog.setDraggable(false);
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(true);
FormLayout formLayout = new FormLayout();
formLayout.setMargin(true);
formLayout.setSpacing(true);
//TextFeld für Name dem Formular hinzufügen
tfName = new TextField("Name ändern:", project.getName());
tfName.setRequired(true);
tfName.addValidator(new StringLengthValidator(
"Der Projektname muss zwischen 2 und 20 Zeichen lang sein.", 2,
20, false));
tfName.setRequiredError("Pflichtfeld");
tfName.setSizeFull();
formLayout.addComponent(tfName);
//TextArea für Beschreibung dem Formular hinzufügen
taDescription = new TextArea("Beschreibung ändern:", project.getDescription());
taDescription.setSizeFull();
formLayout.addComponent(taDescription);
//Formular dem Layout hinzufügen
layout.addComponent(formLayout);
//Speichern-Button erstllen und dem Layout hinzufügen
//TODO: ist das korrekt? Gute Frage, I have no idea what u r doing
dialogEditBtn = new Button("Speichern");
layout.addComponent(dialogEditBtn);
dialogEditBtn.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (tfName.isValid()) {
boolean succed = presenter.editProject(projects.get(indexEditBtn), (String) tfName.getValue(), (String) taDescription.getValue());
if (succed) {
getWindow().removeWindow(editDialog);
logger.debug("Projekt-bearbeiten Dialog geschlossen");
}
} else {
getWindow().showNotification(
"",
"Projektname ist ein Pflichtfeld. Bitte geben Sie einen Projektnamen an",
Notification.TYPE_ERROR_MESSAGE);
}
}
});
//Layout dem Dialog-Fenster hinzufügen
editDialog.addComponent(layout);
//Dialog dem Hauptfenster hinzufügen
getWindow().addWindow(editDialog);
logger.debug("Bearbeiten-Dialog erzeugt");
}