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

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

Introduction

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

Prototype

public void setHorizontalAlignment(HorizontalAlignmentConstant align) 

Source Link

Document

Sets the default horizontal alignment to be used for widgets added to this panel.

Usage

From source file:org.jbpm.formbuilder.client.effect.view.L10NEffectView.java

License:Apache License

public L10NEffectView(L10NFormEffect formEffect) {
    this.effect = formEffect;
    VerticalPanel mainPanel = new VerticalPanel();
    HorizontalPanel controlPanel = new HorizontalPanel();
    controlPanel.add(new Label(i18n.FormatAsLabel()));
    formatBox.addItem("...", "");
    formatBox.addItem(i18n.CurrencyFormatLabel(), I18NFormItem.Format.CURRENCY.toString());
    formatBox.addItem(i18n.NumberFormatLabel(), I18NFormItem.Format.NUMBER.toString());
    formatBox.addItem(i18n.DateFormatLabel(), I18NFormItem.Format.DATE.toString());
    formatBox.addItem(i18n.PercentFormatLabel(), I18NFormItem.Format.PERCENT.toString());
    formatBox.addItem(i18n.IntegerFormatLabel(), I18NFormItem.Format.INTEGER.toString());
    String selectedFormat = this.effect.getSelectedFormat();
    if (selectedFormat != null) {
        int selectedIndex = 0;
        for (int index = 0; index < formatBox.getItemCount(); index++) {
            if (formatBox.getValue(index).equals(selectedFormat)) {
                selectedIndex = index;//from   ww  w  .j  ava 2 s . c om
                break;
            }
        }
        formatBox.setSelectedIndex(selectedIndex);
    }
    controlPanel.add(formatBox);
    mainPanel.add(controlPanel);
    HorizontalPanel buttonsPanel = new HorizontalPanel();
    buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    buttonsPanel.add(new Button(i18n.ConfirmButton(), new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            int selectedIndex = formatBox.getSelectedIndex();
            String selectedFormat = formatBox.getValue(selectedIndex);
            effect.setSelectedFormat(selectedFormat);
            effect.createStyles();
            hide();
        }
    }));
    buttonsPanel.add(new Button(i18n.CancelButton(), new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            hide();
        }
    }));
    mainPanel.add(buttonsPanel);
    setWidget(mainPanel);
}

From source file:org.kaaproject.kaa.sandbox.web.client.mvp.view.project.ProjectBundleViewImpl.java

License:Apache License

@Override
protected void initCenterPanel() {

    FlexTable flexTable = new FlexTable();
    flexTable.addStyleName(sandboxStyle.contentPanel());

    flexTable.getColumnFormatter().setWidth(0, "60px");
    flexTable.getColumnFormatter().setWidth(1, "160px");
    flexTable.getColumnFormatter().setWidth(2, "700px");

    backButton.addStyleName(Utils.sandboxStyle.appBackButton());
    backButton.getElement().getStyle().setHeight(180, Unit.PX);
    setBackButton(backButton);/*w  w  w . j a  v  a  2  s . c  o m*/

    flexTable.setWidget(0, 0, backButton);
    flexTable.getFlexCellFormatter().setRowSpan(0, 0, 2);
    flexTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

    bundleTitleLabel = new Label();
    bundleTitleLabel.addStyleName(Utils.sandboxStyle.contentTitleLabel());
    bundleTitleLabel.getElement().getStyle().setPaddingBottom(15, Unit.PX);

    flexTable.setWidget(0, 1, bundleTitleLabel);
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 2);
    flexTable.getFlexCellFormatter().setHeight(0, 1, "51px");

    VerticalPanel iconAndButtons = new VerticalPanel();
    iconAndButtons.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);

    bundleImage = new Image();
    iconAndButtons.add(bundleImage);

    flexTable.setWidget(1, 0, iconAndButtons);
    flexTable.getFlexCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);

    FlexTable appDetailsPanel = new FlexTable();
    appDetailsPanel.getColumnFormatter().setWidth(0, "130px");
    appDetailsPanel.getColumnFormatter().setWidth(1, "610px");

    int row = -1;

    descriptionLabel = new Label();
    descriptionLabel.addStyleName(Utils.sandboxStyle.descriptionLabel());
    appDetailsPanel.setWidget(++row, 0, descriptionLabel);
    appDetailsPanel.getFlexCellFormatter().setColSpan(row, 0, 2);

    Label sdkLanguagesLabel = new Label(Utils.constants.sdkLanguages());
    sdkLanguagesLabel.addStyleName(Utils.sandboxStyle.contentLabel());
    appDetailsPanel.setWidget(++row, 0, sdkLanguagesLabel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 0).getStyle().setPaddingTop(15, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 0, HasVerticalAlignment.ALIGN_TOP);

    sdkLanguagesPanel = new HorizontalPanel();
    appDetailsPanel.setWidget(row, 1, sdkLanguagesPanel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 1).getStyle().setPaddingTop(15, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    Label platformsLabel = new Label(Utils.constants.platforms());
    platformsLabel.addStyleName(Utils.sandboxStyle.contentLabel());
    appDetailsPanel.setWidget(++row, 0, platformsLabel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 0).getStyle().setPaddingTop(15, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 0, HasVerticalAlignment.ALIGN_TOP);

    platformsPanel = new HorizontalPanel();
    appDetailsPanel.setWidget(row, 1, platformsPanel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 1).getStyle().setPaddingTop(15, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    Label featuresLabel = new Label(Utils.constants.features());
    featuresLabel.addStyleName(Utils.sandboxStyle.contentLabel());
    appDetailsPanel.setWidget(++row, 0, featuresLabel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 0).getStyle().setPaddingTop(10, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 0, HasVerticalAlignment.ALIGN_TOP);

    featuresPanel = new HorizontalPanel();
    appDetailsPanel.setWidget(row, 1, featuresPanel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 1).getStyle().setPaddingTop(10, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    Label complexityLabel = new Label(Utils.constants.complexity());
    complexityLabel.addStyleName(Utils.sandboxStyle.contentLabel());
    appDetailsPanel.setWidget(++row, 0, complexityLabel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 0).getStyle().setPaddingTop(10, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 0, HasVerticalAlignment.ALIGN_MIDDLE);

    complexityPanel = new HorizontalPanel();
    appDetailsPanel.setWidget(row, 1, complexityPanel);
    appDetailsPanel.getFlexCellFormatter().getElement(row, 1).getStyle().setPaddingTop(10, Style.Unit.PX);
    appDetailsPanel.getFlexCellFormatter().setVerticalAlignment(row, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    flexTable.setWidget(1, 1, appDetailsPanel);
    flexTable.getFlexCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_TOP);

    projectDetailsPanel = new HTML();
    projectDetailsPanel.addStyleName(Utils.sandboxStyle.projectDetails());
    projectDetailsPanel.getElement().getStyle().setPaddingTop(15, Style.Unit.PX);
    projectDetailsPanel.getElement().getStyle().setPaddingBottom(15, Style.Unit.PX);
    flexTable.setWidget(2, 1, projectDetailsPanel);
    flexTable.getFlexCellFormatter().setColSpan(2, 1, 2);

    carousel = new CarouselWidget();
    HorizontalPanel carouselPanel = new HorizontalPanel();
    carouselPanel.addStyleName(sandboxStyle.bundleProjectsPanel());
    carouselPanel.getElement().getStyle().setPadding(15, Unit.PX);
    carouselPanel.setHeight("330px");
    carouselPanel.setWidth("100%");
    carouselPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    carouselPanel.add(carousel);

    VerticalPanel content = new VerticalPanel();
    content.add(flexTable);
    content.add(carouselPanel);
    content.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    content.getElement().getStyle().setOverflowX(Overflow.AUTO);

    DockLayoutPanel dockPanel = new DockLayoutPanel(Unit.PX);
    dockPanel.add(new ScrollPanel(content));

    centerPanel.add(dockPanel);
    centerPanel.getWidgetContainerElement(dockPanel).getStyle().setOverflowY(Overflow.AUTO);
}

From source file:org.kaaproject.kaa.sandbox.web.client.mvp.view.widget.DemoProjectWidget.java

License:Apache License

public DemoProjectWidget() {
    super();//from  w  ww  .jav a2 s.  c  o  m

    addStyleName(Utils.sandboxStyle.demoProjectWidget());
    setVisible(false);
    projectWidgetAnimation = new ProjectWidgetAnimation(this, 230, 10.0);

    SimplePanel backPanel = new SimplePanel();
    backPanel.addStyleName(Utils.sandboxStyle.projectCard());
    add(backPanel, 20, 20);
    backPanel = new SimplePanel();
    backPanel.addStyleName(Utils.sandboxStyle.projectCard());
    add(backPanel, 10, 10);
    backPanel = new SimplePanel();
    backPanel.addStyleName(Utils.sandboxStyle.projectCard());
    add(backPanel, 0, 0);

    getWidget(0).setVisible(false);
    getWidget(1).setVisible(false);

    VerticalPanel rootPanel = new VerticalPanel();
    rootPanel.setHeight("100%");
    backPanel.add(rootPanel);

    detailsPanel = new VerticalPanel();
    detailsPanel.addStyleName(Utils.sandboxStyle.details());
    detailsPanel.sinkEvents(Event.ONCLICK);

    detailsPanel.setWidth("100%");

    AbsolutePanel layoutPanel = new AbsolutePanel();

    VerticalPanel platformImagePanel = new VerticalPanel();
    platformImagePanel.addStyleName(Utils.sandboxStyle.detailsInnerTop());
    platformImagePanel.setWidth("100%");
    applicationImage = new Image();
    complexityImage = new Image();
    applicationImage.getElement().getStyle().setHeight(128, Unit.PX);
    platformImagePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    platformImagePanel.add(applicationImage);

    layoutPanel.add(platformImagePanel);
    layoutPanel.add(complexityImage, 3, 3);
    SimplePanel platformImageHoverPanel = new SimplePanel();
    platformImageHoverPanel.addStyleName(Utils.sandboxStyle.platformImageHover());
    layoutPanel.add(platformImageHoverPanel);
    platformImageHoverPanel.setSize("100%", "100%");
    layoutPanel.setSize("100%", "100%");

    detailsPanel.add(layoutPanel);
    VerticalPanel titlePanel = new VerticalPanel();
    titlePanel.addStyleName(Utils.sandboxStyle.detailsInnerCenter());
    titlePanel.addStyleName(Utils.sandboxStyle.titlePanel());
    projectTitle = new Anchor();
    projectTitle.addStyleName(Utils.sandboxStyle.title());
    titlePanel.add(projectTitle);
    titlePanel.setCellVerticalAlignment(projectTitle, HasVerticalAlignment.ALIGN_MIDDLE);

    detailsPanel.add(titlePanel);

    rootPanel.add(detailsPanel);

    bottomPanel = new VerticalPanel();
    bottomPanel.setWidth("100%");

    HorizontalPanel iconsPanel = new HorizontalPanel();
    iconsPanel.setWidth("100%");
    iconsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    iconsPanel.addStyleName(Utils.sandboxStyle.detailsInnerCenter());
    iconsPanel.getElement().getStyle().setPaddingTop(10, Unit.PX);
    platformPanel = new HorizontalPanel();
    platformPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    iconsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    iconsPanel.add(platformPanel);

    featuresPanel = new HorizontalPanel();
    featuresPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    iconsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    iconsPanel.add(featuresPanel);

    bottomPanel.add(iconsPanel);

    rootPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    rootPanel.add(bottomPanel);
    rootPanel.setCellHeight(bottomPanel, "100%");
}

From source file:org.kaaproject.kaa.sandbox.web.client.mvp.view.widget.DemoProjectWidget.java

License:Apache License

private void constructButtons(final boolean isBundle) {

    if (!isBundle) {
        HorizontalPanel buttonsPanel = new HorizontalPanel();
        buttonsPanel.setWidth("100%");
        buttonsPanel.addStyleName(Utils.sandboxStyle.detailsInnerBottom());
        buttonsPanel.setWidth("100%");
        buttonsPanel.addStyleName(Utils.sandboxStyle.detailsInnerBottom());
        getSourceButton = new Button(Utils.constants.getSourceCode());
        getSourceButton.addStyleName(Utils.sandboxStyle.action());
        getSourceButton.getElement().getStyle().setMarginRight(20, Unit.PX);
        getBinaryButton = new Button(Utils.constants.getBinary());
        getBinaryButton.addStyleName(Utils.sandboxStyle.action());
        buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        buttonsPanel.add(getSourceButton);
        buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        buttonsPanel.add(getBinaryButton);
        bottomPanel.add(buttonsPanel);/*from  w  w w .  j  a  v  a 2  s. c o  m*/

        getSourceButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (project != null) {
                    ProjectActionEvent action = new ProjectActionEvent(project, ProjectAction.GET_SOURCE_CODE);
                    fireEvent(action);
                }
            }
        });

        getBinaryButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (project != null) {
                    ProjectActionEvent action = new ProjectActionEvent(project, ProjectAction.GET_BINARY);
                    fireEvent(action);
                }
            }
        });
    }

    detailsPanel.addHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (project != null) {
                ProjectActionEvent action = new ProjectActionEvent(project,
                        isBundle ? ProjectAction.OPEN_BUNDLE_DETAILS : ProjectAction.OPEN_DETAILS);
                fireEvent(action);
            }
        }
    }, ClickEvent.getType());
}

From source file:org.kaaproject.kaa.sandbox.web.client.mvp.view.widget.LeftPanelWidget.java

License:Apache License

public LeftPanelWidget(Unit unit) {
    super(unit);//from  ww  w  .jav  a2  s.  c o  m
    addStyleName(Utils.sandboxStyle.leftPanel());
    HorizontalPanel titlePanel = new HorizontalPanel();
    titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    titlePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    titleLabel = new Label();
    titleLabel.addStyleName(Utils.sandboxStyle.title());
    titlePanel.add(titleLabel);
    titlePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    anchor = new Anchor();
    anchor.addStyleName(Utils.sandboxStyle.toggle());
    titlePanel.add(anchor);
    titlePanel.setSize("100%", "100%");
    addNorth(titlePanel, 40);

    contentScroll = new ScrollPanel() {
        @Override
        public void onResize() {
            super.onResize();
            int scrollHeight = this.getScrollableElement().getClientHeight();
            int elementHeight = this.getContainerElement().getClientHeight();
            boolean isScroll = elementHeight > scrollHeight;
            if (isScroll && !(LeftPanelWidget.this.isOpen && LeftPanelWidget.this.isActive)) {
                LeftPanelWidget.this.addStyleName(Utils.sandboxStyle.isScroll());
            } else {
                LeftPanelWidget.this.removeStyleName(Utils.sandboxStyle.isScroll());
            }
        }
    };
    contentScroll.setHeight("100%");
    add(contentScroll);

    addStyleName(Utils.sandboxStyle.isOpen());

    anchor.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (isActive) {
                setOpen(!isOpen, false);
            }
        }
    });
}

From source file:org.kaaproject.kaa.server.admin.client.mvp.view.base.BaseDetailsViewImpl.java

License:Apache License

protected void constructTopPanel() {
    FlowPanel panel = new FlowPanel();
    panel.setSize("100%", "100%");
    topPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    topPanel.add(panel);/*from   w  ww  . j av a 2 s .  com*/
    topPanel.setCellHeight(panel, "100%");
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setHeight("100%");
    panel.add(horizontalPanel);

    HorizontalPanel backButtonPanel = new HorizontalPanel();
    backButtonPanel.setHeight("100%");
    backButtonPanel.addStyleName(Utils.kaaAdminStyle.bAppPaddedPanel());
    backButtonPanel.setVisible(false);
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.add(backButtonPanel);
    horizontalPanel.setCellHeight(backButtonPanel, "100%");

    backButtonPanelWidget = backButtonPanel;

    Button backButton = new Button();
    backButton.addStyleName(Utils.kaaAdminStyle.bAppBackButton());
    backButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    backButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    backButtonPanel.add(backButton);
    backButtonPanel.setCellHeight(backButton, "100%");

    backButtonWidget = backButton;

    Label titleLabel = new Label();
    titleLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.add(titleLabel);
    horizontalPanel.setCellHeight(titleLabel, "100%");

    titleLabelWidget = titleLabel;

    HorizontalPanel buttonsPanel = new HorizontalPanel();
    buttonsPanel.setHeight("100%");
    buttonsPanel.addStyleName(Utils.avroUiStyle.buttonsPanel());
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.add(buttonsPanel);
    horizontalPanel.setCellHeight(buttonsPanel, "100%");

    Button saveButton = new Button();
    buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    buttonsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    buttonsPanel.add(saveButton);
    buttonsPanel.setCellHeight(saveButton, "100%");

    saveButtonWidget = saveButton;

    Button cancelButton = new Button();
    cancelButton.setVisible(false);
    buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    buttonsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    buttonsPanel.add(cancelButton);
    buttonsPanel.setCellHeight(cancelButton, "100%");

    cancelButtonWidget = cancelButton;
}

From source file:org.kaaproject.kaa.server.admin.client.mvp.view.ctl.CtlSchemaViewImpl.java

License:Apache License

@Override
protected void constructTopPanel() {
    FlexTable flexTable = new FlexTable();
    flexTable.setCellSpacing(0);//from ww  w  .j  a  v a 2  s  .  c  o m
    flexTable.setCellPadding(0);
    flexTable.setHeight("100%");
    topPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    topPanel.add(flexTable);
    topPanel.setCellHeight(flexTable, "100%");

    HorizontalPanel backButtonPanel = new HorizontalPanel();
    backButtonPanel.setHeight("100%");
    backButtonPanel.addStyleName(Utils.kaaAdminStyle.bAppPaddedPanel());
    backButtonPanel.setVisible(false);

    flexTable.setWidget(0, 0, backButtonPanel);
    flexTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);

    backButtonPanelWidget = backButtonPanel;

    Button backButton = new Button();
    backButton.addStyleName(Utils.kaaAdminStyle.bAppBackButton());
    backButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    backButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    backButtonPanel.add(backButton);
    backButtonPanel.setCellHeight(backButton, "100%");

    backButtonWidget = backButton;

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setHeight("100%");
    flexTable.setWidget(0, 1, verticalPanel);
    flexTable.getFlexCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    HorizontalPanel firstRowPanel = new HorizontalPanel();
    firstRowPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    firstRowPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.add(firstRowPanel);

    HorizontalPanel secondRowPanel = new HorizontalPanel();
    secondRowPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    secondRowPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    if (!create) {
        backButton.getElement().getStyle().setPaddingTop(25, Unit.PX);
        backButton.getElement().getStyle().setPaddingBottom(25, Unit.PX);
        firstRowPanel.setHeight("45px");
        firstRowPanel.getElement().getStyle().setPaddingBottom(5, Unit.PX);
        secondRowPanel.setHeight("45px");
        topPanel.setHeight("105px");
        topPanel.getElement().getStyle().setPaddingTop(10, Unit.PX);
        updateNorthSize(185);
    } else {
        firstRowPanel.setHeight("70px");
        secondRowPanel.setHeight("100%");
        topPanel.setHeight("80px");
        updateNorthSize(175);
    }
    verticalPanel.add(secondRowPanel);

    Label titleLabel = new Label();
    titleLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
    firstRowPanel.add(titleLabel);
    firstRowPanel.setCellHeight(titleLabel, "100%");

    titleLabelWidget = titleLabel;

    int horizontalMargin = 15;

    scope = new Label();
    scope.getElement().getStyle().setFontSize(16, Unit.PX);
    scope.getElement().getStyle().setFontWeight(FontWeight.NORMAL);
    scope.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    firstRowPanel.add(scope);
    firstRowPanel.setCellHeight(scope, "100%");

    updateSchemaScopeButton = new Button(Utils.constants.promote());
    updateSchemaScopeButton.setVisible(!create && editable);
    updateSchemaScopeButton.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    if (hasUpdateScopeOption()) {
        firstRowPanel.add(updateSchemaScopeButton);
        firstRowPanel.setCellHeight(updateSchemaScopeButton, "100%");
    }

    Label versionLabel = new Label(Utils.constants.version());
    versionLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
    versionLabel.getElement().getStyle().setFontSize(16, Unit.PX);
    versionLabel.getElement().getStyle().setFontWeight(FontWeight.NORMAL);
    version = new IntegerListBox();
    version.getElement().getStyle().setPadding(5, Unit.PX);
    version.getElement().getStyle().setMarginLeft(10, Unit.PX);
    HorizontalPanel versionPanel = new HorizontalPanel();
    versionPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    versionPanel.add(versionLabel);
    versionPanel.add(version);
    versionPanel.setVisible(!create);

    secondRowPanel.add(versionPanel);
    secondRowPanel.setCellHeight(versionPanel, "100%");

    createNewSchemaVersionButton = new Button(Utils.constants.createNewVersion());
    createNewSchemaVersionButton.setVisible(!create && editable);
    createNewSchemaVersionButton.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    if (!create && editable) {
        secondRowPanel.add(createNewSchemaVersionButton);
        secondRowPanel.setCellHeight(createNewSchemaVersionButton, "100%");
    }

    exportActionsButton = new ActionsButton(Utils.resources.export(), Utils.constants.export());
    exportActionsButton.setVisible(!create);
    exportActionsButton.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    if (!create) {
        secondRowPanel.add(exportActionsButton);
        secondRowPanel.setCellHeight(exportActionsButton, "100%");
    }

    Button saveButton = new Button();
    saveButton.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    if (create) {
        firstRowPanel.add(saveButton);
        firstRowPanel.setCellHeight(saveButton, "100%");
    }

    saveButtonWidget = saveButton;

    Button cancelButton = new Button();
    cancelButton.setVisible(false);
    cancelButton.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    if (create) {
        firstRowPanel.add(cancelButton);
        firstRowPanel.setCellHeight(cancelButton, "100%");
    }

    cancelButtonWidget = cancelButton;

    deleteSchemaVersionButton = new Button(Utils.constants.delete());
    deleteSchemaVersionButton.addStyleName(Utils.kaaAdminStyle.deleteButton());
    deleteSchemaVersionButton.setVisible(!create && editable);
    deleteSchemaVersionButton.getElement().getStyle().setMarginLeft(horizontalMargin, Unit.PX);

    if (!create && editable) {
        secondRowPanel.add(deleteSchemaVersionButton);
        secondRowPanel.setCellHeight(deleteSchemaVersionButton, "100%");
    }
}

From source file:org.kie.guvnor.guided.rule.client.editor.factPattern.Connectives.java

License:Apache License

public Widget connectives(SingleFieldConstraint c, String factClass) {
    HorizontalPanel hp = new HorizontalPanel();
    if (c.getConnectives() != null && c.getConnectives().length > 0) {
        hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        for (int i = 0; i < c.getConnectives().length; i++) {

            ConnectiveConstraint con = c.getConnectives()[i];

            hp.add(connectiveOperatorDropDown(con));
            hp.add(connectiveValueEditor(con));

            if (!isReadOnly) {
                Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
                clear.setAltText(Constants.INSTANCE.RemoveThisRestriction());
                clear.setTitle(Constants.INSTANCE.RemoveThisRestriction());
                clear.addClickHandler(createClickHandlerForClearImageButton(c, i));
                hp.add(clear);/*w ww  . java 2s. c om*/
            }

        }
    }
    return hp;

}

From source file:org.kino.client.clean.CleantProjectsWidget.java

public CleantProjectsWidget(String clinet_id) {

    try {//w w  w.  ja v a 2s . co  m
        int id = Integer.parseInt(clinet_id);
        current_id = id;
    } catch (NumberFormatException e) {
        CenterLayoutContainer msg_bg = new CenterLayoutContainer();
        HTML html = new HTML(
                "<font color='red'>?  ?</font>");
        msg_bg.add(html);
        cartLay.add(msg_bg);
        cartLay.setActiveWidget(msg_bg);
        return;
    }

    CenterLayoutContainer msg_bg = new CenterLayoutContainer();
    VerticalPanel panel = new VerticalPanel();
    panel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    panel.add(new HTML("?..."));
    panel.add(new Image(Resources.INSTANCE.loading_bar()));
    msg_bg.add(panel, new MarginData(15));

    cartLay.add(msg_bg);
    cartLay.add(border);

    HorizontalPanel hor = new HorizontalPanel();
    hor.setHeight("40px");
    hor.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    hor.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
    hor.add(new HTML("? ?"));

    hor.getElement().getStyle().setBackgroundColor("#FDD");

    border.setNorthWidget(hor, new BorderLayoutContainer.BorderLayoutData(25));
    final ContentPanel cenPanel = new ContentPanel();
    cenPanel.setHeaderVisible(false);

    cenPanel.add(vert);
    cenPanel.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            vert.forceLayout();
        }
    });

    border.setCenterWidget(cenPanel);

    GWTServiceAsync.instance.getTheaterMainData(current_id,
            new CallbackWithFailureDialog<TheaterW.TheaterMainData>(
                    "? ?   ") {

                @Override
                public void onSuccess(TheaterW.TheaterMainData result) {
                    if (result != null) {

                        init(result);
                        cartLay.setActiveWidget(border);
                        cartLay.forceLayout();
                    } else {

                        CenterLayoutContainer msg_bg = new CenterLayoutContainer();
                        HTML html = new HTML("<font color='red'>  </font>");
                        msg_bg.add(html);
                        cartLay.add(msg_bg);
                        cartLay.setActiveWidget(msg_bg);

                    }

                }
            });

}

From source file:org.kino.client.monitoring.ConreteProjectInfo.java

public ConreteProjectInfo(String project_id) {

    try {/*from  w ww  .java2 s.c  o m*/
        int id = Integer.parseInt(project_id);
        current_id = id;
    } catch (NumberFormatException e) {
        CenterLayoutContainer msg_bg = new CenterLayoutContainer();
        HTML html = new HTML(
                "<font color='red'>?  </font>");
        msg_bg.add(html);
        cartLay.add(msg_bg);
        cartLay.setActiveWidget(msg_bg);
        return;
    }

    CenterLayoutContainer msg_bg = new CenterLayoutContainer();
    VerticalPanel panel = new VerticalPanel();
    panel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    panel.add(new HTML("?..."));
    panel.add(new Image(Resources.INSTANCE.loading_bar()));
    msg_bg.add(panel, new MarginData(15));

    cartLay.add(msg_bg);
    cartLay.add(border);

    HorizontalPanel hor = new HorizontalPanel();
    hor.setHeight("40px");
    hor.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    hor.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
    hor.add(new HTML("? ?  "));

    hor.getElement().getStyle().setBackgroundColor("#DFD");

    border.setNorthWidget(hor, new BorderLayoutContainer.BorderLayoutData(25));
    final ContentPanel cenPanel = new ContentPanel();
    cenPanel.setHeaderVisible(false);

    cenPanel.add(vert);
    cenPanel.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            vert.forceLayout();
        }
    });

    border.setCenterWidget(cenPanel);

    GWTServiceAsync.instance.getProject(current_id,
            new CallbackWithFailureDialog<ConreteProjectInfo.ConcreteInfo>(
                    "? ?   ") {

                @Override
                public void onSuccess(ConreteProjectInfo.ConcreteInfo result) {
                    if (result != null) {

                        init(result);
                        cartLay.setActiveWidget(border);
                        cartLay.forceLayout();
                    } else {

                        CenterLayoutContainer msg_bg = new CenterLayoutContainer();
                        HTML html = new HTML("<font color='red'>  </font>");
                        msg_bg.add(html);
                        cartLay.add(msg_bg);
                        cartLay.setActiveWidget(msg_bg);

                    }

                }
            });

}