本文整理汇总了Java中com.google.gwt.user.client.ui.HTMLTable.CellFormatter方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLTable.CellFormatter方法的具体用法?Java HTMLTable.CellFormatter怎么用?Java HTMLTable.CellFormatter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HTMLTable
的用法示例。
在下文中一共展示了HTMLTable.CellFormatter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PackageReadyWidget
import com.google.gwt.user.client.ui.HTMLTable; //导入方法依赖的package包/类
PackageReadyWidget(MonitorItem monItem, int idx, boolean markAlreadyActivated) {
_monItem= monItem;
_idx= idx;
BackgroundStatus bgStat= monItem.getStatus();
PackageProgress bundle= bgStat.getPartProgress(idx);
FlexTable fp= new FlexTable();
HTMLTable.CellFormatter formatter= fp.getCellFormatter();
String desc= bgStat.getPackageCount()==1 ? "" : ZIP_ROOT_TXT + (idx+1);
fp.setWidget(0,0,makeDownloadNowButton(bundle.getURL(),desc,idx));
formatter.setWidth(0,0,"100px");
fp.setWidget(0,4,_icon);
setShowRetrivedIcon(markAlreadyActivated ? FileDownloadStatus.DONE : FileDownloadStatus.NONE);
formatter.setWidth(0,4,"20px");
formatter.setHorizontalAlignment(0,4, HasHorizontalAlignment.ALIGN_RIGHT);
Label dSize= new Label(StringUtils.getSizeAsString(bundle.getFinalCompressedBytes(),true));
fp.setWidget(0,2,dSize);
formatter.setWidth(0,2,"65px");
formatter.setHorizontalAlignment(0,2, HasHorizontalAlignment.ALIGN_RIGHT);
initWidget(fp);
}
示例2: testAddBottomAndRightPaddingToTableCells
import com.google.gwt.user.client.ui.HTMLTable; //导入方法依赖的package包/类
@Test
public void testAddBottomAndRightPaddingToTableCells() throws Exception {
final Element cellOne = mock(Element.class);
final Element cellTwo = mock(Element.class);
final HTMLTable.CellFormatter cellFormatter = mock(HTMLTable.CellFormatter.class);
final FlexTable testedTable = mock(FlexTable.class);
doReturn(1).when(testedTable).getRowCount();
doReturn(2).when(testedTable).getCellCount(0);
doReturn(cellFormatter).when(testedTable).getCellFormatter();
doReturn(cellOne).when(cellFormatter).getElement(0, 0);
doReturn(cellTwo).when(cellFormatter).getElement(0, 1);
ScenarioUtils.addBottomAndRightPaddingToTableCells(testedTable);
verify(cellOne).setAttribute("style", ScenarioUtils.BOTTOM_RIGHT_PADDING);
verify(cellTwo).setAttribute("style", ScenarioUtils.BOTTOM_RIGHT_PADDING);
}
示例3: buildActivationUI
import com.google.gwt.user.client.ui.HTMLTable; //导入方法依赖的package包/类
public static Widget buildActivationUI(String text,
String tip,
final MonitorItem monItem,
final int idx,
final BackgroundActivation bActivate,
boolean markAlreadyActivated) {
final Image icon= new Image(RETRIEVED_ICON);
icon.setVisible(markAlreadyActivated);
Widget button= GwtUtil.makeLinkButton(text, tip,
new ClickHandler() {
public void onClick(ClickEvent event) {
bActivate.activate(monItem,idx, false);
icon.setVisible(true);
}
});
WebEventListener autoActListener= new WebEventListener() {
public void eventNotify(WebEvent ev) {
if (ev.getSource()==monItem && ev.getName()==Name.MONITOR_ITEM_UPDATE) {
if (monItem.isDone() && monItem.isActivated(idx)) {
icon.setVisible(true);
WebEventManager.getAppEvManager().removeListener(Name.MONITOR_ITEM_UPDATE,
monItem,this);
}
}
}
};
WebEventManager.getAppEvManager().addListener(Name.MONITOR_ITEM_UPDATE,monItem,autoActListener);
FlexTable fp= new FlexTable();
HTMLTable.CellFormatter formatter= fp.getCellFormatter();
fp.setWidget(0,0,button);
formatter.setWidth(0,0,"100px");
fp.setWidget(0,4,icon);
formatter.setWidth(0,4,"20px");
formatter.setHorizontalAlignment(0,4, HasHorizontalAlignment.ALIGN_RIGHT);
return fp;
}
示例4: getCellFormatter
import com.google.gwt.user.client.ui.HTMLTable; //导入方法依赖的package包/类
public HTMLTable.CellFormatter getCellFormatter() {
return this.table.getCellFormatter();
}