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

The following examples show how to use com.smartgwt.client.widgets.Label#setWidth100() . 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: 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 3
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 4
Source File: ProgressTracker.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public ProgressTracker(ClientMessages i18n) {
    this.i18n = i18n;
    widget = new VLayout(4);
    label = new Label();
    label.setWidth100();
    label.setAutoHeight();
    progressbar = new Progressbar();
    progressbar.setVertical(false);
    progressbar.setLength(400);
    progressbar.setBreadth(24);

    widget.setMembers(label, progressbar);
    widget.setWidth100();
    widget.setAutoHeight();
    progressPrefix = i18n.ProgressTracker_Progress_0();

    closeBtn = new IButton(i18n.ProgressTracker_CloseBtn_Title(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            stop();
        }
    });
    closeBtn.setTooltip(i18n.ProgressTracker_CloseBtn_Hint());
    closeBtn.setAutoFit(true);

}
 
Example 5
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 6
Source File: ResetPassword.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ResetPassword(String product) {
	this.productName = product;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("passwordreset"));
	setWidth(340);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(5);
	setAutoSize(true);
	setMargin(5);

	DynamicForm form = new DynamicForm();
	form.setMargin(5);
	form.setValuesManager(vm);
	TextItem username = ItemFactory.newTextItem("username", "username", "");
	username.setRequired(true);
	TextItem email = ItemFactory.newEmailItem("email", "email", false);
	email.setRequired(true);
	form.setFields(username, email);
	addItem(form);

	Label pwdResetMsg = new Label(I18N.message("passwordresetmessage"));
	pwdResetMsg.setWidth100();
	pwdResetMsg.setMargin(5);
	addItem(pwdResetMsg);

	final DynamicForm buttonForm = new DynamicForm();
	buttonForm.setMargin(5);
	ButtonItem resetButton = new ButtonItem("reset", I18N.message("reset"));
	resetButton.setAutoFit(true);
	resetButton.addClickHandler(new ClickHandler() {
		@SuppressWarnings("unchecked")
		public void onClick(ClickEvent event) {
			Map<String, Object> values = (Map<String, Object>) vm.getValues();

			if (vm.validate()) {
				final String userName = (String) values.get("username");
				final String emailAddress = (String) values.get("email");
				buttonForm.setDisabled(true);
				loginService.resetPassword(userName, emailAddress, productName, new AsyncCallback<Void>() {

					@Override
					public void onFailure(Throwable caught) {
						Log.serverError(caught);
						buttonForm.setDisabled(false);
					}

					@Override
					public void onSuccess(Void result) {
						buttonForm.setDisabled(false);
						SC.say(I18N.message("amessagewassentto", emailAddress));
						destroy();
					}
				});
			}
		}
	});
	buttonForm.setItems(resetButton);
	addItem(buttonForm);
}
 
Example 7
Source File: ImportSourceChooser.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ImportSourceChooser(ClientMessages i18n) {
    this.i18n = i18n;
    VLayout layout = this;
    setWidth100();
    setHeight100();
    VLayout innerLayout = new VLayout();
    innerLayout.setLayoutMargin(4);

    lblCurrSelection = new Label(i18n.ImportSourceChooser_NothingSelected_Title());
    lblCurrSelection.setWidth100();
    lblCurrSelection.setAutoFit(true);
    lblCurrSelection.setMargin(4);
    lblCurrSelection.setCanSelectText(true);

    treeGrid = new TreeGrid();
    treeGrid.setHeight100();
    treeGrid.setDataSource(dataSource);
    TreeGridField stateField = new TreeGridField(
            ImportTreeDataSource.FIELD_STATE,
            i18n.ImportSourceChooser_TreeHeaderImportState_Title());
    stateField.setWidth(100);
    treeGrid.setFields(
            new TreeGridField(ImportTreeDataSource.FIELD_NAME, i18n.ImportSourceChooser_TreeHeaderFolderName_Title()),
            stateField);
    treeGrid.setShowConnectors(true);
    treeGrid.setEmptyMessage(i18n.ImportSourceChooser_NoDataOnServer_Title());
    treeGrid.setAlternateRecordStyles(true);
    treeGrid.setSelectionType(SelectionStyle.SINGLE);
    ListGridPersistance treeGridPersistence = new ListGridPersistance("ImportSourceChooser.directoryList", treeGrid);
    treeGrid.setViewState(treeGridPersistence.getViewState());

    treeGrid.addFolderClickHandler(new FolderClickHandler() {

        @Override
        public void onFolderClick(FolderClickEvent event) {
            updateOnSelection();
            // issue 41: open node on single click
            TreeNode folder = event.getFolder();
            event.getViewer().getTree().openFolder(folder);
        }
    });

    ToolStrip toolbar = createToolbar();

    optionsForm = createOptionsForm();

    innerLayout.setMembers(optionsForm, lblCurrSelection, treeGrid);
    layout.setMembers(toolbar, innerLayout);
}