protected void appendToolbarWidget(Widget widget) { buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); buttonsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); buttonsPanel.add(widget); buttonsPanel.setCellHeight(widget, "100%"); }
panel.setSize("100%", "100%"); topPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); topPanel.add(panel); topPanel.setCellHeight(panel, "100%"); backButtonPanel.setVisible(false); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.add(backButtonPanel); horizontalPanel.setCellHeight(backButtonPanel, "100%"); backButton.addStyleName(Utils.kaaAdminStyle.bAppBackButton()); backButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); backButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); backButtonPanel.add(backButton); backButtonPanel.setCellHeight(backButton, "100%"); titleLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitle()); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.add(titleLabel); horizontalPanel.setCellHeight(titleLabel, "100%"); buttonsPanel.addStyleName(Utils.avroUiStyle.buttonsPanel()); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.add(buttonsPanel); horizontalPanel.setCellHeight(buttonsPanel, "100%");
HorizontalPanel groupPanel = new HorizontalPanel(); groupPanel.setSpacing(15); groupPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); groupPanel.add(endpointGroupButton); groupPanel.add(listBox); keyHashPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); endpointKeyHashButton = new RadioButton("filter", Utils.constants.endpointKeyHash()); endpointKeyHash = new TextBox();
flexTable.setHeight("100%"); topPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); topPanel.add(flexTable); topPanel.setCellHeight(flexTable, "100%"); backButton.addStyleName(Utils.kaaAdminStyle.bAppBackButton()); backButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); backButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); backButtonPanel.add(backButton); backButtonPanel.setCellHeight(backButton, "100%"); firstRowPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(firstRowPanel); secondRowPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); version.getElement().getStyle().setMarginLeft(10, Unit.PX); HorizontalPanel versionPanel = new HorizontalPanel(); versionPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); versionPanel.add(versionLabel); versionPanel.add(version);
schemaNamePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); Label endpointProfSchemaLabel = new Label(Utils.constants.schemaName()); schemaNamePanel.add(endpointProfSchemaLabel); schemaNamePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); Label serverProfSchemaLabel = new Label(Utils.constants.schemaName()); schemaNamePanel.add(serverProfSchemaLabel); schemaNamePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); Label endpointConfSchemaLabel = new Label(Utils.constants.schemaName()); schemaNamePanel.add(endpointConfSchemaLabel);
private void setStyles() { content.addStyleName("programActionPanel"); content.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); }
/** * Getter for property 'panel'. * * @return Value for property 'panel'. */ protected HorizontalPanel getPanel() { if (panel == null) { panel = new HorizontalPanel(); panel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); } return panel; } }
mainPanel.add(bottomBar); bottomBar.setWidth("100%"); bottomBar.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
/** * Creates an empty tab bar. */ public TabBar() { initWidget(panel); sinkEvents(Event.ONCLICK); setStyleName("gwt-TabBar"); // Add a11y role "tablist" Roles.getTablistRole().set(panel.getElement()); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); HTML first = new HTML(" ", true), rest = new HTML(" ", true); first.setStyleName("gwt-TabBarFirst"); rest.setStyleName("gwt-TabBarRest"); first.setHeight("100%"); rest.setHeight("100%"); panel.add(first); panel.add(rest); first.setHeight("100%"); panel.setCellHeight(first, "100%"); panel.setCellWidth(rest, "100%"); setStyleName(first.getElement().getParentElement(), "gwt-TabBarFirst-wrapper"); setStyleName(rest.getElement().getParentElement(), "gwt-TabBarRest-wrapper"); }
private Panel widgets(IsWidget left, IsWidget right) { HorizontalPanel panel = new HorizontalPanel(); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); panel.add(left); panel.add(right); panel.setWidth("100%"); return panel; }
private Panel widgets(IsWidget left, IsWidget right) { HorizontalPanel panel = new HorizontalPanel(); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); panel.add(left); panel.add(right); panel.setWidth("100%"); return panel; }
private Panel widgets( Widget left, Widget right ) { HorizontalPanel panel = new HorizontalPanel(); panel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE ); panel.add( left ); panel.add( right ); panel.setWidth( "100%" ); return panel; }
@Test public void testMakeMetaDataWidgetWhenDecisionTableIsNotEditable() { final HorizontalPanel expectedHorizontalPanel = mock(HorizontalPanel.class); final ColumnLabelWidget columnLabelWidget = mock(ColumnLabelWidget.class); final CheckBox hideColumnCheckBox = mock(CheckBox.class); final DeleteColumnManagementAnchorWidget deleteColumnManagementAnchorWidget = mock(DeleteColumnManagementAnchorWidget.class); final boolean isEditable = false; doReturn(expectedHorizontalPanel).when(presenter).makeHorizontalPanel(); doReturn(columnLabelWidget).when(presenter).makeColumnLabel(metadataColumn); doReturn(hideColumnCheckBox).when(presenter).hideColumnCheckBox(modeller, metadataColumn); doReturn(deleteColumnManagementAnchorWidget).when(presenter).deleteMetaDataColumnAnchor(modeller, metadataColumn); doReturn(isEditable).when(modeller).isActiveDecisionTableEditable(); final HorizontalPanel actualHorizontalPanel = presenter.makeMetaDataWidget(modeller, metadataColumn); verify(actualHorizontalPanel).setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verify(actualHorizontalPanel).add(columnLabelWidget); verify(actualHorizontalPanel).add(hideColumnCheckBox); verify(actualHorizontalPanel, never()).add(deleteColumnManagementAnchorWidget); assertEquals(expectedHorizontalPanel, actualHorizontalPanel); }
@Test public void testMakeMetaDataWidgetWhenDecisionTableIsEditable() { final HorizontalPanel expectedHorizontalPanel = mock(HorizontalPanel.class); final ColumnLabelWidget columnLabelWidget = mock(ColumnLabelWidget.class); final CheckBox hideColumnCheckBox = mock(CheckBox.class); final DeleteColumnManagementAnchorWidget deleteColumnManagementAnchorWidget = mock(DeleteColumnManagementAnchorWidget.class); final boolean isEditable = true; doReturn(expectedHorizontalPanel).when(presenter).makeHorizontalPanel(); doReturn(columnLabelWidget).when(presenter).makeColumnLabel(metadataColumn); doReturn(hideColumnCheckBox).when(presenter).hideColumnCheckBox(modeller, metadataColumn); doReturn(deleteColumnManagementAnchorWidget).when(presenter).deleteMetaDataColumnAnchor(modeller, metadataColumn); doReturn(isEditable).when(modeller).isActiveDecisionTableEditable(); final HorizontalPanel actualHorizontalPanel = presenter.makeMetaDataWidget(modeller, metadataColumn); verify(actualHorizontalPanel).setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verify(actualHorizontalPanel).add(columnLabelWidget); verify(actualHorizontalPanel).add(hideColumnCheckBox); verify(actualHorizontalPanel).add(deleteColumnManagementAnchorWidget); assertEquals(expectedHorizontalPanel, actualHorizontalPanel); }
private HeaderSorter( final DynamicColumn<BaseColumn> col ) { this.col = col; hp.setHorizontalAlignment( HorizontalPanel.ALIGN_CENTER ); hp.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE ); hp.setHeight( resources.rowHeaderSorterHeight() + "px" ); hp.setWidth( "100%" ); setIconImage(); add( hp ); // Ensure our icon is updated when the SortDirection changes col.addValueChangeHandler( new ValueChangeHandler<SortConfiguration>() { public void onValueChange( ValueChangeEvent<SortConfiguration> event ) { setIconImage(); } } ); }
HorizontalPanel makeMetaDataWidget(final GuidedDecisionTableModellerView.Presenter modeller, final MetadataCol52 metaDataColumn) { final HorizontalPanel horizontalPanel = makeHorizontalPanel(); final ColumnLabelWidget label = makeColumnLabel(metaDataColumn); final boolean isEditable = modeller.isActiveDecisionTableEditable(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.add(label); horizontalPanel.add(hideColumnCheckBox(modeller, metaDataColumn)); if (isEditable) { horizontalPanel.add(deleteMetaDataColumnAnchor(modeller, metaDataColumn)); } return horizontalPanel; }
private HeaderSorter( final DynamicColumn<TemplateDataColumn> col ) { this.col = col; hp.setHorizontalAlignment( HorizontalPanel.ALIGN_CENTER ); hp.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE ); hp.setHeight( resources.rowHeaderSorterHeight() + "px" ); hp.setWidth( "100%" ); setIconImage(); add( hp ); // Ensure our icon is updated when the SortDirection changes col.addValueChangeHandler( new ValueChangeHandler<SortConfiguration>() { public void onValueChange( ValueChangeEvent<SortConfiguration> event ) { setIconImage(); } } ); }
HorizontalPanel makeMetaDataWidget(final GuidedDecisionTableModellerView.Presenter modeller, final MetadataCol52 metaDataColumn) { final HorizontalPanel horizontalPanel = makeHorizontalPanel(); final ColumnLabelWidget label = makeColumnLabel(metaDataColumn); final boolean isEditable = modeller.isActiveDecisionTableEditable(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.add(label); horizontalPanel.add(hideColumnCheckBox(modeller, metaDataColumn)); if (isEditable) { horizontalPanel.add(deleteMetaDataColumnAnchor(modeller, metaDataColumn)); } return horizontalPanel; }
layout.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); initWidget(layout); if (location == TextLocation.LEFT) {
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 ); } } } return hp; }