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

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

Introduction

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

Prototype

public void setSpacing(int spacing) 

Source Link

Document

Sets the amount of spacing between this panel's cells.

Usage

From source file:com.Administration.client.Administration.java

License:Apache License

/**
 * ?   UI/*from   www  .  j av a  2s .  co  m*/
 */
public void onModuleLoad() {

    label = new HTML(); //   ?  ?  
    label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    loginLabel = new HTML(); //   ?  ?    
    loginLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    dialog = new PasswordDialog(); //   
    list = new LinkedList<>(); //  ? ? 

    ProvidesKey<LinkData> KEY_PROVIDER = new ProvidesKey<LinkData>() { //    -   ??   
        @Override
        public Object getKey(LinkData item) {
            return item == null ? null : item.getId();
        }
    };
    cellTable = new CellTable<>(KEY_PROVIDER); //  ? 

    dataProvider = new ListDataProvider<>(); //    
    dataProvider.addDataDisplay(cellTable); // ?,   ????   ? 

    sortHandler = new ListHandler<>(list); //  ?
    cellTable.addColumnSortHandler(sortHandler); //  ?   

    SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
    pager = new SimplePager(SimplePager.TextLocation.CENTER, pagerResources, false, 0, true); //  pager -  ?
    pager.setDisplay(cellTable); // ?,  pager ?  ? 

    initTable(); //   ? 
    cellTable.setWidth("100%");
    cellTable.setHeight("80%");
    cellTable.setAutoHeaderRefreshDisabled(true);
    cellTable.setAutoFooterRefreshDisabled(true);

    //  ?  
    VerticalPanel VP = new VerticalPanel();
    VP.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    VP.add(cellTable);
    VP.add(pager);

    logoutButton = new Button("Logout");

    //  ? 
    HorizontalPanel loginHP = new HorizontalPanel();
    loginHP.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    loginHP.setSpacing(5);
    loginHP.add(loginLabel);
    loginHP.add(logoutButton);

    logoutButton.addClickHandler(new ClickHandler() { //  
        @Override
        public void onClick(ClickEvent event) { //  

            Cookies.removeCookie(cookieName); // ?   

            //  ?  ???
            loginLabel.setHTML("");
            loginLabel.setVisible(false);
            label.setHTML("");
            cellTable.setVisible(false);
            pager.setVisible(false);
            logoutButton.setVisible(false);

            dataProvider.getList().clear(); // ? 

            dialog.show(); //   
            dialog.center();

        }
    });
    logoutButton.setVisible(false);

    //  
    RootPanel.get("Login").add(loginHP);
    RootPanel.get("Data").add(VP);
    RootPanel.get("Data").add(label);

    //    ? 
    cellTable.setVisible(false);
    pager.setVisible(false);

    dialog.Login();
}

From source file:com.allen_sauer.gwt.dnd.demo.client.DragStartSensitivityBehaviorPanel.java

License:Apache License

public DragStartSensitivityBehaviorPanel(final DragController dragController) {
    super("Drag Sensitivity", "getBehaviorDragStartSensitivity() / setBehaviorDragStartSensitivity(int)");
    this.dragController = dragController;

    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(5);
    Label label = new Label("Number of Pixels");
    textBox = new TextBox();
    textBox.setWidth("3em");
    panel.add(label);/*from  w  w  w . j  a  va 2s . c  o m*/
    panel.add(textBox);
    panel.setTitle("DragController#setBehaviorDragStartSensitivity(int)");
    add(panel);

    textBox.setText("" + dragController.getBehaviorDragStartSensitivity());

    textBox.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent event) {
            fix();
        }
    });
    textBox.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            fix();
            textBox.selectAll();
        }
    });
    textBox.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            fix();
        }
    });
}

From source file:com.allen_sauer.gwt.dnd.demo.client.example.insertpanel.InsertPanelExample.java

License:Apache License

public InsertPanelExample(DemoDragHandler demoDragHandler) {
    addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE);
    int count = 0;

    // use the boundary panel as this composite's widget
    AbsolutePanel boundaryPanel = new AbsolutePanel();
    boundaryPanel.setSize("100%", "100%");
    setWidget(boundaryPanel);//  ww w  .  j av  a2 s. c  o  m

    // initialize our column drag controller
    PickupDragController columnDragController = new PickupDragController(boundaryPanel, false);
    columnDragController.setBehaviorMultipleSelection(false);
    columnDragController.addDragHandler(demoDragHandler);

    // initialize our widget drag controller
    PickupDragController widgetDragController = new PickupDragController(boundaryPanel, false);
    widgetDragController.setBehaviorMultipleSelection(false);
    widgetDragController.addDragHandler(demoDragHandler);

    // initialize horizontal panel to hold our columns
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_CONTAINER);
    horizontalPanel.setSpacing(SPACING);
    boundaryPanel.add(horizontalPanel);

    // initialize our column drop controller
    HorizontalPanelDropController columnDropController = new HorizontalPanelDropController(horizontalPanel);
    columnDragController.registerDropController(columnDropController);

    for (int col = 1; col <= COLUMNS; col++) {
        // initialize a vertical panel to hold the heading and a second vertical
        // panel
        VerticalPanel columnCompositePanel = new VerticalPanel();
        columnCompositePanel.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_COLUMN_COMPOSITE);

        // initialize inner vertical panel to hold individual widgets
        VerticalPanel verticalPanel = new VerticalPanelWithSpacer();
        verticalPanel.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_CONTAINER);
        verticalPanel.setSpacing(SPACING);
        horizontalPanel.add(columnCompositePanel);

        // initialize a widget drop controller for the current column
        VerticalPanelDropController widgetDropController = new VerticalPanelDropController(verticalPanel);
        widgetDragController.registerDropController(widgetDropController);

        // Put together the column pieces
        Label heading = new Label("Column " + col);
        heading.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_HEADING);
        columnCompositePanel.add(heading);
        columnCompositePanel.add(verticalPanel);

        // make the column draggable by its heading
        columnDragController.makeDraggable(columnCompositePanel, heading);

        for (int row = 1; row <= ROWS; row++) {
            // initialize a widget
            HTML widget = new HTML("Draggable&nbsp;#" + ++count);
            widget.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_WIDGET);
            widget.setHeight(Random.nextInt(4) + 2 + "em");
            verticalPanel.add(widget);

            // make the widget draggable
            widgetDragController.makeDraggable(widget);
        }
    }
}

From source file:com.anzsoft.client.ui.UserIndicator.java

License:Open Source License

public UserIndicator(final String nick) {
    createStatusMenu();/*w w  w .j  av a  2 s.  c  o m*/
    setWidth("100%");
    setCellPadding(0);
    setCellSpacing(0);
    setStyleName("indicator");
    FlexCellFormatter formatter = getFlexCellFormatter();

    // Setup the links cell
    /*
    linksPanel = new HorizontalPanel();
    setWidget(0, 0, linksPanel);
    formatter.setStyleName(0, 0, "indicator-links");
    formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    formatter.setColSpan(0, 0, 2);
    */

    // Setup the title cell
    setTitleWidget(null);
    formatter.setStyleName(0, 0, "indicator-title");

    getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_TOP);
    getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_TOP);

    final ChatIcons icons = ChatIcons.App.getInstance();
    statusImg = new Image();
    statusImg.setWidth("16px");
    statusImg.setHeight("16px");
    icons.online().applyTo(statusImg);

    avatarImg = new Image("images/default_avatar.png");
    avatarImg.setWidth("32px");
    avatarImg.setHeight("32px");
    avatarImg.setStyleName("handler");
    avatarImg.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            JabberApp.instance().showInfoSelf();
        }

    });

    nickName = new Label(nick);
    nickName.setDirection(Direction.LTR);
    nickName.setWidth("100%");

    statusLabel = new Label();
    statusLabel.setStyleName("status_label");
    statusLabel.setWidth("100%");

    statusEditor = new TextBox();
    statusEditor.setVisible(false);
    statusEditor.setWidth("100%");

    statusButton = new Button();
    statusButton.setMenu(statusMenu);
    statusButton.setStyleName("Status-Menu-Button");

    //statusMenuLabel = new Label();
    //statusMenuLabel.setStyleName("status_menu_label");

    //addLink(new HTML("<a href=\"http://samespace.anzsoft.com\">SameSpace</a>"));
    // Add the title and some images to the title bar
    HorizontalPanel titlePanel = new HorizontalPanel();
    titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    titlePanel.setWidth("100%");
    titlePanel.setSpacing(3);

    VerticalPanel statusPanel = new VerticalPanel();
    statusPanel.setWidth("100%");
    statusPanel.add(nickName);

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setWidth("100%");
    hPanel.setSpacing(2);
    hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    hPanel.add(statusLabel);
    hPanel.add(statusEditor);
    hPanel.add(statusButton);

    statusPanel.add(hPanel);

    titlePanel.add(statusImg);
    titlePanel.add(statusPanel);
    titlePanel.add(avatarImg);

    titlePanel.setCellWidth(statusImg, "20px");
    titlePanel.setCellWidth(statusPanel, "100%");
    titlePanel.setCellWidth(avatarImg, "32px");
    setTitleWidget(titlePanel);

    JabberApp.instance().getSession().getUser().addUserListener(new XmppUserListener() {
        public void onPresenceChanged(XmppPresence presence) {
            String show = new String("");
            PresenceShow presenceShow = presence.getShow();
            if (presenceShow != null)
                show = presenceShow.toString();
            String statusString = presence.getStatus();
            int priority = presence.getPriority();
            boolean avaiable = true;
            String type = presence.getType();
            if (type != null && !type.isEmpty()) {
                if (type.equalsIgnoreCase("unavailable"))
                    avaiable = false;
            }
            status = new XmppContactStatus(show, statusString, priority, avaiable);
            statusLabel.setText(status.status());
            iconFromStatus(status).applyTo(statusImg);
        }
    });

    statusLabel.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            statusLabel.setVisible(false);
            statusEditor.setVisible(true);
            statusEditor.setText(statusLabel.getText());
        }

    });

    statusEditor.addKeyboardListener(new KeyboardListener() {

        public void onKeyDown(Widget sender, char keyCode, int modifiers) {

        }

        public void onKeyPress(Widget sender, char keyCode, int modifiers) {

        }

        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
            if (keyCode == 13)
                doneChangeStatusString();
        }

    });

    statusEditor.addFocusListener(new FocusListener() {
        public void onFocus(Widget sender) {
        }

        public void onLostFocus(Widget sender) {
            doneChangeStatusString();
        }

    });

    XmppVCardFactory.instance().addVCardListener(new VCardListener() {
        public void onVCard(XmppID jid, XmppVCard vcard) {
            if (jid.toStringNoResource().equalsIgnoreCase(JabberApp.instance().getJid().toStringNoResource())) {
                if (!vcard.nickName().isEmpty())
                    nickName.setText(vcard.fullName());
                else if (!vcard.fullName().isEmpty())
                    nickName.setText(vcard.fullName());
                String photoData = vcard.photo();
                if (!photoData.isEmpty() && !GXT.isIE) {
                    ImageElement imgEl = avatarImg.getElement().cast();
                    imgEl.removeAttribute("src");
                    imgEl.setSrc("data:image;base64," + photoData);
                }

            }
        }

    });
}

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

License:Open Source License

/**
 * Public constructor of Classification//from  w  w  w .  ja  va2  s.  c  om
 * Admin panel
 *
 */
public ClassificationPanel() {
    this.setSpacing(5);
    this.setSize("100%", "100%");

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

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

    // add classification browser
    this.classBrowser = new ClassBrowser("100%", "100%");
    this.classBrowser.onUpdate();
    this.classBrowser.classes.addTreeListener(this);
    this.classBrowser.setStyleName("audoc-browser");
    this.classBrowser.setSize("100%", "100%");
    hp.add(this.classBrowser);

    // form
    VerticalPanel vp = new VerticalPanel();
    vp.addStyleName("audoc-form");
    vp.setSpacing(5);

    // name field
    HorizontalPanel namePanel = new HorizontalPanel();
    namePanel.setSpacing(5);
    Label n = new Label(LANG.name_Text());
    n.setWidth("100px");
    namePanel.add(n);
    this.name = new TextBox();
    namePanel.add(this.name);
    vp.add(namePanel);

    // retention field
    HorizontalPanel retPanel = new HorizontalPanel();
    retPanel.setSpacing(5);
    Label r = new Label(LANG.retention_Text());
    r.setWidth("100px");
    retPanel.add(r);
    this.retention = new NumericTextBox();
    retPanel.add(this.retention);
    vp.add(retPanel);

    // security level field
    HorizontalPanel secPanel = new HorizontalPanel();
    secPanel.setSpacing(5);
    Label s = new Label(LANG.security_level_Text());
    s.setWidth("100px");
    secPanel.add(s);
    this.secLevel = new ListBox();
    secPanel.add(this.secLevel);
    vp.add(secPanel);

    // caveats field
    HorizontalPanel cavPanel = new HorizontalPanel();
    cavPanel.setSpacing(5);
    Label c = new Label(LANG.security_caveat_Text());
    c.setWidth("100px");
    cavPanel.add(c);
    this.caveats = new ListBox();
    this.caveats.setMultipleSelect(true);
    this.caveats.setVisibleItemCount(5);
    cavPanel.add(this.caveats);
    vp.add(cavPanel);

    // Buttons
    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setSpacing(5);

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

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

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

    this.newChild = new Button(LANG.new_child_Text());
    this.newChild.addClickListener(this);
    butPanel.add(this.newChild);

    vp.add(butPanel);

    // add it all up!
    hp.add(vp);
    hp.setCellWidth(this.classBrowser, "100%");

    this.add(hp);
    this.popLists();
}

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

License:Open Source License

/**
 * Public Constructor/*from   w w  w  .  j  a va2s. c om*/
 *
 */
public KeywordPanel() {
    this.setSpacing(5);
    this.setSize("100%", "100%");

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

    HorizontalPanel kwhs = new HorizontalPanel();
    kwhs.setSpacing(5);
    Label kl = new Label(LANG.keyword_hierarchy_Text());
    kwhs.add(kl);

    this.hierarchies = new ListBox();
    this.hierarchies.setWidth("150px");
    this.hierarchies.setVisibleItemCount(1);
    this.hierarchies.addChangeListener(this);
    kwhs.add(this.hierarchies);

    this.newHierarchy = new Button(LANG.new_Text());
    this.newHierarchy.addClickListener(this);
    kwhs.add(this.newHierarchy);

    this.delHierarchy = new Button(LANG.delete_Text());
    this.delHierarchy.addClickListener(this);
    kwhs.add(this.delHierarchy);

    this.add(kwhs);

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

    // add classification browser

    this.keywordBrowser = new KeywordBrowser("100%", "100%");
    this.keywordBrowser.keywords.addTreeListener(this);
    this.keywordBrowser.setStyleName("audoc-browser");
    this.keywordBrowser.setSize("100%", "100%");
    hp.add(this.keywordBrowser);
    hp.setCellWidth(this.keywordBrowser, "50%");
    hp.setCellHeight(this.keywordBrowser, "300px");

    // form
    VerticalPanel vp = new VerticalPanel();
    vp.addStyleName("audoc-form");
    vp.setSpacing(5);

    // name field
    HorizontalPanel namePanel = new HorizontalPanel();
    namePanel.setSpacing(5);
    Label n = new Label(LANG.name_Text());
    n.setWidth("100px");
    namePanel.add(n);
    this.name = new TextBox();
    namePanel.add(this.name);
    vp.add(namePanel);

    // Buttons
    HorizontalPanel butPanel = new HorizontalPanel();
    butPanel.setSpacing(5);

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

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

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

    this.newChild = new Button(LANG.new_child_Text());
    this.newChild.addClickListener(this);
    butPanel.add(this.newChild);

    vp.add(butPanel);

    // add it all up!
    hp.add(vp);

    this.add(hp);
    this.getHierarchies();
}

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

License:Open Source License

/**
 * Public Constructor which take the parent admin panel
 * so that it can be updated when a new Hierarchy has
 * been added// w w  w  . java  2 s.c  o m
 * @param parent The parent KeywordPanel
 */
public NewHierarchy(KeywordPanel parent) {
    this.parent = parent;

    this.setText(LANG.new_keyword_hierarchy_Text());
    VerticalPanel main = new VerticalPanel();
    main.setSpacing(4);

    HorizontalPanel fields = new HorizontalPanel();
    fields.setSpacing(4);
    Label l = new Label(LANG.name_Text());
    this.name = new TextBox();
    this.name.setWidth("150px");
    fields.add(l);
    fields.add(this.name);
    main.add(fields);

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

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

License:Open Source License

/**
 * Constructor for the PecTypePanel./*w  w  w. j  a v a  2s . co m*/
 * Builds the UI and gets the content of the
 * list.
 */
public RecTypePanel() {

    this.selectedUUID = null;

    this.setSize("100%", "100%");
    this.setSpacing(5);
    Label title = new Label(LANG.admin_rectypes_Text());
    title.addStyleName("audoc-sectionTitle");
    this.add(title);

    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(5);
    String template = "<p><span class=\"audoc-rectype-title\">#0</span><br/>"
            + "<span class=\"audoc-rectype-notes\">#1</span></p>";
    this.recTypes = new HTMLButtonList("images/48x48/rectypes.gif", template, false);
    this.recTypes.addStyleName("audoc-recTypes");
    this.recTypes.addClickListener(this);
    this.recTypes.setPixelSize(300, 300);

    hp.add(this.recTypes);

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

    HorizontalPanel namePanel = new HorizontalPanel();
    Label nameLabel = new Label(LANG.name_Text());
    nameLabel.setWidth("100px");
    namePanel.add(nameLabel);
    this.nameBox = new TextBox();
    namePanel.add(this.nameBox);
    form.add(namePanel);

    HorizontalPanel descPanel = new HorizontalPanel();
    Label descLabel = new Label(LANG.description_Text());
    descLabel.setWidth("100px");
    descPanel.add(descLabel);
    this.descBox = new TextArea();
    descPanel.add(this.descBox);
    form.add(descPanel);

    HorizontalPanel udfPanel = new HorizontalPanel();
    Label udfLabel = new Label(LANG.udf_Text());
    udfLabel.setWidth("100px");
    udfPanel.add(udfLabel);
    this.udfsBox = new ListBox();
    this.udfsBox.setVisibleItemCount(5);
    this.udfsBox.setMultipleSelect(true);
    udfPanel.add(this.udfsBox);
    form.add(udfPanel);

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

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

    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);

    this.add(hp);
    this.getRecTypes();
    this.getUDFs();
}

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

License:Open Source License

/**
 * public contrcutor/*from w  w w .  j  a  v a2 s. c  o m*/
 */
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  ww  w  .j a  va2s . c o m*/
 * @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;
}