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:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java

License:EUPL

protected FlowPanel createTitlePanel() {
    FlowPanel titlePanel = new FlowPanel();

    Label titleLabel = new Label(i18n.title());
    titleLabel.setStyleName("annotationEditForm-label");

    titleTextBox.setStyleName("annotationEditForm-title-input");
    if (annotation == null && parent != null) {
        titleTextBox.setText("RE: " + parent.getAnnotation().getTitle());
    } else if (annotation != null) {
        titleTextBox.setText(annotation.getAnnotation().getTitle());
    }//  w  w w.  j a v a 2s .com

    titlePanel.add(titleLabel);
    titlePanel.add(titleTextBox);
    return titlePanel;
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java

License:EUPL

protected FlowPanel createTextPanel() {
    FlowPanel textPanel = new FlowPanel();

    Label textLabel = new Label(i18n.text());
    textLabel.setStyleName("annotationEditForm-label");

    textArea.setStyleName("annotationEditForm-text-input");
    if (annotation != null)
        textArea.setText(annotation.getAnnotation().getText());
    textArea.addKeyDownHandler(new AbstractKeyboardHandler(1000) {
        @Override/*from   ww w .  java 2s.  c o  m*/
        public void onSpace() {
            getTagSuggestions();
        }

        @Override
        public void onIdle() {
            getTagSuggestions();
        }
    });

    textPanel.add(textLabel);
    textPanel.add(textArea);

    return textPanel;
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java

License:EUPL

protected FlowPanel createAddNewTagPanel() {
    FlowPanel container = new FlowPanel();
    container.setStyleName("annotationEditForm-tag");

    Label addTagLabel = new Label(i18n.addTag());
    addTagLabel.setStyleName("annotationEditForm-label");

    HorizontalPanel addTagPanel = new HorizontalPanel();
    final TagSuggestBox newTagTextBox = new TagSuggestBox(10);
    newTagTextBox.setStyleName("annotationEditForm-tag-input");
    newTagTextBox.addSelectionHandler(new SelectionHandler<Suggestion>() {
        @Override/*  w w  w  .  j  a va  2 s . c  om*/
        public void onSelection(SelectionEvent<Suggestion> evt) {
            addTag(newTagTextBox.getTag());
            newTagTextBox.clear();
        }
    });
    addTagPanel.add(newTagTextBox);

    PushButton btnAdd = new PushButton(i18n.add());
    btnAdd.addStyleName("annotationEditForm-tag-btn-add");
    btnAdd.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent evt) {
            addTag(newTagTextBox.getTag());
            newTagTextBox.clear();
        }
    });
    addTagPanel.add(btnAdd);

    PushButton btnBrowse = new PushButton(i18n.browse());
    btnBrowse.addStyleName("annotationEditForm-tag-btn-browse");

    final TagTreePanel tagTreePanel = new TagTreePanel(this);
    btnBrowse.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            WindowPanel window = MinMaxWindowPanel.createMinMaxWindowPanel(200, 200, 350, 450);
            window.setWidget(tagTreePanel);
            window.getHeader().setText(i18n.vocabularyBrowser());
            window.show();
        }
    });
    addTagPanel.add(btnBrowse);

    container.add(addTagLabel);
    container.add(addTagPanel);

    return container;
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationTreeNode.java

License:EUPL

public ImageAnnotationTreeNode(AnnotationPanel panel, Annotation annotation, AnnotationTreeNode parent) {

    super(panel, annotation, parent);
    container.add(createHeader());/*from w  w  w.  j  a va 2  s. c o  m*/

    Label title = new Label(annotation.getTitle());
    title.setStyleName("imageAnnotation-title");
    title.getElement().setAttribute("property", "dc:title");
    container.add(title);

    InlineHTML text = new InlineHTML(annotation.getText());
    text.getElement().setAttribute("property", "rdfs:label");
    text.setStyleName("imageAnnotation-text");
    container.add(text);

    if (annotation.hasTags()) {
        FlowPanel tagPanel = new FlowPanel();
        tagPanel.setStyleName("imageAnnotation-taglist");
        for (SemanticTag t : annotation.getTags()) {
            InlineHTML span = new InlineHTML("<a target=\"_blank\" href=\"" + t.getURI() + "\" title=\""
                    + t.getPrimaryDescription() + "\">" + t.getPrimaryLabel() + "</a>");
            span.getElement().setAttribute("rel", t.getURI());
            tagPanel.add(span);
        }
        container.add(tagPanel);
    }

    container.add(createActions());
    container.getElement().setAttribute("typeof", "oac:Annotation");
    container.getElement().setAttribute("about",
            YUMACoreProperties.getRDFBaseUrl() + annotation.getId() + ".oac");
    initWidget(container);
    deselect();
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationTreeNode.java

License:EUPL

protected HorizontalPanel createHeader() {
    HorizontalPanel headerPanel = new HorizontalPanel();
    headerPanel.setStyleName("imageAnnotation-header");

    Image avatar = new Image(annotation.getCreatedBy().getGravatarURL());
    avatar.setStyleName("imageAnnotation-header-avatar");
    headerPanel.add(avatar);/*from   ww  w .  j  ava  2s  .  c  o m*/

    Label userLabel = new Label(annotation.getCreatedBy().getUsername());
    userLabel.setStyleName("imageAnnotation-header-user");
    userLabel.getElement().setAttribute("property", "dc:creator");
    headerPanel.add(userLabel);

    Label dateLabel = new Label("(" + DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_SHORT)
            .format(annotation.getLastModified()) + ")");
    dateLabel.setStyleName("imageAnnotation-header-date");
    headerPanel.add(dateLabel);

    PushButton feedIcon = new PushButton(new Image("images/feed-icon-14x14.png"));
    feedIcon.setStyleName("imageAnnotation-header-feedicon");
    feedIcon.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            Window.open(YUMACoreProperties.getFeedUrl() + "replies/" + annotation.getId(), "_self", "");
        }
    });
    headerPanel.add(feedIcon);

    return headerPanel;
}

From source file:at.ait.dme.yuma.suite.apps.map.client.explore.SearchPanel.java

License:EUPL

public SearchPanel(TileBasedImageViewer imageComposite) {
    this.searchLayer = imageComposite.getSearchLayer();
    I18NConstants i18n = YUMACoreProperties.getConstants();

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setStyleName("explore-PlaceSearch");
    Label searchLabel = new Label(i18n.searchLabel());
    searchBox = new TextBox();
    Button searchBtn = new Button(i18n.searchButton(), new ClickHandler() {
        @Override//w w  w.j av  a  2  s  .  c o m
        public void onClick(ClickEvent event) {
            doAsyncGeocoding();
        }
    });
    hPanel.add(searchLabel);
    hPanel.add(searchBox);
    hPanel.add(searchBtn);

    this.add(hPanel);
}

From source file:at.ait.dme.yuma.suite.apps.map.client.georeferencing.ControlPointEditForm.java

License:EUPL

public ControlPointEditForm(AnnotationPanel panel, AnnotationTreeNode annotation,
        ControlPointLayer controlPointLayer) {
    super(panel, annotation, null);

    // Reference to control point layer
    this.controlPointLayer = controlPointLayer;

    // Place name (will be geo-coded)
    HorizontalPanel placeNamePanel = new HorizontalPanel();

    Label placeNameLabel = new Label("Place: ");
    placeNameLabel.setStyleName("cp-Editor-Label");
    placeNamePanel.add(placeNameLabel);/*from w w  w.  ja  va  2 s  .c  o m*/

    placeName = new TextBox();
    placeName.setStyleName("cp-Editor-Field");
    placeName.addKeyDownHandler(new AbstractKeyboardHandler(1000) {
        @Override
        public void onSpace() {
            doAsyncGeocoding(placeName.getText());
        }

        @Override
        public void onIdle() {
            doAsyncGeocoding(placeName.getText());
        }
    });

    placeNamePanel.add(placeName);

    // Lon (determined automatically - field disabled)
    HorizontalPanel lonPanel = new HorizontalPanel();

    Label lonLabel = new Label("Lon: ");
    lonLabel.setStyleName("cp-Editor-Label");
    lonPanel.add(lonLabel);

    lon = new TextBox();
    lon.setEnabled(false);
    lon.setStyleName("cp-Editor-Field");
    lonPanel.add(lon);

    // Lat (determined automatically - field disabled)
    HorizontalPanel latPanel = new HorizontalPanel();

    Label latLabel = new Label("Lat: ");
    latLabel.setStyleName("cp-Editor-Label");
    latPanel.add(latLabel);

    lat = new TextBox();
    lat.setEnabled(false);
    lat.setStyleName("cp-Editor-Field");
    latPanel.add(lat);

    // X/Y (determined automatically - field disabled)
    HorizontalPanel xyPanel = new HorizontalPanel();

    Label xyLabel = new Label("X/Y: ");
    xyLabel.setStyleName("cp-Editor-Label");
    xyPanel.add(xyLabel);

    xy = new TextBox();
    xy.setEnabled(false);
    xy.setStyleName("cp-Editor-Field");
    xyPanel.add(xy);

    if (annotation != null) {
        placeName.setText(annotation.getTitle());
        GeoPoint p = (GeoPoint) ((ImageFragment) annotation.getAnnotation().getFragment()).getShape();
        lon.setText(Double.toString(p.getLng()));
        lat.setText(Double.toString(p.getLat()));
        setXY(p.getX(), p.getY());
    }

    // Assemble the main FlowPanel
    FlowPanel form = new FlowPanel();
    form.setStyleName("cp-Editor");
    form.add(placeNamePanel);
    form.add(lonPanel);
    form.add(latPanel);
    form.add(xyPanel);
    form.add(createButtonsPanel(panel, annotation));
    form.setStyleName("imageAnnotation-form");
    initWidget(form);

    controlPointLayer.setControlPointForm(this);
    if (annotation != null) {
        controlPointLayer.showActiveFragmentPanel((ImageAnnotation) annotation.getAnnotation(), false);
    } else {
        controlPointLayer.showActiveFragmentPanel(null, false);
    }
}

From source file:at.ait.dme.yuma.suite.apps.map.client.georeferencing.ControlPointPanel.java

License:EUPL

@Override
protected Widget createHeader() {
    // The parent header panel
    FlowPanel header = new FlowPanel();

    // 'Help geo-Reference' label
    Label addAnnotationLabel = new Label(YUMACoreProperties.getConstants().helpGeoreference());
    addAnnotationLabel.setStyleName("imageAnnotation-add-annotation");
    header.add(addAnnotationLabel);//  w  w  w  . j  a  va  2 s.  c  o m

    // 'Help' link
    HTML help = new HTML(
            "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName()
                    + ".html\">" + YUMACoreProperties.getConstants().help() + "</a>");
    help.setStyleName("imageAnnotation-help");
    header.add(help);

    // Instructions text
    Label addAnnotationHint = new Label(YUMACoreProperties.getConstants().helpGeoreferenceHint());
    addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint");
    header.add(addAnnotationHint);

    // Button panel
    HorizontalPanel buttons = new HorizontalPanel();

    // 'Create Control Point' button
    createButton = new PushButton(YUMACoreProperties.getConstants().actionCreateCP());
    createButton.setStyleName("imageAnnotation-button");
    createButton.addClickHandler(new AnnotateClickHandler(this, null, null, false));
    createButton.setEnabled(!User.get().isAnonymous());
    buttons.add(createButton);

    if (YUMACoreProperties.getObjectURI().startsWith("http://georeferencer"))
        createButton.setEnabled(false);

    header.add(buttons);

    // Placeholder for the annotation form 
    header.add(editFormPanel);

    return header;
}

From source file:at.ait.dme.yuma.suite.apps.video.client.YumaVideoClient.java

License:EUPL

@Override
public void onModuleLoad() {
    Label label = new Label("YUMA Video Annotation");
    RootPanel.get().add(label);
}

From source file:au.com.gworks.gwt.petstore.client.CartView.java

License:Apache License

private void buildFrame() {
    groupBarContainer = new EastWestHorizPanels();
    container.add(groupBarContainer);//  www  .j a  va 2 s . c o  m
    groupBarContainer.setStyleName("ps-ewp-mainGroupSections");

    Label title = new Label("Cart/Check out");
    groupBarContainer.getWest().add(title);
    title.setStyleName("ps-ewp-mainGroupSections-txt");

    container.add(optionsBar);
    container.add(items, "std-client-width");
    container.add(emptyCartLbl);

    optionsBar.setStyleName("std-client-width");
    optionsBar.add(new Label("Select:"), "std-align-west std-padding");
    optionsBar.add(selAllLbl, "std-align-west std-padding");
    optionsBar.add(selNoneLbl, "std-align-west std-padding");
    optionsBar.add(selOutOfSockLbl, "std-align-west std-padding");
    optionsBar.add(removeBtn, "std-align-west");

    optionsBar.add(checkOutBtn, "std-align-east");
    optionsBar.add(subTotalAmtLbl, "std-align-east std-padding");
    optionsBar.add(new Label("Sub total: $"), "std-align-east std-padding");
}