com.smartgwt.client.widgets.events.CloseClickEvent Java Examples

The following examples show how to use com.smartgwt.client.widgets.events.CloseClickEvent. 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: AddTemplateAttributeDialog.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public AddTemplateAttributeDialog(TemplatePropertiesPanel panel) {
	this.propertiesPanel = panel;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("attributesets"));
	setWidth(500);
	setHeight(400);
	setIsModal(true);
	setShowModalMask(true);
	setCanDragResize(true);
	centerInPage();
	setAutoSize(true);

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			destroy();
		}
	});
}
 
Example #2
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 #3
Source File: WebcontentEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public WebcontentEditor(final GUIDocument document) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	if (document.getId() > 0)
		setTitle(I18N.message("editdoc") + ": " + document.getFileName());
	else
		setTitle(I18N.message("createdoc") + ": " + document.getFileName());

	this.document = document;

	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setWidth100();
	setHeight100();
	centerInPage();

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

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

	prepareBody();

	addItem(layout);
}
 
Example #4
Source File: ZohoEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ZohoEditor(final GUIDocument document) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("editdoc") + ": " + document.getFileName());

	this.document = document;

	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setAutoSize(true);
	centerInPage();
	setMargin(2);

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

	layout = new VLayout();
	layout.setMargin(1);
	layout.setWidth100();
	layout.setHeight100();
	addItem(layout);

	prepareBody();
}
 
Example #5
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 #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: LoginWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public LoginWindow(String ID) {
        COMPONENT_ID = ID;
        initializeWindow();
        new LoginWindowEventBroker(this);
        addCloseClickHandler(new CloseClickHandler() {
            public void onCloseClick(CloseClickEvent event) {
//                clearContent();
//                markForDestroy(); // re-create window once it is closed
                hide();
            }
        });
    }
 
Example #9
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private StationSelector(StationSelectorController controller) {
	stationFilterGroups = new HashMap<String, RadioGroupItem>();
	controller.setStationPicker(this);
    initializeWindow();
    initializeContent();
    addCloseClickHandler(new CloseClickHandler() {
        public void onCloseClick(CloseClickEvent event) {
        	closeStationpicker();
        }
    });
}
 
Example #10
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 #11
Source File: TaskDetailsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public TaskDetailsDialog(final WorkflowDashboard dashboard, GUIWorkflow wfl, boolean readOnly) {
	this.workflow = wfl;
	this.workflowDashboard = dashboard;
	this.readOnly = readOnly;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);

	setTitle(I18N.message("workflow"));
	setWidth(700);
	setHeight(420);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

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

	tabs = new TabSet();
	tabs.setWidth100();
	tabs.setHeight100();

	workflowTab = new Tab(I18N.message("workflow"));
	tabs.addTab(workflowTab, 0);

	buttonsPanel = new VLayout();

	mainPanel = new HLayout();
	mainPanel.setMembersMargin(5);
	mainPanel.setMembers(tabs, buttonsPanel);

	addItem(mainPanel);

	form = new HLayout(25);
	form.setMargin(20);
	form.setWidth100();
	form.setHeight100();

	sxLayout = new VLayout(10);
	appendedDocsPanel = new VLayout(5);
	appendedDocsPanel.setMargin(5);
	notesPanel = new VLayout(5);
	notesPanel.setMargin(5);

	reload(wfl);
}
 
Example #12
Source File: AboutDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public AboutDialog() {
	super();

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

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("about") + " " + Session.get().getInfo().getBranding().getProductName());
	setWidth(400);
	setPadding(2);
	setAutoSize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	HTMLPane vspacer1 = new HTMLPane();
	vspacer1.setContents("<div>&nbsp;</div>");
	vspacer1.setPixelSize(100, 5);
	vspacer1.setOverflow(Overflow.HIDDEN);

	Img logoImage = ItemFactory.newBrandImg("logo.png", Session.get().getInfo());
	logoImage.setWidth(205);
	logoImage.setHeight(40);

	Label productName = new Label(Session.get().getInfo().getBranding().getProductName());
	productName.setWrap(false);
	productName.setHeight(10);
	productName.setAlign(Alignment.CENTER);

	Label version = new Label(I18N.message("version") + " " + Session.get().getInfo().getRelease());
	version.setWrap(false);
	version.setHeight(10);
	version.setAlign(Alignment.CENTER);

	Label copyright = new Label("&copy; " + Session.get().getInfo().getYear() + " "
			+ Session.get().getInfo().getBranding().getVendor());
	copyright.setWrap(false);
	copyright.setHeight(20);
	copyright.setAlign(Alignment.CENTER);

	Label trademark = new Label(I18N.message("copyrights", new String[] { Session.get().getInfo().getBranding().getProduct(),
			Session.get().getInfo().getBranding().getProduct(), Session.get().getInfo().getBranding().getVendor() }));
	trademark.setWidth("80%");
	trademark.setHeight(40);
	trademark.setAlign(Alignment.CENTER);

	// Prepare the website link
	String wsurl = Session.get().getInfo().getBranding().getUrl();

	String htmlUrl = "";
	if (Session.get().getInfo().getBranding().getUrl() != null && !"-".equals(Session.get().getInfo().getBranding().getUrl()))
		htmlUrl = "<div style='text-align: center;'><a href='" + wsurl + "' target='_blank'>" + wsurl
				+ "</a></div>";
	HTMLPane sitelink = new HTMLPane();
	sitelink.setContents(htmlUrl);
	sitelink.setPixelSize(300, 16);
	sitelink.setAlign(Alignment.CENTER);
	sitelink.setLayoutAlign(Alignment.CENTER);

	// Prepare the support link
	String support = Session.get().getInfo().getBranding().getSupport();
	String htmlSupp = "<div style='text-align: center;'><a href='mailto:" + support + "'>" + support + "</a></div>";
	HTMLPane maillink = new HTMLPane();
	maillink.setContents(htmlSupp);
	maillink.setPixelSize(300, 16);
	maillink.setAlign(Alignment.CENTER);
	maillink.setLayoutAlign(Alignment.CENTER);

	HTMLPane vspacer2 = new HTMLPane();
	vspacer2.setContents("<div>&nbsp;</div>");
	vspacer2.setPixelSize(100, 10);
	vspacer2.setOverflow(Overflow.HIDDEN);

	VStack content = new VStack();
	content.setWidth("100%");
	content.setMembersMargin(5);
	content.setMargin(4);
	content.setAlign(Alignment.CENTER);
	content.setDefaultLayoutAlign(Alignment.CENTER);
	content.setBackgroundColor("#ffffff");
	content.setMembers(vspacer1, logoImage, productName, version, copyright, trademark, sitelink, maillink,
			vspacer2);

	addItem(content);
}
 
Example #13
Source File: Dialog.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onCloseClick(CloseClickEvent event) {
    close();
}