本文整理汇总了Java中com.google.gwt.user.client.ui.FlexTable.getRowCount方法的典型用法代码示例。如果您正苦于以下问题:Java FlexTable.getRowCount方法的具体用法?Java FlexTable.getRowCount怎么用?Java FlexTable.getRowCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.FlexTable
的用法示例。
在下文中一共展示了FlexTable.getRowCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTopLeftAlignment
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
/**
* @param flexTable
*
*/
void setTopLeftAlignment(FlexTable flexTable) {
if (flexTable != null) {
int rows = flexTable.getRowCount();
for (int row = 0; row < rows; row++) {
int cellCount = flexTable.getCellCount(row);
for (int col = 0; col < cellCount; col++) {
if (flexTable.isCellPresent(row, col)) {
flexTable.getCellFormatter().setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_LEFT);
flexTable.getCellFormatter().setVerticalAlignment(row, col, HasVerticalAlignment.ALIGN_TOP);
Widget widget = flexTable.getWidget(row, col);
if ((widget != null) && (widget.getClass().getName().equals("FlexTable"))) {
try {
setTopLeftAlignment((FlexTable) widget);
} catch (Exception e) {
// e.printStackTrace();
}
}
}
}
}
}
}
示例2: applyDataRowStyles
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
private void applyDataRowStyles(FlexTable grid) {
RowFormatter rf = grid.getRowFormatter();
for (int row = 0; row < grid.getRowCount(); ++row) {
if ((row % 2) != 0) {
rf.addStyleName(row, "FlexTable-OddRow");
}
else {
rf.addStyleName(row, "FlexTable-EvenRow");
}
}
}
示例3: clearSelectedRowStyle
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
private void clearSelectedRowStyle(final FlexTable flexTable) {
for (int i = 0; i < flexTable.getRowCount(); i++) {
for (int j = 0; j < flexTable.getCellCount(i); j++) {
if (flexTable.getWidget(i, j) != null) {
flexTable.getWidget(i, j).removeStyleName(ReviewValidateConstants.ROW_SELECTION_STYLE);
}
}
}
}
示例4: addRow
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
private void addRow( FlexTable flexTable, Widget w1, Widget w2 )
{
int numRows = flexTable.getRowCount();
flexTable.setWidget( numRows, 0, w1 );
flexTable.setWidget( numRows, 1, w2 );
flexTable.getFlexCellFormatter().setRowSpan( 0, 1, numRows + 1 );
}
示例5: InfoPanelImpl
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
public InfoPanelImpl() {
super("cell");
iText = new P("text");
add(iText);
iHint = new ClickableHint(""); iHint.setStyleName("hint");
add(iHint);
iUpdateInfo = new Callback() {
@Override
public void execute(Callback callback) {
if (callback != null) callback.execute(null);
}
};
iInfo = new FlexTable();
iInfo.setStyleName("unitime-InfoTable");
// iUpdateInfo = updateInfo;
iInfoPanel = new PopupPanel();
iInfoPanel.setWidget(iInfo);
iInfoPanel.setStyleName("unitime-PopupHint");
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
sinkEvents(Event.ONMOUSEMOVE);
iShowInfo = new Timer() {
@Override
public void run() {
if (iInfo.getRowCount() == 0) return;
iUpdateInfo.execute(new Callback() {
public void execute(Callback callback) {
iInfoPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
int maxX = Window.getScrollLeft() + Window.getClientWidth() - offsetWidth - 10;
iInfoPanel.setPopupPosition(Math.min(iX, maxX), iY);
}
});
if (callback != null) callback.execute(null);
}
});
}
};
iHideInfo = new Timer() {
@Override
public void run() {
iInfoPanel.hide();
}
};
iDefaultClickHandler = new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (iUrl != null && !iUrl.isEmpty())
ToolBox.open(GWT.getHostPageBaseURL() + iUrl);
}
};
iTextClick = iHint.addClickHandler(iDefaultClickHandler);
iHintClick = iText.addClickHandler(iDefaultClickHandler);
iHint.setTabIndex(-1);
}
示例6: addDocument
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
/**
* addDocument
*/
public static void addDocument(FlexTable table, final GWTStaple staple, final String uuid, boolean enableDelete) {
int row = table.getRowCount();
final GWTDocument doc = staple.getDoc();
if (doc.isCheckedOut()) {
table.setHTML(row, 0, Util.imageItemHTML("img/icon/edit.png"));
} else if (doc.isLocked()) {
table.setHTML(row, 0, Util.imageItemHTML("img/icon/lock.gif"));
} else {
table.setHTML(row, 0, " ");
}
// Subscribed is a special case, must add icon with others
if (doc.isSubscribed()) {
table.setHTML(row, 0, table.getHTML(row, 0) + Util.imageItemHTML("img/icon/subscribed.gif"));
}
if (doc.isHasNotes()) {
table.setHTML(row, 0, table.getHTML(row, 0) + Util.imageItemHTML("img/icon/note.gif"));
}
table.setHTML(row, 1, Util.mimeImageHTML(doc.getMimeType()));
Anchor anchor = new Anchor();
anchor.setHTML(doc.getName());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
String docPath = doc.getPath();
String path = docPath.substring(0, docPath.lastIndexOf("/"));
GeneralComunicator.openPath(path, doc.getPath());
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
table.setWidget(row, 2, anchor);
table.setHTML(row, 3, Util.formatSize(doc.getActualVersion().getSize()));
if (enableDelete) {
Image delete = new Image(OKMBundleResources.INSTANCE.deleteIcon());
delete.setStyleName("okm-KeyMap-ImageHover");
delete.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
staplingService.removeStaple(String.valueOf(staple.getId()), new AsyncCallback<Object>() {
@Override
public void onSuccess(Object result) {
if (staple.getType().equals(GWTStaple.STAPLE_FOLDER)) {
Stapling.get().refreshFolder(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_DOCUMENT)) {
Stapling.get().refreshDocument(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_MAIL)) {
Stapling.get().refreshMail(uuid);
}
}
@Override
public void onFailure(Throwable caught) {
GeneralComunicator.showError("remove", caught);
}
});
}
});
table.setWidget(row, 4, delete);
} else {
table.setHTML(row, 4, "");
}
table.getCellFormatter().setWidth(row, 0, "60px");
table.getCellFormatter().setWidth(row, 1, "25px");
table.getCellFormatter().setWidth(row, 4, "25px");
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
table.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_LEFT);
table.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);
}
示例7: addMail
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
/**
* addMail
*/
public static void addMail(FlexTable table, final GWTStaple staple, final String uuid, boolean enableDelete) {
int row = table.getRowCount();
final GWTMail mail = staple.getMail();
// Mail is never checkout or subscribed ( because can not be changed )
table.setHTML(row, 0, " ");
if (mail.getAttachments().size() > 0) {
table.setHTML(row, 1, Util.imageItemHTML("img/email_attach.gif"));
} else {
table.setHTML(row, 1, Util.imageItemHTML("img/email.gif"));
}
Anchor anchor = new Anchor();
anchor.setHTML(mail.getSubject());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
String docPath = mail.getPath();
String path = docPath.substring(0, docPath.lastIndexOf("/"));
GeneralComunicator.openPath(path, docPath);
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
table.setWidget(row, 2, anchor);
table.setHTML(row, 3, Util.formatSize(mail.getSize()));
if (enableDelete) {
Image delete = new Image(OKMBundleResources.INSTANCE.deleteIcon());
delete.setStyleName("okm-KeyMap-ImageHover");
delete.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
staplingService.removeStaple(String.valueOf(staple.getId()), new AsyncCallback<Object>() {
@Override
public void onSuccess(Object result) {
if (staple.getType().equals(GWTStaple.STAPLE_FOLDER)) {
Stapling.get().refreshFolder(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_DOCUMENT)) {
Stapling.get().refreshDocument(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_MAIL)) {
Stapling.get().refreshMail(uuid);
}
}
@Override
public void onFailure(Throwable caught) {
GeneralComunicator.showError("remove", caught);
}
});
}
});
table.setWidget(row, 4, delete);
} else {
table.setHTML(row, 4, "");
}
table.getCellFormatter().setWidth(row, 0, "60px");
table.getCellFormatter().setWidth(row, 1, "25px");
table.getCellFormatter().setWidth(row, 4, "25px");
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
table.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_LEFT);
table.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);
}