本文整理匯總了Java中com.google.gwt.user.client.ui.HorizontalPanel.getWidget方法的典型用法代碼示例。如果您正苦於以下問題:Java HorizontalPanel.getWidget方法的具體用法?Java HorizontalPanel.getWidget怎麽用?Java HorizontalPanel.getWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.getWidget方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateGotoWidget
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
protected void updateGotoWidget(Widget widget) {
widget.setVisible(computeNumPages() > 1);
// Update allowed number of characters in the goto page textbox in case page size has changed (Yuck!)
if(widget instanceof HorizontalPanel) {
HorizontalPanel panel = (HorizontalPanel)widget;
if(panel.getWidgetCount() == 3 && panel.getWidget(1) instanceof TextBox) {
TextBox gotoPage = (TextBox)panel.getWidget(1);
int maxlen = String.valueOf(computeNumPages()).length();
gotoPage.setMaxLength(maxlen);
gotoPage.setVisibleLength(maxlen);
}
}
}
示例2: saveCurriculum
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public boolean saveCurriculum(CurriculumInterface c) {
boolean ret = true;
HashSet<String> courses = new HashSet<String>();
HashMap<String, CurriculumCourseGroupInterface> groups = new HashMap<String, CurriculumCourseGroupInterface>();
if (c.hasCourses()) c.getCourses().clear();
for (int row = 1; row < iTable.getRowCount(); row++) {
String course = ((CurriculaCourseSelectionBox)iTable.getWidget(row, 1)).getText();
if (course.isEmpty()) continue;
if (!courses.add(course)) {
((CurriculaCourseSelectionBox)iTable.getWidget(row, 1)).setError(MESSAGES.errorDuplicateCourse(course));
ret = false;
continue;
}
CourseInterface cr = new CourseInterface();
cr.setCourseName(course);
for (int i = 0; i < iClassifications.getClassifications().size(); i++) {
Float share = ((ShareTextBox)iTable.getWidget(row, 2 + 2 * i)).getShare();
if (share == null) continue;
Integer lastLike = ((EnrollmentLabel)iTable.getWidget(row, 3 + 2 * i)).iLastLike;
CurriculumCourseInterface cx = new CurriculumCourseInterface();
cx.setShare(share);
cx.setLastLike(lastLike);
cx.setCurriculumClassificationId(iClassifications.getClassifications().get(i).getId());
cr.setCurriculumCourse(i, cx);
}
if (!cr.hasCurriculumCourses()) continue;
HorizontalPanel hp = (HorizontalPanel)iTable.getWidget(row, 0);
for (int i = 0; i < hp.getWidgetCount(); i++) {
Group g = (Group)hp.getWidget(i);
CurriculumCourseGroupInterface gr = groups.get(g.getName());
if (gr == null) {
gr = new CurriculumCourseGroupInterface();
gr.setName(g.getName());
gr.setType(g.getType());
gr.setEditable(g.isEditable());
gr.setColor(g.getColor());
groups.put(g.getName(), gr);
}
cr.addGroup(gr);
}
c.addCourse(cr);
}
return ret;
}