Example usage for com.google.gwt.user.client.ui HorizontalPanel add

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

Introduction

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

Prototype

@Override
    public void add(Widget w) 

Source Link

Usage

From source file:com.audata.client.record.RecordListPanel.java

License:Open Source License

public RecordListPanel(String subtitle, JSONArray records, String method, JSONArray params, String uuid,
        String criteria) {//from  w  ww .  j ava 2s  . co m
    this.main = new VerticalPanel();
    this.count = 0;
    this.subtitle = subtitle;
    this.method = method;
    this.params = params;
    this.uuid = uuid;
    this.setSize("100%", "100%");
    this.main.setSize("100%", "100%");
    this.main.setSpacing(4);
    HorizontalPanel title = new HorizontalPanel();
    title.setSpacing(4);
    title.setWidth("100%");
    Label l = new Label(LANG.records_Text());
    l.addStyleName("audoc-sectionTitle");
    title.add(l);
    title.setCellHorizontalAlignment(l, HasAlignment.ALIGN_LEFT);
    this.countLabel = new Label(this.subtitle + "\n " + LANG.rec_count_Text() + ": " + this.count);
    this.countLabel.addStyleName("audoc-sectionSubTitle");
    title.add(this.countLabel);
    title.setCellHorizontalAlignment(this.countLabel, HasAlignment.ALIGN_RIGHT);
    this.main.add(title);
    this.getCount();

    if (criteria != null) {
        Label critLabel = new Label(LANG.criteria_Text() + ": [" + criteria + "]");
        critLabel.setWidth("100%");
        critLabel.addStyleName("audoc-criteria");
        this.main.add(critLabel);
    }
    HorizontalPanel hp = new HorizontalPanel();
    this.main.add(hp);

    hp.setVerticalAlignment(HasAlignment.ALIGN_TOP);
    hp.setSize("100%", "100%");
    hp.setSpacing(4);

    VerticalPanel vp = new VerticalPanel();
    //vp.setSpacing(4);
    vp.setSize("100%", "100%");
    vp.add(this.buildMenu());
    String template = "<span class=\"audoc-record-title\">#0 [#1]</span><br/>"
            + "<span class=\"audoc-record-class\">#2</span><br/>" + "<span class=\"audoc-record-cot\">"
            + LANG.with_Text() + ": #3<span>";
    this.rList = new HTMLButtonList("images/48x48/rectypes.gif", template, true);
    this.rList.addStyleName("audoc-recList");
    vp.add(this.rList);
    this.rList.setSize("100%", "90%");
    vp.setCellHeight(this.rList, "100%");
    hp.add(vp);
    this.addRecords(records);

    Panel cPanel = this.buildCommands();

    hp.add(cPanel);
    //cPanel.setWidth("150px");
    hp.setCellWidth(cPanel, "250px");
    hp.setCellWidth(this.rList, "100%");
    this.add(main);
    this.addKeyboardListener(this);
}

From source file:com.audata.client.record.RecordListPanel.java

License:Open Source License

private Panel buildMenu() {
    HorizontalPanel menuContainer = new HorizontalPanel();
    menuContainer.addStyleName("audoc-commandPanel");
    menuContainer.setWidth("100%");
    HorizontalPanel menu = new HorizontalPanel();
    menuContainer.add(menu);
    menu.setSpacing(4);//from  w  w  w  .ja v a 2s  .co  m
    //menu.addStyleName("audoc-commandPanel");
    //menu.setWidth("100%");
    menu.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);

    //add Refresh button
    //CaptionButton refreshButton = new CaptionButton("images/16x16/refresh.gif", "Refresh", CaptionButton.CAPTION_EAST);
    CaptionButton refreshButton = new CaptionButton();
    refreshButton.setCaptionText(LANG.refresh_Text());
    refreshButton.setImageUrl("images/16x16/refresh.gif");
    refreshButton.addClickListener(new CommandClickListener(this, CommandClickListener.COMMAND_REFRESH));
    refreshButton.setTitle(LANG.refresh_title_Text());
    menu.add(refreshButton);

    //add print button
    //CaptionButton printButton = new CaptionButton("images/16x16/print.gif", "Print", CaptionButton.CAPTION_EAST);
    CaptionButton printButton = new CaptionButton();
    printButton.setCaptionText(LANG.print_Text());
    printButton.setImageUrl("images/16x16/print.gif");
    printButton.addClickListener(new CommandClickListener(this, CommandClickListener.COMMAND_PRINT));
    printButton.setTitle(LANG.print_title_Text());
    menu.add(printButton);

    Label pagesLabel = new Label(LANG.page_Text() + ": ");
    pagesLabel.addStyleName("audoc-label");
    menu.add(pagesLabel);
    menu.setCellVerticalAlignment(pagesLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    this.pages = new ListBox();
    this.pages.addChangeListener(this);
    menu.add(this.pages);
    menu.setCellVerticalAlignment(this.pages, HasVerticalAlignment.ALIGN_MIDDLE);
    return menuContainer;
}

From source file:com.audata.client.record.RecordProperties.java

License:Open Source License

/**
 * Called when all the udfs have been added
 *
 *///from ww w  .  j a  va 2s. com
public void paint() {
    this.main.clear();
    ArrayList fields = this.parent.getFields();
    for (int i = 0; i < fields.size(); i++) {
        Field f = (Field) fields.get(i);
        HorizontalPanel hp = new HorizontalPanel();
        hp.setSpacing(5);

        Label l = new Label(f.name);
        l.setWidth("150px");
        l.addStyleName("audoc-label");
        l.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
        Widget w = null;
        w = f.getField();
        Label n = new Label("");
        n.addStyleName("audoc-note");
        switch (f.type) {
        case FieldTypes.TYPE_INT:
            n.setText(LANG.int_Text());
            break;
        case FieldTypes.TYPE_DEC:
            n.setText(LANG.dec_Text());
            break;
        case FieldTypes.TYPE_DATE:
            n.setText(LANG.date_format_Text());
            break;
        case FieldTypes.TYPE_STRING:
            break;
        case FieldTypes.TYPE_KEYWORD:
            break;
        case FieldTypes.TYPE_CLASS:
            n.setText(LANG.req_field_marker_Text());
            n.removeStyleName("audoc-note");
            n.addStyleName("audoc-required");
            break;
        case FieldTypes.TYPE_NOTES:
            break;
        case FieldTypes.TYPE_RECNUM:
            f.setReadOnly();
        }
        hp.add(l);
        hp.add(w);
        hp.add(n);
        this.main.add(hp);
    }
    if ((this.cot.equals(AuDoc.state.getItem("username"))) || (this.cot.equals(""))) {
        Label newRev = new Label(LANG.check_in_new_doc_Text());
        newRev.addStyleName("audoc-subTitle");
        this.main.add(newRev);
        HorizontalPanel hp = new HorizontalPanel();
        hp.setSpacing(5);

        Label l = new Label(LANG.document_Text());
        l.setWidth("150px");
        l.addStyleName("audoc-label");
        l.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
        hp.add(l);
        hp.add(this.upload);
        this.main.add(hp);
    }
}

From source file:com.audata.client.record.RecordPropertiesDialog.java

License:Open Source License

public RecordPropertiesDialog(UpdateListener parent, String rType, String record, String checkedOutTo) {
    this.parent = parent;
    this.recorduuid = record;
    this.recordType = rType;
    this.checkedOutTo = checkedOutTo;

    this.fields = new ArrayList();
    this.properties = new RecordProperties(this, this.checkedOutTo);
    this.revisions = new Revisions(this.recorduuid);
    this.main = new VerticalPanel();

    TabBar tabs = new TabBar();
    tabs.addTab(LANG.props_Text());
    tabs.addTab("Revisions");
    tabs.addTabListener(this);
    tabs.selectTab(0);//from  w  ww .j  a  va  2 s  . c  om
    this.main.add(tabs);

    this.main.add(this.properties);
    this.main.add(this.revisions);
    this.revisions.setVisible(false);

    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.setSpacing(4);

    this.okButton = new Button(LANG.ok_Text());
    this.okButton.addClickListener(this);
    buttonPanel.add(this.okButton);
    this.cancelButton = new Button(LANG.cancel_Text());
    this.cancelButton.addClickListener(this);
    buttonPanel.add(this.cancelButton);
    this.main.add(buttonPanel);
    this.addFields();
    this.getFields();
    this.getRecord();
    this.setWidget(this.main);
}

From source file:com.audata.client.reporting.ReportDialog.java

License:Open Source License

public ReportDialog(String report) {
    this.setText(LANG.report_Text());
    this.setSize("600px", "400px");
    this.main = new VerticalPanel();
    this.main.setSize("100%", "100%");
    this.main.setSpacing(5);
    ScrollPanel sp = new ScrollPanel();
    sp.setStyleName("audoc-report");
    this.report = new HTML(report);
    this.report.addStyleName("audoc-report-content");
    sp.add(this.report);
    sp.setWidth("586px");
    sp.setHeight("300px");

    this.main.add(sp);

    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setSpacing(5);/*from   w w w  .  ja  v a2 s  . c  om*/
    this.print = new Button(LANG.print_Text());
    this.print.addClickListener(this);
    this.close = new Button(LANG.close_Text());
    this.close.addClickListener(this);
    butPanel.add(this.print);
    butPanel.add(this.close);
    this.main.add(butPanel);

    this.setWidget(this.main);
}

From source file:com.audata.client.search.SavedSearchDialog.java

License:Open Source License

public SavedSearchDialog(ArrayList criteria) {
    this.criteria = criteria;
    this.setText(LANG.save_search_Text());
    VerticalPanel main = new VerticalPanel();
    main.setSpacing(4);/*from ww  w .j av  a2  s. co m*/

    HorizontalPanel titlePanel = new HorizontalPanel();
    Label tLabel = new Label(LANG.title_Text());
    titlePanel.add(tLabel);
    this.title = new TextBox();
    titlePanel.add(this.title);
    titlePanel.setCellWidth(tLabel, "100px");
    main.add(titlePanel);

    HorizontalPanel descPanel = new HorizontalPanel();
    Label dLabel = new Label(LANG.description_Text());
    descPanel.add(dLabel);
    this.description = new TextArea();
    descPanel.add(this.description);
    descPanel.setCellWidth(dLabel, "100px");
    main.add(descPanel);

    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setSpacing(4);
    this.ok = new Button(LANG.save_Text());
    this.ok.addClickListener(this);
    butPanel.add(this.ok);
    this.cancel = new Button(LANG.cancel_Text());
    this.cancel.addClickListener(this);
    butPanel.add(this.cancel);
    main.add(butPanel);

    this.setWidget(main);
}

From source file:com.audata.client.search.SavedSearchPanel.java

License:Open Source License

public void addSavedSearch(String uuid, String name, String desc) {
    HorizontalPanel sp = new HorizontalPanel();
    sp.setSpacing(2);/*from   w  w w  .  j a  v  a2 s  .  c  o m*/
    sp.setWidth("100%");
    //CaptionButton cp = new CaptionButton("images/16x16/tray.gif", name, CaptionButton.CAPTION_EAST);
    CaptionButton cp = new CaptionButton();
    cp.setImageUrl("images/16x16/tray.gif");
    cp.setCaptionText(name);
    cp.setTitle(desc);
    cp.setCaptionStyleName("tree-text");
    cp.addClickListener(new SavedSearchClickListener(this.parent, uuid));

    Image dButton = new Image("images/16x16/logout.gif");
    dButton.setTitle(LANG.delete_Text() + " " + name);
    dButton.addClickListener(new ItemDeleteClickListener(AuDoc.STACK_SAVEDSEARCHES, uuid));
    dButton.addStyleName("hand");
    sp.add(cp);
    sp.add(dButton);
    this.searches.add(sp);
}

From source file:com.audata.client.search.SearchPanel.java

License:Open Source License

public SearchPanel(AuDoc audoc, ArrayList criteria) {
    this.audoc = audoc;
    if (criteria != null) {
        this.searchTerms = criteria;
    } else {/* www. j  av  a2s  . co m*/
        if (AuDoc.state.containsKey("Search")) {
            this.searchTerms = (ArrayList) AuDoc.state.getItem("Search");
        } else {
            this.searchTerms = new ArrayList();
        }
    }
    this.setSize("100%", "100%");
    this.setSpacing(4);
    Label title = new Label(LANG.search_Text());
    title.addStyleName("audoc-sectionTitle");
    this.add(title);

    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(4);
    hp.setSize("100%", "100%");

    this.fieldsTree = new Tree();
    this.fieldsTree.addTreeListener(this);
    //this.fieldsTree.setSize("100%", "100%");
    this.fieldsTree.setHeight("90%");
    this.fieldsTree.addStyleName("audoc-fieldTree");
    hp.add(this.fieldsTree);
    this.buildSections();
    this.getUDFs();
    this.addStdFields();

    VerticalPanel form = new VerticalPanel();
    form.addStyleName("audoc-searchForm");
    //form.setSize("100%","100%");
    form.setWidth("250px");
    form.setSpacing(4);
    HorizontalPanel fieldRow = new HorizontalPanel();
    fieldRow.setSpacing(4);
    Label fieldLabel = new Label(LANG.field_Text());
    this.fieldName = new Label();
    this.fieldName.addStyleName("bold");

    fieldRow.add(fieldLabel);
    fieldRow.add(this.fieldName);
    fieldRow.setCellWidth(fieldLabel, "100px");
    fieldRow.setCellHorizontalAlignment(fieldLabel, HasAlignment.ALIGN_LEFT);
    form.add(fieldRow);

    this.valuePanel = new HorizontalPanel();
    this.valuePanel.setSpacing(4);
    Label valueLabel = new Label(LANG.criteria_Text());
    TextBox value = new TextBox();
    this.valuePanel.add(valueLabel);
    this.valuePanel.add(value);
    this.valuePanel.setCellWidth(valueLabel, "100px");
    this.valuePanel.setCellHorizontalAlignment(valueLabel, HasAlignment.ALIGN_LEFT);
    form.add(this.valuePanel);

    HorizontalPanel andOr = new HorizontalPanel();
    andOr.setSpacing(4);
    this.and = new RadioButton("andOr", LANG.and_Text());
    this.and.setChecked(true);
    this.or = new RadioButton("andOr", LANG.or_Text());
    andOr.add(this.and);
    andOr.add(this.or);
    form.add(andOr);

    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setSpacing(4);
    this.add = new Button(LANG.add_Text());
    this.add.addClickListener(this);
    buttons.add(this.add);
    this.clear = new Button(LANG.clear_Text());
    this.clear.addClickListener(this);
    buttons.add(this.clear);

    form.add(buttons);

    this.criteria = new ListBox();
    this.criteria.setVisibleItemCount(10);
    this.criteria.setWidth("100%");
    form.add(this.criteria);

    HorizontalPanel buttons2 = new HorizontalPanel();
    buttons2.setSpacing(4);
    this.search = new Button(LANG.search_Text());
    this.search.addClickListener(this);
    buttons2.add(this.search);
    this.save = new Button(LANG.save_Text());
    this.save.addClickListener(this);
    buttons2.add(this.save);
    form.add(buttons2);

    hp.add(form);

    hp.setCellHeight(this.fieldsTree, "100%");
    this.add(hp);
    this.paintCriteria();
}

From source file:com.audata.client.trays.TrayDialog.java

License:Open Source License

public TrayDialog(ArrayList records) {
    this.setText(LANG.add_to_tray_Text());
    this.records = records;
    String template = "<span class=\"traylist-title\">#0</span>";
    this.trays = new HTMLButtonList("images/48x48/tray.gif", template, false);
    this.trays.addStyleName("audoc-trays");
    this.addBut = new Button(LANG.add_Text());
    this.addBut.addClickListener(this);
    this.cancel = new Button(LANG.cancel_Text());
    this.cancel.addClickListener(this);
    this.newText = new TextBox();
    this.newBut = new Button(LANG.new_Text());
    this.newBut.addClickListener(this);
    this.getTrays();
    VerticalPanel main = new VerticalPanel();
    main.setSpacing(3);//from   w w  w .  j  av  a  2  s .  c o m

    main.add(this.trays);

    HorizontalPanel p = new HorizontalPanel();
    p.add(new Label("New tray:"));
    p.setSpacing(3);
    p.add(this.newText);
    p.add(this.newBut);
    p.setCellHorizontalAlignment(this.addBut, HasAlignment.ALIGN_RIGHT);
    main.add(p);

    HorizontalPanel p2 = new HorizontalPanel();
    p2.setSpacing(3);
    p2.add(this.addBut);
    p2.add(this.cancel);
    main.add(p2);
    main.setCellHorizontalAlignment(p2, HasAlignment.ALIGN_RIGHT);
    this.setWidget(main);
}

From source file:com.audata.client.trays.TrayPanel.java

License:Open Source License

public void addTray(String uuid, String name, String description) {
    HorizontalPanel tp = new HorizontalPanel();
    tp.setSpacing(2);/*from www  . j a va 2s.  co m*/
    tp.setWidth("100%");
    //CaptionButton cp = new CaptionButton("images/16x16/tray.gif", name, CaptionButton.CAPTION_EAST);
    CaptionButton cp = new CaptionButton();
    cp.setImageUrl("images/16x16/tray.gif");
    cp.setCaptionText(name);
    cp.setCaptionStyleName("audoc-trayLabel");
    cp.setTitle(description);
    cp.addClickListener(new TrayClickListener(this.parent, name, uuid));
    Image dButton = new Image("images/16x16/logout.gif");
    dButton.setTitle("delete " + name);
    dButton.addClickListener(new ItemDeleteClickListener(AuDoc.STACK_TRAYS, uuid));
    dButton.addStyleName("hand");

    tp.add(cp);
    tp.add(dButton);
    tp.setCellVerticalAlignment(dButton, HasAlignment.ALIGN_MIDDLE);
    this.trays.add(tp);
    this.show();
}