Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) Copyright(C) 2008-2013, Openmind S.r.l. http://www.openmindonline.it This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 
 package net.sourceforge.openutils.mgnlcontrols.configuration;
 
 import  info.magnolia.cms.core.Content;
 import  info.magnolia.cms.i18n.Messages;
 import  info.magnolia.cms.security.AccessDeniedException;
 import  info.magnolia.context.MgnlContext;
 import  info.magnolia.module.ModuleRegistry;
 
 import java.util.Map;
 
 
A column of checkboxes.

Author(s):
dschivo
Version:
$Id: CheckboxGridColumnType.java 4282 2013-08-22 11:06:56Z lucaboati $
 
 public class CheckboxGridColumnType implements GridColumnType
 {

    
 
     public String getHeadSnippet()
     {
         return "<script type=\"text/javascript\" src=\""
             + MgnlContext.getContextPath()
             + "/.resources/controls/"
             + ModuleRegistry.Factory.getInstance().getDefinition("controls").getVersion()
             + "/js/CheckColumn.js\"></script>";
     }

    
 
     public String drawSupportHtml(String propertyNameint colIndexMap colmap, Messages msgs)
     {
         return .;
     }

    
 
     @SuppressWarnings("unchecked")
     public String drawColumnJs(String propertyNameint colIndexMap colMap, Messages msgs)
     {
         String header = (StringcolMap.get("header");
         return "(function(){\n"
             + "var cc = new Ext.grid.CheckColumn({"
             + "header: '"
             + StringEscapeUtils.escapeJavaScript(msgs.getWithDefault(headerheader))
             + "',"
             + "dataIndex: '"
             + colIndex
             + "',"
             + "width: 40"
             + "});\n"
             + "plugins.push(cc);"
             + "return cc;\n"
             + "})()";
     }

    
 
     public void processColumnOnLoad(String[] column, Content colConfigString propertyName, Content storageNode)
     {
         // TODO Auto-generated method stub
 
     }

    
 
     public void processColumnOnSave(String[] column, Content colConfigString propertyName, Content parentNode)
         throws RepositoryException, AccessDeniedException
    {
    }
New to GrepCode? Check out our FAQ X