All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.as.console.client.shared.subsys.jca.DataSourceValidationEditor Maven / Gradle / Ivy

Go to download

Bundles the core AS7 console as a GWT module. Includes minor customizations to support extensions.

There is a newer version: 0.7.0.Final
Show newest version
package org.jboss.as.console.client.shared.subsys.jca;

import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.shared.subsys.Baseadress;
import org.jboss.as.console.client.shared.subsys.jca.model.DataSource;
import org.jboss.as.console.client.widgets.forms.BlankItem;
import org.jboss.as.console.client.widgets.forms.FormEditor;
import org.jboss.as.console.client.widgets.forms.FormToolStrip;
import org.jboss.ballroom.client.widgets.forms.CheckBoxItem;
import org.jboss.ballroom.client.widgets.forms.NumberBoxItem;
import org.jboss.ballroom.client.widgets.forms.TextBoxItem;
import org.jboss.dmr.client.ModelNode;

/**
 * @author Heiko Braun
 * @date 12/13/11
 */
public class DataSourceValidationEditor extends FormEditor{

    public DataSourceValidationEditor(FormToolStrip.FormCallback callback) {

        super(DataSource.class);

        ModelNode helpAddress = Baseadress.get();
        helpAddress.add("subsystem", "datasources");
        helpAddress.add("data-source", "*");

        setCallback(callback);
        setHelpAddress(helpAddress);
    }

    @Override
    public Widget asWidget() {

        TextBoxItem connectionChecker = new TextBoxItem("validConnectionChecker", "Valid Connection Checker") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };

        TextBoxItem connectionSql= new TextBoxItem("checkValidSql", "Check Valid Sql") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };

        CheckBoxItem validateOnMatch = new CheckBoxItem("validateOnMatch", "Validate On Match") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };

        CheckBoxItem backgroundValidation = new CheckBoxItem("backgroundValidation", "Background Validation") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };


        NumberBoxItem backgroundValidationMillis = new NumberBoxItem("backgroundValidationMillis", "Validation Millis") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };

        TextBoxItem staleConnectionChecker = new TextBoxItem("staleConnectionChecker", "Stale Connection Checker") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };

        TextBoxItem exceptionSorter= new TextBoxItem("exceptionSorter", "Exception Sorter") {
            @Override
            public boolean isRequired() {
                return false;
            }
        };

        getForm().setFields(
                connectionChecker, connectionSql,
                validateOnMatch, BlankItem.INSTANCE,
                backgroundValidation, backgroundValidationMillis,
                staleConnectionChecker, exceptionSorter);

        return super.asWidget();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy