// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/ComponentCellKeyExtension.java
// public class ComponentCellKeyExtension extends Grid.AbstractGridExtension {
// 
//     private ComponentCellKeyExtension(final Grid grid) {
//         super.extend(grid);
//     }
// 
//     public static ComponentCellKeyExtension extend(Grid grid) {
//         return new ComponentCellKeyExtension(grid);
//     }
// 
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/DetailsKeysExtension.java
// public class DetailsKeysExtension extends Grid.AbstractGridExtension {
// 
//     private DetailsKeysExtension(final Grid grid) {
//         super.extend(grid);
//         registerRpc(new DetailsOpenCloseServerRpcImpl(grid));
//     }
// 
//     public static DetailsKeysExtension extend(Grid grid) {
//         return new DetailsKeysExtension(grid);
//     }
// 
//     public static class DetailsOpenCloseServerRpcImpl implements DetailsOpenCloseServerRpc {
//         private final Grid grid;
// 
//         public DetailsOpenCloseServerRpcImpl(Grid grid) {
//             this.grid = grid;
//         }
// 
//         @Override
//         public void setDetailsVisible(int rowIndex, boolean visible) {
//             Object itemId = grid.getContainerDataSource().getItemIds(rowIndex, 1).get(0);
//             grid.setDetailsVisible(itemId, visible);
//         }
//     }
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/FocusPreserveExtension.java
// public class FocusPreserveExtension extends Grid.AbstractGridExtension {
//     private final FocusPreservingRefreshClientRpc focusRpc = getRpcProxy(FocusPreservingRefreshClientRpc.class);
// 
//     private FocusPreserveExtension(final Grid grid) {
//         super.extend(grid);
//     }
// 
//     public static FocusPreserveExtension extend(Grid grid) {
//         return new FocusPreserveExtension(grid);
//     }
// 
//     /**
//      * Saves the grid's current focus in this extension's internal state.
//      */
//     public void saveFocus() {
//         focusRpc.saveFocus();
//     }
// 
//     /**
//      * Restores the grid's focus from  extension's internal state.
//      */
//     public void restoreFocus() {
//         focusRpc.restoreFocus();
//     }
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/header/ComponentHeaderGenerator.java
// public interface ComponentHeaderGenerator extends HeaderGenerator<Component> {
// 
//     @Override
//     Component getHeader(Object propertyId);
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/header/HtmlHeaderGenerator.java
// public interface HtmlHeaderGenerator extends HeaderGenerator<String> {
// 
//     @Override
//     String getHeader(Object propertyId);
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/header/TextHeaderGenerator.java
// public interface TextHeaderGenerator extends HeaderGenerator<String> {
// 
//     @Override
//     String getHeader(Object propertyId);
// }


import com.vaadin.v7.data.Item;
import com.vaadin.v7.data.util.GeneratedPropertyContainer;
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.ComponentCellKeyExtension;
import de.datenhahn.vaadin.componentrenderer.DetailsKeysExtension;
import de.datenhahn.vaadin.componentrenderer.FocusPreserveExtension;
import de.datenhahn.vaadin.componentrenderer.grid.header.ComponentHeaderGenerator;
import de.datenhahn.vaadin.componentrenderer.grid.header.HtmlHeaderGenerator;
import de.datenhahn.vaadin.componentrenderer.grid.header.TextHeaderGenerator;
import org.hamcrest.core.Is;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertTrue;
/*
 * Licensed under the Apache License,Version2.0(the"License");you may not
 * use this file except in compliance with the License.You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,software
 * distributed under the License is distributed on an"AS IS"BASIS,WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/*
 * Licensed under the Apache License,Version2.0(the"License");you may not
 * use this file except in compliance with the License.You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,software
 * distributed under the License is distributed on an"AS IS"BASIS,WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package de.datenhahn.vaadin.componentrenderer.grid;




public class ComponentGridTest {

    public static final String COLUMN_CAPTION = "caption";
    public static final String FOO_0 = "foo0";

    @Test
    public void testDecoration() {
        ComponentGrid grid = createTestGrid();
        Grid.DetailsGenerator detailsGenerator = grid.getDetailsGenerator();

        assertTrue(containsExtension(grid, FocusPreserveExtension.class));
        assertTrue(containsExtension(grid, DetailsKeysExtension.class));
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/ComponentCellKeyExtension.java
// public class ComponentCellKeyExtension extends Grid.AbstractGridExtension {
// 
//     private ComponentCellKeyExtension(final Grid grid) {
//         super.extend(grid);
//     }
// 
//     public static ComponentCellKeyExtension extend(Grid grid) {
//         return new ComponentCellKeyExtension(grid);
//     }
// 
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/DetailsKeysExtension.java
// public class DetailsKeysExtension extends Grid.AbstractGridExtension {
// 
//     private DetailsKeysExtension(final Grid grid) {
//         super.extend(grid);
//         registerRpc(new DetailsOpenCloseServerRpcImpl(grid));
//     }
// 
//     public static DetailsKeysExtension extend(Grid grid) {
//         return new DetailsKeysExtension(grid);
//     }
// 
//     public static class DetailsOpenCloseServerRpcImpl implements DetailsOpenCloseServerRpc {
//         private final Grid grid;
// 
//         public DetailsOpenCloseServerRpcImpl(Grid grid) {
//             this.grid = grid;
//         }
// 
//         @Override
//         public void setDetailsVisible(int rowIndex, boolean visible) {
//             Object itemId = grid.getContainerDataSource().getItemIds(rowIndex, 1).get(0);
//             grid.setDetailsVisible(itemId, visible);
//         }
//     }
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/FocusPreserveExtension.java
// public class FocusPreserveExtension extends Grid.AbstractGridExtension {
//     private final FocusPreservingRefreshClientRpc focusRpc = getRpcProxy(FocusPreservingRefreshClientRpc.class);
// 
//     private FocusPreserveExtension(final Grid grid) {
//         super.extend(grid);
//     }
// 
//     public static FocusPreserveExtension extend(Grid grid) {
//         return new FocusPreserveExtension(grid);
//     }
// 
//     /**
//      * Saves the grid's current focus in this extension's internal state.
//      */
//     public void saveFocus() {
//         focusRpc.saveFocus();
//     }
// 
//     /**
//      * Restores the grid's focus from  extension's internal state.
//      */
//     public void restoreFocus() {
//         focusRpc.restoreFocus();
//     }
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/header/ComponentHeaderGenerator.java
// public interface ComponentHeaderGenerator extends HeaderGenerator<Component> {
// 
//     @Override
//     Component getHeader(Object propertyId);
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/header/HtmlHeaderGenerator.java
// public interface HtmlHeaderGenerator extends HeaderGenerator<String> {
// 
//     @Override
//     String getHeader(Object propertyId);
// }
// 
// Path: componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/header/TextHeaderGenerator.java
// public interface TextHeaderGenerator extends HeaderGenerator<String> {
// 
//     @Override
//     String getHeader(Object propertyId);
// }


// Path: componentrenderer/src/test/java/de/datenhahn/vaadin/componentrenderer/grid/ComponentGridTest.java
import com.vaadin.v7.data.Item;
import com.vaadin.v7.data.util.GeneratedPropertyContainer;
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.ComponentCellKeyExtension;
import de.datenhahn.vaadin.componentrenderer.DetailsKeysExtension;
import de.datenhahn.vaadin.componentrenderer.FocusPreserveExtension;
import de.datenhahn.vaadin.componentrenderer.grid.header.ComponentHeaderGenerator;
import de.datenhahn.vaadin.componentrenderer.grid.header.HtmlHeaderGenerator;
import de.datenhahn.vaadin.componentrenderer.grid.header.TextHeaderGenerator;
import org.hamcrest.core.Is;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertTrue;

/*
 * Licensed under the Apache License,Version2.0(the"License");you may not
 * use this file except in compliance with the License.You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,software
 * distributed under the License is distributed on an"AS IS"BASIS,WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/*
 * Licensed under the Apache License,Version2.0(the"License");you may not
 * use this file except in compliance with the License.You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,software
 * distributed under the License is distributed on an"AS IS"BASIS,WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package de.datenhahn.vaadin.componentrenderer.grid;




public class ComponentGridTest {

    public static final String COLUMN_CAPTION = "caption";
    public static final String FOO_0 = "foo0";

    @Test
    public void testDecoration() {
        ComponentGrid grid = createTestGrid();
        Grid.DetailsGenerator detailsGenerator = grid.getDetailsGenerator();

        assertTrue(containsExtension(grid, FocusPreserveExtension.class));
        assertTrue(containsExtension(grid, DetailsKeysExtension.class));
        assertTrue(containsExtension(grid, ComponentCellKeyExtension.class));