// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/client/detailskeys/DetailsOpenCloseServerRpc.java
// public interface DetailsOpenCloseServerRpc extends ServerRpc {
// 
//     /**
//      * Sets the details of a row visible or hidden.
//      *
//      * @param rowIndex the rowIndex of the row, this is the rowIndex of an IndexedContainer,
//      *                 this is NOT the rowId (= id in the container) or the
//      *                 rowKey (= internal key in clienside grid implementation)
//      * @param visible set the details to visible (= true) or hidden (= false)
//      */
//     void setDetailsVisible(int rowIndex, boolean visible);
// }


import com.vaadin.server.Extension;
import com.vaadin.ui.Component;
import com.vaadin.v7.ui.Grid;
import com.vaadin.v7.ui.Label;
import de.datenhahn.vaadin.componentrenderer.client.detailskeys.DetailsOpenCloseServerRpc;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

        assertFalse(grid.isDetailsVisible(id));

    }

    private Grid createTestGrid() {
        Grid grid = new Grid();
        grid.addColumn("rows");
        grid.setDetailsGenerator(new Grid.DetailsGenerator() {
            @Override
            public Component getDetails(Grid.RowReference rowReference) {
                return new Label("foo");
            }
        });
        for(int i = 0; i <= 10;i++) {
            grid.addRow("foo"+i);
        }
        return grid;
    }

    private boolean containsDetailsGridExtension(Grid grid) {
        for (Extension extension : grid.getExtensions()) {
            if (extension instanceof DetailsKeysExtension) {
                return true;
            }
        }
        return false;
    }

    private boolean hasDetailsGridExtensionRpc(DetailsKeysExtension extension) {
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/client/detailskeys/DetailsOpenCloseServerRpc.java
// public interface DetailsOpenCloseServerRpc extends ServerRpc {
// 
//     /**
//      * Sets the details of a row visible or hidden.
//      *
//      * @param rowIndex the rowIndex of the row, this is the rowIndex of an IndexedContainer,
//      *                 this is NOT the rowId (= id in the container) or the
//      *                 rowKey (= internal key in clienside grid implementation)
//      * @param visible set the details to visible (= true) or hidden (= false)
//      */
//     void setDetailsVisible(int rowIndex, boolean visible);
// }


// Path: componentrenderer/src/test/java/de/datenhahn/vaadin/componentrenderer/DetailsKeysExtensionTest.java
import com.vaadin.server.Extension;
import com.vaadin.ui.Component;
import com.vaadin.v7.ui.Grid;
import com.vaadin.v7.ui.Label;
import de.datenhahn.vaadin.componentrenderer.client.detailskeys.DetailsOpenCloseServerRpc;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;


        assertFalse(grid.isDetailsVisible(id));

    }

    private Grid createTestGrid() {
        Grid grid = new Grid();
        grid.addColumn("rows");
        grid.setDetailsGenerator(new Grid.DetailsGenerator() {
            @Override
            public Component getDetails(Grid.RowReference rowReference) {
                return new Label("foo");
            }
        });
        for(int i = 0; i <= 10;i++) {
            grid.addRow("foo"+i);
        }
        return grid;
    }

    private boolean containsDetailsGridExtension(Grid grid) {
        for (Extension extension : grid.getExtensions()) {
            if (extension instanceof DetailsKeysExtension) {
                return true;
            }
        }
        return false;
    }

    private boolean hasDetailsGridExtensionRpc(DetailsKeysExtension extension) {
        return extension.getRpcManager(DetailsOpenCloseServerRpc.class.getName()) != null;