Java Code Examples for com.google.gwt.user.client.ui.Label

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project bpm-console, under directory /gui/war/src/main/java/org/jboss/bpm/console/client/common/.

Source file: PropertyGrid.java

  22 
vote

private void initReset(){
  for (int i=0; i < fieldNames.length; i++) {
    Label label=new Label(fieldNames[i]);
    label.setStyleName("bpm-prop-grid-label");
    grid.setWidget(i,0,label);
    grid.setWidget(i,1,new HTML(""));
    String style=(i % 2 == 0) ? "bpm-prop-grid-even" : "bpm-prop-grid-odd";
    grid.getRowFormatter().setStyleName(i,style);
    grid.getColumnFormatter().setWidth(0,"20%");
    grid.getColumnFormatter().setWidth(1,"80%");
  }
}
 

Example 2

From project emite, under directory /examples/src/main/java/com/calclab/emite/example/pingpong/client/.

Source file: PingPongWidget.java

  22 
vote

@Override public void print(final String text,final String style){
  final int widgetCount=output.getWidgetCount();
  if (widgetCount == maxOutput) {
    output.remove(widgetCount - 1);
  }
  final Label label=new Label(text);
  label.addStyleName(style);
  if (isEventWidget(label)) {
    label.setVisible(!hideEvents);
  }
  output.insert(label,0);
}
 

Example 3

From project event-timeline, under directory /src/main/java/com/spaceapplications/vaadin/addon/eventtimeline/gwt/client/.

Source file: VEventTimelineWidget.java

  22 
vote

private void setZoomCaption(UIDL uidl){
  if (uidl.hasAttribute("zlvlcaption")) {
    String caption=uidl.getStringAttribute("zlvlcaption");
    Label lbl=(Label)zoomBar.getWidget(0);
    lbl.setText(caption);
  }
}
 

Example 4

From project exo-training, under directory /gxt-showcase/src/main/java/com/sencha/gxt/explorer/client/layout/.

Source file: HorizontalLayoutExample.java

  22 
vote

private Label createLabel(String text){
  Label label=new Label(text);
  label.getElement().getStyle().setProperty("whiteSpace","nowrap");
  label.addStyleName(ThemeStyles.getStyle().border());
  label.addStyleName("pad-text white-bg");
  return label;
}
 

Example 5

From project FormDesigner, under directory /OpenRosa/src/org/openrosa/client/view/.

Source file: LoginDialog.java

  22 
vote

/** 
 * Called when one selects the OK button.
 */
private void login(){
  if (!FormUtil.authenticate(txtUserName.getText(),txtPassword.getText())) {
    clearUserInfo();
    Label label=new Label(LocaleText.get("invalidUser"));
    table.setWidget(4,0,label);
    DOM.setStyleAttribute(label.getElement(),"color","red");
    txtUserName.setFocus(true);
  }
}
 

Example 6

From project GwtMobile-UI, under directory /src/com/gwtmobile/ui/client/widgets/.

Source file: PanelBase.java

  22 
vote

@Override public void add(Widget w){
  if (isDesignTimeEmptyLabel(w)) {
    Label label=(Label)w;
    String designTimeMessage=getDesignTimeMessage();
    if (designTimeMessage == null) {
      label.setText("Empty " + Utils.getSimpleName(this.getClass()));
    }
 else {
      label.setText("Empty " + Utils.getSimpleName(this.getClass()) + ". "+ designTimeMessage);
    }
  }
  super.add(w);
}
 

Example 7

From project harmony, under directory /harmony.ui.webgui/src/client/reservation/panel/.

Source file: NspFixedReservationCreatePanel.java

  22 
vote

/** 
 */
public NspFixedReservationCreatePanel(final String epr){
  super(epr);
  final Label labelStart=new Label();
  labelStart.setText("Start: ");
  this.start.setText(this.dateTimeFormat.format(new Date()));
  this.table.setWidget(2,0,labelStart);
  this.table.setWidget(2,1,this.start);
  final Label labelDuration=new Label();
  labelDuration.setText("Duration: ");
  this.duration.setText(800 + "");
  this.table.setWidget(2,2,labelDuration);
  this.table.setWidget(2,3,this.duration);
}
 

Example 8

From project jbpm-form-builder, under directory /jbpm-gwt-form-builder/src/main/java/org/jbpm/formbuilder/client/effect/view/.

Source file: FilesDataPanel.java

  22 
vote

private boolean contains(String url){
  String fileName=toFileName(url);
  for (int row=0; row < table.getRowCount(); row++) {
    FocusPanel labelPanel=(FocusPanel)table.getWidget(row,0);
    if (labelPanel != null && labelPanel.getWidget() != null) {
      Label label=(Label)labelPanel.getWidget();
      if (label.getText().equals(fileName)) {
        return true;
      }
    }
  }
  return false;
}
 

Example 9

From project kevoree-library, under directory /javase/org.kevoree.library.javase.webserver.gallery/src/main/java/org/kevoree/library/javase/webserver/gallery/client/gui/.

Source file: Action.java

  22 
vote

public static void showNoData(){
  Action.hideNavigation();
  Label message1=new Label(constants.noalbum());
  Label message2=new Label(constants.notice1());
  message1.addStyleName("nodata-title");
  message2.addStyleName("nodata-text");
  NODATA.add(message1);
  NODATA.add(message2);
  NODATA.addStyleName("nodata");
  CONTENT.showWidget(3);
}
 

Example 10

From project LanguageSpecCreator, under directory /src/liber/browse/client/.

Source file: CustomTabBar.java

  22 
vote

/** 
 * Inserts a new tab at the specified index.
 * @param text the new tab's text
 * @param asHTML <code>true</code> to treat the specified text as HTML
 * @param beforeIndex the index before which this tab will be inserted
 */
public void insertTab(String text,boolean asHTML,int beforeIndex){
  if ((beforeIndex < 0) || (beforeIndex > getTabCount()))   throw new IndexOutOfBoundsException();
  Label item;
  if (asHTML)   item=new HTML(text);
 else   item=new Label(text);
  item.setWordWrap(false);
  item.addClickListener(this);
  item.setStyleName("gwt-TabBarItem");
  panel.insert(item,beforeIndex + (beforeIndex + 1));
  HTML spacer=new HTML("&nbsp;",true);
  int spacerIndex=panel.getWidgetIndex(item);
  spacer.setStyleName("gwt-TabBarSpacer");
  panel.insert(spacer,spacerIndex + 1);
}
 

Example 11

From project maven-gae-plugin, under directory /gae-archetype-gwt/src/main/resources/archetype-resources/src/main/java/net/kindleit/gae/example/client/ui/.

Source file: MessageForm.java

  22 
vote

public MessageForm(){
  Label label=new Label("Text: ");
  label.setStyleName("textLabel");
  add(label);
  textBox=new TextBox();
  label.setStyleName("textBox");
  add(textBox);
  button=new Button("Create");
  button.addStyleName("sendButton");
  button.addClickHandler(new SayClickHandler());
  add(button);
}
 

Example 12

From project netnumeri, under directory /lib/gwt-2.5.0.rc1/samples/SimpleXML/src/com/google/gwt/sample/simplexml/client/.

Source file: SimpleXML.java

  22 
vote

/** 
 * Show the raw XML.
 * @param xmlText
 * @param xmlSource
 */
private void xmlPane(String xmlText,final FlowPanel xmlSource){
  xmlText=xmlText.replaceAll("<","&#60;");
  xmlText=xmlText.replaceAll(">","&#62;");
  Label xml=new HTML("<pre>" + xmlText + "</pre>",false);
  xml.setStyleName(XML_LABEL_STYLE);
  xmlSource.add(xml);
}
 

Example 13

From project ANNIS, under directory /annis-widgets/src/main/java/annis/gui/widgets/gwt/client/.

Source file: VSimpleCanvas.java

  21 
vote

/** 
 * The constructor should first call super() to initialize the component and then handle any initialization relevant to Vaadin.
 */
public VSimpleCanvas(){
  super();
  canvas=Canvas.createIfSupported();
  if (canvas == null) {
    Label lblErrorMessage=new Label("Your browser does not support the Canvas element.");
    initWidget(lblErrorMessage);
  }
 else {
    initWidget(canvas);
    canvas.setHeight("" + height + "px");
    canvas.setWidth("" + width + "px");
    canvas.setCoordinateSpaceHeight(height);
    canvas.setCoordinateSpaceWidth(width);
    context=canvas.getContext2d();
  }
  setStyleName(CLASSNAME);
}
 

Example 14

From project annotare2, under directory /app/web/src/main/java/uk/ac/ebi/fg/annotare2/web/gwt/editor/client/view/.

Source file: IdfNavigationViewImpl.java

  21 
vote

public IdfNavigationViewImpl(){
  FlowPanel flowPanel=new FlowPanel();
  flowPanel.setStyleName("app-IdfNavigation");
  for (  final IdfSection s : IdfSection.values()) {
    Label label=new Label(s.getTitle());
    label.setStyleName("app-IdfNavigationItem");
    label.addClickHandler(new ClickHandler(){
      public void onClick(      ClickEvent event){
        onIdfSectionClick(s);
      }
    }
);
    labelMap.put(s,label);
    flowPanel.add(label);
  }
  initWidget(flowPanel);
}
 

Example 15

From project gwt-maven-plugin, under directory /src/it/compile/src/main/java/org/codehaus/mojo/gwt/test/client/.

Source file: Hello.java

  21 
vote

public void onModuleLoad(){
  RootPanel.get().add(new Label("GWT is running :D"));
  HelloServiceAsync service=HelloServiceAsync.Util.getInstance();
  service.exit(new VoidAsyncCallBack());
  service.returnsVoid("test",new VoidAsyncCallBack());
  service.returnsPrimitive(new String[0],new IntegerAsyncCallBack());
  service.returnsGenerics(new ArrayList<String>(),new CollectionAsynCallBack());
}
 

Example 16

From project GWTPOT, under directory /src/com/fountainhead/client/view/.

Source file: SignInPageView.java

  21 
vote

public SignInPageView(){
  panel=new HTMLPanel(html);
  errorLabel=new Label();
  userNameField=new TextBox();
  passwordField=new PasswordTextBox();
  signInButton=new Button("Sign in");
  userNameField.setText(DEFAULT_USER_NAME);
  passwordField.setText(DEFAULT_PASSWORD);
  panel.add(userNameField,"userNameFieldContainer");
  panel.add(passwordField,"passwordFieldContainer");
  panel.add(signInButton,"signInButtonContainer");
  panel.add(errorLabel,"errorLabelContainer");
  bindCustomUiHandlers();
}
 

Example 17

From project james-hupa, under directory /client/src/main/java/org/apache/hupa/client/dnd/.

Source file: PagingScrollTableRowDragController.java

  21 
vote

public RowDragProxy(){
  RndPanel proxyPanel=new RndPanel();
  setIsValid(false);
  proxy.add(new Image(bundle.moveMailIcon()));
  proxy.add(new Label(" " + messages.moveMessage()));
  proxyPanel.add(proxy);
  proxyPanel.setWidth("150px");
  initWidget(proxyPanel);
}
 

Example 18

From project maven3-support, under directory /maven3-plugin/src/main/java/org/hudsonci/maven/plugin/ui/gwt/buildinfo/internal/.

Source file: BuildSummaryViewImpl.java

  21 
vote

@Inject public BuildSummaryViewImpl(){
  builderSummary=new Label();
  moduleSummary=initModuleSummary(createModuleTable());
  VerticalPanel layout;
  layout=new VerticalPanel();
  layout.add(builderSummary);
  layout.add(moduleSummary);
  ScrollPanel container=new ScrollPanel();
  container.add(layout);
  initWidget(container);
}
 

Example 19

From project mgwt.showcase, under directory /src/main/java/com/googlecode/mgwt/examples/showcase/client/activities/tabbar/.

Source file: TabBarViewGwtImpl.java

  21 
vote

public TabBarViewGwtImpl(){
  TabPanel tabPanel=new TabPanel();
  tabPanel.add(new BookmarkTabBarButton(),new Label("Bookmark"));
  tabPanel.add(new HistoryTabBarButton(),new Label("History"));
  tabPanel.add(new SearchTabBarButton(),new Label("Search"));
  main.add(tabPanel);
  main.remove(scrollPanel);
}
 

Example 20

From project ned, under directory /NEDAdminConsole/src/org/ned/server/nedadminconsole/client/widgets/.

Source file: NedLanguageWidget.java

  21 
vote

public NedLanguageWidget(){
  HorizontalPanel horizontalPanelOuter=new HorizontalPanel();
  horizontalPanelOuter.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
  VerticalPanel verticalPanel=new VerticalPanel();
  verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
  verticalPanel.setSpacing(10);
  initWidget(horizontalPanelOuter);
  horizontalPanelOuter.setWidth("100%");
  horizontalPanelOuter.add(verticalPanel);
  horizontalPanelOuter.setCellHorizontalAlignment(verticalPanel,HasHorizontalAlignment.ALIGN_CENTER);
  horizontalPanelOuter.setCellWidth(verticalPanel,"95%");
  verticalPanel.setSize("60%","95px");
  Label labelUploadedLang=new Label(NedRes.instance().langUploaded());
  verticalPanel.add(labelUploadedLang);
  gridLanguages=new Grid(1,4);
  gridLanguages.setCellSpacing(13);
  gridLanguages.setStyleName("NedUserManagementGrid");
  gridLanguages.setBorderWidth(1);
  verticalPanel.add(gridLanguages);
  verticalPanel.setCellHorizontalAlignment(gridLanguages,HasHorizontalAlignment.ALIGN_CENTER);
  gridLanguages.setWidth("100%");
  verticalPanel.setCellWidth(gridLanguages,"100%");
  Button buttonUploadLang=new Button(NedRes.instance().langAddLanguage());
  buttonUploadLang.addClickHandler(new ClickHandlerUploadLanguage());
  verticalPanel.add(buttonUploadLang);
  buttonUploadLang.setWidth("80");
}
 

Example 21

From project next, under directory /src/next/i/view/.

Source file: CellData.java

  21 
vote

public CellData(Widget westImage,String title,Widget eastImage){
  setWestWidgets(westImage);
  setTextWidgets(new Label(title));
  setEastWidgets(eastImage);
  this.title=title;
}
 

Example 22

From project data-access, under directory /src/org/pentaho/platform/dataaccess/datasource/wizard/.

Source file: GwtWaitingDialog.java

  20 
vote

public GwtWaitingDialog(String waitTitle,String waitMessage){
  setStyleName("waitPopupg");
  VerticalPanel vp=new VerticalPanel();
  messageLabel=new Label(waitMessage);
  messageLabel.setStyleName("waitPopup_title");
  vp.add(messageLabel);
  messageTitle=new Label(waitTitle);
  messageTitle.setStyleName("waitPopup_msg");
  vp.add(messageTitle);
  vp.setStyleName("waitPopup_table");
  this.add(vp);
  if (pageBackground == null) {
    pageBackground=new FocusPanel();
    pageBackground.setHeight("100%");
    pageBackground.setWidth("100%");
    pageBackground.setStyleName("modalDialogPageBackground");
    pageBackground.addClickListener(new ClickListener(){
      public void onClick(      Widget sender){
        clickCount++;
        if (clickCount > 2) {
          clickCount=0;
          pageBackground.setVisible(false);
        }
      }
    }
);
    RootPanel.get().add(pageBackground,0,0);
    RootPanel.get().add(this);
    this.setVisible(false);
  }
}
 

Example 23

From project gadget-server, under directory /gadget-web/src/main/java/org/overlord/gadgets/web/client/widgets/.

Source file: Portlet.java

  20 
vote

private void generateUserPref(WidgetModel model){
  UserPreference pref=model.getUserPreference();
  int row=0;
  for (  UserPreferenceSetting prefSet : pref.getData()) {
    if (UserPreference.Type.STRING.equals(prefSet.getType())) {
      prefTable.setWidget(row,0,new Label(prefSet.getDisplayName()));
      Widget textBox=createTextBox(prefSet.getName(),prefSet.getDefaultValue());
      prefs.add(textBox);
      prefTable.setWidget(row,1,textBox);
    }
 else     if (UserPreference.Type.ENUM.equals(prefSet.getType())) {
      prefTable.setWidget(row,0,new Label(prefSet.getDisplayName()));
      Widget listBox=createSelectBox(prefSet.getName(),prefSet.getDefaultValue(),prefSet.getEnumOptions());
      prefs.add(listBox);
      prefTable.setWidget(row,1,listBox);
    }
    row++;
  }
  prefTable.setWidget(row,1,createPrefSettingButtons());
}
 

Example 24

From project hazelcast-cluster-monitor, under directory /src/main/java/com/hazelcast/monitor/client/.

Source file: ToolTip.java

  20 
vote

public ToolTip(String message,int x,int y){
  super(true);
  this.setPopupPosition(x,y);
  this.add(new Label(message));
  removeDelay=new Timer(){
    public void run(){
      ToolTip.this.setVisible(false);
      ToolTip.this.hide();
    }
  }
;
  removeDelay.schedule(VISIBLE_DELAY);
  this.addCloseHandler(new CloseHandler(){
    public void onClose(    CloseEvent closeEvent){
      removeDelay.cancel();
    }
  }
);
  this.setStyleName("toolTip");
  this.show();
}
 

Example 25

From project java-maven-tests, under directory /src/gwt21demo/src/main/java/com/mysite/gde/client/blog/.

Source file: Application.java

  20 
vote

@Override public void onModuleLoad(){
  final DesktopStyleBundle styleBundle=GWT.create(DesktopStyleBundle.class);
  styleBundle.globalStyle().ensureInjected();
  final Element loading=Document.get().getElementById("loading");
  loading.getParentElement().removeChild(loading);
  Widget widget;
  if (!GWT.getVersion().contains("ultima")) {
    widget=new MainView();
  }
 else   if (GWT.getVersion().contains("rope")) {
    widget=new LoginView();
  }
 else   if (GWT.getVersion().contains("rope2")) {
    widget=new HeaderView();
  }
 else   if (GWT.getVersion().contains("rope3")) {
    widget=new FooterView();
  }
 else   if (GWT.getVersion().contains("rope4")) {
    widget=new RegistrationView();
  }
 else {
    widget=new Label();
  }
  RootPanel.get().add(widget);
}
 

Example 26

From project mgwt, under directory /src/main/java/com/googlecode/mgwt/ui/client/dialog/.

Source file: AlertDialog.java

  20 
vote

/** 
 * Construct an alert dialog
 * @param css - the css to use
 * @param title - the title of the dialog
 * @param text - the text of the dialog
 * @param okButtonText the text of the button of the dialog
 */
public AlertDialog(DialogCss css,String title,String text,String okButtonText){
  css.ensureInjected();
  popinDialog=new PopinDialog(css);
  dialogPanel1=new DialogPanel();
  dialogPanel1.showCancelButton(false);
  dialogPanel1.showOkButton(true);
  textLabel=new Label();
  dialogPanel1.getContent().add(textLabel);
  popinDialog.add(dialogPanel1);
  dialogPanel1.getOkButton().addTapHandler(new TapHandler(){
    @Override public void onTap(    TapEvent event){
      popinDialog.hide();
    }
  }
);
  setText(text);
  setTitleText(title);
  dialogPanel1.setOkButtonText(okButtonText);
}
 

Example 27

From project narya, under directory /core/src/main/java/com/threerings/admin/web/client/.

Source file: ConfigFieldEditor.java

  20 
vote

public ConfigFieldEditor(ConfigField field,Command onChange){
  _field=field;
  _onChange=onChange;
  _value=buildWidget(field);
  _name=new Label(field.name);
  _name.setStyleName("fieldName");
  _reset=new Label("X");
  _reset.setStyleName("resetButton");
  _reset.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      resetField();
      updateModificationState();
    }
  }
);
  _reset.setVisible(false);
}
 

Example 28

From project ballroom, under directory /widgets/src/main/java/org/jboss/ballroom/client/widgets/forms/.

Source file: InputElementWrapper.java

  19 
vote

public InputElementWrapper(Widget widget,final InputElement input){
  super();
  setStyleName("fill-layout-width");
  add(widget);
  widget.getElement().getParentElement().setAttribute("style","width:100%;vertical-align:middle");
  add(expr);
  expr.setAltText("Resolve Expression");
  expr.setStyleName("expression-icon");
  expr.setVisible(false);
  expr.getElement().getParentElement().setAttribute("style","width:16px;vertical-align:middle");
  expr.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent clickEvent){
      framework.getEventBus().fireEvent(new ResolveExpressionEvent(input.asExpressionValue()));
    }
  }
);
  add(err);
  err.setVisible(false);
  err.getElement().getParentElement().setAttribute("style","width:16px;vertical-align:middle");
  err.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      PopupPanel popup=new PopupPanel(true);
      popup.getElement().setAttribute("style","z-index:20");
      popup.setWidget(new Label(input.getErrMessage()));
      popup.setStyleName("popup-hint");
      popup.setPopupPosition(err.getAbsoluteLeft() + 16,err.getAbsoluteTop() + 16);
      popup.show();
    }
  }
);
}
 

Example 29

From project Guit, under directory /src/test/java/com/guit/client/binder/.

Source file: GuitBinderGwtTest.java

  19 
vote

public void testStopPropagationViewHandler(){
  presenter.stopPropagation$triggered=false;
  presenter.stopPropagationPanel$triggered=false;
  NativeEvent event=Document.get().createClickEvent(0,0,0,0,0,false,false,false,false);
  ((Label)presenter.stopPropagation).getElement().dispatchEvent(event);
  assertTrue(presenter.stopPropagation$triggered);
  assertFalse(presenter.stopPropagationPanel$triggered);
}