Example usage for com.google.gwt.user.client.ui HTMLPanel iterator

List of usage examples for com.google.gwt.user.client.ui HTMLPanel iterator

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HTMLPanel iterator.

Prototype

public Iterator<Widget> iterator() 

Source Link

Usage

From source file:com.polymerui.client.view.util.PolymerUtil.java

License:Apache License

public static PaperDialog findPaperDialog(String errMess, HTMLPanel ha) {
    if (ha instanceof PaperDialog)
        return (PaperDialog) ha;
    Iterator<Widget> iW = ha.iterator();
    while (iW.hasNext()) {
        Widget ww = iW.next();//from  w  w  w  . j a  va 2s.  c o  m
        if (ww instanceof PaperDialog)
            return (PaperDialog) ww;
    }
    Utils.errAlertB(errMess, M.M().CannotFindPaperDialog());
    return null;
}

From source file:org.ednovo.gooru.client.uc.CourseListUc.java

License:Open Source License

private void setCourseData(final List<LibraryCodeDo> libraryCodeDo) {
    final HTMLPanel panel = new HTMLPanel("");
    panel.clear();// w  ww  .ja  va 2  s.  c o  m
    contentPanel.clear();
    Map<String, Integer> courseList = new HashMap<String, Integer>();
    for (int j = 0; j < libraryCodeDo.size(); j++) {
        String courseListValues = libraryCodeDo.get(j).getLabel();
        Label courseValues = new Label(courseListValues);
        courseValues.setStyleName(res.css().infoCourseListText());
        courseValues.getElement().setId(courseListValues);
        courseList.put(courseListValues, j);
        panel.add(courseValues);

    }
    contentPanel.add(panel);
    final Map<String, Integer> course = courseList;
    Iterator<Widget> widgets = panel.iterator();
    while (widgets.hasNext()) {
        final Widget widget = widgets.next();
        if (widget instanceof Label) {
            ((Label) widget).addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    isSelected = true;
                    int subjectCode = course.get(widget.getElement().getId());
                    courseName = libraryCodeDo.get(subjectCode).getLabel();

                    courseCode = libraryCodeDo.get(subjectCode).getCodeId();
                    final Iterator<Widget> widgetsPanel = panel.iterator();

                    while (widgetsPanel.hasNext()) {
                        widgetsPanel.next().removeStyleName(res.css().collectionInfoCourseList());
                    }
                    widget.addStyleName(res.css().collectionInfoCourseList());

                }
            });
        }
    }

}