Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Form$FormListenerList


        invalidateComponent();
    }

    private void removeFields(int sectionIndex, int index, Sequence<Component> removed) {
        Form form = (Form)getComponent();
        int count = removed.getLength();

        // Remove the labels
        Sequence<Label> removedLabels = labels.get(sectionIndex).remove(index, count);
        for (int i = 0; i < count; i++) {
            form.remove(removedLabels.get(i));
        }

        // Remove the flag image views
        Sequence<ImageView> removedFlagImageViews = flagImageViews.get(sectionIndex).remove(index, count);
        for (int i = 0; i < count; i++) {
            form.remove(removedFlagImageViews.get(i));
        }

        invalidateComponent();
    }
View Full Code Here


        invalidateComponent();
    }

    private void updateSectionHeading(Form.Section section) {
        Form form = (Form)getComponent();
        int sectionIndex = form.getSections().indexOf(section);

        Separator separator = separators.get(sectionIndex);
        separator.setHeading(section.getHeading());
    }
View Full Code Here

        Separator separator = separators.get(sectionIndex);
        separator.setHeading(section.getHeading());
    }

    private void updateFieldLabel(Form.Section section, int fieldIndex) {
        Form form = (Form)getComponent();
        Component field = section.get(fieldIndex);

        int sectionIndex = form.getSections().indexOf(section);
        Label label = labels.get(sectionIndex).get(fieldIndex);
        String labelText = Form.getLabel(field);
        label.setText((labelText == null) ? "" : labelText + delimiter);
    }
View Full Code Here

        String labelText = Form.getLabel(field);
        label.setText((labelText == null) ? "" : labelText + delimiter);
    }

    private void updateFieldFlag(Form.Section section, int fieldIndex) {
        Form form = (Form)getComponent();
        Component field = section.get(fieldIndex);

        int sectionIndex = form.getSections().indexOf(section);
        ImageView flagImageView = flagImageViews.get(sectionIndex).get(fieldIndex);
        Form.Flag flag = Form.getFlag(field);

        Image flagImage = null;
        String flagMessage = null;
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        Form form = (Form) component;
        form.getFormListeners().add(this);
        form.getFormAttributeListeners().add(this);

        Form.SectionSequence sections = form.getSections();
        for (int i = 0, n = sections.getLength(); i < n; i++) {
            insertSection(sections.get(i), i);
        }

        form.getDecorators().add(new InlineFlagMessageDecorator());
    }
View Full Code Here

        int maximumLabelWidth = 0;
        int maximumFieldWidth = 0;
        int maximumSeparatorWidth = 0;

        Form form = (Form)getComponent();
        Form.SectionSequence sections = form.getSections();

        for (int sectionIndex = 0, sectionCount = sections.getLength();
            sectionIndex < sectionCount; sectionIndex++) {
            Form.Section section = sections.get(sectionIndex);
View Full Code Here

    @Override
    public int getPreferredHeight(int width) {
        int preferredHeight = 0;

        Form form = (Form)getComponent();
        Form.SectionSequence sections = form.getSections();

        // Determine the field width constraint
        int fieldWidth = (fill && width != -1) ? getFieldWidth(width) : -1;

        for (int sectionIndex = 0, sectionCount = sections.getLength();
View Full Code Here

    @Override
    public int getBaseline(int width, int height) {
        int baseline = -1;

        Form form = (Form)getComponent();
        Form.SectionSequence sections = form.getSections();

        // Determine the field width constraint
        int fieldWidth = (fill) ? getFieldWidth(width) : -1;

        int sectionCount = sections.getLength();
View Full Code Here

    private int getFieldWidth(int width) {
        int maximumLabelWidth = 0;
        int maximumFlagMessageWidth = 0;

        Form form = (Form)getComponent();
        Form.SectionSequence sections = form.getSections();

        for (int sectionIndex = 0, sectionCount = sections.getLength();
            sectionIndex < sectionCount; sectionIndex++) {
            Form.Section section = sections.get(sectionIndex);
View Full Code Here

        return fieldWidth;
    }

    @Override
    public void layout() {
        Form form = (Form)getComponent();
        Form.SectionSequence sections = form.getSections();

        // Determine the maximum label and flag message width
        int maximumLabelWidth = 0;
        int maximumFlagMessageWidth = 0;
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Form$FormListenerList

Copyright © 2018 www.massapicom. 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.