本文整理汇总了Java中com.google.gwt.user.client.ui.HTMLTable.Cell类的典型用法代码示例。如果您正苦于以下问题:Java Cell类的具体用法?Java Cell怎么用?Java Cell使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Cell类属于com.google.gwt.user.client.ui.HTMLTable包,在下文中一共展示了Cell类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFlexTableClicked
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
@UiHandler("flexTable")
protected void onFlexTableClicked(ClickEvent event) {
removeSelectedRowStyleFromTable();
Cell cell = flexTable.getCellForEvent(event);
if (cell != null && totalCount != 0) {
int row = cell.getRowIndex();
selectedIndex = row;
flexTable.getRowFormatter().addStyleName(row, selectionStyle.rowHighlighted());
RadioButtonContainer radioButtonContainer = radioButtons.get(row);
if (radioButtonContainer != null && radioButtonContainer.getRadioButton() != null) {
clearRadioButtons();
radioButtonContainer.getRadioButton().setValue(true);
selectedRowId = radioButtonContainer.getIdentifier();
if (listner != null) {
listner.onRowSelected(selectedRowId);
}
}
if (radioButtonContainer != null && radioButtonContainer.getRadioButton() == null
&& radioButtonContainer.getIdentifier() != null) {
selectedRowId = radioButtonContainer.getIdentifier();
}
}
}
示例2: GroupTable
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
public GroupTable(String pointerId) {
super(AdminConstants.I.groupItemHelp());
setSavePointerId(pointerId);
table.setText(0, 1, AdminConstants.I.columnGroupName());
table.setText(0, 2, AdminConstants.I.columnGroupDescription());
table.setText(0, 3, AdminConstants.I.columnGroupVisibleToAll());
table.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final Cell cell = table.getCellForEvent(event);
if (cell != null
&& cell.getCellIndex() != 1
&& getRowItem(cell.getRowIndex()) != null) {
movePointerTo(cell.getRowIndex());
}
}
});
final FlexCellFormatter fmt = table.getFlexCellFormatter();
for (int i = 1; i <= NUM_COLS; i++) {
fmt.addStyleName(0, i, Gerrit.RESOURCES.css().dataHeader());
}
}
示例3: DocTable
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
DocTable() {
super(Util.C.docItemHelp());
table.setText(0, C_TITLE, Util.C.docTableColumnTitle());
FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, C_TITLE, Gerrit.RESOURCES.css().dataHeader());
table.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Cell cell = table.getCellForEvent(event);
if (cell == null) {
return;
}
if (getRowItem(cell.getRowIndex()) != null) {
movePointerTo(cell.getRowIndex());
}
}
});
}
示例4: ListTable
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
public ListTable()
{
initWidget( table );
setStylePrimaryName( Css.CSS.main() );
table.addClickHandler( new ClickHandler()
{
@Override
public void onClick( ClickEvent event )
{
Cell cell = table.getCellForEvent( event );
if( cell == null )
return;
selected = rows.get( cell.getRowIndex() );
}
} );
}
示例5: SimpleColorPicker
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
/**
* Instantiates a new simple color picker.
*
* @param colopicker the colopicker
*/
public SimpleColorPicker(ComplexColorPicker colopicker) {
super(colopicker);
style.ensureInjected();
final Grid grid = new Grid(ROWS, COLS);
grid.setCellSpacing(0);
grid.getRowFormatter().getElement(0).addClassName(style.firstRow());
grid.getRowFormatter().getElement(1).addClassName(style.firstRow());
int row;
int col;
int num = 0;
for (final String c : COLORS) {
row = num / COLS;
col = num % COLS;
grid.setWidget(row, col, createCell(c));
num++;
}
grid.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
Cell cell = grid.getCellForEvent(event);
if (cell != null) {
String color = COLORS[cell.getRowIndex() * COLS + cell.getCellIndex()];
onColorChoose(color);
}
}
});
grid.addStyleName(style.grid());
initWidget(grid);
}
示例6: fileTableClicked
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
@UiHandler("files")
public void fileTableClicked(ClickEvent clickEvent) {
Cell cell = files.getCellForEvent(clickEvent);
if (cell != null) {
presenter.onRowClicked(cell.getRowIndex());
}
}
示例7: onItemClickHandler
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void onItemClickHandler(final ClickEvent event) {
final Cell cell = getCellForEvent(event);
LocationInfo location = m_locations.get(cell.getRowIndex() + (getCurrentPageIndex() * getTotalListItemsPerPage()));
fireEvent(new LocationPanelSelectEvent(location.getName()));
}
示例8: onItemClickHandler
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void onItemClickHandler(final ClickEvent event) {
final Cell cell = getCellForEvent(event);
final ApplicationInfo appInfo = getApplications().get(cell.getRowIndex() + (getCurrentPageIndex() * getTotalListItemsPerPage()));
m_eventBus.fireEvent(new ApplicationSelectedEvent(appInfo.getName()));
}
示例9: SimpleColorPicker
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
/**
* Instantiates a new simple color picker.
*
* @param colopicker the colopicker
*/
public SimpleColorPicker(ComplexColorPicker colopicker) {
super(colopicker);
style.ensureInjected();
final Grid grid = new Grid(ROWS, COLS);
grid.setCellSpacing(0);
grid.getRowFormatter().getElement(0).addClassName(style.firstRow());
grid.getRowFormatter().getElement(1).addClassName(style.firstRow());
int row;
int col;
int num = 0;
for (final String c : COLORS) {
row = num / COLS;
col = num % COLS;
grid.setWidget(row, col, createCell(c));
num++;
}
grid.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
Cell cell = grid.getCellForEvent(event);
if (cell != null) {
String color = COLORS[cell.getRowIndex() * COLS + cell.getCellIndex()];
onColorChoose(color);
}
}
});
grid.addStyleName(style.grid());
initWidget(grid);
}
示例10: onTableClicked
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
@UiHandler("table")
void onTableClicked(ClickEvent event) {
// Select the row that was clicked (-1 to account for header row).
Cell cell = table.getCellForEvent(event);
if (cell != null) {
int row = cell.getRowIndex();
selectRow(row);
}
}
示例11: ChangeTable
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
public ChangeTable() {
super(Util.C.changeItemHelp());
columns = BASE_COLUMNS;
labelNames = Collections.emptyList();
showAssignee = Gerrit.info().change().showAssigneeInChangesTable();
showLegacyId = Gerrit.getUserPreferences().legacycidInChangeTable();
if (Gerrit.isSignedIn()) {
keysAction.add(new StarKeyCommand(0, 's', Util.C.changeTableStar()));
}
sections = new ArrayList<>();
table.setText(0, C_STAR, "");
table.setText(0, C_ID, Util.C.changeTableColumnID());
table.setText(0, C_SUBJECT, Util.C.changeTableColumnSubject());
table.setText(0, C_STATUS, Util.C.changeTableColumnStatus());
table.setText(0, C_OWNER, Util.C.changeTableColumnOwner());
table.setText(0, C_ASSIGNEE, Util.C.changeTableColumnAssignee());
table.setText(0, C_PROJECT, Util.C.changeTableColumnProject());
table.setText(0, C_BRANCH, Util.C.changeTableColumnBranch());
table.setText(0, C_LAST_UPDATE, Util.C.changeTableColumnLastUpdate());
table.setText(0, C_SIZE, Util.C.changeTableColumnSize());
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(0, C_STAR, Gerrit.RESOURCES.css().iconHeader());
for (int i = C_ID; i < columns; i++) {
fmt.addStyleName(0, i, Gerrit.RESOURCES.css().dataHeader());
}
if (!showLegacyId) {
fmt.addStyleName(0, C_ID, Gerrit.RESOURCES.css().dataHeaderHidden());
}
if (!showAssignee) {
fmt.addStyleName(0, C_ASSIGNEE, Gerrit.RESOURCES.css().dataHeaderHidden());
}
table.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final Cell cell = table.getCellForEvent(event);
if (cell == null) {
return;
}
if (cell.getCellIndex() == C_STAR) {
// Don't do anything (handled by star itself).
} else if (cell.getCellIndex() == C_STATUS) {
// Don't do anything.
} else if (cell.getCellIndex() == C_OWNER) {
// Don't do anything.
} else if (getRowItem(cell.getRowIndex()) != null) {
movePointerTo(cell.getRowIndex());
}
}
});
}
示例12: getCellForEvent
import com.google.gwt.user.client.ui.HTMLTable.Cell; //导入依赖的package包/类
/**
* <p>getCellForEvent</p>
*
* @param event a {@link com.google.gwt.event.dom.client.ClickEvent} object.
* @return a {@link com.google.gwt.user.client.ui.HTMLTable.Cell} object.
*/
protected Cell getCellForEvent(final ClickEvent event) {
return getDataList().getCellForEvent(event);
}