poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Merenidis, Grigorios" <Grigorios.Mereni...@Dresdner-Bank.com>
Subject Implement FreezePane in cocoon
Date Tue, 18 Mar 2003 12:35:38 GMT
	This is the first time I'm doing this so I don't know if I'm doing
it correctly. 

	I won`t to add the FreezePane function from Excel to the
HSSFSerializer from cocoon.
	I defined new XML tags,
	<gmr:FreezeCol>2</gmr:FreezeCol>
	<gmr:FreezeRow>2</gmr:FreezeRow>

	I add in the package
org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements
	two classes EPFreezeCol and EPFreezeRow. They look like this:

	public class EPFreezeRow
	    extends BaseElementProcessor
	{
	    private NumericResult _freeze_row;

	   
	    public EPFreezeRow()
	    {
	        super(null);
	        _freeze_row = null;
	    }

	    public int getFreezeRow()
	        throws IOException
	    {
	        if (_freeze_row == null)
	        {
	            _freeze_row =
NumericConverter.extractPositiveInteger(getData());
	        }
	        return _freeze_row.intValue();
	    }
	} 


	----------------------------------------------------

	public class EPFreezeCol
	    extends BaseElementProcessor
	{
	    private NumericResult _freeze_col;

	    public EPFreezeCol()
	    {
	        super(null);
	        _freeze_col = null;
	    }

	 
	    public int getFreezeCol()
	        throws IOException
	    {
	        if (_freeze_col == null)
	        {
	            _freeze_col =
NumericConverter.extractPositiveInteger(getData());
	        }
	        return _freeze_col.intValue();
	    }
	}  

	------------------------------------------------

	In the HSSFElementProcessorFactory class I add this two rows

	        addElementProcessorProgenitor("freeze_col",
EPFreezeCol.class);
	        addElementProcessorProgenitor("freeze_row",
EPFreezeRow.class);

	After that I won`t to create the FreezePanes with the
createFreezePane(int col, int row)  method. I do this in the Sheet.java
class


	Sheet(final Workbook workbook)
	    {
	        _workbook       = workbook;
	        _name           = _workbook.getNextName();
	        _sheet          = _workbook.createSheet(_name);
	        _sheet.createFreezePane(  2, 2); // I append this, to test
if the createFreezePane method is called
	        _physical_index = _workbook.getPhysicalIndex(_name);
	        _rows           = new HashMap(ROWS_CAPACITY);
	        regions         = new HashMap(REGION_CAPACITY);
	    }


	But I`m get some errors. How I can solve this problem?

	Thanks and regards,

	Gregori Merenidis


Mime
View raw message