< prev index next >

## src/java.desktop/share/classes/javax/swing/text/html/HTMLWriter.java

Print this page

    rev 48358 : Work in progress for JDK-6303622
    Use generic in Swing components like JComboBox
    1. Added generic return type and parameter type for JComboBox.
    2. Modified JList related classes as well.

    *** 529,548 ****
           */
          protected void selectContent(AttributeSet attr) throws IOException {
              Object model = attr.getAttribute(StyleConstants.ModelAttribute);
              incrIndent();
              if (model instanceof OptionListModel) {
    !             @SuppressWarnings("unchecked")
    !             OptionListModel<Option> listModel = (OptionListModel<Option>) model;
                  int size = listModel.getSize();
                  for (int i = 0; i < size; i++) {
                      Option option = listModel.getElementAt(i);
                      writeOption(option);
                  }
              } else if (model instanceof OptionComboBoxModel) {
    !             @SuppressWarnings("unchecked")
    !             OptionComboBoxModel<Option> comboBoxModel = (OptionComboBoxModel<Option>) model;
                  int size = comboBoxModel.getSize();
                  for (int i = 0; i < size; i++) {
                      Option option = comboBoxModel.getElementAt(i);
                      writeOption(option);
                  }
    --- 529,546 ----
           */
          protected void selectContent(AttributeSet attr) throws IOException {
              Object model = attr.getAttribute(StyleConstants.ModelAttribute);
              incrIndent();
              if (model instanceof OptionListModel) {
    !             OptionListModel listModel = (OptionListModel) model;
                  int size = listModel.getSize();
                  for (int i = 0; i < size; i++) {
                      Option option = listModel.getElementAt(i);
                      writeOption(option);
                  }
              } else if (model instanceof OptionComboBoxModel) {
    !             OptionComboBoxModel comboBoxModel = (OptionComboBoxModel) model;
                  int size = comboBoxModel.getSize();
                  for (int i = 0; i < size; i++) {
                      Option option = comboBoxModel.getElementAt(i);
                      writeOption(option);
                  }

< prev index next >