當前位置: 首頁>>代碼示例>>Java>>正文


Java Window.setWidth方法代碼示例

本文整理匯總了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");
    }
}
 
開發者ID:kumoregdev,項目名稱:kumoreg,代碼行數:24,代碼來源:PrintBadgeWindow.java

示例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);
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:20,代碼來源:SpellChoiceForm.java

示例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);
        }
    }
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:17,代碼來源:SubSetSelector.java

示例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);
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:24,代碼來源:AutoApplication.java

示例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();
	}
}
 
開發者ID:lizardtechblog,項目名稱:ExpressZip,代碼行數:22,代碼來源:MapToolbarViewComponent.java

示例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);
    }
 
開發者ID:ExtaSoft,項目名稱:extacrm,代碼行數:22,代碼來源:FormUtils.java

示例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);
	}

}
 
開發者ID:ahn,項目名稱:mideaas,代碼行數:28,代碼來源:ZipPlugin.java

示例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);
		}
	});
}
 
開發者ID:ahn,項目名稱:mideaas,代碼行數:17,代碼來源:ShowLogButton.java

示例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; 
}
 
開發者ID:moberwasserlechner,項目名稱:vaadin-medium-editor,代碼行數:41,代碼來源:WindowEditorView.java

示例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);
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:16,代碼來源:ShopItem.java

示例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);
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:13,代碼來源:NotificationUnreadButton.java

示例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);
}
 
開發者ID:akquinet,項目名稱:vaangular,代碼行數:12,代碼來源:VaangularUI.java

示例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);
    }
}
 
開發者ID:viritin,項目名稱:viritin,代碼行數:16,代碼來源:SubSetSelector.java

示例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();
}
 
開發者ID:lizardtechblog,項目名稱:ExpressZip,代碼行數:34,代碼來源:SetupMapPresenter.java

示例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);
	}
}
 
開發者ID:alejandro-du,項目名稱:enterprise-app,代碼行數:39,代碼來源:MDIWindow.java


注:本文中的com.vaadin.ui.Window.setWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。