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

public Label(String text, boolean wordWrap) 

Source Link

Document

Creates a label with the specified text.

Usage

From source file:com.dawg6.web.dhcalc.client.LeaderboardPanel.java

License:Open Source License

public LeaderboardPanel(MainPanel mainPanel) {

    this.mainPanel = mainPanel;

    table = new FlexTable();
    initWidget(table);//  w ww  . j  av  a 2  s . com

    int row = 0;
    table.setWidget(row, 0, new Label("Season/Era:", false));
    table.setWidget(row, 1, seasonList);

    table.setWidget(row, 2, new Label("Hardcore:", false));
    table.setWidget(row, 3, hardcore);

    table.setWidget(row, 4, new Label("Leaderboard:", false));
    table.setWidget(row, 5, leaderboard);
    row++;

    Button button = new Button("Get Leaderboard");
    button.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            getLeaderboard();

        }
    });

    table.setWidget(row, 0, button);

    Anchor anchor = new Anchor("battle.net");
    anchor.setHref("javascript:void(0)");
    anchor.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            leaderboardLink();
        }
    });

    table.setWidget(row, 1, anchor);

    row++;

    for (LeaderboardType t : LeaderboardType.values()) {
        leaderboard.addItem(t.toString(), t.name());
    }

    leaderboard.setSelectedIndex(0);
    leaderboardRow = row;

}

From source file:com.dawg6.web.dhcalc.client.SkillDamagePanel.java

License:Open Source License

public SkillDamagePanel() {

    CaptionPanel captionPanel = new CaptionPanel("Skill Damage Modifiers");
    initWidget(captionPanel);/*  w w w  .java2s .c  o m*/

    flexTable = new FlexTable();
    captionPanel.setContentWidget(flexTable);

    List<ActiveSkill> list = new Vector<ActiveSkill>(ActiveSkill.values().length);
    listBox = new ListBox();

    for (ActiveSkill skill : ActiveSkill.values()) {
        if (skill.doesDamage() && (skill != ActiveSkill.BOLT) && (skill.getSkillType() != SkillType.NA)) {
            list.add(skill);
        }
    }

    Collections.sort(list, new Comparator<ActiveSkill>() {

        @Override
        public int compare(ActiveSkill o1, ActiveSkill o2) {
            return o1.getLongName().compareTo(o2.getLongName());
        }
    });

    for (ActiveSkill s : list) {
        listBox.addItem(s.getLongName(), s.name());
    }

    listBox.setSelectedIndex(0);
    addButton = new Button("Add");

    addButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            addSkill();
        }
    });

    flexTable.setWidget(0, 0, new Label("Skill:", false));
    flexTable.setWidget(0, 1, listBox);
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 2);
    flexTable.setWidget(0, 2, addButton);

}

From source file:com.dawg6.web.dhcalc.client.SkillDamagePanel.java

License:Open Source License

private void addSkill(ActiveSkill skill, int value) {
    int row = fields.size() + 1;

    final Holder holder = new Holder();
    holder.anchor = new Anchor(skill.getLongName());
    holder.anchor.setHref(skill.getUrl());
    holder.anchor.setTarget("_blank");
    holder.removeButton = new Button("Remove");
    holder.row = row;//from   w  ww.j  a va 2s. c om
    holder.spinner = new NumberSpinner();
    holder.spinner.setVisibleLength(4);
    holder.spinner.setTitle("Additional damage done by " + skill.getLongName()
            + " skill, as shown in-game in the Character Details screen, under Offense");
    holder.spinner.setValue(value);
    holder.skill = skill;

    holder.removeButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            removeSkill(holder);
        }
    });

    fields.put(skill, holder);

    flexTable.setWidget(row, 0, holder.anchor);
    flexTable.setWidget(row, 1, new Label("+ %", false));
    flexTable.setWidget(row, 2, holder.spinner);
    flexTable.setWidget(row, 3, holder.removeButton);
}