Examples of FormSelectListModel


Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
                        selectModel = new FormSelectComboBoxModel(getCurrentForm(), attr);
                    }
                    model = selectModel;
                    openedBlocks.add(Tag.SELECT);
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
                        selectModel = new FormSelectComboBoxModel(getCurrentForm(), attr);
                    }
                    model = selectModel;
                    openedBlocks.add(Tag.SELECT);
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

            /*
             * JList attributes
             */
            JList selectionList = new JList();
            FormSelectListModel optionModel;

            // Model
            if (model != null) {
                optionModel = (FormSelectListModel)model;
            } else {
                optionModel = new FormSelectListModel(new Form(SimpleAttributeSet.EMPTY),
                                                      SimpleAttributeSet.EMPTY,
                                                      selectionList.getSelectionModel());
            }

            selectionList.setModel(optionModel);
            selectionList.setSelectionModel(optionModel.getSelectionModel());

            if (isMultiple) {
                selectionList.setSelectionMode(ListSelectionModel
                                               .MULTIPLE_INTERVAL_SELECTION);

            }

            // TITLE
            if (!Utilities.isEmptyString(optionModel.getTitle())) {
                selectionList.setToolTipText(optionModel.getTitle());
            }

            // DIR
            setTextDir(selectionList, attrs);

            // OPTION attributes
            if (linesCount <= 1) {
                linesCount = Math.max(1, selectionList.getModel().getSize());
            }

            // Selection
            FormViewUtils.resetMultipleSelection(optionModel);

            /*
             * JScrollPane attributes
             */
            final FontMetrics fontMetrics
                = selectionList.getFontMetrics(selectionList.getFont());
            Dimension size;
            if (optionModel.getSize() == 0) {
                size = selectionList.getPreferredSize();
                Insets insets = selectionList.getInsets();
                size.width = fontMetrics.charWidth(MEAN_CHAR)
                             + insets.left + insets.right;
                selectionList.setPreferredSize(size);
            }

            JScrollPane pane = new JScrollPane(selectionList,
                                               JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);


            size = pane.getPreferredSize();
            size.height = linesCount * fontMetrics.getHeight();
            pane.setMinimumSize(size);
            pane.setMaximumSize(size);
            pane.setPreferredSize(size);
            pane.setAlignmentY(JComponent.BOTTOM_ALIGNMENT);

            // DISABLED
            if (optionModel.isEnabled()) {
                pane.setEnabled(false);
            }

            return pane;
        }
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

            /*
             * JList attributes
             */
            JList selectionList = new JList();
            FormSelectListModel optionModel;

            // Model
            if (model != null) {
                optionModel = (FormSelectListModel)model;
            } else {
                optionModel = new FormSelectListModel(new Form(SimpleAttributeSet.EMPTY),
                                                      SimpleAttributeSet.EMPTY,
                                                      selectionList.getSelectionModel());
            }

            selectionList.setModel(optionModel);
            selectionList.setSelectionModel(optionModel.getSelectionModel());

            if (isMultiple) {
                selectionList.setSelectionMode(ListSelectionModel
                                               .MULTIPLE_INTERVAL_SELECTION);

            }

            // TITLE
            if (!Utilities.isEmptyString(optionModel.getTitle())) {
                selectionList.setToolTipText(optionModel.getTitle());
            }

            // DIR
            setTextDir(selectionList, attrs);

            // OPTION attributes
            if (linesCount <= 1) {
                linesCount = Math.max(1, selectionList.getModel().getSize());
            }

            // Selection
            FormViewUtils.resetMultipleSelection(optionModel);

            /*
             * JScrollPane attributes
             */
            final FontMetrics fontMetrics
                = selectionList.getFontMetrics(selectionList.getFont());
            Dimension size;
            if (optionModel.getSize() == 0) {
                size = selectionList.getPreferredSize();
                Insets insets = selectionList.getInsets();
                size.width = fontMetrics.charWidth(MEAN_CHAR)
                             + insets.left + insets.right;
                selectionList.setPreferredSize(size);
            }

            JScrollPane pane = new JScrollPane(selectionList,
                                               JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);


            size = pane.getPreferredSize();
            size.height = linesCount * fontMetrics.getHeight();
            pane.setMinimumSize(size);
            pane.setMaximumSize(size);
            pane.setPreferredSize(size);
            pane.setAlignmentY(JComponent.BOTTOM_ALIGNMENT);

            // DISABLED
            if (optionModel.isEnabled()) {
                pane.setEnabled(false);
            }

            return pane;
        }
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
                        selectModel = new FormSelectComboBoxModel(getCurrentForm(), attr);
                    }
                    model = selectModel;
                    openedBlocks.add(Tag.SELECT);
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

            /*
             * JList attributes
             */
            JList selectionList = new JList();
            FormSelectListModel optionModel;

            // Model
            if (model != null) {
                optionModel = (FormSelectListModel)model;
            } else {
                optionModel = new FormSelectListModel(new Form(SimpleAttributeSet.EMPTY),
                                                      SimpleAttributeSet.EMPTY,
                                                      selectionList.getSelectionModel());
            }

            selectionList.setModel(optionModel);
            selectionList.setSelectionModel(optionModel.getSelectionModel());

            if (isMultiple) {
                selectionList.setSelectionMode(ListSelectionModel
                                               .MULTIPLE_INTERVAL_SELECTION);

            }

            // TITLE
            if (!Utilities.isEmptyString(optionModel.getTitle())) {
                selectionList.setToolTipText(optionModel.getTitle());
            }

            // DIR
            setTextDir(selectionList, attrs);

            // OPTION attributes
            if (linesCount <= 1) {
                linesCount = Math.max(1, selectionList.getModel().getSize());
            }

            // Selection
            FormViewUtils.resetMultipleSelection(optionModel);

            /*
             * JScrollPane attributes
             */
            final FontMetrics fontMetrics
                = selectionList.getFontMetrics(selectionList.getFont());
            Dimension size;
            if (optionModel.getSize() == 0) {
                size = selectionList.getPreferredSize();
                Insets insets = selectionList.getInsets();
                size.width = fontMetrics.charWidth(MEAN_CHAR)
                             + insets.left + insets.right;
                selectionList.setPreferredSize(size);
            }

            JScrollPane pane = new JScrollPane(selectionList,
                                               JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);


            size = pane.getPreferredSize();
            size.height = linesCount * fontMetrics.getHeight();
            pane.setMinimumSize(size);
            pane.setMaximumSize(size);
            pane.setPreferredSize(size);
            pane.setAlignmentY(JComponent.BOTTOM_ALIGNMENT);

            // DISABLED
            if (optionModel.isEnabled()) {
                pane.setEnabled(false);
            }

            return pane;
        }
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
                        selectModel = new FormSelectComboBoxModel(getCurrentForm(), attr);
                    }
                    model = selectModel;
                    openedBlocks.add(Tag.SELECT);
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

            /*
             * JList attributes
             */
            JList selectionList = new JList();
            FormSelectListModel optionModel;

            // Model
            if (model != null) {
                optionModel = (FormSelectListModel)model;
            } else {
                optionModel = new FormSelectListModel(new Form(SimpleAttributeSet.EMPTY),
                                                      SimpleAttributeSet.EMPTY,
                                                      selectionList.getSelectionModel());
            }

            selectionList.setModel(optionModel);
            selectionList.setSelectionModel(optionModel.getSelectionModel());

            if (isMultiple) {
                selectionList.setSelectionMode(ListSelectionModel
                                               .MULTIPLE_INTERVAL_SELECTION);

            }

            // TITLE
            if (!Utilities.isEmptyString(optionModel.getTitle())) {
                selectionList.setToolTipText(optionModel.getTitle());
            }

            // DIR
            setTextDir(selectionList, attrs);

            // OPTION attributes
            if (linesCount <= 1) {
                linesCount = Math.max(1, selectionList.getModel().getSize());
            }

            // Selection
            FormViewUtils.resetMultipleSelection(optionModel);

            /*
             * JScrollPane attributes
             */
            final FontMetrics fontMetrics
                = selectionList.getFontMetrics(selectionList.getFont());
            Dimension size;
            if (optionModel.getSize() == 0) {
                size = selectionList.getPreferredSize();
                Insets insets = selectionList.getInsets();
                size.width = fontMetrics.charWidth(MEAN_CHAR)
                             + insets.left + insets.right;
                selectionList.setPreferredSize(size);
            }

            JScrollPane pane = new JScrollPane(selectionList,
                                               JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);


            size = pane.getPreferredSize();
            size.height = linesCount * fontMetrics.getHeight();
            pane.setMinimumSize(size);
            pane.setMaximumSize(size);
            pane.setPreferredSize(size);
            pane.setAlignmentY(JComponent.BOTTOM_ALIGNMENT);

            // DISABLED
            if (optionModel.isEnabled()) {
                pane.setEnabled(false);
            }

            return pane;
        }
View Full Code Here

Examples of org.apache.harmony.x.swing.text.html.form.FormSelectListModel

                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
                        selectModel = new FormSelectComboBoxModel(getCurrentForm(), attr);
                    }
                    model = selectModel;
                    openedBlocks.add(Tag.SELECT);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.