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

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

Introduction

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

Prototype

public HorizontalPanel() 

Source Link

Document

Creates an empty horizontal panel.

Usage

From source file:com.audata.client.checkout.CheckinDialog.java

License:Open Source License

public CheckinDialog(String uuid, String name) {
    this.uuid = uuid;
    this.name = name;
    this.setText(LANG.check_in_msg_Text() + ": " + this.name);

    VerticalPanel main = new VerticalPanel();
    main.setSize("100%", "100%");
    main.setSpacing(3);//from  www.j  av  a  2 s  . c o m
    main.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);

    this.undo = new RadioButton("ActionGroup", LANG.check_in_Text());
    this.checkin = new RadioButton("ActionGroup", LANG.check_in_version_Text());
    this.undo.setChecked(true);
    this.undo.addClickListener(this);
    this.checkin.addClickListener(this);
    main.add(this.undo);
    main.add(this.checkin);

    this.upload = new UploadPanel();
    String url = AuDoc.jsonCall.getURL();
    this.upload.setAction(url + "docIO.php");
    this.upload.setEncoding(FormPanel.ENCODING_MULTIPART);
    this.upload.setMethod(FormPanel.METHOD_POST);
    this.upload.setVisible(false);
    main.add(upload);

    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setSpacing(3);
    this.ok = new Button(LANG.ok_Text());
    this.ok.addClickListener(this);
    buttons.add(this.ok);
    this.cancel = new Button(LANG.cancel_Text());
    this.cancel.addClickListener(this);
    buttons.add(this.cancel);
    main.add(buttons);
    main.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT);

    this.setWidget(main);
}

From source file:com.audata.client.checkout.CheckoutPanel.java

License:Open Source License

public void addRecord(String uuid, String title, String recordType, String cot) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.setWidth("100%");
    hp.setSpacing(3);/*  w  w  w. j a  v a2  s  .  c o m*/
    //CaptionButton button = new CaptionButton("images/16x16/treerec.gif",title, CaptionButton.CAPTION_EAST);
    CaptionButton button = new CaptionButton();
    button.setImageUrl("images/16x16/treerec.gif");
    button.setCaptionText(title);

    button.addClickListener(new CheckoutClickListener(this, uuid, recordType, cot));

    Image cButton = new Image("images/16x16/checkouts.gif");
    cButton.addClickListener(new CheckinClickListener(uuid, title));
    cButton.setTitle(LANG.check_in_Text() + " " + title);
    cButton.addStyleName("hand");

    hp.add(button);
    hp.add(cButton);
    hp.setCellVerticalAlignment(cButton, HasAlignment.ALIGN_MIDDLE);
    this.records.add(hp);
}

From source file:com.audata.client.feedback.SimpleDialog.java

License:Open Source License

private SimpleDialog(int type, String title, String message, ResponseListener listener) {
    this.listener = listener;
    this.type = type;
    this.setText(title);
    this.addStyleName("audoc-simpleDialog");

    DockPanel main = new DockPanel();

    main.setSpacing(4);// w ww . java2s. c o m
    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT);
    butPanel.setSpacing(4);
    switch (type) {
    case SimpleDialog.TYPE_ERROR:
        main.add(new Image("images/48x48/error.gif"), DockPanel.WEST);
        this.close = new Button("Close");
        this.close.addClickListener(this);
        butPanel.add(this.close);
        break;
    case SimpleDialog.TYPE_MESSAGE:
        main.add(new Image("images/48x48/udf.gif"), DockPanel.WEST);
        this.close = new Button("Close");
        this.close.addClickListener(this);
        butPanel.add(this.close);
        break;
    case SimpleDialog.TYPE_QUERY:
        main.add(new Image("images/48x48/help.gif"), DockPanel.WEST);
        this.ok = new Button("Ok");
        this.ok.addClickListener(this);
        this.cancel = new Button("Cancel");
        this.cancel.addClickListener(this);
        butPanel.add(this.ok);
        butPanel.add(this.cancel);
        break;
    }
    VerticalPanel p = new VerticalPanel();
    p.setSpacing(15);
    p.add(new Label(message));
    p.add(butPanel);
    p.setCellHorizontalAlignment(butPanel, HasAlignment.ALIGN_RIGHT);
    main.add(p, DockPanel.EAST);
    this.setWidget(main);
    this.setPopupPosition(0, 0);
}

From source file:com.audata.client.newRecord.Metadata.java

License:Open Source License

private void paintFields() {
    this.main.clear();
    //Display Record Type
    Label type = new Label(this.rTypeName);
    type.setWidth("150px");
    type.addStyleName("audoc-sectionSubTitle");
    this.main.add(type);

    //Add Fields//from  w  ww. j  a v a 2 s  .c  o m
    for (int i = 0; i < this.fields.size(); i++) {
        Field f = (Field) this.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:
            n.setText(LANG.req_field_marker_Text());
            n.removeStyleName("audoc-note");
            n.addStyleName("audoc-required");
        }
        hp.add(l);
        hp.add(w);
        hp.add(n);
        this.main.add(hp);
    }
    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);

    Label req = new Label();
    req.setText(LANG.req_field_Text());
    req.addStyleName("audoc-required");
    this.main.add(req);
}

From source file:com.audata.client.rapidbooking.RapidBookingDialog.java

License:Open Source License

public RapidBookingDialog() {
    setText(CONSTANTS.rapid_title_Text());
    DockPanel outer = new DockPanel();
    outer.setSpacing(4);/*from w  w  w . j a  va  2 s  .  c o  m*/

    outer.add(new Image("images/48x48/checkout.gif"), DockPanel.WEST);

    VerticalPanel form = new VerticalPanel();
    form.setSpacing(4);

    this.checkin = new RadioButton("ActionGroup", CONSTANTS.check_in_Text());
    this.checkin.addClickListener(this);
    this.checkin.setChecked(true);
    this.checkin.addStyleName("audoc-label");
    form.add(this.checkin);
    this.checkout = new RadioButton("ActionGroup", CONSTANTS.checkout_Text());
    this.checkout.addClickListener(this);
    this.checkout.addStyleName("audoc-label");
    form.add(this.checkout);

    this.userPanel = new HorizontalPanel();
    Label l = new Label(CONSTANTS.user_Text());
    l.addStyleName("audoc-label");
    userPanel.add(l);
    this.users = new ListBox();
    userPanel.add(this.users);
    userPanel.setCellWidth(l, "100px");
    this.userPanel.setVisible(false);
    form.add(this.userPanel);

    HorizontalPanel recnumPanel = new HorizontalPanel();
    Label r = new Label(CONSTANTS.rec_num_Text());
    r.addStyleName("audoc-label");
    recnumPanel.add(r);
    this.recnum = new TextBox();
    recnumPanel.add(this.recnum);
    recnumPanel.setCellWidth(r, "100px");
    form.add(recnumPanel);

    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    butPanel.setSpacing(4);
    this.closeButton = new Button(CONSTANTS.close_Text());
    this.closeButton.addClickListener(this);
    butPanel.add(this.closeButton);

    this.okButton = new Button(CONSTANTS.ok_Text());
    this.okButton.addClickListener(this);
    butPanel.add(this.okButton);
    //       butPanel.setWidth("100%");
    form.add(butPanel);

    String template = "<span class=\"rapid_processed\">#0 #1</span>";
    this.processed = new HTMLButtonList("images/16x16/treerec.gif", template, false);
    this.processed.setWidth("100%");
    this.processed.setHeight("75px");
    form.add(this.processed);

    outer.add(form, DockPanel.NORTH);
    if (AuDoc.state.getItem("isAdmin") == "true") {
        this.getUsers();
    } else {
        String username = (String) AuDoc.state.getItem("username");
        String forename = (String) AuDoc.state.getItem("forename");
        String surname = (String) AuDoc.state.getItem("surname");
        this.users.addItem(surname + ", " + forename, username);
    }
    this.setWidget(outer);
}

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

License:Open Source License

public RecNumberDialog(String uuid, String recNumber, UpdateListener listener) {
    this.setText(LANG.change_rec_num_Text());
    this.listener = listener;
    this.uuid = uuid;

    VerticalPanel main = new VerticalPanel();

    HorizontalPanel fields = new HorizontalPanel();
    fields.setSpacing(3);/*from ww w.ja  v  a  2  s.  c  om*/
    Label l = new Label(LANG.rec_num_Text());
    fields.add(l);
    this.numBox = new TextBox();
    this.numBox.setText(recNumber);
    fields.add(this.numBox);
    main.add(fields);

    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setSpacing(3);
    this.ok = new Button(LANG.save_Text());
    this.ok.addClickListener(this);
    buttons.add(this.ok);
    this.cancel = new Button(LANG.cancel_Text());
    this.cancel.addClickListener(this);
    buttons.add(this.cancel);
    main.add(buttons);
    main.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT);

    this.setWidget(main);
}

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) {//  w w w .  j a va  2 s .  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);//from w  w  w. jav  a2s  .  c  o m
    menu.setSpacing(4);
    //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  w  w w. j  av a 2 s  .  c  o m
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 w  w. ja v  a  2s  .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);
}