List of usage examples for com.google.gwt.user.client.ui FlexTable getCellCount
@Override public int getCellCount(int row)
From source file:com.google.gwt.sample.stockwatcher.client.SensorActuatorResponsePage.java
private void addEditResponseColumnAllRow(FlexTable ft) { for (int i = 1; i < ft.getRowCount(); i++) { final Anchor edit = new Anchor("Edit"); ft.setWidget(i, ft.getCellCount(i), edit); edit.setName(ft.getText(i, 0));/*from w w w . ja v a 2 s.c o m*/ setEditResponseClickHandler(edit); } }
From source file:com.google.gwt.sample.stockwatcher.client.UserNotificationPage.java
private void addUnsubscribeControllerColumnAllRow(FlexTable ft) { for (int i = 1; i < ft.getRowCount(); i++) { if (ft.getText(i, 0).equals(noSubscription)) { break; }/*from ww w. j a v a 2 s . c o m*/ Anchor Unsubscribe = new Anchor("Unsubscribe"); ft.setWidget(i, ft.getCellCount(i), Unsubscribe); Unsubscribe.setName(ft.getText(i, 0)); setUnsubscribeControllerClickHandler(Unsubscribe); } }
From source file:com.google.gwt.sample.stockwatcher.client.UserNotificationPage.java
private void addUnsubscribeSensorColumnAllRow(FlexTable ft) { for (int i = 1; i < ft.getRowCount(); i++) { if (ft.getText(i, 0).equals(noSubscription)) { break; }/* w w w .j ava 2 s . co m*/ Anchor Unsubscribe = new Anchor("Unsubscribe"); ft.setWidget(i, ft.getCellCount(i), Unsubscribe); Unsubscribe.setName(ft.getText(i, 0)); setUnsubscribeSensorClickHandler(Unsubscribe); } }
From source file:com.google.gwt.sample.stockwatcher.client.UserNotificationPage.java
private void addUnsubscribeActuatorColumnAllRow(FlexTable ft) { for (int i = 1; i < ft.getRowCount(); i++) { if (ft.getText(i, 0).equals(noSubscription)) { break; }// w w w .j a v a 2s . c o m Anchor Unsubscribe = new Anchor("Unsubscribe"); ft.setWidget(i, ft.getCellCount(i), Unsubscribe); Unsubscribe.setName(ft.getText(i, 0)); setUnsubscribeActuatorClickHandler(Unsubscribe); } }
From source file:com.risevision.ui.client.common.dnd.FlexTableUtil.java
License:Apache License
/** * Move an entire FlexTable from one FlexTable to another. Elements are moved by attempting to * call {@link FlexTable#getWidget(int, int)} on the source table. If no widget is found (because * <code>null</code> is returned), a new {@link HTML} is created instead by calling * {@link FlexTable#getHTML(int, int)} on the source table. * /*from w ww. j av a 2 s.c om*/ * @param sourceTable the FlexTable to move a row from * @param targetTable the FlexTable to move a row to * @param sourceRow the index of the source row * @param targetRow the index before which to insert the moved row */ public static void moveRow(FlexTable sourceTable, FlexTable targetTable, int sourceRow, int targetRow) { if (sourceTable == targetTable && sourceRow >= targetRow) { sourceRow++; } targetTable.insertRow(targetRow); for (int col = 0; col < sourceTable.getCellCount(sourceRow); col++) { Widget w = sourceTable.getWidget(sourceRow, col); if (w != null) { targetTable.setWidget(targetRow, col, w); } else { HTML html = new HTML(sourceTable.getHTML(sourceRow, col)); targetTable.setWidget(targetRow, col, html); } copyCellStyle(sourceTable, targetTable, sourceRow, col, targetRow, col); } copyRowStyle(sourceTable, targetTable, sourceRow, targetRow); sourceTable.removeRow(sourceRow); }
From source file:edu.cudenver.bios.glimmpse.client.panels.MatrixDisplayPanel.java
License:Open Source License
public FlexTable buildFixedRandomMatrixGrid(Node matrixNode, String randomValue) { FlexTable table = new FlexTable(); table.setBorderWidth(1);//from ww w . j av a 2 s.co m if (matrixNode != null) { NamedNodeMap frAttrs = matrixNode.getAttributes(); boolean combineHorizontal = true; Node combineHorizontalNode = frAttrs.getNamedItem(GlimmpseConstants.ATTR_COMBINE_HORIZONTAL); if (combineHorizontalNode != null) combineHorizontal = Boolean.parseBoolean(combineHorizontalNode.getNodeValue()); Node fixedNode = null; Node randomNode = null; NodeList children = matrixNode.getChildNodes(); for (int i = 0; i < children.getLength() && (fixedNode == null || randomNode == null); i++) { Node child = children.item(i); if (GlimmpseConstants.TAG_MATRIX.equals(child.getNodeName())) { NamedNodeMap attrs = child.getAttributes(); Node nameNode = attrs.getNamedItem(GlimmpseConstants.ATTR_NAME); if (GlimmpseConstants.MATRIX_FIXED.equals(nameNode.getNodeValue())) fixedNode = child; else if (GlimmpseConstants.MATRIX_FIXED.equals(nameNode.getNodeValue())) randomNode = child; } } int startRow = 0; int startCol = 0; if (fixedNode != null) { addMatrixData(fixedNode, table, startRow, startCol); } if (randomNode != null) { if (combineHorizontal) { startCol = table.getCellCount(0); } else { startRow = table.getRowCount(); } addMatrixData(fixedNode, table, startRow, startCol); } } return table; }
From source file:net.europa13.taikai.web.client.ui.TournamentPanel.java
License:Open Source License
public TournamentPanel() { final FlexTable table = new FlexTable(); int row = 0;/* w w w . j a v a 2 s . c o m*/ //********************************************************************* // Id and taikai info, mostly for debugging purposes. table.setText(row, 0, "Id"); tbId = new Label(); // tbId.setEnabled(false); table.setWidget(row++, 1, tbId); table.setText(row, 0, "Taikai"); tbTaikai = new Label(); // tbTaikai.setEnabled(false); table.setWidget(row++, 1, tbTaikai); //********************************************************************* // General info table.setText(row, 0, "Namn"); tbName = new TextBox(); table.setWidget(row++, 1, tbName); //********************************************************************* // Pool controls poolBox = new TournamentPoolPanel(); table.setWidget(row, 0, poolBox); table.getFlexCellFormatter().setColSpan(row, 0, table.getCellCount(0)); row++; seedTable = new TournamentSeedPanel(); table.setWidget(row, 0, seedTable); table.getFlexCellFormatter().setColSpan(row, 0, table.getCellCount(0)); row++; // advancementTable = new TournamentAdvancementTable(); // table.setWidget(row, 0, advancementTable); // table.getFlexCellFormatter().setColSpan(row, 0, table.getCellCount(0)); // row++; add(table); }
From source file:net.jorgeherskovic.medrec.client.FlexTableRowDragController.java
License:Apache License
@Override protected Widget newDragProxy(DragContext context) { FlexTable proxy; proxy = new FlexTable(); proxy.addStyleName(CSS_TABLE_PROXY_STYLE); draggableTable = (DraggableFlexTable) context.draggable.getParent(); dragRow = getWidgetRow(context.draggable, draggableTable); FlexTableUtil.copyRow(draggableTable, proxy, dragRow, 0); // Format the draggable row proxy.getRowFormatter().setStyleName(0, draggableTable.getRowFormatter().getStyleName(dragRow)); CellFormatter proxyFormatter = proxy.getCellFormatter(); CellFormatter originFormatter = draggableTable.getCellFormatter(); for (int i = 0; i < proxy.getCellCount(0); i++) { proxyFormatter.setStyleName(0, i, originFormatter.getStyleName(dragRow, i)); }/*from w w w . java2 s . com*/ return proxy; }
From source file:org.dataconservancy.dcs.access.client.upload.Util.java
License:Apache License
public static void addColumn(FlexTable table, String... values) { int col = table.getCellCount(0); for (int i = 0; i < values.length; i++) { if (values[i] != null) { table.setText(i, col, values[i]); }/* w w w. j a v a 2s . c o m*/ } }
From source file:org.dataconservancy.dcs.access.client.upload.Util.java
License:Apache License
public static void addColumn(FlexTable table, Widget... widgets) { int col = table.getCellCount(0); for (int i = 0; i < widgets.length; i++) { if (widgets[i] != null) { table.setWidget(i, col, widgets[i]); }/*w w w . ja va 2s . c om*/ } }