Example usage for com.google.gwt.user.client.ui Label Label

List of usage examples for com.google.gwt.user.client.ui Label Label

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Label Label.

Prototype

protected Label(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:$.HelloScreen.java

License:Apache License

HelloScreen() {
        setStyleName("hello-panel");
        add(new Label("Hello World Screen"));
    }

From source file:ace.client.JSEditorToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * /*from   w w w . j  a va 2s .  co  m*/
 * @param richText the rich text area to be controlled
 */
public JSEditorToolbar(JSEditorProxy editor) {
    this.editor = editor;
    //this.basic = richText.getBasicFormatter();
    //this.extended = richText.getExtendedFormatter();
    hm = new HandlerManager(editor);

    outer.add(topPanel);
    //outer.add(bottomPanel);
    //topPanel.setWidth("100%");
    //bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");
    //richText.addStyleName("hasRichTextToolbar");

    topPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    topPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    topPanel.setSpacing(3);
    topPanel.add(new Label("JSEditor") {
        {
            setWidth("70px");
        }
    });

    topPanel.add(save = createPushButton(images.save(), strings.save()));
    topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
    indent.setEnabled(false);
    topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
    outdent.setEnabled(false);

    /*
        if (basic != null) {
          topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
          topPanel.add(italic = createToggleButton(images.italic(),
              strings.italic()));
          topPanel.add(underline = createToggleButton(images.underline(),
              strings.underline()));
          topPanel.add(subscript = createToggleButton(images.subscript(),
              strings.subscript()));
          topPanel.add(superscript = createToggleButton(images.superscript(),
              strings.superscript()));
          topPanel.add(justifyLeft = createPushButton(images.justifyLeft(),
              strings.justifyLeft()));
          topPanel.add(justifyCenter = createPushButton(images.justifyCenter(),
              strings.justifyCenter()));
          topPanel.add(justifyRight = createPushButton(images.justifyRight(),
              strings.justifyRight()));
        }
            
        if (extended != null) {
          topPanel.add(strikethrough = createToggleButton(images.strikeThrough(),
              strings.strikeThrough()));
          topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
          topPanel.add(outdent = createPushButton(images.outdent(),
              strings.outdent()));
          topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
          topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
          topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
          topPanel.add(insertImage = createPushButton(images.insertImage(),
              strings.insertImage()));
          topPanel.add(createLink = createPushButton(images.createLink(),
              strings.createLink()));
          topPanel.add(removeLink = createPushButton(images.removeLink(),
              strings.removeLink()));
          topPanel.add(removeFormat = createPushButton(images.removeFormat(),
              strings.removeFormat()));
        }
            
        if (basic != null) {
          bottomPanel.add(backColors = createColorList("Background"));
          bottomPanel.add(foreColors = createColorList("Foreground"));
          bottomPanel.add(fonts = createFontList());
          bottomPanel.add(fontSizes = createFontSizes());
            
          // We only use these handlers for updating status, so don't hook them up
          // unless at least basic editing is supported.
          richText.addKeyUpHandler(handler);
          richText.addClickHandler(handler);
        }
    */
}

From source file:anagram.client.GwtCanvasDemo.java

License:Apache License

public void onModuleLoad() {
    canvas = Canvas.createIfSupported();
    backBuffer = Canvas.createIfSupported();
    if (canvas == null) {
        RootPanel.get(holderId).add(new Label(upgradeMessage));
        return;//w w  w . j  av a 2s  . com
    }

    // init the canvases
    canvas.setWidth(width + "px");
    canvas.setHeight(height + "px");
    canvas.setCoordinateSpaceWidth(width);
    canvas.setCoordinateSpaceHeight(height);
    backBuffer.setCoordinateSpaceWidth(width);
    backBuffer.setCoordinateSpaceHeight(height);
    RootPanel.get(holderId).add(canvas);
    context = canvas.getContext2d();
    backBufferContext = backBuffer.getContext2d();

    // init the objects
    logoGroup = new LogoGroup(width, height, 18, 165);
    ballGroup = new BallGroup(width, height);
    lens = new Lens(35, 15, width, height, new Vector(320, 150), new Vector(1, 1));

    // init handlers
    initHandlers();

    // setup timer
    final Timer timer = new Timer() {
        @Override
        public void run() {
            doUpdate();
        }
    };
    timer.scheduleRepeating(refreshRate);
}

From source file:annis.gui.widgets.gwt.client.ui.VSimpleCanvas.java

License:Apache License

/**
 * The constructor should first call super() to initialize the component and
 * then handle any initialization relevant to Vaadin.
 *///  ww w  .  j  a va2s  .c  o  m
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();
    }

    // This method call of the Paintable interface sets the component
    // style name in DOM tree
    setStyleName(CLASSNAME);

}

From source file:ar.com.kyol.jet.client.JetPaginatedTable.java

License:Open Source License

private void addNavigationLinks() {
    //gmail like pagination:
    int to = from + qtyRetrieved - 1;
    if (qtyRetrieved == 0)
        from = 0; //for empty lists
    if (from > 0) {
        if (from + 1 > (qty + 2)) {
            addOldest();//w  w  w .  j  a  v  a 2  s .c  om
        }
        addOlder();
    }
    Label label = new Label((from + 1) + " - " + (to + 1) + " " + Jet.constants.of() + " " + total);
    label.addStyleDependentName("navigator-gwtjet");
    //label.setWidth("130px");
    label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    navigationPanel.add(label);
    if (from + qtyRetrieved < total && total != 0) {
        addNewer();
        if (from + qtyRetrieved < (total - qty)) {
            addNewest();
        }
    }
    //
    //-------------------------------------------------------------------------------------------
    //OLD another pagination:
    //      int to = from+qtyRetrieved-1;
    //      if(qtyRetrieved == 0) from = 0; //for empty lists
    //      if(from > 1) {
    ////         if(from > (qty + 2)) {
    ////            navigationPanel.add(new Hyperlink("<< Newest", this.getPlainToken()+"/p1"));
    ////         }
    //         navigationPanel.add(new Hyperlink("previous", this.getPlainToken()+"/p"+(page-1)));
    //      }
    //      int mostrados = 0;
    //      for (int i = page-5; i < page; i++) {
    //         if(i > 0) {
    //            navigationPanel.add(new Hyperlink(Integer.toString(i), this.getPlainToken()+"/p"+(i)));
    //            mostrados++;
    //         }
    //      }
    //      if(mostrados > 0 || total > qty) {
    //         navigationPanel.add(new Hyperlink("<b>"+Integer.toString(page)+"</b>",true, this.getPlainToken()+"/p"+(page)));
    //      }
    //      for (int i = page+1; i < ((int)Math.ceil(Float.valueOf(total) / qty))+1 && i < page+10-mostrados; i++) {
    //         navigationPanel.add(new Hyperlink(Integer.toString(i), this.getPlainToken()+"/p"+(i)));
    //      }
    //      if(from+qtyRetrieved < total && total != 0) {
    //         navigationPanel.add(new Hyperlink("next", this.getPlainToken()+"/p"+(page+1)));
    ////         if(from-1+qtyRetrieved < (total - qty)) {
    ////            navigationPanel.add(new Hyperlink("Oldest >>", this.getPlainToken()+"/p"+(int)Math.ceil(Float.valueOf(total) / qty)));
    ////         }
    //      }
    //      Label label = new Label(" (Showing "+from+" to "+to+" out of "+total+" results)");
    //      label.setWidth("250px");
    //      label.addStyleName("showingResults");
    //      label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    //      navigationPanel.add(label);
    //
    //-------------------------------------------------------------------------------------------
}

From source file:ar.com.kyol.jet.client.JetTable.java

License:Open Source License

private Widget createCellWidget(Object cellObject) {
    Widget widget = null;//www . ja  v a  2s .c  o m

    if (cellObject instanceof Widget)
        widget = (Widget) cellObject;
    else
        widget = new Label(cellObject.toString());

    return widget;
}

From source file:ar.com.kyol.jet.client.wrappers.NullWrapper.java

License:Open Source License

/**
 * Instantiates a new null wrapper./* www  . j  av  a 2 s  . co m*/
 *
 * @param useValueAsString the use value as string
 */
public NullWrapper(boolean useValueAsString) {
    super(useValueAsString);
    initWidget(new Label(""));
}

From source file:asquare.gwt.tests.circularbinding.client.Demo.java

License:Apache License

private Widget createDemoPanel() {
    VerticalPanel outer = new VerticalPanel();

    final TextArea output = new TextArea();
    outer.add(output);/*w  w  w  .j  av a  2  s .c o m*/

    Label label = new Label("Click me");
    label.addMouseDownHandler(new MouseDownHandler() {
        public void onMouseDown(MouseDownEvent event) {
            // this works
            output.setText("x=" + DOM2.eventGetClientX());

            // this results in an infinite loop
            output.setText(output.getText() + "\r\ny=" + DOM2.eventGetClientY());
        }
    });
    DOM.setStyleAttribute(label.getElement(), "border", "solid black 1px");
    outer.insert(label, 0);

    return outer;
}

From source file:asquare.gwt.tests.clientcoords.client.Demo.java

License:Apache License

public void onModuleLoad() {
    RootPanel.get("outer").add(new Label("Event client position"));
    final TextArea output = new TextArea();
    RootPanel.get("outer").add(output);
    Event.addNativePreviewHandler(new Event.NativePreviewHandler() {
        public void onPreviewNativeEvent(NativePreviewEvent event) {
            if (event.getTypeInt() == Event.ONMOUSEDOWN) {
                NativeEvent nativeEvent = event.getNativeEvent();
                output.setText("clientX=" + nativeEvent.getClientX() + ", clientY=" + nativeEvent.getClientY());
            }/*ww  w  .j  a va 2  s .  c  o m*/
        }
    });
}

From source file:asquare.gwt.tests.focus.client.Demo.java

License:Apache License

private Widget createFocusPanel() {
    Table outer = new Table();

    outer.add(new FocusPanel(new Label("Label in a FocusPanel")));
    outer.add(new Button("Button"));
    outer.add(new CheckBox("CheckBox"));
    outer.add(new TextBox());
    outer.add(new PasswordTextBox());
    outer.add(new TextArea());
    outer.add(new RadioButton("group1", "RadioButton1"));
    outer.add(new RadioButton("group1", "RadioButton2"));
    ListBox listBox1 = new ListBox();
    listBox1.addItem("ListBox1");
    listBox1.addItem("item2");
    listBox1.addItem("item3");
    outer.add(listBox1);//from  w  w  w .j  a  v  a  2  s.c  o  m
    ListBox listBox2 = new ListBox(true);
    listBox2.setVisibleItemCount(3);
    listBox2.addItem("ListBox2");
    listBox2.addItem("item2");
    listBox2.addItem("item3");
    outer.add(listBox2);
    Tree tree = new Tree();
    tree.addItem("Tree");
    tree.addItem("item2");
    tree.addItem("item3");
    outer.add(tree);

    return outer;
}