Package org.libreplan.business.common.entities

Examples of org.libreplan.business.common.entities.ConnectorProperty


    public RowRenderer getConnectorPropertriesRenderer() {
        return new RowRenderer() {
            @Override
            public void render(Row row, Object data) {
                ConnectorProperty property = (ConnectorProperty) data;
                row.setValue(property);

                Util.appendLabel(row, _(property.getKey()));
                appendValueTextbox(row, property);
            }

            private void appendValueTextbox(Row row,
                    final ConnectorProperty property) {
                final Textbox textbox = new Textbox();
                textbox.setWidth("400px");
                textbox.setConstraint(checkPropertyValue(property));

                Util.bind(textbox, new Util.Getter<String>() {

                    @Override
                    public String get() {
                        return property.getValue();
                    }
                }, new Util.Setter<String>() {

                    @Override
                    public void set(String value) {
                        property.setValue(value);
                    }
                });
                if (property.getKey().equals(
                        PredefinedConnectorProperties.PASSWORD)) {
                    textbox.setType("password");
                }

                row.appendChild(textbox);
            }

            public Constraint checkPropertyValue(
                    final ConnectorProperty property) {
                final String key = property.getKey();
                return new Constraint() {
                    @Override
                    public void validate(Component comp, Object value) {
                        if (key.equals(PredefinedConnectorProperties.ACTIVATED)) {
                            if (!((String) value).equalsIgnoreCase("Y")
View Full Code Here

TOP

Related Classes of org.libreplan.business.common.entities.ConnectorProperty

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.