// 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.v7.ui.Grid;
import de.datenhahn.vaadin.componentrenderer.client.detailskeys.DetailsOpenCloseServerRpc;
/**
 * 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;


/**
 * Handles the expansion and collapsing of the detailsrow with STRG+DOWN (expand) and STRG+UP (collapse).
 *
 * @author Jonas Hahn (jonas.hahn@datenhahn.de)
 */
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);
    }

// 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/main/java/de/datenhahn/vaadin/componentrenderer/DetailsKeysExtension.java
import com.vaadin.v7.ui.Grid;
import de.datenhahn.vaadin.componentrenderer.client.detailskeys.DetailsOpenCloseServerRpc;

/**
 * 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;


/**
 * Handles the expansion and collapsing of the detailsrow with STRG+DOWN (expand) and STRG+UP (collapse).
 *
 * @author Jonas Hahn (jonas.hahn@datenhahn.de)
 */
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 {