Examples of BoundWidget


Examples of com.totsp.gwittir.client.ui.BoundWidget

        this.panel = panel;
        this.provider = provider;
    }
   
    public void handleException(Object source, ValidationException exception) {
        BoundWidget widget = (BoundWidget) this.widgets.get( source );
        if( this.provider != null ){
            if( widget != null ){
                panel.remove( (Widget) widget );
            }
            widget = provider.get();
        } else {
            Label l = new Label();
            l.setStyleName( "gwittir-ValidationPanel");
            widget = l;
        }
        this.panel.add( (Widget) widget );
        widget.setValue( this.getMessage( exception ) );
        this.widgets.put( source, widget );
    }
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

    public AbstractTableWidget() {
    }

    protected BoundWidget createWidget(Binding parent, Field field,
        SourcesPropertyChangeEvents target) {
        final BoundWidget widget;
        Binding binding;

        if(field.getCellProvider() != null) {
            widget = field.getCellProvider().get();
        } else {
            final Property p = Introspector.INSTANCE.getDescriptor(target)
                                                    .getProperty(field
                    .getPropertyName());
            widget = this.factory.getWidgetProvider(field.getPropertyName(),
                    p.getType()).get();

            // TODO Figure out some way to make this read only.
        }

       


        binding = new Binding(widget, "value", field.getValidator(),
                field.getFeedback(), target, field.getPropertyName(), null, null);
        widget.setModel(this.getValue());

        if(field.getConverter() != null) {
            binding.getRight().converter = field.getConverter();
        }

        if(field.getComparator() != null) {
            widget.setComparator(field.getComparator());
        }

        parent.getChildren().add(binding);

        return widget;
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

                valueHasChanged = true;
                if( factory.isMarking() && widget.isAttached() ){
                    showMarker( widget );
                }
                if(widget instanceof BoundWidget ){
                    BoundWidget bw = (BoundWidget) widget;
                    List widgets = (List) factory.widgetLookup.get( bw.getModel() );
                    if( widgets == null ){
                        widgets = new ArrayList();
                        factory.widgetLookup.put( bw.getModel(), widgets );
                    }
                    if( !widgets.contains( bw ) ){
                        widgets.add( bw );
                    }
                       
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

            this.p = p;
            this.factory = factory;
        }
       
        public BoundWidget get() {
            BoundWidget w = p.get();
            w.addPropertyChangeListener( new ChangeMarkerListener(this.factory) );
            return w;
        }
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

    }

    private BoundWidget createCellWidget(Binding rowBinding, int colIndex,
            SourcesPropertyChangeEvents target) {
        try {
            final BoundWidget widget;
            Field col = this.columns[colIndex];
            BoundWidget[] rowWidgets = (BoundWidget[]) widgetCache.get(target);

            if (rowWidgets == null) {
                rowWidgets = new BoundWidget[this.columns.length];
                widgetCache.put(target, rowWidgets);
            }

            if (rowWidgets[colIndex] != null) {
                widget = rowWidgets[colIndex];
                BoundTable.LOG.log(Level.SPAM,
                        "Using cache widget for " + target + "."
                        + col.getPropertyName(), null);
            } else {
                if (col.getCellProvider() != null) {
                    widget = col.getCellProvider().get();
                } else {
                    final Property p = Introspector.INSTANCE.getDescriptor(target).getProperty(col.getPropertyName());
                    widget = this.factory.getWidgetProvider(col.getPropertyName(),
                            p.getType()).get();

                    // TODO Figure out some way to make this read only.
                }

                rowWidgets[colIndex] = widget;
                BoundTable.LOG.log(Level.SPAM,
                        "Creating widget for " + target + "." + col.getPropertyName(),
                        null);
            }

            Binding[] bindings = (Binding[]) this.bindingCache.get(target);

            if (bindings == null) {
                bindings = new Binding[this.columns.length];
                this.bindingCache.put(target, bindings);
            }

            if (bindings[colIndex] == null) {
                bindings[colIndex] = new Binding(widget, "value",
                        col.getValidator(), col.getFeedback(), target,
                        col.getPropertyName(), null, null);
                BoundTable.LOG.log(Level.SPAM,
                        "Created binding " + bindings[colIndex], null);
            }

            widget.setModel(target);
            rowBinding.getChildren().add(bindings[colIndex]);

            return widget;
        } catch (Exception e) {
            GWT.log(null, e);
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

            } else {
                it.next();
            }
        }

        BoundWidget widget = this.factory.getWidgetProvider(Introspector.INSTANCE.resolveClass(
                o)).get();
        widget.setModel(o);
        this.table.insertRow(row + 1);
        this.table.setWidget(row + 1, 0, (Widget) widget);
        this.table.getFlexCellFormatter().setColSpan(row + 1, 0, this.columns.length + 1);
        this.table.getCellFormatter().setStyleName(row + 1, 0, "expanded");
        this.modifySelectedIndexes(row, +1);
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

    public AbstractTableWidget() {
    }

    protected BoundWidget createWidget(Binding parent, Field field,
        Bindable target) {
        final BoundWidget widget;
        Binding binding;

        if(field.getCellProvider() != null) {
            widget = field.getCellProvider().get();
        } else {
            final Property p = Introspector.INSTANCE.getDescriptor(target)
                                                    .getProperty(field
                    .getPropertyName());
            widget = this.factory.getWidgetProvider(field.getPropertyName(),
                    p.getType()).get();

            // TODO Figure out some way to make this read only.
        }

       


        binding = new Binding(widget, "value", field.getValidator(),
                field.getFeedback(), target, field.getPropertyName(), null, null);
        widget.setModel(this.getValue());

        if(field.getConverter() != null) {
            binding.getRight().converter = field.getConverter();
        }

        if(field.getComparator() != null) {
            widget.setComparator(field.getComparator());
        }

        parent.getChildren().add(binding);

        return widget;
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

        this.changes.firePropertyChange("selected", old, this.getSelected());
    }

    private BoundWidget createCellWidget(Binding rowBinding, int colIndex,
        Bindable target) {
        final BoundWidget widget;
        Field col = this.columns[colIndex];
        BoundWidget[] rowWidgets = (BoundWidget[]) widgetCache.get(target);

        if (rowWidgets == null) {
            rowWidgets = new BoundWidget[this.columns.length];
            widgetCache.put(target, rowWidgets);
        }

        if (rowWidgets[colIndex] != null) {
            widget = rowWidgets[colIndex];
            BoundTable.LOG.log(Level.SPAM,
                "Using cache widget for " + target + "." +
                col.getPropertyName(), null);
        } else {
            if (col.getCellProvider() != null) {
                widget = col.getCellProvider().get();
            } else {
                final Property p = Introspector.INSTANCE.getDescriptor(target)
                                                        .getProperty(col.getPropertyName());
                widget = this.factory.getWidgetProvider(col.getPropertyName(),
                        p.getType()).get();

                // TODO Figure out some way to make this read only.
            }

            rowWidgets[colIndex] = widget;
            BoundTable.LOG.log(Level.SPAM,
                "Creating widget for " + target + "." + col.getPropertyName(),
                null);
        }

        Binding[] bindings = (Binding[]) this.bindingCache.get(target);

        if (bindings == null) {
            bindings = new Binding[this.columns.length];
            this.bindingCache.put(target, bindings);
        }

        if (bindings[colIndex] == null) {
            bindings[colIndex] = new Binding(widget, "value",
                    col.getValidator(), col.getFeedback(), target,
                    col.getPropertyName(), null, null);
            BoundTable.LOG.log(Level.SPAM,
                "Created binding " + bindings[colIndex], null);
        }

        widget.setModel(target);
        rowBinding.getChildren().add(bindings[colIndex]);

        return widget;
    }
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

            } else {
                it.next();
            }
        }

        BoundWidget widget = this.factory.getWidgetProvider(Introspector.INSTANCE.resolveClass(
                    o)).get();
        widget.setModel(o);
        this.table.insertRow(row + 1);
        this.table.setWidget(row + 1, 0, (Widget) widget);
        this.table.getFlexCellFormatter()
                  .setColSpan(row + 1, 0, this.columns.length + 1);
        this.table.getCellFormatter().setStyleName(row + 1, 0, "expanded");
View Full Code Here

Examples of com.totsp.gwittir.client.ui.BoundWidget

    }

    private BoundWidget createCellWidget(Binding rowBinding, int colIndex,
            SourcesPropertyChangeEvents target) {
        try {
            final BoundWidget widget;
            Field col = this.columns[colIndex];
            BoundWidget[] rowWidgets = (BoundWidget[]) widgetCache.get(target);

            if (rowWidgets == null) {
                rowWidgets = new BoundWidget[this.columns.length];
                widgetCache.put(target, rowWidgets);
            }

            if (rowWidgets[colIndex] != null) {
                widget = rowWidgets[colIndex];
                BoundTable.LOG.log(Level.SPAM,
                        "Using cache widget for " + target + "."
                        + col.getPropertyName(), null);
            } else {
                if (col.getCellProvider() != null) {
                    widget = col.getCellProvider().get();
                } else {
                    final Property p = Introspector.INSTANCE.getDescriptor(target).getProperty(col.getPropertyName());
                    widget = this.factory.getWidgetProvider(col.getPropertyName(),
                            p.getType()).get();

                    // TODO Figure out some way to make this read only.
                }
                assert widget != null : target + "." + col.getPropertyName() + " did not get a widget.";
                rowWidgets[colIndex] = widget;
                BoundTable.LOG.log(Level.SPAM,
                        "Creating widget for " + target + "." + col.getPropertyName(),
                        null);
            }

            Binding[] bindings = (Binding[]) this.bindingCache.get(target);

            if (bindings == null) {
                bindings = new Binding[this.columns.length];
                this.bindingCache.put(target, bindings);
            }

            if (bindings[colIndex] == null) {
                try {
                    bindings[colIndex] = new Binding(widget, "value",
                            col.getValidator(), col.getFeedback(), target,
                            col.getPropertyName(), null, null);
                    BoundTable.LOG.log(Level.SPAM,
                            "Created binding " + bindings[colIndex], null);
                } catch (Throwable e) {
                    throw new RuntimeException("Error creating " + col.getPropertyName(), e);
                }
            }

            widget.setModel(target);
            rowBinding.getChildren().add(bindings[colIndex]);

            return widget;
        } catch (Exception e) {
            GWT.log(null, e);
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.