Example usage for com.google.gwt.user.client.ui VerticalPanel setBorderWidth

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

Introduction

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

Prototype

public void setBorderWidth(int width) 

Source Link

Document

Sets the width of the border to be applied to all cells in this panel.

Usage

From source file:com.cognitivemedicine.metricsdashboard.client.adminconsole.MetricsTab.java

License:Apache License

private VerticalPanel createLabeledList(String labelText, ListBox listBox) {
    VerticalPanel panel = new VerticalPanel();
    panel.setBorderWidth(2);
    HTML label = new HTML(labelText);

    panel.add(label);//from   www  .  j a v  a2s  . co m
    panel.add(listBox);
    return panel;
}

From source file:com.edgenius.wiki.gwt.client.widgets.DialogBox.java

License:Open Source License

public DialogBox(UIObject parent, boolean autoHide, boolean withBackground, boolean modal) {
    super(autoHide, modal);
    if (modal && withBackground)
        lightbox = new Lightbox(parent, this);

    closeBtn.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            hidebox();// w  ww  .j  a v a 2  s . co  m
        }
    });

    VerticalPanel panel = new VerticalPanel();
    //caption part: caption focus panel(drag/drop handler) and close button
    captionTable.setWidget(0, 0, icon);
    captionTable.setWidget(0, 1, caption);
    captionTable.setWidget(0, 2, closeBtn);

    captionTable.getCellFormatter().setWidth(0, 0, "42px");
    captionTable.getCellFormatter().setWidth(0, 2, "42px");
    captionTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_BOTTOM);
    captionTable.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    captionTable.getFlexCellFormatter().setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_BOTTOM);
    captionTable.getFlexCellFormatter().setStyleName(0, 0, "dlg-top-left");
    captionTable.getFlexCellFormatter().setStyleName(0, 1, "dlg-border-top");
    captionTable.getFlexCellFormatter().setStyleName(0, 2, "dlg-top-right");
    captionTable.setCellPadding(0);
    captionTable.setCellSpacing(0);

    FlexTable bodyTable = new FlexTable();
    bodyTable.getFlexCellFormatter().setStyleName(0, 0, "dlg-border-left");
    bodyTable.getFlexCellFormatter().setStyleName(0, 2, "dlg-border-right");
    bodyTable.setWidget(0, 1, body);
    bodyTable.setWidget(1, 0, buttonBar);
    bodyTable.setCellPadding(0);
    bodyTable.setCellSpacing(0);

    bodyTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP);
    bodyTable.getFlexCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_BOTTOM);
    bodyTable.getFlexCellFormatter().setStyleName(0, 1, Css.MAIN_BODY);
    bodyTable.getFlexCellFormatter().setStyleName(1, 0, Css.BUTTONS_BAR);
    bodyTable.getFlexCellFormatter().setRowSpan(0, 0, 2);
    bodyTable.getFlexCellFormatter().setRowSpan(0, 2, 2);
    bodyTable.getCellFormatter().setWidth(0, 0, "17px");
    bodyTable.getCellFormatter().setWidth(0, 2, "17px");

    FlexTable bottomTable = new FlexTable();
    bottomTable.setWidget(0, 0, new HTML(" ")); //just a placeholder
    bottomTable.setWidget(0, 1, new HTML(" ")); //just a placeholder
    bottomTable.setWidget(0, 2, new HTML(" ")); //just a placeholder
    bottomTable.getFlexCellFormatter().setStyleName(0, 0, "dlg-bottom-left");
    bottomTable.getFlexCellFormatter().setStyleName(0, 1, "dlg-border-bottom");
    bottomTable.getFlexCellFormatter().setStyleName(0, 2, "dlg-bottom-right");
    bottomTable.getCellFormatter().setWidth(1, 0, "34px");
    bottomTable.getCellFormatter().setWidth(1, 2, "34px");
    bottomTable.setCellPadding(0);
    bottomTable.setCellSpacing(0);

    panel.add(captionTable);
    panel.add(bodyTable);
    panel.add(bottomTable);

    //style
    captionTable.setWidth("100%");
    bodyTable.setWidth("100%");
    bottomTable.setWidth("100%");

    body.setSize("100%", "100%");
    caption.setWidth("100%");

    panel.setStyleName(Css.DIALOG_BOX_TABLE);
    panel.setBorderWidth(0);
    caption.addMouseOutHandler(this);
    caption.addMouseOverHandler(this);
    caption.addMouseDownHandler(this);
    caption.addMouseUpHandler(this);
    caption.addMouseMoveHandler(this);
    //      icon.addMouseOutHandler(this);
    //      icon.addMouseOverHandler(this);
    //      icon.addMouseDownHandler(this);
    //      icon.addMouseUpHandler(this);
    //      icon.addMouseMoveHandler(this);

    captionTable.setStyleName(Css.CAPTION);
    setStyleName(Css.DIALOG_BOX);

    windowWidth = Window.getClientWidth();
    clientLeft = Document.get().getBodyOffsetLeft();
    clientTop = Document.get().getBodyOffsetTop();

    super.setWidget(panel);

}

From source file:com.example3.client.HelloFront.java

License:Apache License

public void init() {

    /* panel *//*from w  ww  .  ja  va2 s  . c o m*/
    VerticalPanel pnl = new VerticalPanel();
    pnl.setWidth("100%");
    pnl.setBorderWidth(3);
    pnl.setSpacing(3);

    /* table */
    FlexTable tbl = new FlexTable();
    tbl.setWidth("100%");
    tbl.setBorderWidth(3);
    tbl.getColumnFormatter().setWidth(0, "100%");

    /* row */
    int row = 0;
    {
        TextArea txt = new TextArea();
        txt.setWidth("100%");
        txt.setText("HelloJsonp Test");
        Button btn = new Button("Click to test", new ClickHandler() {
            public void onClick(ClickEvent event) {
                HelloJsonp.get();
            }
        });
        tbl.setWidget(row, 0, txt);
        tbl.setWidget(row, 1, btn);
    }

    /* add table to panel, panel to root */
    pnl.add(tbl);
    Hello.hookNewRoot(pnl);
    thisPanel = pnl;
}

From source file:com.itgp.gwtviz.client.ui.MyDialog.java

License:Open Source License

public MyDialog(Widget w) {
    // Set the dialog box's caption.
    setText("My First Dialog");

    // Enable animation.
    setAnimationEnabled(true);/*from ww w .j  a va 2 s.  c  o  m*/

    // Enable glass background.
    setGlassEnabled(true);

    // DialogBox is a SimplePanel, so you have to set its widget 
    // property to whatever you want its contents to be.
    Button ok = new Button("OK");
    ok.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            MyDialog.this.hide();
        }
    });

    Label label = new Label("This is a simple dialog box.");

    VerticalPanel panel = new VerticalPanel();
    panel.setBorderWidth(5);
    panel.setHeight("100");
    panel.setWidth("300");
    panel.setSpacing(10);
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    panel.add(w);
    panel.add(label);
    panel.add(ok);

    setWidget(panel);
}

From source file:fast.mediation.client.DataTransformationTool.java

License:Open Source License

public void refreshOverviewPanel() {
    overviewFlowPanel.clear();/*  w  ww . j  av  a  2  s.  co  m*/
    // add operator panels
    for (TrafoOperator trafoOp : designer.getTrafoOperators()) {
        VerticalPanel verticalPanel = new VerticalPanel();
        HorizontalPanel imagePanel = new HorizontalPanel();
        Image image = new Image("images/DataTransformationOperatorIcon.png");
        imagePanel.add(image);
        Image delImage = new Image("images/x.png");

        delImage.addClickHandler(new TrafoOpRemoveHandler(trafoOp));

        imagePanel.add(delImage);

        verticalPanel.add(imagePanel);
        Label label = new Label(trafoOp.getName());
        verticalPanel.add(label);
        if (trafoOp == trafoOperator) {
            verticalPanel.setBorderWidth(3);
        }
        TrafoOpSelectionHandler selectHandler = new TrafoOpSelectionHandler();
        selectHandler.myOp = trafoOp;
        image.addClickHandler(selectHandler);
        overviewFlowPanel.add(verticalPanel);

        TrafoOpNameListener trafoOpNameListener = new TrafoOpNameListener();
        trafoOpNameListener.myLabel = label;
        trafoOp.addPropertyChangeListener(TrafoOperator.PROPERTY_NAME, trafoOpNameListener);
    }

    // add add button
    Button button = new Button("add");
    button.setStyleName("fastButton");
    button.addClickHandler(addTrafoOpHandler);
    overviewFlowPanel.add(button);
}

From source file:mcamara.client.TutorialComposite.java

License:Open Source License

/**
 * Instantiates a new tutorial composite.
 *
 * @param idioma the idioma//from   w w  w. ja v  a 2  s.  c o m
 */
@SuppressWarnings("deprecation")
public TutorialComposite(String idioma) {
    m = Util.getMensajes(idioma);
    DockPanel dockPanel = new DockPanel();
    initWidget(dockPanel);
    dockPanel.setSize("800", "500");

    panelTitulo = new HorizontalPanel();
    panelTitulo.setSpacing(1);
    panelTitulo.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panelTitulo.setBorderWidth(0);
    titulo = new Label("New label");
    titulo.setStyleName("gwt-Label-Titulo");
    titulo.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panelTitulo.add(titulo);
    titulo.setWidth("100%");
    dockPanel.add(panelTitulo, DockPanel.NORTH);
    panelTitulo.setWidth("100%");

    itemsMenuPantallas = new ScrollPanel();
    menuPantallas = new VerticalPanel();
    menuPantallas.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    menuPantallas.setSpacing(1);
    menuPantallas.setBorderWidth(1);
    itemsMenuPantallas.add(menuPantallas);
    menuPantallas.setSize("120px", "100%");
    dockPanel.add(itemsMenuPantallas, DockPanel.WEST);
    itemsMenuPantallas.setSize("100%", "100%");

    VerticalPanel verticalPanel_1 = new VerticalPanel();
    verticalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel_1.setSpacing(5);
    verticalPanel_1.setBorderWidth(0);
    dockPanel.add(verticalPanel_1, DockPanel.CENTER);
    verticalPanel_1.setSize("100%", "100%");

    horizontalPanel = new HorizontalPanel();
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    verticalPanel_1.add(horizontalPanel);
    horizontalPanel.setWidth("80%");

    image = new Image((String) null);
    horizontalPanel.add(image);

    explicacion = new TextArea();
    explicacion.setTextAlignment(TextBoxBase.ALIGN_CENTER);
    explicacion.setEnabled(false);
    explicacion.setVisibleLines(4);
    explicacion.setReadOnly(true);
    explicacion.setAlignment(TextAlignment.LEFT);
    verticalPanel_1.add(explicacion);
    explicacion.setWidth("100%");

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    horizontalPanel_1.setSpacing(1);
    horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    verticalPanel_1.add(horizontalPanel_1);
    horizontalPanel_1.setWidth("100%");

    continuar = new Button(m.continuar());
    horizontalPanel_1.add(continuar);
}

From source file:net.europa13.taikai.web.client.TaikaiWebEntryPoint.java

License:Open Source License

private void initLogger() {
    //*********************************************************************
    // Logger/*from w  w  w . j ava  2  s  .co m*/
    VerticalPanel logPanel = new VerticalPanel();
    VerticalPanel logPanelContents = new VerticalPanel();
    logPanel.setWidth("100%");
    logPanel.setBorderWidth(1);
    Button logClearBTN = new Button("Tm logg", new ClickListener() {

        public void onClick(Widget source) {
            Logger.clear();
        }
    });
    HorizontalPanel logPanelHeader = new HorizontalPanel();
    logPanelHeader.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    logPanelHeader.add(new HTML("<h2>Logg</h2>"));
    logPanelHeader.add(logClearBTN);

    logPanel.add(logPanelHeader);
    logPanel.add(logPanelContents);
    RootPanel.get("root_bottom").add(logPanel);

    Logger.setTarget(new PanelHtmlLogTarget(logPanelContents));
    Logger.setLevel(LogLevel.DEBUG);
}

From source file:org.jboss.as.console.client.teiid.runtime.SQLWorkbenchEditor.java

License:Apache License

public Widget createWidget(VDBPresenter presenter) {
    this.presenter = presenter;
    final ToolStrip toolStrip = new ToolStrip();
    toolStrip.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_refresh(), new ClickHandler() {
        @Override/*  w  w  w  .ja  v  a 2s . co  m*/
        public void onClick(ClickEvent event) {
            presenter.getVDBs();
        }
    }));

    VerticalPanel workBenchPanel = new VerticalPanel();
    workBenchPanel.setBorderWidth(1);
    workBenchPanel.setSpacing(10);

    HorizontalPanel toolbarPanel = new HorizontalPanel();
    toolbarPanel.getElement().getStyle().setPadding(10, Style.Unit.PX);
    Label vdbNameLabel = new Label("VDB Name");
    vdbNameLabel.getElement().setAttribute("style",
            "margin-top:10px;margin-bottom:10px;margin-right:10px;font-weight:bold;");
    toolbarPanel.add(vdbNameLabel);

    vdbSelector = new ComboBoxItem("type", "Type");
    vdbSelector.setDefaultToFirstOption(true);

    toolbarPanel.add(vdbSelector.asWidget());

    ToolButton applyBtn = new ToolButton("Run", new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
            String sqlCommand = editor.getText();
            String name = vdbSelector.getValue();
            if (!sqlCommand.trim().isEmpty()) {
                setSqlResult(sqlCommand, name);
            }
        }
    });
    toolbarPanel.add(applyBtn);

    Label descriptionLabel = new Label("   Enter SQL in below window, then select the text and click Run");
    vdbNameLabel.getElement().setAttribute("style", "margin-top:10px;margin-bottom:10px;margin-right:10px;");
    toolbarPanel.add(descriptionLabel);

    workBenchPanel.add(toolbarPanel);
    workBenchPanel.setCellHeight(toolbarPanel, "50px");

    editor = new AceEditor() {
        public native String getText() /*-{
                                       var editor = this.@edu.ycp.cs.dh.acegwt.client.ace.AceEditor::editor;
                                       return editor.getSelectedText();
                                       }-*/;
    };
    editor.setHeight("200px");
    editor.addAttachHandler(new AttachEvent.Handler() {
        @Override
        public void onAttachOrDetach(AttachEvent event) {
            if (event.isAttached()) {
                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                    @Override
                    public void execute() {
                        editor.startEditor();
                        editor.setAutocompleteEnabled(true);
                        editor.setShowGutter(true);
                        editor.setShowPrintMargin(false);
                        editor.setMode(AceEditorMode.SQL);
                        editor.setTheme(AceEditorTheme.TWILIGHT);
                        editor.setFontSize("11px");
                    }
                });
            }
        }
    });

    HorizontalPanel editorPanel = new HorizontalPanel();
    editorPanel.setStyleName("fill-layout-width");
    editorPanel.add(editor);

    workBenchPanel.add(editorPanel);
    workBenchPanel.setCellHeight(editorPanel, "200px");

    this.resultPanelTabs = new DefaultTabLayoutPanel(40, Style.Unit.PX, true, true);
    this.resultPanelTabs.addStyleName("default-tabpanel");

    VerticalPanel resultPanel = new VerticalPanel();
    resultPanel.add(new HTML("<h3> No Results</h3>"));
    this.resultPanelTabs.add(resultPanel, "No Results");

    workBenchPanel.add(this.resultPanelTabs);

    return workBenchPanel.asWidget();
}

From source file:org.ned.server.nedadminconsole.client.widgets.NedItemEditor.java

License:Open Source License

public NedItemEditor(NedDataModel model) {
    this.model = model;

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    verticalPanel.setSpacing(8);/*from   w  w  w  .jav  a  2s  .c  om*/
    verticalPanel.setBorderWidth(0);
    verticalPanel.setSize("400px", "100%");
    initWidget(verticalPanel);

    lblElementInfo = new Label(NedRes.instance().itemEditElementInfo());
    lblElementInfo.setStyleName("gwt-Label-element");
    verticalPanel.add(lblElementInfo);
    verticalPanel.setCellVerticalAlignment(lblElementInfo, HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.setCellHorizontalAlignment(lblElementInfo, HasHorizontalAlignment.ALIGN_CENTER);
    lblElementInfo.setSize("100%", "");

    Grid gridItemInfo = new Grid(8, 2);
    gridItemInfo.setCellPadding(10);
    gridItemInfo.setStyleName("NedItemEditorPanel");
    verticalPanel.add(gridItemInfo);
    verticalPanel.setCellVerticalAlignment(gridItemInfo, HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.setCellWidth(gridItemInfo, "300px");
    verticalPanel.setCellHorizontalAlignment(gridItemInfo, HasHorizontalAlignment.ALIGN_CENTER);
    gridItemInfo.setSize("392px", "470px");

    Label lblNewLabel_3 = new Label(NedRes.instance().id() + ":");
    gridItemInfo.setWidget(0, 0, lblNewLabel_3);
    gridItemInfo.getCellFormatter().setWidth(0, 0, "30%");

    textBoxId = new TextBox();
    gridItemInfo.setWidget(0, 1, textBoxId);
    textBoxId.setWidth("97%");
    gridItemInfo.getCellFormatter().setWidth(0, 1, "");
    textBoxId.setReadOnly(true);

    Label lblNewLabel_5 = new Label(NedRes.instance().itemEditParentId() + ":");
    gridItemInfo.setWidget(1, 0, lblNewLabel_5);
    gridItemInfo.getCellFormatter().setWidth(1, 0, "30%");

    textBoxIdParent = new TextBox();
    gridItemInfo.setWidget(1, 1, textBoxIdParent);
    gridItemInfo.getCellFormatter().setWidth(1, 1, "");
    textBoxIdParent.setMaxLength(20);
    textBoxIdParent.setReadOnly(true);
    textBoxIdParent.setWidth("97%");

    Label lblNewLabel = new Label(NedRes.instance().itemEditTitle() + ":");
    gridItemInfo.setWidget(2, 0, lblNewLabel);

    textBoxTitle = new TextBox();
    gridItemInfo.setWidget(2, 1, textBoxTitle);
    textBoxTitle.setMaxLength(40);
    textBoxTitle.setWidth("97%");

    Label lblNewLabel_1 = new Label(NedRes.instance().itemEditType() + ":");
    gridItemInfo.setWidget(3, 0, lblNewLabel_1);

    textBoxType = new TextBox();
    gridItemInfo.setWidget(3, 1, textBoxType);
    textBoxType.setReadOnly(true);
    textBoxType.setWidth("97%");

    Label lblNewLabel_2 = new Label(NedRes.instance().itemEditDescription() + ":");
    gridItemInfo.setWidget(4, 0, lblNewLabel_2);

    textAreaDescription = new TextArea();
    gridItemInfo.setWidget(4, 1, textAreaDescription);
    textAreaDescription.setVisibleLines(4);
    textAreaDescription.setCharacterWidth(30);
    textAreaDescription.setSize("97%", "");

    Label lblKeywords = new Label(NedRes.instance().itemEditKeywords() + ":");
    gridItemInfo.setWidget(5, 0, lblKeywords);

    textBoxKeywords = new TextBox();
    gridItemInfo.setWidget(5, 1, textBoxKeywords);
    textBoxKeywords.setVisibleLength(30);
    textBoxKeywords.setWidth("97%");

    Label lblExternalLinks = new Label(NedRes.instance().itemEditExternalLinks() + ":");
    gridItemInfo.setWidget(6, 0, lblExternalLinks);

    textAreaLinks = new TextArea();
    gridItemInfo.setWidget(6, 1, textAreaLinks);
    textAreaLinks.setCharacterWidth(30);
    textAreaLinks.setWidth("97%");

    labelFile = new Label(NedRes.instance().itemFile() + ":");
    gridItemInfo.setWidget(7, 0, labelFile);

    horizontalPanelFile = new HorizontalPanel();
    horizontalPanelFile.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanelFile.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    gridItemInfo.setWidget(7, 1, horizontalPanelFile);
    horizontalPanelFile.setWidth("100%");
    gridItemInfo.getCellFormatter().setWidth(7, 1, "");

    textBoxFile = new TextBox();
    horizontalPanelFile.add(textBoxFile);
    horizontalPanelFile.setCellWidth(textBoxFile, "60%");
    textBoxFile.setReadOnly(true);
    textBoxFile.setWidth("147px");

    buttonUpload = new Button();
    horizontalPanelFile.add(buttonUpload);
    horizontalPanelFile.setCellHorizontalAlignment(buttonUpload, HasHorizontalAlignment.ALIGN_RIGHT);
    horizontalPanelFile.setCellWidth(buttonUpload, "40%");
    buttonUpload.setText(NedRes.instance().uploadDlgUpload());
    buttonUpload.addClickHandler(new CommandUploadFile());
    buttonUpload.setWidth("100%");
    gridItemInfo.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(3, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(4, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(5, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(6, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(7, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
    gridItemInfo.getCellFormatter().setHorizontalAlignment(4, 1, HasHorizontalAlignment.ALIGN_LEFT);
    textAreaLinks.getElement().setAttribute("wrap", "off");

    HorizontalPanel horizontalPanel_4 = new HorizontalPanel();
    horizontalPanel_4.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.add(horizontalPanel_4);
    verticalPanel.setCellVerticalAlignment(horizontalPanel_4, HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_4.setWidth("100%");

    Button buttonSave = new Button("");
    buttonSave.setText(NedRes.instance().save());
    horizontalPanel_4.add(buttonSave);
    horizontalPanel_4.setCellWidth(buttonSave, "25%");
    buttonSave.addClickHandler(new UpdateItemCommand());
    buttonSave.setWidth("100%");

    Button buttonDelete = new Button("");
    buttonDelete.setText(NedRes.instance().delete());
    buttonDelete.addClickHandler(new CommandDeleteItem());
    horizontalPanel_4.add(buttonDelete);
    horizontalPanel_4.setCellHorizontalAlignment(buttonDelete, HasHorizontalAlignment.ALIGN_RIGHT);
    buttonDelete.setWidth("100%");
    horizontalPanel_4.setCellWidth(buttonDelete, "25%");

    // decoratorPanel.add(verticalPanel);
    setVisible(false);
}

From source file:org.wso2.developerstudio.codenvy.core.client.ui.dashboard.page.DashboardPageViewImpl.java

License:Open Source License

/**
 *  generate the dashboard for display//w  w  w.  j  a  v a 2s.  c  o  m
 * @param itemList
 */

@Override
public void generateDashboard(Map<String, List<DashboardItem>> itemList) {
    //for css resource injection
    if (!CoreExtensionResources.INSTANCE.styleCSS().ensureInjected()) {
        //log the error
    }
    ScrollPanel mainBackgroundPanel = new ScrollPanel();
    HorizontalPanel backGroundDashboardPanel = new HorizontalPanel(); // we should ad the common items in a vertical panel into this

    backGroundDashboardPanel.setSpacing(DASHBOARD_SPACING);

    if (!itemList.isEmpty()) {//designing the dashboard
        VerticalPanel dashBoardSectionPanel = new VerticalPanel();
        dashBoardSectionPanel.setStyleName(CATEGORY_STYLE);
        for (Map.Entry<String, List<DashboardItem>> entry : itemList.entrySet()) {
            dashBoardSectionPanel.add(createCategoryHeaderPanel(entry));
            List<DashboardItem> dashBoardList = entry.getValue();
            if (!dashBoardList.isEmpty()) {
                dashBoardSectionPanel.add(createCategory(dashBoardList));
            } else {
                //log : no values for that category
            }
            dashBoardSectionPanel.setBorderWidth(BORDER_WIDTH);
            backGroundDashboardPanel.add(dashBoardSectionPanel);
        }
    } else {
        //log the error
    }
    mainBackgroundPanel.add(backGroundDashboardPanel);
    actionList.addNorth(mainBackgroundPanel, MAIN_BACKGROUND_PANEL_NORTH);
}