Re: [sc-dev] Hello

2007-09-13 Thread Max Giesbert
I don't know if you are into Java but maybe also have a look at
http://poi.apache.org/ and http://sourceforge.net/projects/jexcelapi/

Cheers

Max

Himanshu Thapar wrote:
 Hello Everyone,
 
 I am trying to find the library that Open Office uses to read and
 write Excel files. It would be really great if someone could tell me
 where to find that library.
 
 Thanks  Regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sc-dev] Rubber/Pencil function for Calc

2007-07-31 Thread Max Giesbert
Short question now that I have the Netbeans plug-in running
(http://www.openoffice.org/issues/show_bug.cgi?id=80183):

The constructor gets a XComponentContext passed over. Now how do I get
the XComponent of the actually opened spreadsheet from it?

thx for help!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sc-dev] Rubber/Pencil function for Calc

2007-06-26 Thread Max Giesbert
Hi everyone,

thx to Niklas and Daniel i got it running. Attached you find a Java
class which can be registered with XEnhancedMouseClickBroadcaster.
please have a look at it. i am looking forward to your feedback.

still some questions remain:
1. does it make sense to create a UNO package out of it wrapping some OO
basic macro around it to make an oxt extension out of it? Or how else
could this packaging thing be done?
2. anything about creating a custom mouse cursor? would be nice to see a
rubber/pencil as the mouse cursor.

thx

Daniel Rentz wrote:
 Max Giesbert schrieb:
 actually i have problems with the very first line of code you sent:

 acc =
 ThisComponent.CurrentController.Frame.ComponentWindow.AccessibleContext

 i am doing development right now using java. so i do get the
 ComponentWindow by:

 XWindow window = xController.getFrame().getComponentWindow();

 but how do i get the AccessibleContext from XWindow?
 
 The Window should support the XAccessible interface, which in turn
 contains one function getAccessibleContext() that returns the
 XAccessibleContext interface.
 
 XAccessible acc =
 (XAccessible)UnoRuntime.queryInterface(XAccessible.class, window);
 XAccessibleContext accessibleContext = acc.getAccessibleContext();
 
 
 Daniel
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
Max Giesbert - exactt technology

Schießstättstr. 16  T: +49 17 75 07 53 44
D-80339 München F: +49 89 1 22 21 97 02
package de.exactt.openoffice;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleComponent;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.accessibility.XAccessibleTable;
import com.sun.star.awt.EnhancedMouseEvent;
import com.sun.star.awt.XEnhancedMouseClickHandler;
import com.sun.star.awt.XWindow;
import com.sun.star.beans.PropertyVetoException;
import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.frame.XController;
import com.sun.star.frame.XModel;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.IndexOutOfBoundsException;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.sheet.XCellAddressable;
import com.sun.star.sheet.XEnhancedMouseClickBroadcaster;
import com.sun.star.sheet.XSheetCellCursor;
import com.sun.star.sheet.XSpreadsheet;
import com.sun.star.sheet.XSpreadsheetView;
import com.sun.star.table.CellAddress;
import com.sun.star.table.TableBorder;
import com.sun.star.table.XCell;
import com.sun.star.uno.UnoRuntime;

/**When added to [EMAIL PROTECTED] XEnhancedMouseClickBroadcaster} this class either rubbers or draws borders depending on the contructor called.
 * @author Max Giesbert
 * @version 0.1
 * released under the LGPLv2
 * 2007-06-26
 * */
public class MouseClickHandler implements XEnhancedMouseClickHandler
{
	private XAccessibleTable accessibleTable = null;
	private XController xController = null;
	private XModel xSpreadsheetModel = null;
	
	private static final int TOP = 0;
	//private static final int BOTTOM = 1;
	private static final int LEFT = 2;
	//private static final int RIGHT = 3;
	private int color;
	private short inner;
	private short outer;
	private short distance;
	private boolean remove = true;
	//private Object oldSelection;
	
	/**call this constructor to let the border specified by the parameters be drawn
	 * */
	public MouseClickHandler(XController xController, XModel xSpreadsheetModel, int color, int inner, int outer, int distance)
	{
		init(xController, xSpreadsheetModel);
		this.color = color;
		this.inner = (short) inner;
		this.outer = (short) outer;
		this.distance = (short) distance;
		remove = false;
	}
	
	/**call this contructor to let the border be removed/rubbered
	 * */
	public MouseClickHandler(XController xController, XModel xSpreadsheetModel)
	{
		init(xController, xSpreadsheetModel);
		remove = true;
	}
	
	/**initialization stuff that is called from both contructors
	 * */
	private void init(XController xController, XModel xSpreadsheetModel)
	{
		this.xController = xController;
		this.xSpreadsheetModel = xSpreadsheetModel;
		
		XWindow window = xController.getFrame().getComponentWindow();
		
		XAccessible accessible = (XAccessible) UnoRuntime.queryInterface(XAccessible.class, window);
		XAccessibleContext accessibleContext = accessible.getAccessibleContext();
		
		XAccessibleContext table = getAccessibleForRole(accessibleContext, com.sun.star.accessibility.AccessibleRole.TABLE);
		accessibleTable = (XAccessibleTable) UnoRuntime.queryInterface(XAccessibleTable.class, table);
	}

	@Override
	public boolean mousePressed(EnhancedMouseEvent arg0)
	{
		//TODO make this work! see end of mouseReleased()
		//oldSelection = xSpreadsheetModel.getCurrentController().getViewData();
		return true;
	}

	/**this method

Re: [sc-dev] Rubber/Pencil function for Calc

2007-06-20 Thread Max Giesbert
Thx again. feels like i am already there. i got the XCell now from the
Target but how can i get the location of the cell on the screen. i read
about XAccessibleComponent but XCell doesn't seem to implement it...

Niklas Nebel wrote:
 Max Giesbert wrote:
 Thanks for pointing to XEnhancedMouseClickBroadcaster . I register a
 XEnhancedMouseClickHandler to it. But I only have an EnhancedMouseEvent
 in the mousePressed method. How can i find out the cell clicked with
 that? I didn't find any suiting methods.
 
 It's in the Target member of the EnhancedMouseEvent.
 
 Niklas
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
Max Giesbert - exactt technology

Schießstättstr. 16  T: +49 17 75 07 53 44
D-80339 München F: +49 89 1 22 21 97 02

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]