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.admin.ReportingPanel.java

License:Open Source License

/**
 * public contrcutor//from  w  ww .ja  v  a2 s. c  om
 */
public ReportingPanel() {
    this.uuid = "";
    this.setSize("100%", "100%");

    //section title
    Label l = new Label(LANG.reports_Text());
    l.addStyleName("audoc-sectionTitle");
    this.add(l);

    HorizontalPanel main = new HorizontalPanel();
    main.setSpacing(5);

    //Reports list
    String rTemplate = "<span class=\"audoc-report-title\">#0</span><br/><span class=\"audoc-report-template\">#1</span><br/><span class=\"audoc-report-criteria\">#2</span>";
    this.reports = new HTMLButtonList("images/48x48/reports.gif", rTemplate, false);
    this.reports.addClickListener(this);
    this.reports.addStyleName("audoc-udfs");
    this.reports.setPixelSize(300, 300);
    main.add(this.reports);

    //Form
    VerticalPanel formPanel = new VerticalPanel();
    formPanel.setSpacing(4);

    HorizontalPanel tPanel = new HorizontalPanel();
    Label titleLabel = new Label(LANG.title_Text());
    titleLabel.setWidth("100px");
    tPanel.add(titleLabel);
    this.title = new TextBox();
    tPanel.add(this.title);
    formPanel.add(tPanel);

    HorizontalPanel tempPanel = new HorizontalPanel();
    Label tempLabel = new Label(LANG.template_Text());
    tempLabel.setWidth("100px");
    tempPanel.add(tempLabel);
    this.template = new TextBox();
    tempPanel.add(this.template);
    formPanel.add(tempPanel);

    HorizontalPanel cPanel = new HorizontalPanel();
    Label cLabel = new Label(LANG.criteria_Text());
    cLabel.setWidth("100px");
    cPanel.add(cLabel);
    this.criteria = new TextArea();
    this.criteria.setVisibleLines(5);
    cPanel.add(this.criteria);
    formPanel.add(cPanel);

    HorizontalPanel bPanel = new HorizontalPanel();
    bPanel.setSpacing(5);
    this.newButton = new Button(LANG.new_Text());
    this.newButton.addClickListener(this);
    bPanel.add(this.newButton);
    this.saveButton = new Button(LANG.save_Text());
    this.saveButton.addClickListener(this);
    bPanel.add(this.saveButton);
    this.delButton = new Button(LANG.delete_Text());
    this.delButton.addClickListener(this);
    bPanel.add(this.delButton);
    formPanel.add(bPanel);

    main.add(formPanel);
    this.add(main);
    this.onUpdate();
}

From source file:com.audata.client.admin.SecurityPanel.java

License:Open Source License

/**
 * Creates SecLevel panel//from w  w w  .  j  a  va2s  .com
 * @return VerticalPanel containing SecLevel admin features
 */
private VerticalPanel buildLevelPanel() {
    VerticalPanel lp = new VerticalPanel();
    lp.setSpacing(5);
    lp.addStyleName("audoc-group");

    Label levelTitle = new Label(LANG.security_levels_Text());
    levelTitle.addStyleName("audoc-sectionTitle");
    String levelCaption = "<span class=\"secLevel-title\">#1</span><br/>" + "<span class=\"secLevel-level\">"
            + LANG.level_Text() + ": #0</span>";
    this.levelList = new HTMLButtonList("images/48x48/security.gif", levelCaption, false);
    this.levelList.addStyleName("audoc-levels");
    this.levelList.addClickListener(new SecLevelClickListener(this));
    this.levelList.setPixelSize(250, 200);

    lp.add(levelTitle);
    lp.add(this.levelList);

    HorizontalPanel namePanel = new HorizontalPanel();
    Label nameLabel = new Label(LANG.name_Text());
    nameLabel.setWidth("100px");
    nameLabel.addStyleName("audoc-label");
    this.levelNameBox = new TextBox();
    namePanel.add(nameLabel);
    namePanel.add(this.levelNameBox);
    lp.add(namePanel);

    HorizontalPanel levelPanel = new HorizontalPanel();
    Label levelLabel = new Label(LANG.level_Text());
    levelLabel.setWidth("100px");
    levelLabel.addStyleName("audoc-label");
    this.levelBox = new TextBox();
    levelPanel.add(levelLabel);
    levelPanel.add(this.levelBox);
    lp.add(levelPanel);

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

    this.newLevButton = new Button(LANG.new_Text());
    this.newLevButton.addClickListener(this);

    this.saveLevButton = new Button(LANG.save_Text());
    this.saveLevButton.addClickListener(this);

    this.delLevButton = new Button(LANG.delete_Text());
    this.delLevButton.addClickListener(this);

    buttonPanel.add(this.newLevButton);
    buttonPanel.add(this.saveLevButton);
    buttonPanel.add(this.delLevButton);

    lp.add(buttonPanel);
    return lp;
}

From source file:com.audata.client.admin.SecurityPanel.java

License:Open Source License

/**
 * Creates the Caveat admin panel/*from  ww  w .  j a  va 2 s.  co  m*/
 * @return VerticalPanel containing Caveat functions
 */
private VerticalPanel buildCaveatPanel() {
    VerticalPanel cp = new VerticalPanel();
    cp.setSpacing(5);
    cp.addStyleName("audoc-group");

    Label caveatTitle = new Label(LANG.security_caveats_Text());
    caveatTitle.addStyleName("audoc-sectionTitle");
    String cavCaption = "<span class=\"caveat-title\">#0</span>";
    this.caveatList = new HTMLButtonList("images/48x48/security.gif", cavCaption, false);
    this.caveatList.addStyleName("audoc-caveats");
    this.caveatList.addClickListener(new CaveatClickListener(this));
    this.caveatList.setPixelSize(250, 200);

    cp.add(caveatTitle);
    cp.add(this.caveatList);

    HorizontalPanel namePanel = new HorizontalPanel();
    Label nameLabel = new Label(LANG.name_Text());
    nameLabel.setWidth("100px");
    nameLabel.addStyleName("audoc-label");
    this.cavName = new TextBox();
    namePanel.add(nameLabel);
    namePanel.add(this.cavName);

    cp.add(namePanel);

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

    this.newCavButton = new Button(LANG.new_Text());
    this.newCavButton.addClickListener(this);

    this.saveCavButton = new Button(LANG.save_Text());
    this.saveCavButton.addClickListener(this);

    this.delCavButton = new Button(LANG.delete_Text());
    this.delCavButton.addClickListener(this);

    buttonPanel.add(this.newCavButton);
    buttonPanel.add(this.saveCavButton);
    buttonPanel.add(this.delCavButton);
    cp.add(buttonPanel);
    return cp;
}

From source file:com.audata.client.admin.SetPasswordDialog.java

License:Open Source License

public SetPasswordDialog(UserPanel parent) {
    this.setText(LANG.set_password_Text());

    DockPanel outer = new DockPanel();
    outer.setSpacing(4);/*from   w w w  .j av  a2  s  .co m*/

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

    VerticalPanel formPanel = new VerticalPanel();

    HorizontalPanel pass1Panel = new HorizontalPanel();
    Label l1 = new Label(LANG.password_Text());
    l1.addStyleName("audoc-label");
    l1.setWidth("120px");

    pass1Panel.add(l1);
    this.pass1 = new PasswordTextBox();
    pass1Panel.add(this.pass1);
    formPanel.add(pass1Panel);

    HorizontalPanel pass2Panel = new HorizontalPanel();

    Label l2 = new Label(LANG.password_reenter_Text());
    l2.addStyleName("audoc-label");
    l2.setWidth("120px");
    pass2Panel.add(l2);
    this.pass2 = new PasswordTextBox();
    pass2Panel.add(this.pass2);
    formPanel.add(pass2Panel);

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

    this.setButton = new Button(LANG.set_password_Text());
    this.setButton.addClickListener(this);
    buttonPanel.add(this.setButton);

    this.cancelButton = new Button(LANG.cancel_Text());
    this.cancelButton.addClickListener(this);
    buttonPanel.add(this.cancelButton);

    formPanel.add(buttonPanel);
    formPanel.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);

    outer.add(formPanel, DockPanel.SOUTH);
    formPanel.setSpacing(4);
    outer.setSpacing(8);
    setWidget(outer);
}

From source file:com.audata.client.admin.UDFPanel.java

License:Open Source License

public UDFPanel() {

    this.setSize("100%", "100%");

    //section title
    Label l = new Label(LANG.udf_Text());
    l.addStyleName("audoc-sectionTitle");
    this.add(l);// ww  w .ja  v a2s .c  o  m

    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(5);

    //add UDF list
    String template = "<span class=\"audoc-udf-title\">#0</span><br/><span class=\"audoc-udf-type\">#1</span>";
    this.userDFs = new HTMLButtonList("images/48x48/udf.gif", template, false);
    this.userDFs.addClickListener(this);
    this.userDFs.addStyleName("audoc-udfs");
    this.userDFs.setPixelSize(200, 300);
    hp.add(this.userDFs);

    VerticalPanel form = new VerticalPanel();
    form.addStyleName("audoc-form");

    //name
    HorizontalPanel namePanel = new HorizontalPanel();
    Label nameLabel = new Label(LANG.name_Text());
    nameLabel.setWidth("100px");
    namePanel.add(nameLabel);

    this.name = new TextBox();
    namePanel.add(this.name);
    form.add(namePanel);

    //type
    HorizontalPanel typePanel = new HorizontalPanel();
    Label typeLabel = new Label(LANG.type_Text());
    typeLabel.setWidth("100px");
    typePanel.add(typeLabel);

    this.types = new ListBox();
    this.types.addChangeListener(this);
    this.popTypes();
    typePanel.add(this.types);
    form.add(typePanel);

    //Keyword
    this.kwp = new HorizontalPanel();
    this.kwp.setVisible(false);
    Label kwl = new Label(LANG.keywords_Text());
    kwl.setWidth("100px");
    this.kwp.add(kwl);
    this.keywords = new ListBox();
    this.keywords.setVisibleItemCount(1);
    this.kwp.add(this.keywords);
    form.add(this.kwp);
    //buttons
    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setSpacing(5);

    this.addBut = new Button(LANG.new_Text());
    this.addBut.addClickListener(this);
    butPanel.add(this.addBut);

    this.saveBut = new Button(LANG.save_Text());
    this.saveBut.addClickListener(this);
    butPanel.add(this.saveBut);

    this.delBut = new Button(LANG.delete_Text());
    this.delBut.addClickListener(this);
    butPanel.add(this.delBut);

    form.add(butPanel);

    hp.add(form);

    //Add hp to panel
    this.add(hp);

    //populate lists
    this.getUDFs();
    this.getKWHs();
}

From source file:com.audata.client.admin.UserDialog.java

License:Open Source License

public UserDialog(UserPanel parent, String uuid, HashMap details) {
    this.parent = parent;
    this.uuid = uuid;
    if (this.uuid != "") {
        this.setText(LANG.edit_user_Text());
        //call details
    } else {/*w  w w.ja v  a  2 s .  co m*/
        this.setText(LANG.new_user_Text());
    }
    //build empty
    VerticalPanel main = new VerticalPanel();

    HorizontalPanel fname = new HorizontalPanel();
    fname.setSpacing(5);
    Label flabel = new Label(LANG.forename_Text());
    flabel.setWidth("150px");
    fname.add(flabel);
    this.forename = new TextBox();
    fname.add(this.forename);
    main.add(fname);

    HorizontalPanel sname = new HorizontalPanel();
    sname.setSpacing(5);
    Label slabel = new Label(LANG.surname_Text());
    slabel.setWidth("150px");
    sname.add(slabel);
    this.surname = new TextBox();
    sname.add(this.surname);
    main.add(sname);

    HorizontalPanel uname = new HorizontalPanel();
    uname.setSpacing(5);
    Label ulabel = new Label(LANG.username_Text());
    ulabel.setWidth("150px");
    uname.add(ulabel);
    this.username = new TextBox();
    uname.add(this.username);
    main.add(uname);
    if (this.uuid.equals("")) {
        HorizontalPanel p1 = new HorizontalPanel();
        p1.setSpacing(5);
        Label p1label = new Label(LANG.password_Text());
        p1label.setWidth("150px");
        p1.add(p1label);
        this.pass1 = new PasswordTextBox();
        p1.add(this.pass1);
        main.add(p1);

        HorizontalPanel p2 = new HorizontalPanel();
        p2.setSpacing(5);
        Label p2label = new Label(LANG.password_reenter_Text());
        p2label.setWidth("150px");
        p2.add(p2label);
        this.pass2 = new PasswordTextBox();
        p2.add(this.pass2);
        main.add(p2);
    }

    HorizontalPanel adminPanel = new HorizontalPanel();
    adminPanel.setSpacing(5);
    Label adminlabel = new Label(LANG.is_admin_Text());
    adminlabel.setWidth("150px");
    adminPanel.add(adminlabel);
    this.isAdmin = new CheckBox();
    adminPanel.add(this.isAdmin);
    main.add(adminPanel);

    HorizontalPanel levPanel = new HorizontalPanel();
    levPanel.setSpacing(5);
    Label levlabel = new Label(LANG.security_level_Text());
    levlabel.setWidth("150px");
    levPanel.add(levlabel);
    this.secLevel = new ListBox();
    levPanel.add(this.secLevel);
    main.add(levPanel);

    HorizontalPanel cavPanel = new HorizontalPanel();
    cavPanel.setSpacing(5);
    Label cavlabel = new Label(LANG.security_caveats_Text());
    cavlabel.setWidth("150px");
    cavPanel.add(cavlabel);
    this.caveats = new ListBox();
    this.caveats.setMultipleSelect(true);
    this.caveats.setVisibleItemCount(5);
    cavPanel.add(this.caveats);
    main.add(cavPanel);

    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setSpacing(5);
    this.saveBut = new Button(LANG.save_Text());
    this.saveBut.addClickListener(this);
    butPanel.add(this.saveBut);
    this.cancelBut = new Button(LANG.cancel_Text());
    this.cancelBut.addClickListener(this);
    butPanel.add(this.cancelBut);
    main.add(butPanel);

    this.popLists();

    this.setWidget(main);
    //this.show();
    int left = (Window.getClientWidth() - this.getOffsetWidth()) / 2;
    int top = (Window.getClientHeight() - this.getOffsetHeight()) / 2;
    this.setPopupPosition(left, top);

    if (details != null) {
        this.setValues(details);
    }
}

From source file:com.audata.client.admin.UserPanel.java

License:Open Source License

public UserPanel() {

    this.dialog = new SetPasswordDialog(this);
    this.setSpacing(5);

    Label title = new Label(LANG.admin_user_Text());
    title.addStyleName("audoc-sectionTitle");
    this.add(title);

    String caption = "<span class=\"user-name\">#0 #1</span><br/>" + "<span class=\"user-username\">#2</span>";
    this.usersBox = new HTMLButtonList("images/48x48/users.gif", caption, false);
    this.usersBox.addStyleName("audoc-users");
    this.usersBox.setPixelSize(300, 250);
    this.usersBox.addClickListener(new UserClickListener(this));

    this.add(this.usersBox);

    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setSpacing(5);//from   w  w  w .ja  v  a2 s .  c  o  m
    this.newUser = new Button(LANG.new_Text());
    this.newUser.addClickListener(this);

    this.editUser = new Button(LANG.edit_Text());
    this.editUser.addClickListener(this);

    this.delUser = new Button(LANG.delete_Text());
    this.delUser.addClickListener(this);

    this.setPassword = new Button(LANG.set_password_Text());
    this.setPassword.addClickListener(this);

    buttons.add(this.newUser);
    buttons.add(this.editUser);
    buttons.add(this.delUser);
    buttons.add(this.setPassword);

    this.add(buttons);
    this.getUsers();
}

From source file:com.audata.client.AuDoc.java

License:Open Source License

/**
 * Builds the menu bar panel//from  ww w. ja  v a 2s  . c om
 * @return HorizontalPanel containing the menu bar
 */
private HorizontalPanel buildMenu() {
    HorizontalPanel menu = new HorizontalPanel();
    menu.addStyleName("menu");
    menu.setWidth("100%");
    menu.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
    menu.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM);
    menu.setSpacing(4);

    CaptionButton cb = new CaptionButton();
    cb.setImageUrl("images/48x48/home.gif");
    cb.setCaptionText(LANG.home_Text());
    cb.setOrientation(DockPanel.SOUTH);
    cb.addClickListener(new MenuClickListener(this, AuDoc.SECTION_HOME));
    cb.setTitle(LANG.home_title_Text());
    menu.add(cb);

    CaptionButton cb_1 = new CaptionButton();
    cb_1.setImageUrl("images/48x48/search.gif");
    cb_1.setCaptionText(LANG.search_Text());
    cb_1.setOrientation(DockPanel.SOUTH);
    cb_1.addClickListener(new MenuClickListener(this, AuDoc.SECTION_SEARCH));
    cb_1.setTitle(LANG.search_title_Text());
    menu.add(cb_1);

    CaptionButton cb_2 = new CaptionButton();
    cb_2.addCaptionStyleName("nowrap");
    cb_2.setOrientation(DockPanel.SOUTH);
    cb_2.setImageUrl("images/48x48/newrec.gif");
    cb_2.setCaptionText(LANG.newrec_Text());
    cb_2.addClickListener(new MenuClickListener(this, AuDoc.SECTION_NEW));
    cb_2.setTitle(LANG.newrec_title_Text());
    menu.add(cb_2);

    CaptionButton cb_3 = new CaptionButton();
    cb_3.setImageUrl("images/48x48/reports.gif");
    cb_3.setCaptionText(LANG.report_Text());
    cb_3.setOrientation(DockPanel.SOUTH);
    cb_3.addClickListener(new MenuClickListener(this, AuDoc.SECTION_REPORT));
    cb_3.setTitle(LANG.report_title_Text());
    menu.add(cb_3);

    CaptionButton cb_4 = new CaptionButton();
    cb_4.setImageUrl("images/48x48/checkout.gif");
    cb_4.setCaptionText(LANG.rapid_title_Text());
    cb_4.setOrientation(DockPanel.SOUTH);
    cb_4.addClickListener(new MenuClickListener(this, AuDoc.SECTION_RAPID));
    cb_4.setTitle(LANG.rapid_title_Text());
    menu.add(cb_4);

    this.adminButton = new CaptionButton();
    this.adminButton.setImageUrl("images/48x48/admin.gif");
    this.adminButton.setCaptionText(LANG.admin_Text());
    this.adminButton.setOrientation(DockPanel.SOUTH);
    this.adminButton.setVisible(false);
    this.adminButton.addClickListener(new MenuClickListener(this, AuDoc.SECTION_ADMIN));
    this.adminButton.setTitle(LANG.admin_title_Text());
    menu.add(this.adminButton);
    menu.setCellWidth(this.adminButton, "100%");
    menu.setCellHorizontalAlignment(this.adminButton, HasAlignment.ALIGN_RIGHT);

    return menu;
}

From source file:com.audata.client.AuDoc.java

License:Open Source License

/**
 * Called when a user logs in/*from ww  w  . ja  va2  s. c om*/
 */
public void onLogin() {

    SecLoader.cacheCaveats();
    SecLoader.cacheSecLevels();

    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(2);
    panel.setWidth("150px");
    panel.add(new Image("images/16x16/users.gif"));
    Label name = new Label(AuDoc.state.getItem("surname") + ", " + AuDoc.state.getItem("forename"));
    name.setWidth("116px");
    name.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
    name.addStyleName("audoc-userNote");
    panel.add(name);
    Image logout = new Image("images/16x16/logout.gif");
    logout.addStyleName("audoc-logoutButton");
    logout.addClickListener(new LogoutListener(this));
    panel.add(logout);
    RootPanel.get("user").add(panel);

    if (AuDoc.state.getItem("isAdmin") == "true") {
        this.adminButton.setVisible(true);
    }

    this.classBrowser.onUpdate();
    this.trayPanel.onUpdate();
    this.checkoutsPanel.onUpdate();
    this.savedSearchPanel.onUpdate();
}

From source file:com.audata.client.authentication.LoginDialog.java

License:Open Source License

public LoginDialog(AuDoc parent) {
    this.parent = parent;
    setText(CONSTANTS.welcome_Text());

    // Create a DockPanel to contain the 'about' label and the 'OK' button.
    DockPanel outer = new DockPanel();
    outer.setSpacing(4);/* w ww  . j av  a2 s . co m*/

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

    VerticalPanel formPanel = new VerticalPanel();
    formPanel.setSpacing(1);

    HorizontalPanel userPanel = new HorizontalPanel();
    this.username = new TextBox();
    Label l = new Label(CONSTANTS.username_Text());
    l.addStyleName("audoc-label");
    l.setWidth("85px");
    userPanel.add(l);
    userPanel.add(this.username);
    formPanel.add(userPanel);

    HorizontalPanel passPanel = new HorizontalPanel();
    this.password = new PasswordTextBox();
    l = new Label(CONSTANTS.password_Text());
    l.addStyleName("audoc-label");
    l.setWidth("85px");
    passPanel.add(l);
    passPanel.add(this.password);
    formPanel.add(passPanel);

    HorizontalPanel langPanel = new HorizontalPanel();
    l = new Label(CONSTANTS.lang_Text());
    l.addStyleName("audoc-label");
    l.setWidth("85px");
    langPanel.add(l);
    formPanel.add(langPanel);

    this.languages = new ListBox();
    this.populateLocales();
    this.languages.setWidth("146px");

    langPanel.add(this.languages);

    this.languages.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
            //refreshes the browser in the selected locale
            Location loc = WindowUtils.getLocation();
            String path = loc.getProtocol() + "//" + loc.getHost() + loc.getPath();
            String locale = languages.getValue(languages.getSelectedIndex());
            Window.open(path + "?locale=" + locale, "_self", "");
        }
    });

    this.loginButton = new Button(CONSTANTS.login_Text(), this);
    formPanel.add(loginButton);
    formPanel.setCellHorizontalAlignment(this.loginButton, HasAlignment.ALIGN_RIGHT);
    outer.add(formPanel, DockPanel.SOUTH);

    HTML text = new HTML(CONSTANTS.message_Text());
    text.setStyleName("audoc-LoginDialogText");
    outer.add(text, DockPanel.CENTER);

    // Add a bit of spacing and margin to the dock to keep the components from
    // being placed too closely together.
    outer.setSpacing(8);
    this.setWidget(outer);
}