com.smartgwt.client.widgets.Window Java Examples

The following examples show how to use com.smartgwt.client.widgets.Window. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImageLightbox.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ImageLightbox(long docId, String title) {
	int size = 800;
	if (Session.get().getConfig("gui.thumbnail.size") != null)
		size = Integer.parseInt(Session.get().getConfig("gui.thumbnail.size"));
	int windowHeight = size + 10;
	if (windowHeight > com.google.gwt.user.client.Window.getClientHeight())
		windowHeight = com.google.gwt.user.client.Window.getClientHeight();

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(title);
	setWidth("50%");
	setHeight(windowHeight);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	HTMLPanel html = new HTMLPanel(Util.thumbnailImgageHTML(docId, null, null, size));
	addItem(html);
}
 
Example #2
Source File: LoginWindow.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private Window createWindow(DynamicForm form) {
    VLayout container = new VLayout();
    container.setMembers(form, createButtons());
    container.setMargin(15);
    Window window = new Window();
    window.setAutoCenter(true);
    window.setAutoSize(true);
    window.setIsModal(true);
    window.addItem(container);
    window.setTitle(i18nSgwt.dialog_LoginTitle());
    window.setShowCloseButton(false);
    window.setShowMinimizeButton(false);
    window.setKeepInParentRect(true);
    window.setShowModalMask(true);
    window.setCanDragReposition(false);
    return window;
}
 
Example #3
Source File: FormEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public FormEditor(GUIDocument form) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("form") + " " + form.getFileName());

	this.form = form;

	setWidth(com.google.gwt.user.client.Window.getClientWidth());
	setHeight(com.google.gwt.user.client.Window.getClientHeight());
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			destroy();
		}
	});

	layout = new VLayout();
	layout.setWidth100();

	prepareBody();

	addItem(layout);
}
 
Example #4
Source File: PreviewPopup.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private PreviewPopup() {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	int size = 100;
	try {
		size = Integer.parseInt(Session.get().getInfo().getConfig("gui.preview.size"));
		if (size <= 0 || size > 100)
			size = 100;
	} catch (Throwable t) {

	}

	setWidth(Math.round((float) com.google.gwt.user.client.Window.getClientWidth() * (float) size / 100F));
	setHeight(Math.round((float) com.google.gwt.user.client.Window.getClientHeight() * (float) size / 100F));
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setMargin(2);

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			if (previewPanel != null)
				previewPanel.destroy();
			destroy();
		}
	});

	previewSlot.setWidth100();
	previewSlot.setHeight100();

	layout.setMembers(previewSlot);

	addItem(layout);
}
 
Example #5
Source File: DesaExportAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private void openResult(String pid, String token) {
    if (pid == null) {
        throw new IllegalArgumentException("pid");
    }
    StringBuilder sb = new StringBuilder();
    sb.append(RestConfig.URL_EXPORT_DESA);
    sb.append('?').append(ExportResourceApi.DESA_PID_PARAM).append('=').append(pid);
    sb.append('&').append(ExportResourceApi.RESULT_TOKEN).append('=').append(token);
    com.google.gwt.user.client.Window.open(sb.toString(), "_blanc", "");
}
 
Example #6
Source File: UploadFile.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public void showWindow(DigitalObject dobj, BooleanCallback callback) {
    this.dobj = dobj;
    this.windowCallback = callback;
    form.setAutoHeight();

    window = new Window();
    window.setAutoSize(true);
    window.setAutoCenter(true);
    window.setIsModal(true);
    window.setTitle(i18n.DigitalObjectEditor_MediaEditor_Uploader_Title());
    window.setShowMinimizeButton(false);
    window.setShowModalMask(true);
    window.addCloseClickHandler(new CloseClickHandler() {

        @Override
        public void onCloseClick(CloseClickEvent event) {
            closeWindow();
        }
    });

    VLayout winContent = new VLayout(4);
    winContent.setWidth(400);
    winContent.setPadding(5);
    winContent.addMember(createBrowseCanvas());
    winContent.addMember(form);
    winContent.addMember(createProgressBar());
    winContent.addMember(createButtons());
    window.addItem(winContent);

    window.show();
}
 
Example #7
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Window createFullImageWindow(Canvas content) {
    final Window window = new Window();
    window.setWidth(Page.getWidth() - 200);
    window.setHeight(Page.getHeight() - 40);
    window.setAutoCenter(true);
    window.setMaximized(true);
    window.setCanDragResize(true);
    window.setCanDragReposition(true);
    window.setIsModal(true);
    window.setDismissOnEscape(true);
    window.setDismissOnOutsideClick(true);
    window.setKeepInParentRect(true);
    window.setShowMaximizeButton(true);
    window.setShowMinimizeButton(false);

    window.setModalMaskOpacity(10);
    window.setShowModalMask(true);

    window.setShowResizer(true);
    window.setTitle(i18n.DigitalObjectPreview_Window_Title());
    window.setBodyColor(BACKGROUND_COLOR);
    window.setCanFocus(true);
    window.addItem(content);

    window.setHeaderControls(HeaderControls.HEADER_ICON, HeaderControls.HEADER_LABEL,
            getWindowZoomer(), HeaderControls.MAXIMIZE_BUTTON, HeaderControls.CLOSE_BUTTON);

    window.addCloseClickHandler(new CloseClickHandler() {

        @Override
        public void onCloseClick(CloseClickEvent event) {
            event.cancel();
            window.close();
            onWindowClose();
        }
    });

    return window;
}
 
Example #8
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void createInformationWindow() {
	informationWindow = new Window();
	informationWindow.setTitle(LegendEntryTimeSeries.this.getTimeSeries().getTimeSeriesLabel());
	informationWindow.setWidth(450);
	informationWindow.setHeight(500);
	informationWindow.setShowMinimizeButton(false);
	informationWindow.centerInPage();
	HTMLPane htmlPane = new HTMLPane();
	htmlPane.setContentsURL(LegendEntryTimeSeries.this
			.getTimeSeries().getMetadataUrl());
	htmlPane.setContentsType(ContentsType.PAGE);
	informationWindow.addItem(htmlPane);
}
 
Example #9
Source File: Toaster.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void getToasterWindow() {

        if (this.toasterWindow == null) {
            this.toasterWindow = new Window();
            this.layout = new VLayout();
            this.layout.setTabIndex( -1);

            this.toasterWindow.setParentElement(this.parentElem);
            this.toasterWindow.setAnimateFadeTime(fadeout);

            this.toasterWindow.setHeight(this.height);
            this.toasterWindow.setWidth(this.width);
            this.toasterWindow.setTitle(this.title);
            this.toasterWindow.setAutoSize(new Boolean(false));
            this.toasterWindow.setOverflow(Overflow.AUTO);
            this.left = this.toasterWindow.getParentElement().getWidth().intValue() - this.width - 10;
            this.top = this.toasterWindow.getParentElement().getHeight().intValue() - this.height - 30;

            this.toasterWindow.setLeft(this.left);
            this.toasterWindow.setTop(this.top);
            this.toasterWindow.setCanDragResize(true);
            this.toasterWindow.setShowMaximizeButton(true);

            this.toasterWindow.setID(this.id);
            this.toasterWindow.addItem(this.layout);

            this.toasterWindow.addCloseClickHandler(new CloseClickHandler() {

                public void onCloseClick(CloseClickEvent event) {
                    hide();
                }
            });
        }
    }
 
Example #10
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public void showInNewWindow(String url) {
    com.google.gwt.user.client.Window.open(url, "_blank", "");
}