Package com.palantir.ptoss.cinch.core

Examples of com.palantir.ptoss.cinch.core.Binding


                if(level == null){
                    throw new IllegalArgumentException("'" + levelParam + "' is not a valid log4j level");
                }
                if (BindableModel.class.isAssignableFrom(field.getType())) {
                    BindableModel model = context.getFieldObject(field, BindableModel.class);
                    Binding binding = new Binding() {
                        public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                            for (T t : changed){
                                Logger logger = LogManager.getLogger(loggerParam);
                                Level configuredLevel = logger.getLevel();
                                if(configuredLevel == null || configuredLevel.isGreaterOrEqual(level)){
View Full Code Here


        return ImmutableList.of(bindJComboBox(bound, mutator, combo, nullValue));
    }

    private Binding bindJComboBox(final Bound bound, final Mutator mutator, final JComboBox combo, final String nullValue) {
        final List<Object> ons = BindingContext.getOnObjects(bound.on(), mutator.getModel());
        Binding binding = new Binding() {
            public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                if (!BindingContext.isOn(ons, changed)) {
                    return;
                }
                try {
View Full Code Here

                throw new BindingException("could not find bindable property: " + to);
            }
            if (getter.getMethod().getReturnType() != boolean.class) {
                throw new BindingException("VisibleIf binding must return boolean: " + to);
            }
            final Binding binding = new Binding() {
                public <T extends Enum<?> & ModelUpdate> void update(final T... changed) {
                    try {
                        getter.getMethod().setAccessible(true);
                        boolean visible = (Boolean)getter.getMethod().invoke(getter.getObject());
                        if (invert) {
View Full Code Here

        return ImmutableList.of(bindJList(bound, mutator, list));
    }

    private Binding bindJList(final Bound bound, final Mutator mutator, final JList list) {
        final List<Object> ons = BindingContext.getOnObjects(bound.on(), mutator.getModel());
        Binding binding = new Binding() {
            public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                if (!BindingContext.isOn(ons, changed)) {
                    return;
                }
                try {
View Full Code Here

                } catch (Exception ex) {
                    Wiring.logger.error("exception in AbstractButton binding", ex);
                }
            }
        });
        Binding binding = new Binding() {
            public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                try {
                  abstractButton.setSelected((Boolean)mutator.get());
                } catch (Exception ex) {
                    Wiring.logger.error("exception in AbstractButton binding", ex);
View Full Code Here

                        }
                    }
                }
            });

            Binding binding = new Binding() {
                public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                    if (!BindingContext.isOn(ons, changed)) {
                        return;
                    }
                    try {
View Full Code Here

                        logger.error("could not invoke JComboBox binding", ex);
                    }
                }
            });

            Binding binding = new Binding() {
                public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                    try {
                        Object current = mutator.get();
                        if (current == null) {
                            current = nullValue;
View Full Code Here

                    Wiring.logger.error("exception in JRadioButton binding", ex); //$NON-NLS-1$
                }
            }
        });

        Binding binding = new Binding() {
            public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                try {
                    button.setSelected(mutator.get().equals(Boolean.valueOf(booleanValue)));
                } catch (Exception ex) {
                    Wiring.logger.error("exception in JRadioButton binding", ex); //$NON-NLS-1$
View Full Code Here

                    Wiring.logger.error("exception in JToggleButton binding", ex); //$NON-NLS-1$
                }
            }
        });

        Binding binding = new Binding() {
            public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                try {
                    button.setSelected(mutator.get() == enumValue);
                } catch (Exception ex) {
                    Wiring.logger.error("exception in JToggleButton binding", ex); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of com.palantir.ptoss.cinch.core.Binding

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.