com.smartgwt.client.widgets.Label Java Examples

The following examples show how to use com.smartgwt.client.widgets.Label. 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: PopupMessage.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public PopupMessage(String title, String messageText) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(title);
	setAlign(Alignment.CENTER);
	setAutoSize(true);
	centerInPage();
	
	Label label=new Label(messageText);
	label.setMinWidth(350);
	
	VLayout layout= new VLayout();
	layout.setMembersMargin(2);
	layout.setMembers(label);
	
	addItem(layout);
	
	Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

		@Override
		public boolean execute() {
			PopupMessage.this.destroy();
			return false;
		}
	}, Session.get().getConfigAsInt("gui.popup.timeout") * 1000);
}
 
Example #3
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 #4
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createInformationFieldForSelectedStation() {
        VLayout layout = new VLayout();
        timeseriesInfoHTMLPane = new HTMLPane();
        phenomenonBox = new SelectItem(i18n.phenomenonLabel());
        phenomenonBox.addChangedHandler(new ChangedHandler() {
			@Override
			public void onChanged(ChangedEvent event) {
				String category = (String) event.getItem().getValue();
				controller.loadTimeseriesByCategory(category);
			}
		});
        DynamicForm form = new DynamicForm();
        form.setItems(phenomenonBox);
//        phenomenonInfoLabel = new Label();
//        phenomenonInfoLabel.setAutoHeight();
        stationInfoLabel = new Label();
        stationInfoLabel.setAutoHeight();
//        layout.addMember(phenomenonInfoLabel);
        layout.addMember(form);
        layout.addMember(stationInfoLabel);
        layout.addMember(timeseriesInfoHTMLPane);
        return layout;
    }
 
Example #5
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 #6
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createValueIntervalLabel() {
	Layout interval = new HLayout();
	interval.setAutoWidth();
	interval.setStyleName("n52_sensorweb_client_legendInfoRow");
	this.firstValueInterval.setAutoWidth();
	this.firstValueInterval.setWrap(false);
	this.firstValueInterval.setStyleName("n52_sensorweb_client_legendlink");
	this.lastValueInterval.setAutoWidth();
	this.lastValueInterval.setWrap(false);
	this.lastValueInterval.setStyleName("n52_sensorweb_client_legendlink");
	Label separator = new Label(i18n.to());
	separator.setAlign(Alignment.CENTER);
	separator.setWidth(20);
	interval.addMember(this.firstValueInterval);
	interval.addMember(separator);
	interval.addMember(this.lastValueInterval);
	return interval;
}
 
Example #7
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 #8
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label createExportLabelButton() {
    Label export = new Label(i18n.export());
    export.setStyleName("n52_sensorweb_client_legendbuttonDisabled");
    export.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (exportMenu.isVisible()) {
                exportMenu.hide();
            }
            else {
                exportMenu.setLeft(exportButton.getAbsoluteLeft() - 2);
                exportMenu.setWidth(exportButton.getWidth());
                exportMenu.show();
            }
        }
    });
    return export;
}
 
Example #9
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 #10
Source File: FeatureDisabled.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public FeatureDisabled(Integer feature) {
	Label label = null;
	if (feature == null)
		label = new MessageLabel(new GUIMessage("<b>" + I18N.message("featuredisabled") + "</b>",
				GUIMessage.PRIO_WARN), false);
	else
		label = new MessageLabel(new GUIMessage("<b>" + I18N.message("feature_" + feature) + " "
				+ I18N.message("disabled") + "</b>", GUIMessage.PRIO_WARN), false);
	new Label();
	label.setHeight(30);
	label.setPadding(10);
	label.setAlign(Alignment.CENTER);
	label.setValign(VerticalAlignment.CENTER);
	label.setShowEdges(false);

	addMember(label);
}
 
Example #11
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label getCopyrightLink() {

        DateTimeFormat dateFormatter = DateTimeFormat.getFormat("yyyy");
		String year = dateFormatter.format(new Date());

        Label copyright = getHeaderLinkLabel("&copy; 52&#176;North, GmbH " + year);
        copyright.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				String url = "http://www.52north.org";
                Window.open(url, "_blank", "");
			}
		});
		return copyright;
	}
 
Example #12
Source File: StatsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onDraw() {
	SystemService.Instance.get().getStatistics(I18N.getLocale(), new AsyncCallback<GUIParameter[][]>() {

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

		@Override
		public void onSuccess(GUIParameter[][] parameters) {
			Label lastUpdateLabel = new Label("<b>" + I18N.message("lastupdate") + ": "
					+ parameters[3][0].getValue() + "</b>");
			lastUpdateLabel.setHeight(30);
			lastUpdateLabel.setAlign(Alignment.RIGHT);

			StatsPie charts = new StatsPie(parameters);

			setMembers(lastUpdateLabel, charts);
		}
	});
}
 
Example #13
Source File: UserPropertiesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public UserPropertiesPanel(GUIUser user, ChangedHandler changedHandler) {
	if (user == null) {
		setMembers(UsersPanel.SELECT_USER);
	} else {
		this.user = user;
		this.changedHandler = changedHandler;
		setWidth100();
		setHeight100();
		setMembersMargin(20);

		layout.setWidth(300);

		idLabel = new Label(I18N.message("id") + ": " + Long.toString(user.getId()));
		idLabel.setHeight(15);
		layout.addMember(idLabel, 0);

		prepareGUI();
	}
}
 
Example #14
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label getImprintLink() {
	Label imprint = getHeaderLinkLabel(i18n.Impressum());
       imprint.addClickHandler(new ClickHandler() {
           public void onClick(ClickEvent event) {
               com.smartgwt.client.widgets.Window w = new com.smartgwt.client.widgets.Window();
               w.setTitle(i18n.Impressum());
               w.setWidth(450);
               w.setHeight(460);
               w.centerInPage();
               w.setIsModal(true);

               VLayout layout = new VLayout();
               HTMLPane pane = new HTMLPane();
               pane.setContentsURL(i18n.imprintPath());
               layout.setStyleName("n52_sensorweb_client_imprint_content");
               layout.addMember(pane);
               w.addItem(layout);
               w.show();
           }
       });
	return imprint;
}
 
Example #15
Source File: DocumentsPreviewPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public DocumentsPreviewPanel() {
	setAlign(Alignment.CENTER);
	selectLabel = new Label("&nbsp;" + selectLabelString);
	selectLabel.setOverflow(Overflow.HIDDEN);
	
	setInitialSize();
	reset();
	
	addResizedHandler(new ResizedHandler() {
		@Override
		public void onResized(ResizedEvent event) {
			if ("true".equals(Session.get().getConfig("gui.preview.openpanel")))
				Offline.put(widthCookieName, getWidthAsString());
		}
	});
}
 
Example #16
Source File: TenantPropertiesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public TenantPropertiesPanel(GUITenant tenant, ChangedHandler changedHandler) {
	if (tenant == null) {
		setMembers(TenantsPanel.SELECT_TENANT);
	} else {
		this.tenant = tenant;
		this.changedHandler = changedHandler;
		setWidth100();
		setHeight100();
		setMembersMargin(20);

		layout.setWidth(300);

		idLabel = new Label(I18N.message("id") + ": " + Long.toString(tenant.getId()));
		idLabel.setHeight(15);
		layout.addMember(idLabel, 0);

		refresh();
	}
}
 
Example #17
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 #18
Source File: Toaster.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public void addErrorMessage(String error) {

        Date d = new Date();
        String timeStamp = DateTimeFormat.getFormat("dd.MM.yyyy HH:mm").format(d);

        Label l = new Label(timeStamp + " " + error);
        l.setCanSelectText(true);
        l.setStyleName("n52_sensorweb_client_toasterErrorMsg");
        l.setAutoHeight();

        for (int i = 0; i < this.messages.size(); i++) {
            this.layout.removeMember(this.messages.get(i));

        }
        this.messages.add(l);
        for (int i = this.messages.size() - 1; i >= 0; i--) {
            this.layout.addMember(this.messages.get(i));
        }

        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);

        animateToaster();
    }
 
Example #19
Source File: Toaster.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public void addMessage(String msg) {

        Date d = new Date();
        String timeStamp = DateTimeFormat.getFormat("dd.MM.yyyy HH:mm").format(d);

        Label l = new Label(timeStamp + " " + msg);
        l.setCanSelectText(true);
        l.setStyleName("n52_sensorweb_client_toasterMsg");
        l.setAutoHeight();

        this.messages.add(l);

        for (int i = 0; i < this.messages.size(); i++) {
            if (this.layout.hasMember(this.messages.get(i))) {
                this.layout.removeMember(this.messages.get(i));
            }
        }
        for (int i = this.messages.size() - 1; i >= 0; i--) {
            this.layout.addMember(this.messages.get(i));
        }

//        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);

        animateToaster();
    }
 
Example #20
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Canvas createLegendInfo() {

		this.legendInfo = new VLayout();
		this.legendInfo.setTabIndex(-1);
		// this.offeringLabel = new Label();
		// this.procedureLabel = new Label();
		this.phenonmenonLabel = new Label();
		this.stationLabel = new Label();
		this.firstValueInterval = new Label();
		this.lastValueInterval = new Label();

		this.phenonmenonLabel.setStyleName("n52_sensorweb_client_legendInfoRow");
		this.stationLabel.setStyleName("n52_sensorweb_client_legendInfoRow");

		// this.offeringLabel.setHeight(15);
		// this.procedureLabel.setHeight(15);
		this.phenonmenonLabel.setAutoHeight();
		this.stationLabel.setAutoHeight();

		// this.legendInfo.addMember(this.offeringLabel);
		// this.legendInfo.addMember(this.procedureLabel);
		this.legendInfo.addMember(this.phenonmenonLabel);
		this.legendInfo.addMember(this.stationLabel);
		this.legendInfo.addMember(createValueIntervalLabel());

		return this.legendInfo;
	}
 
Example #21
Source File: Toaster.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Toaster(String id, int width, int height, String title, Canvas parentElem, int fadeout) {
    this.id = id;
    this.height = height;
    this.width = width;
    this.title = title;
    this.parentElem = parentElem;
    this.fadeout = fadeout;
    this.messages = new ArrayList<Label>();
    this.animationTimer = new Timer() {
        @Override
        public void run() {
            hide();
        }
    };
}
 
Example #22
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void createColorChangeButton() {
	this.titleCol = new SmallButton(new Label(), i18n.changeColor(),
			i18n.changeColorExtended());
	this.titleCol.hide();
	this.titleCol.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			LegendEntryTimeSeries.this.styleChanger.show();
		}
	});
}
 
Example #23
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 #24
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label getAddBookmarkLink() {
	Label addToFavorites = getHeaderLinkLabel(i18n.addToBookmarks());
       addToFavorites.addClickHandler(new ClickHandler() {
           public void onClick(ClickEvent evt) {
               addToFavorites();
           }
       });
	return addToFavorites;
}
 
Example #25
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label createAddTimeSeriesLabelButton() {
    Label addTS = new Label(i18n.picker());
    addTS.setStyleName("n52_sensorweb_client_legendbuttonPrimary");
    addTS.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            StationSelector.getInst().show();
        }
    });
    return addTS;
}
 
Example #26
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label createSESTabLabelButton() {
    Label sesTabLabelButton = new Label(i18n.editProfile());
    sesTabLabelButton.setStyleName("n52_sensorweb_client_legendbutton");
    sesTabLabelButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Legend.this.showProfileWindow();
        }
    });
    sesTabLabelButton.setVisible(true);
    return sesTabLabelButton;
}
 
Example #27
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label getMetadatareset() {
       Label label = getHeaderLinkLabel("reset Metadata");
       label.addClickHandler(new ClickHandler() {
           @Override
           public void onClick(ClickEvent event) {
           	Toaster.getToasterInstance().addMessage("Update protected services");
           	EventBus.getMainEventBus().fireEvent(new UpdateSOSMetadataEvent());
           }
       });
       return label;
}
 
Example #28
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 #29
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label getVersionInfo() {
    String version = "foobar";
    Label versionLabel = getHeaderLinkLabel("Version: " +  version);
    versionLabel.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.open("version-info.txt", "_blank", "");
        }
    });
    return versionLabel;
    
}
 
Example #30
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Label getHelpLink() {
	Label help = getHeaderLinkLabel(i18n.help());
       help.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
           public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
               String helpUrl = GWT.getHostPageBaseURL() + i18n.helpPath();
               Window.open(helpUrl, "", "");
           }
       });
	return help;
}