本文整理汇总了Java中com.vaadin.ui.Window.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setWidth方法的具体用法?Java Window.setWidth怎么用?Java Window.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Window
的用法示例。
在下文中一共展示了Window.setWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showBadgesInBrowser
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public void showBadgesInBrowser(List<Attendee> attendeeList) {
if (attendeeList.size() > 0) {
StreamResource.StreamSource source = handler.getBadgeFormatter(this, attendeeList);
String filename = "testbadge" + System.currentTimeMillis() + ".pdf";
StreamResource resource = new StreamResource(source, filename);
resource.setMIMEType("application/pdf");
resource.getStream().setParameter("Content-Disposition", "attachment; filename="+filename);
Window window = new Window();
window.setWidth(800, Sizeable.Unit.PIXELS);
window.setHeight(600, Sizeable.Unit.PIXELS);
window.setModal(true);
window.center();
BrowserFrame pdf = new BrowserFrame("test", resource);
pdf.setSizeFull();
window.setContent(pdf);
getUI().addWindow(window);
} else {
Notification.show("No attendees selected");
}
}
示例2: getSpellWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void getSpellWindow(Spell spell) {
Messages messages = Messages.getInstance();
Window window = new Window(spell.getName());
window.setModal(true);
window.setWidth("60%");
CollectionToStringConverter converter = new CollectionToStringConverter();
FormLayout layout = new FormLayout();
DSLabel componentType = new DSLabel(messages.getMessage("spellStep.component.label"),
converter.convertToPresentation(spell.getComponentTypes(), new ValueContext()));
DSLabel text = new DSLabel(messages.getMessage("spellStep.description.label"), spell.getDescription());
layout.addComponents(componentType, text);
//TODO : other useful info
window.setContent(layout);
UI.getCurrent().addWindow(window);
}
示例3: addEntity
import com.vaadin.ui.Window; //导入方法依赖的package包/类
protected void addEntity(String input) {
ET newInstance = instantiator.apply(input);
if (newInstanceForm != null) {
String caption = "Add new " + elementType.getSimpleName();
newInstanceForm.setEntity(newInstance);
newInstanceForm.setSavedHandler(this);
newInstanceForm.setResetHandler(this);
Window w = newInstanceForm.openInModalPopup();
w.setWidth("70%");
w.setCaption(caption);
} else {
onSave(newInstance);
}
}
示例4: init
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void init() {
// エラーハンドリング
setErrorHandler(new ErrorHandler(this));
// ログアウト後の画面設定
String logoutUrl;
try {
logoutUrl = new URL(getURL(), "..").toExternalForm();
} catch (MalformedURLException e) {
logoutUrl = "../../../";
}
setLogoutURL(logoutUrl);
Window mainWindow = new Window(ViewProperties.getCaption("window.main"));
mainWindow.setWidth("960px");
mainWindow.setHeight("100%");
setTheme("classy");
setMainWindow(mainWindow);
MainView mainView = new MainView();
mainWindow.setContent(mainView);
}
示例5: buttonClick
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
if (b == btnJobQueueStatus) {
Window subWindow = new Window("Job Manager");
subWindow.setWidth("500px");
subWindow.center();
getApplication().getMainWindow().addWindow(subWindow);
Panel p = new Panel(new JobsStatusViewComponent(getApplication().getURL()));
p.getContent().setWidth("100%");
p.setWidth("100%");
subWindow.addComponent(p);
subWindow.setModal(true);
} else if (b == help) {
String HelpURL = getApplication().getURL().toExternalForm() + "doc";
getApplication().getMainWindow().open(new ExternalResource(HelpURL), "_blank");
} else if (b == restart) {
((ExpressZipWindow) getApplication().getMainWindow()).getApplication().close();
}
}
示例6: showModalWin
import com.vaadin.ui.Window; //导入方法依赖的package包/类
public static void showModalWin(final ExtaEditForm<?> editWin) {
final Window window = new Window(editWin.getCaption(), editWin);
window.setClosable(true);
window.setModal(true);
if (editWin.getWinHeight() != Sizeable.SIZE_UNDEFINED)
window.setHeight(editWin.getWinHeight(), editWin.getWinHeightUnit());
if (editWin.getWinWidth() != Sizeable.SIZE_UNDEFINED)
window.setWidth(editWin.getWinWidth(), editWin.getWinWidthUnit());
window.addCloseListener(event -> editWin.fireCloseForm());
editWin.addCloseFormListener(event -> window.close());
if (editWin.getWinHeight() != Sizeable.SIZE_UNDEFINED && editWin.getWinWidth() != Sizeable.SIZE_UNDEFINED)
editWin.addAttachListener(e -> editWin.adjustSize());
else
new WinSizeAdjuster(editWin, window);
UI.getCurrent().addWindow(window);
}
示例7: zipProject
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Zips project.
*
* @param projectName the name of the project to be zipped
*/
protected void zipProject() {
try {
File zipFile = File.createTempFile("mideaas-"+project.getName(), ".zip");
zipProjectToFile(zipFile, settings);
FileResource zip = new FileResource(zipFile);
FileDownloader fd = new FileDownloader(zip);
Button downloadButton = new Button("Download project");
fd.extend(downloadButton);
//filedonwnloader can not be connected to menuitem :( So I connected it to popupwindow :)
Window zipButtonWindow = new Window();
zipButtonWindow.setCaption("Zip and download project");
zipButtonWindow.setWidth(200, Unit.PIXELS);
zipButtonWindow.setContent(downloadButton);
UI.getCurrent().addWindow(zipButtonWindow);
} catch (IOException e) {
e.printStackTrace();
Notification.show("Error: " + e.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
示例8: openLogWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void openLogWindow() {
Window w = new Window("Log");
w.center();
w.setWidth("80%");
w.setHeight("80%");
w.setContent(logView);
logView.setSizeFull();
UI.getCurrent().addWindow(w);
setEnabled(false);
w.addCloseListener(new CloseListener() {
@Override
public void windowClose(CloseEvent e) {
ShowLogButton.this.setEnabled(true);
}
});
}
示例9: getAddonComponent
import com.vaadin.ui.Window; //导入方法依赖的package包/类
@Override
public Component getAddonComponent() {
Window w = new Window("Medium Editor in window");
w.setWidth(500, Unit.PIXELS);
w.setHeight(400, Unit.PIXELS);
Panel p = new Panel();
p.addStyleName(ValoTheme.PANEL_WELL);
p.setSizeFull();
MediumEditor editor = new MediumEditor();
editor.setSizeFull();
editor.setFocusOutlineEnabled(false);
editor.setJsLoggingEnabled(true);
editor.setContent(Lorem.getHtmlParagraphs(3, 5));
editor.configure(
editor.options()
.toolbar()
.buttons(Buttons.BOLD, Buttons.ITALIC,
Buttons.JUSTIFY_CENTER,
Buttons.ANCHOR)
.done()
.autoLink(true)
.imageDragging(false)
.done()
);
editors.add(editor);
p.setContent(editor);
w.setContent(p);
Button b = new Button("Open Window");
b.addClickListener(e -> {
w.setPosition(e.getClientX(), e.getClientY());
UI.getCurrent().addWindow(w);
});
return b;
}
示例10: showItemWindow
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showItemWindow() {
Messages messages = Messages.getInstance();
Window window = new Window(this.item.getEquipment().getName());
window.setModal(true);
window.setWidth("60%");
FormLayout layout = new FormLayout();
DSLabel description = new DSLabel("Description", this.item.getEquipment().getDescription());
layout.addComponents(description);
//TODO : other useful info
window.setContent(layout);
UI.getCurrent().addWindow(window);
}
示例11: 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);
}
示例12: showPopup
import com.vaadin.ui.Window; //导入方法依赖的package包/类
private void showPopup(String eintrag) {
Window modalWin = new Window("E-Mail is being sent...");
modalWin.setContent(new Label("<div style=\"margin: 10px; \">"
+ "<h2>Season's greetings</h2>" + "<p>" + eintrag + "</p>"
+ "</div>", ContentMode.HTML));
modalWin.setModal(true);
modalWin.setWidth("400px");
modalWin.setHeight("250px");
modalWin.center();
UI.getCurrent().addWindow(modalWin);
}
示例13: addEntity
import com.vaadin.ui.Window; //导入方法依赖的package包/类
protected void addEntity(String stringInput) {
final ET newInstance = instantiateOption(stringInput);
if (newInstanceForm != null) {
String caption = "Add new " + elementType.getSimpleName();
newInstanceForm.setEntity(newInstance);
newInstanceForm.setSavedHandler(this);
newInstanceForm.setResetHandler(this);
Window w = newInstanceForm.openInModalPopup();
w.setWidth("70%");
w.setCaption(caption);
} else {
onSave(newInstance);
}
}
示例14: 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();
}
示例15: addWorkbenchContent
import com.vaadin.ui.Window; //导入方法依赖的package包/类
/**
* Adds the given component as a tab or window acordingly to current visualizacion settings.
* @param component component to add.
* @param caption Tab or Window caption.
* @param icon Tab or Window icon.
* @param closable true if the user can close the tab or window.
* @param confirmClosing true to show a confirmation dialog before closing the tab or window.
*/
public void addWorkbenchContent(Component component, String caption, Resource icon, boolean closable, boolean confirmClosing) {
component.setSizeFull();
if(windowsMenuItem != null && !windowsMenuItem.isVisible()) {
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.setMargin(false);
layout.addComponent(component);
Window window = new Window(caption);
window.setIcon(icon);
window.setClosable(closable);
window.setContent(layout);
window.setWidth("80%");
window.setHeight("80%");
window.getContent().setSizeFull();
placeWindow(window);
UI.getCurrent().addWindow(window);
} else {
Tab tab = tabsheet.addTab(component, caption, icon);
tab.setClosable(closable);
tabsheet.setSelectedTab(component);
}
if(confirmClosing) {
confirmClosingComponents.add(component);
}
}