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:com.calclab.emiteuimodule.client.chat.ChatUIPanel.java

License:Open Source License

public void addDelimiter(final String datetime) {
    final HorizontalPanel hp = new HorizontalPanel();
    final HorizontalLine hr = new HorizontalLine();
    hp.add(new Label(datetime));
    hp.add(hr);//from w w  w .j a va 2  s  . c om
    hp.setWidth("100%");
    hp.setCellWidth(hr, "100%");
    addWidget(hp);
    hp.setStyleName("emite-ChatPanel-HorizDelimiter");
}

From source file:com.chaosinmotion.securechat.client.SecureChat.java

License:Open Source License

/**
 * This is the entry point method./*from w w  w .ja va  2  s.c  o  m*/
 */
public void onModuleLoad() {
    Label helloLabel = new Label("SecureChat Server.");
    RootPanel.get().add(helloLabel);
}

From source file:com.chinarewards.gwt.license.client.core.ui.impl.SimpleMenuProcessor.java

/**
 * /*  www .  j  a v  a 2 s.  c o  m*/
 * 
 * @param parent
 * @param node
 */
private void addSubTreeNode(TreeItem parent, final MenuNode node) {

    TreeItem item = new TreeItem();
    Grid grid = new Grid(1, 2);
    //      if (node.getValue().getIcon() != null) {
    //   //      grid.setWidget(0, 0, node.getValue().getIcon());
    //      } else {
    //         // default menu icon
    //   //      grid.setWidget(0, 0, new Image(resources.getDefaultMenuIcon()));
    //      }

    // setup handler to fire menu click event
    Label text = new Label(node.getValue().getTitle());
    text.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent paramClickEvent) {
            eventBus.fireEvent(new MenuClickEvent(node.getValue()));
        }
    });
    grid.setWidget(0, 1, text);

    // make it visible
    item.setWidget(grid);
    item.setVisible(true);
    item.setState(true);
    parent.addItem(item);

    // continue processing child menus if any.
    for (MenuNode i : node.getChildren()) {
        addSubTreeNode(item, i);
    }
}

From source file:com.chinarewards.gwt.license.client.core.ui.impl.SimpleSiteManager.java

public void openEditor(final Editor e) {
    // store which tab is which instanceId
    openedEditors.add(e);/*from  w ww  .j  av a  2 s. co m*/

    HorizontalPanel panel = new HorizontalPanel();
    Label close = new Label("  ");
    close.setStyleName("close");
    close.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent paramClickEvent) {
            Platform.getInstance().getEditorRegistry().closeEditor(e.getEditorId(), e.getInstanceId());
        }
    });
    Label title = new Label(e.getTitle());
    title.setStyleName("tabTitle");
    Label leftImg = new Label("");
    leftImg.setStyleName("leftImg");
    Label rightImg = new Label("");
    rightImg.setStyleName("rightImg");
    panel.add(leftImg);
    panel.add(title);
    panel.add(close);
    panel.add(rightImg);

    panel.setCellHorizontalAlignment(leftImg, HorizontalPanel.ALIGN_RIGHT);
    panel.setCellHorizontalAlignment(title, HorizontalPanel.ALIGN_RIGHT);
    panel.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_LEFT);
    panel.setCellHorizontalAlignment(rightImg, HorizontalPanel.ALIGN_RIGHT);

    ScrollPanel sp = new ScrollPanel(e.asWidget());
    editor.add(sp);
    // editor.add(e.asWidget(), g);

    // show editor panels only if there is at least one editor opened.
    if (!openedEditors.isEmpty()) {
        editor.setVisible(true);
    }
}

From source file:com.cms.gwt.fs.client.view.calendar.ExtMonthPanelDayPanel.java

License:Apache License

public ExtMonthPanelDayPanel(int day, final Date newDate, final ExtMonthPanel newParent,
        DateRenderer newRenderer) {/*from w w w  .  j ava 2  s. co  m*/
    super();
    renderer = newRenderer;
    sorter = new EventComparator();
    parent = newParent;
    theDay.setTime(newDate);
    dayLabel = new Label(String.valueOf(day));
    dayLabel.setHorizontalAlignment(Label.ALIGN_RIGHT);
    dayLabel.setStyleName(FtrGwtDateCss.DATE_DAY_HEADER);
    dayLabel.addStyleName("Calendar-MonthDayHeader");
    // add click-handler to goto DayPanel from MonthPanel
    dayLabel.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            DateEvent toFire = new DateEvent();
            toFire.setCommand(DateEventActions.SELECT_DAY);
            toFire.setDate(newDate);
            newParent.fireDateEvent(toFire);
        }
    });
    super.setStyleName(FtrGwtDateCss.DATE_DAY);
    clickPanel.addMouseDownHandler(this);
    super.add(dayLabel, DockPanel.NORTH);
    super.setCellHeight(dayLabel, "10px");
    clickPanel.setStyleName(FtrGwtDateCss.DATE_MONTH_DAY_DATA);
    entryPanel.setStyleName(FtrGwtDateCss.DATE_DAY_DATA);
    super.add(entryPanel, DockPanel.CENTER);
    super.setCellHeight(entryPanel, "60px");

    entryPanel.add(clickPanel);
}

From source file:com.codenvy.ide.client.UITestProject.java

License:Open Source License

public void onModuleLoad() {

    // Defines debug IDs
    button.ensureDebugId(GWTIDConstants.BUTTON_DEBUG_ID);
    newProxyOption.ensureDebugId(GWTIDConstants.NEW_PROXY_DEBUG_ID);
    importProxyOption.ensureDebugId(GWTIDConstants.IMPORT_PROXY_DEBUG_ID);
    proxyNameBox.ensureDebugId(GWTIDConstants.PROXY_NAME_DEBUG_ID);
    proxyTypeBox.ensureDebugId(GWTIDConstants.PROXY_TYPE_DEBUG_ID);
    proxySaveBox.ensureDebugId(GWTIDConstants.PROXY_LOCATION_DEBUG_ID);
    proxyFileBox.ensureDebugId(GWTIDConstants.PROXY_FILE_DEBUG_ID);
    proxyEndpointBox.ensureDebugId(GWTIDConstants.PROXY_ENDPOINT_DEBUG_ID);

    // Adds items to the list
    proxyTypeBox.addItem(Constants.CUSTOM_PROXY);
    proxyTypeBox.addItem(Constants.PASS_THROUGH_PROXY);
    proxyTypeBox.addItem(Constants.TRANSFORMER_PROXY);
    proxyTypeBox.addItem(Constants.LOG_FORWARD_PROXY);
    proxyTypeBox.addItem(Constants.WSDL_BASED_PROXY);
    proxyTypeBox.addItem(Constants.SECURE_PROXY);

    grid.setWidget(0, 0, newProxyOption);
    grid.setWidget(0, 1, importProxyOption);
    root.add(grid);//from  w w w.j  a va2  s.  c o m

    /*Allows relevant fields to be visible when selecting the new proxy
    option*/
    //TODO use for hadler for deprecated methods
    newProxyOption.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {

            grid.setWidget(1, 0, proxyNameLabel);
            grid.setWidget(1, 1, proxyNameBox);
            grid.setWidget(2, 0, proxyTypeLabel);
            grid.setWidget(2, 1, proxyTypeBox);
            grid.setWidget(3, 0, proxySaveLocation);
            grid.setWidget(3, 1, proxySaveBox);
            grid.setWidget(5, 1, button);
            root.add(grid);
        }
    });

    /*Allows relevant fields to be visible when selecting the import proxy
    option*/
    importProxyOption.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {

            grid.setWidget(1, 0, proxyFileLabel);
            grid.setWidget(1, 1, proxyFileBox);
            grid.setWidget(2, 0, proxySaveLocation);
            grid.setWidget(2, 1, proxySaveBox);
            grid.setWidget(5, 1, button);
            root.add(grid);
        }
    });

    // Allows relevant fields to be visible when selecting the list item
    proxyTypeBox.addChangeListener(new ChangeListener() {

        @Override
        public void onChange(Widget sender) {
            // Get the index of the selected item
            int itemSelected = proxyTypeBox.getSelectedIndex();

            // Get the string value of the item that has been selected
            String itemStringSelected = proxyTypeBox.getValue(itemSelected);
            if (itemStringSelected.equals(Constants.TRANSFORMER_PROXY)) {
                grid.setWidget(4, 0, proxyEndpointLabel);
                grid.setWidget(4, 1, proxyEndpointBox);
                root.add(grid);
            } else {
                grid.remove(proxyEndpointLabel);
                grid.remove(proxyEndpointBox);
                root.add(grid);
            }
        }
    });

    // Handles the button action when creating and importing proxies
    button.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {

            if (!proxyNameBox.getValue().isEmpty() && !proxySaveBox.getValue().isEmpty()) {
                grid.setVisible(false);
                root.add(new Label("Proxy Created Successfully...."));

            } else if (!proxyFileBox.getValue().isEmpty() && !proxySaveBox.getValue().isEmpty()) {
                grid.setVisible(false);
                root.add(new Label("Proxy Imported Successfully...."));
            } else {
                Window.alert("Please insert Data...");
            }
        }
    });
}

From source file:com.codenvy.redhat.plugin.quick.start.ide.panel.DocsViewPartImpl.java

License:Open Source License

/** Show stub if guide is unavailable */
@Override//from   w  ww . j  a va2s . c  om
public void showStub(String stubMessage) {
    chapters.clear();
    setTitle("");
    FlowPanel stubPanel = new FlowPanel();
    stubPanel.add(new Label(stubMessage));
    stubPanel.addStyleName(guideResources.getGuideStyle().stub());
    chapters.add(stubPanel);
}

From source file:com.cognitivemedicine.metricsdashboard.client.charts.types.EmptyChartPanel.java

License:Apache License

@Override
protected void draw(GrainMatrix grainMatrix) {
    this.clear();
    this.add(new Label("No chart data available"));
}

From source file:com.cognitivemedicine.metricsdashboard.client.widgets.CalendarPicker.java

License:Apache License

private HorizontalPanel buildTimePanel() {
    timePanel = new HorizontalPanel();
    if (isWide) {
        timePanel.setWidth("400px");
    } else {//from w  w w.  ja v  a  2s. com
        timePanel.setWidth("230px");
    }
    // timePanel.setWidth("250px");
    timePanel.setSpacing(4);

    hourList = new ListBox();
    hourList.getElement().setId(idPrefix + "HourList");
    hourList.setVisibleItemCount(1);
    for (int i = 1; i <= 12; i++) {
        hourList.addItem(String.valueOf(i));
    }

    minuteBox = new TextBox();
    minuteBox.getElement().setId(idPrefix + "MinutesBox");
    minuteBox.setValue("00");
    minuteBox.setEnabled(false);
    minuteBox.setHeight("13px");

    amPmList = new ListBox();
    amPmList.getElement().setId(idPrefix + "AmPmList");
    amPmList.setVisibleItemCount(1);
    amPmList.addItem("AM");
    amPmList.addItem("PM");

    if (isWide) {
        minuteBox.setWidth("20px");
        amPmList.setWidth("50px");
        hourList.setWidth("45px");
    } else {
        minuteBox.setWidth("20px");
        amPmList.setWidth("50px");
        hourList.setWidth("45px");
    }

    // this.setCellVerticalAlignment(checkBox, HasVerticalAlignment.ALIGN_MIDDLE);
    HTML label = new HTML("End Time:");
    if (isWide) {
        label.setWidth("105px");
    } else {
        label.setWidth("70px");
    }
    timePanel.add(label);
    if (isWide) {
        Label spacer = new Label("");
        spacer.setWidth("20px");
        timePanel.add(spacer);
    }

    timePanel.add(hourList);
    timePanel.add(new HTML(":"));
    timePanel.add(minuteBox);
    timePanel.add(amPmList);

    timePanel.setCellHorizontalAlignment(label, HasHorizontalAlignment.ALIGN_RIGHT);
    return timePanel;
}

From source file:com.controlj.addon.gwttree.client.Dialog.java

License:Open Source License

private static void showErrorDialog(String title, String html, String text) {
    // Create a dialog box and set the caption text
    final DialogBox dialogBox = new DialogBox(false, true);
    dialogBox.setText(title);//ww  w  .j  av a 2s .  c  om

    // Create a table to layout the content
    VerticalPanel dialogContents = new VerticalPanel();
    dialogContents.setSpacing(4);
    dialogBox.setWidget(dialogContents);

    // Add either HTML or Text
    Widget details = html != null ? new HTML(html) : new Label(text);
    dialogContents.add(details);
    dialogContents.setCellHorizontalAlignment(details, HasHorizontalAlignment.ALIGN_CENTER);

    // Add a close button at the bottom of the dialog
    Button closeButton = new Button("Close", new ClickHandler() {
        public void onClick(ClickEvent event) {
            dialogBox.hide();
        }
    });
    dialogContents.add(closeButton);
    dialogContents.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER);

    // final configuration and show the dialog box
    dialogBox.setGlassEnabled(true);
    dialogBox.setAnimationEnabled(true);
    dialogBox.center();
    dialogBox.show();
}