private void render(final FixtureList retList, final FlexTable outer, final Scenario sc) { outer.clear(); outer.getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader"); outer .getCellFormatter() .setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE); outer.setStyleName("modeller-fact-pattern-Widget"); outer.setWidget(0, 0, new SmallLabel(Constants.INSTANCE.ActivateRuleFlowGroup())); outer.getFlexCellFormatter().setColSpan(0, 0, 2); int row = 1; for (Fixture fixture : retList) { final ActivateRuleFlowGroup acticateRuleFlowGroup = (ActivateRuleFlowGroup) fixture; outer.setWidget(row, 0, new SmallLabel(acticateRuleFlowGroup.getName())); Image del = new ImageButton( DroolsGuvnorImages.INSTANCE.itemImages().deleteItemSmall(), Constants.INSTANCE.RemoveThisRuleFlowActivation(), new ClickHandler() { public void onClick(ClickEvent w) { retList.remove(acticateRuleFlowGroup); sc.getFixtures().remove(acticateRuleFlowGroup); render(retList, outer, sc); parent.renderEditor(); } }); outer.setWidget(row, 1, del); row++; } }
private void appendRow(Row row) { if (row.object == null) { Widget groupWidget; try { groupWidget = createGroupWidget(row.group); } catch (Exception ex) { throw new RuntimeException(Str.getSimpleName(getClass()) + "getGroupWidget() failed"); } table.setWidget(row.tableRowIndex, 0, groupWidget); table.getFlexCellFormatter().setColSpan(row.tableRowIndex, 0, columns.size()); } else { for (AColumn column : columns) { table.setWidget(row.tableRowIndex, column.index, column.getCellWidget(row.object)); column.formatCell(row.tableRowIndex, row.object, table.getCellFormatter()); } if (isClickable()) { switch (getMouseover()) { case ROW: table.getRowFormatter().setStyleName(row.tableRowIndex, "clickable"); break; case CELL: for (int col = 0; col < columns.size(); col++) { if (isColumnClickable(col)) { table.getCellFormatter().setStyleName(row.tableRowIndex, col, "clickable"); } } break; case NONE: break; } } } }
public SubGoalDialogBox( final Command riksPane, List<GwtSubGoal> allSubGoals, List<GwtSubGoal> curretSelectedSubGoals) { // Set the dialog box's caption. setText(messages.associateGoals()); this.allSubGoals = allSubGoals; this.oldSelectedSubGoals = curretSelectedSubGoals; final VerticalPanel checkBoxContainer = new VerticalPanel(); checkBoxContainer.setSpacing(10); for (GwtSubGoal a : allSubGoals) { SubGoalCheckBox checkBox = new SubGoalCheckBox(); checkBox.setText(a.getDescription()); checkBox.setSubGoalID(a.getId()); if (isCurrentSubGoalSelected(a.getId())) { checkBox.setValue(true); } checkBoxContainer.add(checkBox); } Button ok = new Button(messages.ok()); Button cancel = new Button(messages.cancel()); cancel.setWidth("60px"); ok.setWidth("60px"); FlexTable buttonsTable = new FlexTable(); buttonsTable.setWidth("100%"); buttonsTable.setCellPadding(3); buttonsTable.setWidget(0, 0, ok); buttonsTable.setWidget(0, 1, cancel); buttonsTable .getCellFormatter() .setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); buttonsTable.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT); ok.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { loadSelectedSubGoals(checkBoxContainer); riksPane.execute(); SubGoalDialogBox.this.hide(); } }); cancel.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { SubGoalDialogBox.this.hide(); } }); checkBoxContainer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); checkBoxContainer.add(buttonsTable); setWidget(checkBoxContainer); }
private void displayStock(final String finalSymbol) { // Add the task to the table. int row = tasksFlexTable.getRowCount(); tasks.add(finalSymbol); tasksFlexTable.setText(row, 0, finalSymbol); tasksFlexTable.setWidget(row, 2, new Label()); tasksFlexTable.getCellFormatter().addStyleName(row, 1, "watchListNumericColumn"); tasksFlexTable.getCellFormatter().addStyleName(row, 2, "watchListNumericColumn"); tasksFlexTable.getCellFormatter().addStyleName(row, 3, "watchListRemoveColumn"); // Add a button to remove this task from the table. Button removeTaskButton = new Button("x"); removeTaskButton.addStyleDependentName("remove"); removeTaskButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { removeStock(finalSymbol); } }); tasksFlexTable.setWidget(row, 3, removeTaskButton); // Get the stock price. refreshWatchList(); newTaskTextBox.setFocus(true); }
/** * Render the cell located at <code>column</code>, <code>row</code> * * @param row * @param column * @param date * @param currentMonth */ private void drawCell(int row, int column, Date date, int currentMonth) { final Label header = new Label(dayFormatter.format(date)); header.addStyleName("calendar-cell-header"); final FlexTable grid = (FlexTable) getWidget(); grid.getCellFormatter().setStyleName(row, column, "calendar-cell"); FlowPanel cell = (FlowPanel) grid.getWidget(row, column); if (cell == null) { // New cell cell = new FlowPanel(); cell.setWidth("100%"); grid.setWidget(row, column, cell); } else { // Reusing an existing cell cell.clear(); } if (currentMonth != date.getMonth()) grid.getCellFormatter().addStyleName(row, column, "calendar-cell-other-month"); if (date.equals(today)) grid.getCellFormatter().addStyleName(row, column, "calendar-cell-today"); cell.add(header); }
public WeaponsView() { DecoratorPanel contentTableDecorator = new DecoratorPanel(); initWidget(contentTableDecorator); contentTableDecorator.setWidth("100%"); contentTableDecorator.setWidth("15em"); contentTable = new FlexTable(); contentTable.setWidth("100%"); contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListContainer"); contentTable.getCellFormatter().setWidth(0, 0, "100%"); contentTable.getFlexCellFormatter().setVerticalAlignment(0, 0, DockPanel.ALIGN_TOP); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setBorderWidth(0); hPanel.setSpacing(0); hPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT); addButton = new Button("增加"); hPanel.add(addButton); deleteButton = new Button("删除"); hPanel.add(deleteButton); contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListMenu"); contentTable.setWidget(0, 0, hPanel); contactsTable = new FlexTable(); contactsTable.setCellSpacing(0); contactsTable.setCellPadding(0); contactsTable.setWidth("100%"); contactsTable.addStyleName("contacts-ListContents"); contactsTable.getColumnFormatter().setWidth(0, "15px"); contentTable.setWidget(1, 0, contactsTable); contentTableDecorator.add(contentTable); }
private void addStylesToElementsInStockList() { stocksFlexTable.getRowFormatter().addStyleName(0, "watchListHeader"); stocksFlexTable.addStyleName("watchList"); stocksFlexTable.getCellFormatter().addStyleName(0, 1, "watchListNumericColumn"); stocksFlexTable.getCellFormatter().addStyleName(0, 2, "watchListNumericColumn"); stocksFlexTable.getCellFormatter().addStyleName(0, 3, "watchListRemoveColumn"); stocksFlexTable.setCellPadding(6); }
private int addStockToWatchList(String symbol) { int row = stocksFlexTable.getRowCount(); stocks.add(symbol); stocksFlexTable.setText(row, 0, symbol); stocksFlexTable.setWidget(row, 2, new Label()); stocksFlexTable.getCellFormatter().addStyleName(row, 1, "watchListNumericColumn"); stocksFlexTable.getCellFormatter().addStyleName(row, 2, "watchListNumericColumn"); stocksFlexTable.getCellFormatter().addStyleName(row, 3, "watchListRemoveColumn"); return row; }
public SettingsPageGenerated() { FlowPanel flowPanel = new FlowPanel(); flowPanel.setStyleName("gwt-SettingsPage"); initWidget(flowPanel); flowPanel.setSize("100%", "100%"); FlowPanel flowPanel_1 = new FlowPanel(); flowPanel.add(flowPanel_1); flowPanel_1.setStyleName("gwt-insidePanel"); Label lblZmieHaso = new Label("Zmień hasło"); flowPanel_1.add(lblZmieHaso); lblZmieHaso.setStyleName("gwt-GroupLabel"); FlexTable flexTable = new FlexTable(); flexTable.setStyleName("gwt-table"); flowPanel_1.add(flexTable); Label lblStareHaso = new Label("STARE HASŁO"); lblStareHaso.setStyleName("gwt-LabelCustom"); flexTable.setWidget(0, 0, lblStareHaso); oldPassTextBox = new PasswordTextBox(); flexTable.setWidget(0, 1, oldPassTextBox); Label lblNoweHaso = new Label("NOWE HASŁO"); lblNoweHaso.setStyleName("gwt-LabelCustom"); flexTable.setWidget(1, 0, lblNoweHaso); newPassTextBox = new PasswordTextBox(); flexTable.setWidget(1, 1, newPassTextBox); Label lblPowtrzHaso = new Label("POWTÓRZ HASŁO"); lblPowtrzHaso.setStyleName("gwt-LabelCustom"); flexTable.setWidget(2, 0, lblPowtrzHaso); flexTable.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); flexTable.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT); flexTable.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); newPassConfirmTextBox = new PasswordTextBox(); flexTable.setWidget(2, 1, newPassConfirmTextBox); changePassButton = new Button("New button"); changePassButton.setStyleName("gwt-ButtonCustom"); changePassButton.setText("Zmień"); flexTable.setWidget(3, 1, changePassButton); flexTable.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_RIGHT); errorLabel = new Label(""); errorLabel.setStyleName("gwt-LabelErr"); flowPanel_1.add(errorLabel); }
public void setOrientation(TEXT_POSITION orientation) { int imageRow = 0; int imageColumn = 0; int textRow = 0; int textColumn = 0; HorizontalAlignmentConstant textHorizontalAling = HasHorizontalAlignment.ALIGN_CENTER; if (orientation == TEXT_POSITION.TOP) { imageRow = 0; imageColumn = 0; textRow = 1; textColumn = 0; textHorizontalAling = HasHorizontalAlignment.ALIGN_CENTER; } else if (orientation == TEXT_POSITION.BOTTOM) { imageRow = 1; imageColumn = 0; textRow = 0; textColumn = 0; textHorizontalAling = HasHorizontalAlignment.ALIGN_CENTER; } else if (orientation == TEXT_POSITION.LEFT) { imageRow = 0; imageColumn = 1; textRow = 0; textColumn = 0; textHorizontalAling = HasHorizontalAlignment.ALIGN_LEFT; } else if (orientation == TEXT_POSITION.RIGHT) { imageRow = 0; imageColumn = 0; textRow = 0; textColumn = 1; textHorizontalAling = HasHorizontalAlignment.ALIGN_LEFT; } contentPanel.setWidget(imageRow, imageColumn, image); contentPanel.setWidget(textRow, textColumn, anchor); contentPanel .getCellFormatter() .setHorizontalAlignment(imageRow, imageColumn, HasHorizontalAlignment.ALIGN_CENTER); contentPanel .getCellFormatter() .setVerticalAlignment(imageRow, imageColumn, HasVerticalAlignment.ALIGN_TOP); contentPanel.getCellFormatter().setWidth(imageRow, imageColumn, "20px"); contentPanel.getCellFormatter().setHeight(imageRow, imageColumn, "20px"); contentPanel .getCellFormatter() .setVerticalAlignment(textRow, textColumn, HasVerticalAlignment.ALIGN_TOP); contentPanel .getCellFormatter() .setHorizontalAlignment(textRow, textColumn, textHorizontalAling); }
public FlexTable createTable() { if (!currentRow.cells.isEmpty()) nextRow(); FlexTable table = new FlexTable(); table.setStyleName(styleName); table.setCellSpacing(cellSpacing); table.setCellPadding(cellPadding); if (centered) table.getElement().setAttribute("align", "center"); String widthAsString = width == null ? "" : width; table.setWidth(widthAsString); table.getElement().setAttribute("width", widthAsString); if (columnWidths != null) { ColumnFormatter columnFormatter = table.getColumnFormatter(); for (int i = 0; i < columnWidths.length; i++) { columnFormatter.setWidth(i, columnWidths[i]); } } int rowIndex = 0; for (Row row : rows) { int colIndex = 0; for (Cell cell : row.cells) { table.setWidget(rowIndex, colIndex, cell.widget); if (cell.colspan > 1) table.getFlexCellFormatter().setColSpan(rowIndex, colIndex, cell.colspan); if (cell.align != null) { table.getCellFormatter().setHorizontalAlignment(rowIndex, colIndex, cell.align); } colIndex += cell.colspan; } rowIndex++; } return table; }
public LoginViewImpl() { VerticalPanel vp = new VerticalPanel(); this.initWidget(vp); vp.setSize("100%", "100%"); FlexTable grid = new FlexTable(); grid.setStyleName(Adicionais.RESOURCES.css().login()); Label loginLabel = new Label("Login:"******"Senha:"); this.passwordTextBox = new PasswordTextBox(); this.accessButton = new Button("Acessar"); this.accessButton.setWidth("5em"); grid.setCellSpacing(6); grid.setWidget(0, 0, loginLabel); grid.setWidget(0, 1, this.loginTextBox); grid.setWidget(1, 0, passwordLabel); grid.setWidget(1, 1, this.passwordTextBox); grid.setWidget(2, 0, accessButton); grid.getFlexCellFormatter().setColSpan(2, 0, 2); grid.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); vp.add(grid); vp.setCellVerticalAlignment(grid, HasVerticalAlignment.ALIGN_MIDDLE); vp.setCellHorizontalAlignment(grid, HasHorizontalAlignment.ALIGN_CENTER); this.setSize("100%", "100%"); }
private void addColumn(Object columnHeading) { Widget widget = createCellWidget(columnHeading); int cell = flexTable.getCellCount(HEADER_ROW_INDEX); widget.setWidth("100%"); widget.addStyleName("FlexTable-ColumnLabel"); flexTable.setWidget(HEADER_ROW_INDEX, cell, widget); flexTable.getCellFormatter().addStyleName(HEADER_ROW_INDEX, cell, "FlexTable-ColumnLabelCell"); }
protected void layoutCalendar() { calendarGrid.clear(); calendarGrid.setCellSpacing(0); for (int i = 0, row = -2, col = 0; i < simpleDatePickers.size(); i++) { if ((i % monthColumns) == 0) { col = 0; row += 2; } else if (i > 0) { calendarGrid.setHTML(row, col, " "); calendarGrid.setHTML(row + 1, col, " "); calendarGrid.getCellFormatter().addStyleName(row, col, StyleMonthSeparator); calendarGrid.getCellFormatter().addStyleName(row + 1, col, StyleMonthSeparator); col += 1; } if (monthSelectorHeader.getParent() == null || simpleDatePickers.size() > 1) { if (i == 0 || (i % monthColumns) == 0) { calendarGrid.getRowFormatter().addStyleName(row, StyleMonthLabels); calendarGrid.getRowFormatter().addStyleName(row + 1, StyleMonthCell); } Widget w = null; if (i == 0 && monthSelectorHeader.getElement().getParentElement() == null) w = monthSelectorHeader; // calendarGrid.setWidget(row, col, monthSelectorHeader); else w = monthHeaders.get(i); // calendarGrid.setWidget(row, col, monthHeaders.get(i)); DockPanel p = null; if (leftButtons.iterator().hasNext() && leftButtons.getParent() == null && col == 0) { p = leftButtons; p.add(w, DockPanel.WEST); p.setCellWidth(w, "100%"); w = p; if (simpleDatePickers.size() == 1) { Iterator<Widget> it = p.iterator(); while (it.hasNext()) { p.add(it.next(), DockPanel.WEST); } } } if (rightButtons.iterator().hasNext() && rightButtons.getParent() == null && ((i + 1) % monthColumns) == 0) { p = rightButtons; p.add(w, DockPanel.WEST); p.setCellWidth(w, "100%"); w = p; } calendarGrid.setWidget(row, col, w); } calendarGrid.setWidget(row + 1, col, simpleDatePickers.get(i)); calendarGrid.getColumnFormatter().addStyleName(i, "Month-" + i); simpleDatePickers.get(i).addValueChangeHandler(onDaySelected); col++; } }
/** * switchSearchMode * * @param mode */ public void switchSearchMode(int mode) { searchMode = mode; switch (searchMode) { case SEARCH_MODE_SIMPLE: table.getCellFormatter().setVisible(3, 0, false); table.getCellFormatter().setVisible(4, 0, false); table.getCellFormatter().setVisible(4, 1, false); break; case SEARCH_MODE_ADVANCED: advancedView.setValue(true); // switch search mode can be done by execute saved query table.getCellFormatter().setVisible(3, 0, true); table.getCellFormatter().setVisible(4, 0, true); table.getCellFormatter().setVisible(4, 1, true); break; } Main.get().mainPanel.search.searchBrowser.searchIn.switchSearchMode(searchMode); }
private void initComponents() { pnlContenedor = new FlexTable(); infoUbicacion = new UIInfoUbicacion(); infoUsuario = new UIInfoUsuario(); infoTc = new UIInfoTC(); pnlContenedor.setWidget(0, 0, infoUsuario); pnlContenedor.setWidget(0, 1, infoUbicacion); pnlContenedor.setWidget(0, 2, infoTc); pnlContenedor .getCellFormatter() .setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); pnlContenedor .getCellFormatter() .setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER); pnlContenedor .getCellFormatter() .setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT); this.initWidget(pnlContenedor); }
/** * Default constructor * * @param delHandler Обработчик нажатия на "Удалить * @param title Заголовок окна * @param message Сообщение */ public DeleteDialog(final ClickHandler delHandler, String title, String message) { this.setText(title); FlexTable flexTable = new FlexTable(); flexTable.setCellSpacing(5); flexTable.setCellPadding(5); setWidget(flexTable); flexTable.setSize("100%", "100%"); Label messageLabel = new Label(message); flexTable.setWidget(0, 0, messageLabel); Button delBtn = new Button("Удалить"); flexTable.setWidget(1, 0, delBtn); delBtn.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); delHandler.onClick(event); } }); Button cancelBtn = new Button("Отмена"); flexTable.setWidget(1, 1, cancelBtn); cancelBtn.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { // Просто тупо закрываем. Печалька hide(); } }); flexTable.getFlexCellFormatter().setColSpan(0, 0, 2); flexTable.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); flexTable.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER); flexTable.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER); }
private void formatRow(FlexTable table, int row) { String border = "1px solid #EEE"; for (int i = 0; i <= 4; i++) { Element element = table.getCellFormatter().getElement(row, i); Style style = element.getStyle(); style.setProperty("borderBottom", border); if (row == 0) style.setProperty("borderTop", border); if (i < 3 || i == 4) style.setProperty("borderLeft", border); if (i == 4) style.setProperty("borderRight", border); } }
public Viewer(int rowLimit, Set<String> showNames) { table = new FlexTable(); table.setSize("100%", "auto"); table.setCellSpacing(2); cellFormatter = table.getCellFormatter(); rowFormatter = table.getRowFormatter(); scroller = new ScrollPanel(table); scroller.getElement().getStyle().setProperty("borderTop", "1px solid #333333"); setPause(false); setRowLimit(rowLimit); updateRowVisibility(showNames); }
/** Calculates the number of events that can be displayed in a cell. */ public void calibrateCalendar() { final FlexTable grid = (FlexTable) getWidget(); final Element row = grid.getRowFormatter().getElement(displayHeaders); row.setId("calendar-row-calibration"); final Element cell = grid.getCellFormatter().getElement(displayHeaders, displayWeekNumber ? 1 : 0); cell.setId("calendar-cell-calibration"); eventLimit = (getCellHeight(CELL_DEFAULT_HEIGHT) / EVENT_HEIGHT) - 2; if (eventLimit < 0) eventLimit = 0; }
public Category() { VerticalPanel verPanel = new VerticalPanel(); initWidget(verPanel); verPanel.setSize("100%", "100%"); FlexTable flexTable = new FlexTable(); verPanel.add(flexTable); verPanel.setCellVerticalAlignment(flexTable, HasVerticalAlignment.ALIGN_MIDDLE); verPanel.setCellHorizontalAlignment(flexTable, HasHorizontalAlignment.ALIGN_CENTER); flexTable.setSize("20%", "20%"); Label lblCategoryName = new Label("CategoryName"); flexTable.setWidget(0, 0, lblCategoryName); TextBox txtCatgegoryName = new TextBox(); flexTable.setWidget(0, 1, txtCatgegoryName); Label lblCategoryDescription = new Label("CategoryDescription"); flexTable.setWidget(1, 0, lblCategoryDescription); TextBox txtCategoryDescription = new TextBox(); flexTable.setWidget(1, 1, txtCategoryDescription); CheckBox isParentCategory = new CheckBox(); isParentCategory.setName("isParentCategory"); flexTable.setWidget(2, 1, isParentCategory); Label lblIsParentCategory = new Label("ParentCategory"); flexTable.setWidget(2, 0, lblIsParentCategory); TextButton buttonCreateCategory = new TextButton("Create"); flexTable.setWidget(3, 1, buttonCreateCategory); flexTable.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); flexTable.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT); flexTable.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); flexTable.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_CENTER); }
private void addRow(JSONObject object, int row) { String desc = Util.str(object.get("description")); String id = Util.str(object.get("id")); String trust = Util.str(object.get("fond")); String defaultdesc = Util.str(object.get("defaultdesc")); String actionclub = Util.str(object.get("actionclub")); String actiontrust = Util.str(object.get("actionfond")); String debetpost = Util.strSkipNull(object.get("debetpost")); String creditpost = Util.strSkipNull(object.get("creditpost")); table.setText(row, 0, trustActionCache.trustGivesDesc(trust)); table.setText(row, 1, desc); table.setText(row, 2, defaultdesc); table.setText(row, 3, Util.debkred(elements, actionclub)); table.setText(row, 4, Util.debkred(elements, actiontrust)); if (!("".equals(debetpost))) { table.setText(row, 5, posttypeCache.getDescriptionWithType(debetpost)); } if (!("".equals(creditpost))) { table.setText(row, 6, posttypeCache.getDescriptionWithType(creditpost)); } table.getCellFormatter().setStyleName(row, 0, "desc"); table.getCellFormatter().setStyleName(row, 1, "desc"); table.getCellFormatter().setStyleName(row, 2, "desc"); table.getCellFormatter().setStyleName(row, 5, "desc"); table.getCellFormatter().setStyleName(row, 6, "desc"); Image editImage = ImageFactory.editImage("projectEditView_editImage"); editImage.addClickHandler(me); idHolder.add(id, editImage); table.setWidget(row, 7, editImage); String style = (((row + 1) % 6) < 3) ? "line2" : "line1"; table.getRowFormatter().setStyleName(row, style); }
public AddPR() { VerticalPanel verticalPanel = new VerticalPanel(); initWidget(verticalPanel); FlexTable flexTable = new FlexTable(); verticalPanel.add(flexTable); flexTable.setSize("323px", "184px"); Label lblSelectTheMethod = new Label("Select the method to add physical resources"); lblSelectTheMethod.setStyleName("gui-Label"); flexTable.setWidget(0, 0, lblSelectTheMethod); lblSelectTheMethod.setHeight("39px"); final ListBox prList = new ListBox(); flexTable.setWidget(1, 0, prList); prList.setWidth("249px"); prList.addItem("Add PR by IP"); prList.addItem("Add PR by IP response"); prList.addItem("Add PR by URL"); prList.addItem("Add PR by URL response"); prList.addItem("Add Multiple PRs"); prList.setVisibleItemCount(5); flexTable.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); Button btnAddPr = new Button("Add PR"); btnAddPr.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { // if (prList.getSelectedIndex() == -1) {Window.alert("Select the method!");}; // if (prList.getSelectedIndex() == 0) {Window.alert("Under construction!");}; } }); flexTable.setWidget(2, 0, btnAddPr); flexTable.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT); flexTable.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); }
public void onSuccess(GWTResultSet result) { GWTResultSet resultSet = result; removeAllRows(); for (Iterator<GWTQueryResult> it = resultSet.getResults().iterator(); it.hasNext(); ) { GWTQueryResult gwtQueryResult = it.next(); if (gwtQueryResult.getFolder() != null) { GWTFolder folder = gwtQueryResult.getFolder(); int rows = folderTable.getRowCount(); // Looks if must change icon on parent if now has no childs and properties with user // security atention if ((folder.getPermissions() & GWTPermission.WRITE) == GWTPermission.WRITE) { if (folder.isHasChildren()) { folderTable.setHTML(rows, 0, Util.imageItemHTML("img/menuitem_childs.gif")); } else { folderTable.setHTML(rows, 0, Util.imageItemHTML("img/menuitem_empty.gif")); } } else { if (folder.isHasChildren()) { folderTable.setHTML(rows, 0, Util.imageItemHTML("img/menuitem_childs_ro.gif")); } else { folderTable.setHTML(rows, 0, Util.imageItemHTML("img/menuitem_empty_ro.gif")); } } folderTable.setHTML(rows, 1, folder.getPath()); folderTable.getCellFormatter().setWidth(rows, 0, "30"); folderTable .getCellFormatter() .setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER); } } status.unsetFlagChilds(); }
private void displayAction(TaskValue taskValue, int row) { String description = "<div class='actionTitle'>" + escapeHtml(taskValue.getTitle()) + "<span class='actionDetails'> - " + escapeHtml(taskValue.getDetails()) + "</span></div>"; table.setHTML(row, 0, description); table.setText(row, 1, mFormatter.getShortDueDate(taskValue)); table .getCellFormatter() .setStyleName( row, 1, isInPast(taskValue.getDueDate()) ? "actionDueInPass" : "actionDueInFuture"); }
@Test public void html() { // Given FlexTable t = new FlexTable(); // When t.setHTML(1, 1, "<h1>test</h1>"); // Then assertThat(t.getHTML(1, 1)).isEqualTo("<h1>test</h1>"); Element e = t.getCellFormatter().getElement(1, 1); assertThat(e.getChildCount()).isEqualTo(1); HeadingElement h1 = e.getChild(0).cast(); assertThat(h1.getTagName()).isEqualTo("H1"); assertThat(h1.getInnerText()).isEqualTo("test"); }
/** * Initializes the table so that it contains enough rows for a full page of emails. Also creates * the images that will be used as 'read' flags. */ private void initTable() { // Initialize the header. header.getColumnFormatter().setWidth(0, "128px"); header.getColumnFormatter().setWidth(1, "192px"); header.getColumnFormatter().setWidth(3, "256px"); header.setText(0, 0, "Sender"); header.setText(0, 1, "Email"); header.setText(0, 2, "Subject"); header.setWidget(0, 3, navBar); header.getCellFormatter().setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_RIGHT); // Initialize the table. table.getColumnFormatter().setWidth(0, "128px"); table.getColumnFormatter().setWidth(1, "192px"); }
/** Render the whole calendar but do not render the events. */ public void drawEmptyCells() { final FlexTable grid = (FlexTable) getWidget(); final int rows = displayMode.getRows() + displayHeaders; final int columns = displayMode.getColumns() + (displayWeekNumber ? 1 : 0); Date date = displayMode.getStartDate(startDate, firstDayOfWeek); // Column headers if (displayHeaders != NO_HEADERS) { if (displayHeaders == ALL_HEADERS) { // Header of the calendar final Label calendarHeader = new Label(getHeading()); calendarHeader.addStyleName("calendar-header"); grid.setWidget(0, 0, calendarHeader); grid.getFlexCellFormatter().setColSpan(0, 0, columns + (displayWeekNumber ? 1 : 0)); } final Date currentHeader = new Date(date.getTime()); for (int x = displayWeekNumber ? 1 : 0; x < columns; x++) { final Label columnHeader = new Label(headerFormatter.format(currentHeader)); columnHeader.addStyleName("calendar-column-header"); grid.setWidget(displayHeaders == ALL_HEADERS ? 1 : 0, x, columnHeader); currentHeader.setDate(currentHeader.getDate() + 1); } } int currentMonth = startDate.getMonth(); for (int y = displayHeaders; y < rows; y++) { if (displayWeekNumber) { grid.getCellFormatter().addStyleName(y, 0, "calendar-row-header"); grid.setText(y, 0, Integer.toString(getWeekNumber(date, firstDayOfWeek))); } for (int x = displayWeekNumber ? 1 : 0; x < columns; x++) { drawCell(y, x, date, currentMonth); date.setDate(date.getDate() + 1); } } }
public VersionBrowser( ClientFactory clientFactory, EventBus eventBus, String uuid, boolean isPackage) { this.clientFactory = clientFactory; this.eventBus = eventBus; this.uuid = uuid; this.isPackage = isPackage; HorizontalPanel wrapper = new HorizontalPanel(); ClickHandler clickHandler = new ClickHandler() { public void onClick(ClickEvent event) { clickLoadHistory(); } }; layout = new FlexTable(); ClickableLabel vh = new ClickableLabel(constants.VersionHistory1(), clickHandler); layout.setWidget(0, 0, vh); layout.getCellFormatter().setStyleName(0, 0, "metadata-Widget"); // NON-NLS FlexCellFormatter formatter = layout.getFlexCellFormatter(); formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); refresh = new ImageButton(images.refresh()); refresh.addClickHandler(clickHandler); layout.setWidget(0, 1, refresh); formatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT); wrapper.setStyleName("version-browser-Border"); wrapper.add(layout); layout.setWidth("100%"); wrapper.setWidth("100%"); initWidget(wrapper); }
private void setNavigationBar() { navBarTable.getCellFormatter().setWidth(0, 1, "30%"); navBarTable.getCellFormatter().setWidth(0, 2, "10%"); navBarTable.getCellFormatter().setWidth(0, 3, "10%"); navBarTable.getCellFormatter().setWidth(0, 4, "22%"); navBarTable.getCellFormatter().setWidth(0, 5, "23%"); Label displayText = new Label(navBar.getCountString()); Label searchPageText = new Label(LocaleDictionary.get().getConstantValue(LocaleCommonConstants.TITLE_GO_TO_PAGE)); Label totalPageCountText = new Label(" /" + navBar.getTotalPageCount()); HorizontalPanel searchPagePanel = new HorizontalPanel(); displayText.setStyleName(selectionStyle.boldText()); searchPageText.setStyleName(selectionStyle.boldText()); totalPageCountText.setStyleName(selectionStyle.boldText()); searchPagePanel.add(searchPageText); searchPagePanel.add(navBar.getSearchPageTextBox()); searchPagePanel.add(totalPageCountText); searchPagePanel.setCellHorizontalAlignment(searchPageText, HasHorizontalAlignment.ALIGN_RIGHT); searchPagePanel.setCellHorizontalAlignment( navBar.getSearchPageTextBox(), HasHorizontalAlignment.ALIGN_RIGHT); searchPagePanel.setCellHorizontalAlignment( totalPageCountText, HasHorizontalAlignment.ALIGN_RIGHT); if (this.navBar.getOrderingListner() != null) { navBarTable.setWidget(0, 2, navBar.getOrderingPanel()); navBarTable .getCellFormatter() .setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT); } if (this.navBar.getListner() != null) { navBarTable.setWidget(0, 3, navBar.getPaginationPanel()); navBarTable .getCellFormatter() .setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_RIGHT); navBarTable.setWidget(0, 4, searchPagePanel); } navBarTable.setWidget(0, 5, displayText); navBarTable.getCellFormatter().setHorizontalAlignment(0, 4, HasHorizontalAlignment.ALIGN_RIGHT); navBarTable.getCellFormatter().setHorizontalAlignment(0, 5, HasHorizontalAlignment.ALIGN_RIGHT); }