Refine search
Grid grid = new Grid(); HTMLTable.CellFormatter formatter = grid.getCellFormatter(); formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); formatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
removeCell(i, j); insertCell(i, j); getColumnFormatter().resizeColumnGroup(columns, false);
/** * Resizes the grid to the specified number of rows. * * @param rows the number of rows * @throws IndexOutOfBoundsException */ public void resizeRows(int rows) { if (numRows == rows) { return; } if (rows < 0) { throw new IndexOutOfBoundsException("Cannot set number of rows to " + rows); } if (numRows < rows) { addRows(getBodyElement(), rows - numRows, numColumns); numRows = rows; } else { while (numRows > rows) { // Fewer rows. Remove extraneous ones. removeRow(numRows - 1); } } }
@Override public void onBind(IWidgetProvider widgetProvider) { Label lbl = new Label(); lbl.getElement().setAttribute("style", "font-weight:bold;font-size:14px;"); lbl.setText(getTitle()); vp.add(lbl); ArrayList<LabelWidgetPair> allLabelWidgetPair = new ArrayList<LabelWidgetPair>(); allLabelWidgetPair.addAll(getPairs(widgetProvider)); Grid grid = new Grid(allLabelWidgetPair.size(),2); for(int i=0;i<=allLabelWidgetPair.size()-1;i++){ LabelWidgetPair lwp = allLabelWidgetPair.get(i); grid.setWidget(i, 0, new Label(lwp.getLabel())); grid.setWidget(i, 1, lwp.getWidget()); } vp.add(grid); }
m_grid = new Grid(5, 3); m_grid.setStyleName("topoHudDisplay"); m_grid.setWidget(0,0, m_providerLabel); Label vertexLabel = new Label("Vertices"); m_grid.setWidget(0,1, vertexLabel); Label edgeLabel = new Label("Edges"); m_grid.setWidget(0,2, edgeLabel); Label focusLabel = new Label("Focus"); m_grid.setWidget(1, 0, focusLabel); m_grid.setWidget(1, 1, m_vertexFocusLabel); m_grid.setWidget(1, 2, m_edgeFocusLabel); Label selectionLabel = new Label("Selection"); m_grid.setWidget(2, 0, selectionLabel); m_grid.setWidget(2, 1, m_vertexSelectionLabel); m_grid.setWidget(2, 2, m_edgeSelectionLabel); Label contextLabel = new Label("Context"); m_grid.setWidget(3, 0, contextLabel); m_grid.setWidget(3, 1, m_vertexContextLabel); m_grid.setWidget(3, 2, m_edgeContextLabel); Label totalLabel = new Label("Total"); m_grid.setWidget(4, 0, totalLabel); m_grid.setWidget(4, 1, m_vertexTotalLabel); m_grid.setWidget(4, 2, m_edgeTotalLabel);
private void initReset() { for (int i = 0; i < fieldNames.length; i++) { Label label = new Label(fieldNames[i]); label.setStyleName("soa-prop-grid-label"); grid.setWidget(i, 0, label); grid.setWidget(i, 1, new HTML("")); String style = (i % 2 == 0) ? "soa-prop-grid-even" : "soa-prop-grid-odd"; grid.getRowFormatter().setStyleName(i, style); grid.getColumnFormatter().setWidth(0, "20%"); grid.getColumnFormatter().setWidth(1, "80%"); } }
public void update(String[] fieldValues) { if (fieldValues.length != fieldNames.length) throw new IllegalArgumentException("fieldValues.length doesn't match fieldName.length: " + fieldNames); for (int i = 0; i < fieldNames.length; i++) { Label label = new Label(fieldNames[i]); label.setStyleName("soa-prop-grid-label"); grid.setWidget(i, 0, label); grid.setWidget(i, 1, new HTML(fieldValues[i])); } }
this.mainGrid = new Grid(3,3); this.messageTypeImg.setStyleName("message-type"); this.titleLbl = new Label(); this.titleLbl.setStyleName("title"); this.mainGrid.getCellFormatter().getElement(0, 0).addClassName("notification-topleft"); this.mainGrid.getCellFormatter().getElement(0, 1).addClassName("notification-top"); this.mainGrid.getCellFormatter().getElement(0, 2).addClassName("notification-topright"); this.mainGrid.getCellFormatter().getElement(1, 0).addClassName("notification-left"); this.mainGrid.getCellFormatter().getElement(1, 2).addClassName("notification-right"); this.mainGrid.getCellFormatter().getElement(1, 1).addClassName("notification-content"); this.mainGrid.getCellFormatter().getElement(2, 2).addClassName("notification-bottomright"); this.mainGrid.getCellFormatter().getElement(2, 0).addClassName("notification-bottomleft"); this.mainGrid.getCellFormatter().getElement(2, 1).addClassName("notification-bottom"); this.mainGrid.setWidget(1, 1, contentLayout);
/*************************************** * {@inheritDoc} */ @Override public void addPage(Component rGroupComponent, String sGroupTitle, boolean bCloseable) { Widget rTabContent = rGroupComponent.getWidget(); sGroupTitle = rContext.expandResource(sGroupTitle); if (bCloseable) { Grid aTabWidgets = new Grid(1, 2); Button aCloseButton = new Button("x"); aTabWidgets.setWidget(0, 0, new Label(sGroupTitle)); aTabWidgets.setWidget(0, 1, aCloseButton); aCloseButton.addClickHandler(new TabCloseHandler(rTabContent)); aTabPanel.add(rTabContent, aTabWidgets); } else { aTabPanel.add(rTabContent, sGroupTitle); } if (aTabPanel.getWidgetCount() == 1) { aTabPanel.selectTab(0); } }
/** * @param rfl List<VeryfyRuleFired> * @param scenario = the scenario to add/remove from */ public VerifyRulesFiredWidget(final FixtureList rfl, final Scenario scenario, boolean showResults) { outer = new Grid( 2, 1 ); this.showResults = showResults; outer.getCellFormatter().setStyleName( 0, 0, "modeller-fact-TypeHeader" ); //NON-NLS outer.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE ); outer.setStyleName( "modeller-fact-pattern-Widget" ); //NON-NLS outer.setWidget( 0, 0, new SmallLabel( TestScenarioConstants.INSTANCE.ExpectRules() ) ); initWidget( outer ); FlexTable data = render( rfl, scenario ); outer.setWidget( 1, 0, data ); }
private Widget getRuleAttributesPanel() { ruleAttributesGrid = new Grid(2, 4); ruleAttributesGrid.setCellSpacing(5); ruleAttributesGrid.setCellPadding(5); ruleAttributesGrid.setText(0, 0, GuidedScoreCardConstants.INSTANCE.ruleFlowGroup()); ruleAttributesGrid.setText(0, 1, GuidedScoreCardConstants.INSTANCE.agendaGroup()); final String ruleFlowGroup = model.getRuleFlowGroup(); final String agendaGroup = model.getAgendaGroup(); tbRuleFlowGroup = TextBoxFactory.getTextBox(DataType.TYPE_STRING); if (!(ruleFlowGroup == null || ruleFlowGroup.isEmpty())) { tbRuleFlowGroup.setText(ruleFlowGroup); } tbAgendaGroup = TextBoxFactory.getTextBox(DataType.TYPE_STRING); if (!(agendaGroup == null || agendaGroup.isEmpty())) { tbAgendaGroup.setText(agendaGroup); } ruleAttributesGrid.setWidget(1, 0, tbRuleFlowGroup); ruleAttributesGrid.setWidget(1, 1, tbAgendaGroup); return ruleAttributesGrid; }
aNextYearButton.addClickHandler(new MonthChangeClickHandler(12)); aMonthLabel.setStyleName("datePickerMonth"); aMonthLabel.addDoubleClickHandler(new DoubleClickHandler() Grid aGrid = new Grid(1, 5); aGrid.setStyleName(CSS.datePickerMonthSelector()); aGrid.setWidget(0, COL_PREV_YEAR, aPrevYearButton); aGrid.setWidget(0, COL_PREV_MONTH, aPrevMonthButton); aGrid.setWidget(0, COL_MONTH, aMonthLabel); aGrid.setWidget(0, COL_NEXT_MONTH, aNextMonthButton); aGrid.setWidget(0, COL_NEXT_YEAR, aNextYearButton); CellFormatter rFormatter = aGrid.getCellFormatter(); Grid aPanel = new Grid(2, 1); aPanel.setWidth("100%"); aPanel.setWidget(0, 0, aTimePicker); aPanel.setWidget(1, 0, aGrid); aPanel.getCellFormatter() .addStyleName(0, 0, CSS.ewtTimePicker()); aPanel.getCellFormatter() .setHorizontalAlignment(0, 0,
/** * Builds the panel containing customizations for the axes of the graph. */ private Grid makeAxesPanel() { final Grid grid = new Grid(5, 3); grid.setText(0, 1, "Y"); grid.setText(0, 2, "Y2"); setTextAlignCenter(grid.getRowFormatter().getElement(0)); grid.setText(1, 0, "Label"); grid.setWidget(1, 1, ylabel); grid.setWidget(1, 2, y2label); grid.setText(2, 0, "Format"); grid.setWidget(2, 1, yformat); grid.setWidget(2, 2, y2format); grid.setText(3, 0, "Range"); grid.setWidget(3, 1, yrange); grid.setWidget(3, 2, y2range); grid.setText(4, 0, "Log scale"); grid.setWidget(4, 1, ylog); grid.setWidget(4, 2, y2log); setTextAlignCenter(grid.getCellFormatter().getElement(4, 1)); setTextAlignCenter(grid.getCellFormatter().getElement(4, 2)); return grid; }
var myGrid = new Grid("#grid1"); $('#actionPopupButton').click(function(){ myGrid.popup("ajax/test.html", function(data){ // do instance-specific stuff here }); });
public DurationFilterConfig() { grid = new Grid(2, 2); grid.setWidget(0, 0, createFormLabel("Minimum")); grid.setWidget(0, 1, min = createTextBox(5)); grid.setWidget(1, 0, createFormLabel("Maximum")); grid.setWidget(1, 1, max = createTextBox(5)); addValueChangeHandler(new ValueChangeHandler<Config>() { //@Override public void onValueChange(ValueChangeEvent<Config> event) { min.setText(Integer.toString(getMinDuration())); max.setText(Integer.toString(getMaxDuration())); } }); }
final Grid layout = new Grid( 1, 2 ); layout.setWidget( 0, 0, browser ); layout.setWidget( 0, 1, ruleContentWidget ); layout.getColumnFormatter().setWidth( 0, "10%" ); layout.getColumnFormatter().setWidth( 1, "90%" ); layout.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP ); layout.getCellFormatter().setAlignment( 0, 1, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP ); layout.setWidth( "95%" );
days = new Grid(1, 7); days.setStyleName("x-date-days"); days.setCellPadding(0); days.setCellSpacing(0); days.setBorderWidth(0); days.setHTML(0, 0, "<span>" + dn[(0 + firstDOW) % 7] + "</span>"); days.setHTML(0, 1, "<span>" + dn[(1 + firstDOW) % 7] + "</span>"); days.setHTML(0, 2, "<span>" + dn[(2 + firstDOW) % 7] + "</span>"); days.setHTML(0, 3, "<span>" + dn[(3 + firstDOW) % 7] + "</span>"); days.setHTML(0, 4, "<span>" + dn[(4 + firstDOW) % 7] + "</span>"); days.setHTML(0, 5, "<span>" + dn[(5 + firstDOW) % 7] + "</span>"); days.setHTML(0, 6, "<span>" + dn[(6 + firstDOW) % 7] + "</span>"); days.getRowFormatter().getElement(0).setAttribute("role", "row"); days.getCellFormatter().getElement(0, i).setAttribute("role", "columnheader"); days.getCellFormatter().getElement(0, i).setAttribute("aria-label", longdn[i]); grid = new Grid(6, 7); grid.setStyleName("x-date-inner"); grid.setCellSpacing(0); grid.setCellPadding(0); grid.addClickHandler(new ClickHandler() { for (int row = 0; row < 6; row++) { if (GXT.isAriaEnabled()) { grid.getRowFormatter().getElement(row).setAttribute("role", "row");
@Override public void setWidget( Widget widget ) { table.setWidget( row, column, widget ); } }
final Grid grid = new Grid(2, 9); grid.setWidget(0, 0, newShiftDateButton(-3600, "1h")); grid.setWidget(0, 1, newShiftDateButton(-600, "10m")); grid.setWidget(0, 2, newShiftDateButton(-60, "1m")); grid.setWidget(0, 3, new InlineHTML("‹")); grid.setWidget(0, 4, now); grid.setWidget(0, 5, new InlineHTML("›")); grid.setWidget(0, 6, newShiftDateButton(+60, "1m")); grid.setWidget(0, 7, newShiftDateButton(+600, "10m")); grid.setWidget(0, 8, newShiftDateButton(+3600, "1h")); grid.setWidget(1, 0, newShiftDateButton(-86400 * 30, "30d")); grid.setWidget(1, 1, newShiftDateButton(-86400 * 7, "1w")); grid.setWidget(1, 2, newShiftDateButton(-86400, "1d")); grid.setWidget(1, 3, new InlineHTML("«")); grid.setWidget(1, 4, new InlineHTML(" ")); grid.setWidget(1, 5, new InlineHTML("»")); grid.setWidget(1, 6, newShiftDateButton(+86400, "1d")); grid.setWidget(1, 7, newShiftDateButton(+86400 * 7, "1w")); grid.setWidget(1, 8, newShiftDateButton(+86400 * 30, "30d")); final CellFormatter formatter = grid.getCellFormatter(); formatter.setWidth(0, 4, "100%"); formatter.setWidth(1, 4, "100%"); hours_minutes = new Grid(4, 8); setupAmUI(); hours_minutes.setWidget(0, 0, new InlineLabel("HH")); final PushButton set_am = new PushButton("AM"); set_am.addClickHandler(new ClickHandler() {