List of usage examples for com.google.gwt.user.client.ui Label Label
protected Label(Element element)
From source file:com.appspot.socialinquirer.client.util.UiUtils.java
License:Apache License
/** * Show settings saved dialog.//from ww w . j av a2 s . com * * @param constants the constants */ public static void showSettingsSavedDialog(EverScribeConstants constants) { final DialogBox dialogBox = new DialogBox(); dialogBox.setText(constants.titleDialogBoxOperationSuccessful()); dialogBox.setAnimationEnabled(true); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); dialogVPanel.add(new Label(constants.settingsSaved())); final Button closeButton = new Button(constants.closeButton()); closeButton.getElement().setId("closeButton"); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.center(); }
From source file:com.appspot.socialinquirer.client.util.UiUtils.java
License:Apache License
/** * Show error dialog.//ww w. j a v a 2 s . c o m * * @param constants the constants * @param message the message */ public static void showErrorDialog(EverScribeConstants constants, String message) { final DialogBox dialogBox = new DialogBox(); dialogBox.setText(constants.titleDialogBoxError()); dialogBox.setAnimationEnabled(true); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); dialogVPanel.add(new Label(message)); final Button closeButton = new Button(constants.closeButton()); closeButton.getElement().setId("closeButton"); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.center(); }
From source file:com.appspot.socialinquirer.client.util.UiUtils.java
License:Apache License
/** * Show message dialog./*from w ww . j a va 2s .c o m*/ * * @param message the message * @param clientFactory the client factory */ public static void showMessageDialog(Message message, ClientFactory clientFactory) { // TODO-NM: implement this method. final DialogBox dialogBox = new DialogBox(); dialogBox.setText("Message"); dialogBox.setAnimationEnabled(true); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); dialogVPanel.add(new Label(clientFactory.getConstants().featureNotImplemented())); final Button closeButton = new Button(clientFactory.getConstants().closeButton()); closeButton.getElement().setId("closeButton"); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.center(); }
From source file:com.appspot.socialinquirer.client.util.UiUtils.java
License:Apache License
/** * Show content analysis dialog.// w ww . ja v a 2s . c o m * * @param analysis the analysis * @param constants the constants */ public static void showContentAnalysisDialog(ContentAnalysis analysis, EverScribeConstants constants) { // TODO-NM: implement this method. final DialogBox dialogBox = new DialogBox(); dialogBox.setText("Content Analysis"); dialogBox.setAnimationEnabled(true); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); dialogVPanel.add(new Label(constants.settingsSaved())); final Button closeButton = new Button(constants.closeButton()); closeButton.getElement().setId("closeButton"); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.center(); }
From source file:com.appstore.yorknodelays.client.ControllerPage.java
License:sencha.com license
@Override public Widget asWidget() { FlowPanel container = new FlowPanel(); // should be layout based /* int w = 275;/*from ww w.ja v a 2 s .c om*/ name.setWidth(w); company.setWidth(w); location.setWidth(w); income.setWidth(w); container.add(new FieldLabel(name, "Name")); container.add(new FieldLabel(company, "Company")); container.add(new FieldLabel(location, "Location")); container.add(new FieldLabel(income, "Income")); */ List<ColumnConfig<Flight, ?>> columns = new ArrayList<ColumnConfig<Flight, ?>>(); ColumnConfig<Flight, String> name = new ColumnConfig<Flight, String>(props.flightId(), 200, "Fligt Name"); columns.add(name); ColumnConfig<Flight, String> origin = new ColumnConfig<Flight, String>(props.origin(), 100, "Origin"); columns.add(origin); ColumnConfig<Flight, String> destination = new ColumnConfig<Flight, String>(props.destination(), 100, "Destination"); columns.add(destination); ColumnConfig<Flight, String> remarks = new ColumnConfig<Flight, String>(props.remarks(), 100, "Remarks"); columns.add(remarks); Grid<Flight> grid = new Grid<Flight>(flightStore, new ColumnModel<Flight>(columns)); grid.setBorders(true); grid.getView().setForceFit(true); GridInlineEditing<Flight> inlineEditor = new GridInlineEditing<Flight>(grid); grid.setWidth(382); grid.setHeight(200); Button backButton = new Button("Back"); container.add(backButton); backButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Login loginPage = GWT.create(Login.class); vp.clear(); vp.add(loginPage.asWidget()); } }); FieldLabel flightContainer = new FieldLabel(); flightContainer.setText("Flights"); flightContainer.setLabelAlign(LabelAlign.TOP); flightContainer.setWidget(grid); container.add(flightContainer); FramedPanel panel = new FramedPanel(); panel.setHeadingText("Real Time Flight Information"); panel.setBodyBorder(false); panel.setWidth(400); panel.addStyleName("margin-10"); /*TextArea description = new TextArea(); description.setAllowBlank(false); description.addValidator(new MinLengthValidator(10)); p.add(new FieldLabel(description, ""), new VerticalLayoutData(1, 100)); */ /* PersonEditor personEditor = new PersonEditor(); driver.initialize(personEditor); panel.setWidget(personEditor); panel.addButton(new TextButton("Save", new SelectHandler() { @Override public void onSelect(SelectEvent event) { driver.flush(); } })); Person person = new Person("Darrell Meyer", "Sencha Inc", "GXT", "Washington, DC", 9.99);*/ HorizontalLayoutContainer p2 = new HorizontalLayoutContainer(); panel.add(p2); VerticalLayoutContainer p = new VerticalLayoutContainer(); panel.add(p); Label spinLabel = new Label("Collision Warning:"); Label = new Label("nil"); p.add(spinLabel, new VerticalLayoutData(1, -1)); return container; }
From source file:com.appstore.yorknodelays.client.Login.java
License:Open Source License
private void createForm1() { FramedPanel panel = new FramedPanel(); panel.setHeadingText("Login Page"); panel.setWidth(350);/*from w ww.jav a2 s .c o m*/ panel.setBodyStyle("background: none; padding: 5px"); VerticalLayoutContainer p = new VerticalLayoutContainer(); panel.add(p); TextField username = new TextField(); username.setAllowBlank(false); username.setEmptyText("Please enter your username..."); username.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { Info.display("Value Changed", "First name changed to " + event.getValue() == null ? "blank" : event.getValue()); } }); p.add(new FieldLabel(username, "Username"), new VerticalLayoutData(1, -1)); PasswordField password = new PasswordField(); p.add(new FieldLabel(password, "Password"), new VerticalLayoutData(1, -1)); Label spinLabel = new Label("Role"); p.add(spinLabel, new VerticalLayoutData(1, -1)); Button pilotLogin = new Button("Pilot"); Button dispatcherLogin = new Button("Dispatcher"); Button controllerLogin = new Button("Controller"); panel.addButton(pilotLogin); panel.addButton(dispatcherLogin); panel.addButton(controllerLogin); vp.add(panel); pilotLogin.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { PilotLogin pilotLogin = GWT.create(PilotLogin.class); vp.clear(); vp.add(pilotLogin.asWidget()); } }); dispatcherLogin.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { DispatcherPage dispatcherLogin = GWT.create(DispatcherPage.class); vp.clear(); vp.add(dispatcherLogin.asWidget()); } }); controllerLogin.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { ControllerPage controllerLogin = GWT.create(ControllerPage.class); vp.clear(); vp.add(controllerLogin.asWidget()); } }); }
From source file:com.apress.progwt.client.college.gui.ApplicationStatusChooserWidget.java
License:Apache License
public ApplicationStatusChooserWidget(Application application, ServiceCache serviceCache) { this.serviceCache = serviceCache; ProcessType currentStatus = application.getCurrentStatus(); lab = new Label(currentStatus.getName()); lab.addClickListener(new ClickListener() { public void onClick(Widget sender) { showOptions();/*from ww w . j av a 2s . c o m*/ } }); VerticalPanel chooseP = new VerticalPanel(); for (ProcessType statusType : application.getUser().getStatusProcessTypes()) { HorizontalPanel hp = new HorizontalPanel(); hp.add(new PChooser(statusType)); chooseP.add(hp); } chooseP.add(new Label("Click Status To Choose")); popupP = new DecoratedPopupPanel(true); popupP.add(chooseP); popupP.addStyleName("TC-Popup"); popupP.addStyleName("TC-Popup-Status"); initWidget(lab); }
From source file:com.apress.progwt.client.college.gui.CollegeEntry.java
License:Apache License
public CollegeEntry(User user, Application application, ServiceCache serviceCache, MyRankings myRankings) { this.application = application; this.serviceCache = serviceCache; this.user = user; this.myRankings = myRankings; collegeNameLabel = new Label(application.getSchool().getName()); collegeNameLabel.setStylePrimaryName("TC-CollegeLabel"); rankLabel = new Label(); rankLabel.setStylePrimaryName("TC-CollegeEntry-RankLabel"); HorizontalPanel mainPanel = new HorizontalPanel(); mainPanel.add(rankLabel);//w w w .j a v a2s .c o m mainPanel.add(collegeNameLabel); mainPanel.setCellWidth(rankLabel, "30px"); DisclosurePanel disclosurePanel = new DisclosurePanel(" "); disclosurePanel.add(getInfoPanel()); mainPanel.add(disclosurePanel); mainPanel.setCellHorizontalAlignment(disclosurePanel, HorizontalPanel.ALIGN_RIGHT); mainPanel.setStylePrimaryName("TC-CollegeEntry"); initWidget(mainPanel); }
From source file:com.apress.progwt.client.college.gui.CollegeRatingPanel.java
License:Apache License
public CollegeRatingPanel(ServiceCache serviceCache, User thisUser, Application application) { this.serviceCache = serviceCache; this.application = application; VerticalPanel mainPanel = new VerticalPanel(); Grid ratingGrid = new Grid(thisUser.getRatingTypes().size(), 2); int row = 0;//w w w .ja v a 2 s . co m for (RatingType ratingType : thisUser.getRatingTypes()) { ratingGrid.setWidget(row, 0, new Label(ratingType.getName())); int rating = application.getRating(ratingType); RatingChooser chooser = new RatingChooser(ratingType, rating); chooser.addChangeListener(this); ratingGrid.setWidget(row, 1, chooser); row++; } mainPanel.add(ratingGrid); initWidget(mainPanel); }
From source file:com.apress.progwt.client.college.gui.EqualSpacedPanel.java
License:Apache License
public void add(String s) { Label label = new Label(s); Log.debug("EqualSpacedPanel Add " + s + " " + curLeft + " " + curTop); add(label, curLeft, curTop);//from ww w . j a v a2s . co m curLeft += spacingPerEntry; curTop += ySpacing; if (curTop > height) { curTop = 0; } }