Java Code Examples for com.smartgwt.client.widgets.Label#setWrap()

The following examples show how to use com.smartgwt.client.widgets.Label#setWrap() . 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: Legend.java    From SensorWebClient with GNU General Public License v2.0 7 votes vote down vote up
private Label createCSVLabel() {
    Label toCSV = new Label(i18n.toCSV());
    toCSV.setWrap(false);
    toCSV.setAutoFit(true);
    toCSV.setPadding(3);
    toCSV.setWidth100();
    toCSV.setStyleName("n52_sensorweb_client_exportEntry");
    toCSV.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            controller.exportTo(ExportType.CSV_ZIP);
            exportMenu.hide();
        }
    });
    return toCSV;
}
 
Example 2
Source File: SessionTimeout.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private SessionTimeout() {
	setShowEdges(false);
	setShowHeader(false);
	centerInPage();
	setIsModal(true);
	setVertical(true);
	setAlign(Alignment.CENTER);
	setMargin(2);
	setMembersMargin(0);
	setBodyColor("white");
	setBackgroundColor("white");
	setOverflow(Overflow.HIDDEN);
	setHeight100();
	setWidth100();

	Label message = new Label(I18N.message("sessiontimeout"));
	message.setWrap(false);
	message.setAlign(Alignment.CENTER);
	message.setStyleName("sessiontimeout");
	message.setLayoutAlign(Alignment.CENTER);
	message.setLayoutAlign(VerticalAlignment.CENTER);
	message.setHeight(50);
	message.setBackgroundColor("white");

	addMember(message);
}
 
Example 3
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label createPDFLabel() {
    Label toPDF = new Label(i18n.toPDF());
    toPDF.setWrap(false);
    toPDF.setAutoFit(true);
    toPDF.setPadding(3);
    toPDF.setWidth100();
    toPDF.setStyleName("n52_sensorweb_client_exportEntry");
    toPDF.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            controller.exportTo(ExportType.PDF_ALL_IN_ONE);
            exportMenu.hide();
        }
    });
    return toPDF;
}
 
Example 4
Source File: DataControlsTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createAutoScaleButton() {
	Layout layout = new Layout();
	layout.setStyleName("n52_sensorweb_client_scaleButtonLayout");
	autoScaleButton = new Label(i18n.resetScale());
	autoScaleButton.setStyleName("n52_sensorweb_client_scaleButton");
    autoScaleButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            EventBus.getMainEventBus().fireEvent(new SwitchAutoscaleEvent(true), new EventCallback() {
                public void onEventFired() {
                    EventBus.getMainEventBus().fireEvent(new RequestDataEvent());
                }
            });
        }
    });
    autoScaleButton.setWidth(80);
    autoScaleButton.setWrap(false);
    return autoScaleButton;
}
 
Example 5
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createSelectionMenuButton() {
   	showSelectionMenuButton = new Label(i18n.chooseDataSource());
   	showSelectionMenuButton.setStyleName("n52_sensorweb_client_legendbuttonPrimary");
   	showSelectionMenuButton.setZIndex(1000000);
   	showSelectionMenuButton.setAutoHeight();
   	showSelectionMenuButton.setAutoWidth();
   	showSelectionMenuButton.setWrap(false);
   	showSelectionMenuButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (selectionMenu.isVisible()) {
				selectionMenu.animateHide(AnimationEffect.SLIDE);
			} else {
				selectionMenu.animateShow(AnimationEffect.SLIDE);
			}
		}
	});
   	setSelectionMenuButtonPosition();
	return showSelectionMenuButton;
}
 
Example 6
Source File: UploadFile.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createBrowseCanvas() {
    UploadHandler uploadHandler = new UploadHandler();
    uploader = new Uploader() {

        @Override
        protected void onLoad() {
            super.onLoad();
            openFileDialog(uploader);
        }

    };
    uploader.setUploadURL(RestConfig.URL_DIGOBJECT_DISSEMINATION)
            .setButtonImageURL(Page.getSkinImgDir() + "MultiUploadItem/icon_add_files.png")
            .setButtonWidth(16)
            .setButtonHeight(16)
            .setButtonCursor(Cursor.HAND)
            .setButtonAction(ButtonAction.SELECT_FILE)
            .setFileSizeLimit("1 GB")
            .setFilePostName(FIELD_FILE)
            .setFileUploadLimit(0)
            .setFileQueuedHandler(uploadHandler)
            .setFileQueueErrorHandler(uploadHandler)
            .setUploadCompleteHandler(uploadHandler)
            .setUploadErrorHandler(uploadHandler)
            .setUploadProgressHandler(uploadHandler)
            .setUploadSuccessHandler(uploadHandler)
            ;
    HStack hStack = new HStack(4);
    Label label = new Label(i18n.DigitalObjectEditor_MediaEditor_Uploader_Browse_Title() + ": ");
    label.setAutoFit(true);
    label.setWrap(false);
    hStack.addMember(label);
    hStack.addMember(uploader);
    return hStack;
}
 
Example 7
Source File: InteractionWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public InteractionWindow(Layout content) {
	this.setContent(content);
	
	title = new Label();
	title.setWidth100();
	title.setAutoHeight();
	title.setStyleName("n52_sensorweb_client_interactionmenuHeader");
	title.setWrap(false);
	title.hide();
	addMember(title);
	addMember(content);
	
	setStyleName("n52_sensorweb_client_interactionmenu");
}
 
Example 8
Source File: LoginHeaderLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label getHeaderLinkLabel(String labelText) {
   	Label label = new Label(labelText);
       label.setStyleName("n52_sensorweb_client_headerlink");
       label.setAutoWidth();
       label.setWrap(false);
	return label;
}
 
Example 9
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label getHeaderLinkLabel(String labelText) {
   	Label label = new Label(labelText);
       label.setStyleName("n52_sensorweb_client_headerlink");
       label.setAutoWidth();
       label.setWrap(false);
	return label;
}
 
Example 10
Source File: StatusView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private StatusView() {
    container = new HLayout();
    content = new Label();
    content.setIcon("[SKIN]/Dialog/say.png");
    content.setIconSize(20);
    content.setMargin(1);
    content.setPadding(1);

    content.setHeight(38);
    content.setValign(VerticalAlignment.CENTER);
    content.setAlign(Alignment.LEFT);
    content.setWrap(Boolean.FALSE);

    container.setMembers(content);
    container.setLeft(Page.getWidth() / 2 - 50);
    container.setTop(4);
    container.setLayoutLeftMargin(4);
    container.setLayoutRightMargin(4);
    container.setBorder("1px solid red");
    container.setBackgroundColor("white");
    container.setAutoHeight();
    container.setShowShadow(Boolean.TRUE);

    timer = new Timer() {

        @Override
        public void run() {
            container.animateHide(AnimationEffect.FADE);
        }
    };
}
 
Example 11
Source File: DesaExportAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public ExportOptionsWidget() {
    i18n = GWT.create(ClientMessages.class);
    label = new Label();
    label.setMargin(5);
    label.setWidth100();
    label.setAutoHeight();
    label.setWrap(false);
    form = new DynamicForm();
    CheckboxItem hierarchy = new CheckboxItem(ExportResourceApi.DESA_HIERARCHY_PARAM,
            i18n.ExportOptionsWidget_Hierarchy_Title());
    hierarchy.setPrompt(i18n.ExportOptionsWidget_Hierarchy_Hint());
    form.setFields(hierarchy);
}
 
Example 12
Source File: Editor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createMainHeader(TreeGrid menu) {
        ToolStrip mainHeader = new ToolStrip();
        mainHeader.setWidth100();
        mainHeader.setHeight(40);

        mainHeader.addSpacer(6);

        Label headerItem = new Label();
        headerItem.setWrap(false);
        headerItem.setIcon("16/logo.png");
        headerItem.setIconHeight(16);
        headerItem.setIconWidth(205);
//        headerItem.setIcon("24/logo.png");
//        headerItem.setIconHeight(24);
//        headerItem.setIconWidth(307);
//        headerItem.setIcon("20/logo.png");
//        headerItem.setIconHeight(20);
//        headerItem.setIconWidth(256);

        mainHeader.addMember(createGlobalMenuButton(menu));
        mainHeader.addMember(createLangMenu());
        createUserLink(mainHeader, mainHeader.getMembers().length);
        mainHeader.addFill();
        mainHeader.addMember(headerItem);
        mainHeader.addSpacer(6);

        return mainHeader;
    }
 
Example 13
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static Label newLinkLabel(String title) {
	Label label = new Label(I18N.message(title));
	label.setWrap(false);
	label.setCursor(Cursor.HAND);
	label.setAutoWidth();
	return label;
}
 
Example 14
Source File: UpdatePanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void onUpdateUnavailable() {
	Label message = new Label();
	message.setContents(I18N.message("updatepackagenotfound"));
	message.setWrap(false);
	message.setAlign(Alignment.LEFT);
	message.setStyleName("updateunavailable");
	message.setLayoutAlign(Alignment.LEFT);
	message.setLayoutAlign(VerticalAlignment.TOP);
	message.setHeight(20);
	setMembers(message);
}
 
Example 15
Source File: GoogleAuthenticatorSetup.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void init(String account, String key, String qrUrl) {
	// Prepare the form with account informations
	StaticTextItem accountItem = ItemFactory.newStaticTextItem("account", I18N.message("account"), account);
	accountItem.setWrap(false);
	accountItem.setWrapTitle(false);

	StaticTextItem keyItem = ItemFactory.newStaticTextItem("key", I18N.message("key"), key);
	keyItem.setWrap(false);
	keyItem.setWrapTitle(false);

	DynamicForm form = new DynamicForm();
	form.setTitleOrientation(TitleOrientation.LEFT);
	form.setItems(accountItem, keyItem);

	Label formTitle = new Label("<b>" + I18N.message(Constants.TWOFA_GOOGLE_AUTHENTICATOR+".hint1") + "</b>");
	formTitle.setWrap(true);
	formTitle.setMinWidth(250);

	VLayout formLayout = new VLayout();
	formLayout.setMembersMargin(2);
	formLayout.setMembers(formTitle, form);
	formLayout.setAlign(VerticalAlignment.TOP);

	// Prepare the QR Code
	HTMLFlow qrCode = new HTMLFlow("<img width='200' height='200' src='" + qrUrl + "'/>");
	qrCode.setOverflow(Overflow.VISIBLE);

	Label qrCodeTitle = new Label("<b>" + I18N.message(Constants.TWOFA_GOOGLE_AUTHENTICATOR+".hint2") + "</b>");
	qrCodeTitle.setWrap(true);
	qrCodeTitle.setMinWidth(250);

	VLayout qrCodeLayout = new VLayout();
	qrCodeLayout.setWidth100();
	qrCodeLayout.setHeight100();
	qrCodeLayout.setMembers(qrCodeTitle, qrCode);

	VLayout separator = new VLayout();
	separator.setWidth(20);

	HLayout body = new HLayout();
	body.setMembersMargin(2);
	body.setMembers(formLayout, separator, qrCodeLayout);

	setMembers(body);
}
 
Example 16
Source File: Cursor.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * ID of the message to be used to compose the email
 * 
 * @param maxDisplayedRecordsCookieName name of the cookies to save the max number of displayed records
 * @param enabledPagination if the pagination must be enabled
 * @param compactView if the compact vidualization must be used
 */
public Cursor(String maxDisplayedRecordsCookieName, boolean enabledPagination, boolean compactView) {
	setHeight(20);
	this.maxCookieName = maxDisplayedRecordsCookieName;

	label = new Label(" ");
	label.setWrap(false);
	label.setMargin(2);
	setAlign(Alignment.RIGHT);

	String mx = "100";
	if (maxDisplayedRecordsCookieName != null) {
		if (Offline.get(maxDisplayedRecordsCookieName) != null
				&& !Offline.get(maxDisplayedRecordsCookieName).equals(""))
			mx = (String) Offline.get(maxDisplayedRecordsCookieName);
	}

	maxItem = ItemFactory.newSpinnerItem("max", "display", Integer.parseInt(mx), 2, (Integer) null);
	maxItem.setValue(Integer.parseInt(mx));
	maxItem.setWidth(70);
	maxItem.setStep(20);
	maxItem.setSaveOnEnter(true);
	maxItem.setImplicitSave(true);
	maxItem.addChangedHandler(new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			onMaxChange();
		}
	});
	if (compactView) {
		maxItem.setShowTitle(false);
	} else {
		maxItem.setHint(I18N.message("elements"));
	}

	addFormItem(maxItem);
	if (enabledPagination) {
		pageItem = ItemFactory.newSpinnerItem("page", "page", 1, 1, 1);
		pageItem.setHint("");
		pageItem.setSaveOnEnter(true);
		pageItem.setImplicitSave(true);

		addSeparator();
		addFormItem(pageItem);
	}
	addFill();
	addMember(label);
}
 
Example 17
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);
}