public SurveillanceView(Dashlet dashlet) { super(dashlet); m_grid.addTableListener(new TableListener() { public void onCellClicked(SourcesTableEvents table, int row, int col) { cellClicked(row, col); if (row == 0 && col == 0) { onAllClicked(); } else if (row == 0) { onColumnGroupClicked(col-1); } else if (col == 0) { onRowGroupClicked(row-1); } else { onIntersectionClicked(row-1, col-1); } } }); initWidget(m_grid); }
public void onCellClicked(SourcesTableEvents sender, int row, int cell) { int index = table.getTableControl().getSelectScreenIndex(); if (index >= 0) { String type = table.getTableControl().getObjectName(row, cell); if (type != null) { getBaseEntryScreen().showScreen(index, type, new Long(0)); } } }
/** Creates a new instance of Calendar */ public Calendar() { this.value = this.renderDate; for (int i = 0; i < 7; i++) { grid.setWidget(0, i, new Label(Calendar.DAYS_OF_WEEK_SHORT[i])); grid.getCellFormatter().setStyleName(0, i, "day"); } grid.setCellSpacing(0); grid.setCellPadding(0); super.initWidget(grid); final Calendar instance = this; this.grid.addTableListener( new TableListener() { public void onCellClicked(SourcesTableEvents sender, int row, int cell) { boolean cancelled = false; for (Iterator it = new ArrayList(eventListeners).iterator(); it.hasNext();) { if (!((CalendarListener) it.next()).onDateClicked(instance, currentDates[row - 1][cell])) { cancelled = true; break; } } if (!cancelled && (currentDates[row - 1][cell].getMonth() == getRenderDate().getMonth())) { setValue(currentDates[row - 1][cell]); } } } ); this.setStyleName("gwittir-Calendar"); }