com.sun.star.frame.XDispatchProvider Java Examples

The following examples show how to use com.sun.star.frame.XDispatchProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Frame.java    From noa-libre with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Returns dispatch for the submitted command URL.
 * 
 * @param commandURL command URL of the dispatch
 * 
 * @return dispatch for the submitted command URL
 * 
 * @throws NOAException if a dispatch for the submitted command URL
 * can not be provided
 * 
 * @author Andreas Bröker
 * @date 14.06.2006
 */
public IDispatch getDispatch(String commandURL) throws NOAException {
	if(commandURL == null)
		throw new NOAException("The command URL is not valid.");
	try {  		
 	XDispatchProvider xDispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, xFrame);
 	URL[] urls = new URL[1];
 	urls[0] = new URL();
 	urls[0].Complete = commandURL;
 	Object service = null;
 	if(officeConnection != null)
 	  service = officeConnection.createService("com.sun.star.util.URLTransformer");
 	else
 	  service = serviceProvider.createService("com.sun.star.util.URLTransformer");
 	XURLTransformer xURLTranformer = (XURLTransformer)UnoRuntime.queryInterface(XURLTransformer.class, service);
 	xURLTranformer.parseStrict(urls);
 	XDispatch xDispatch = xDispatchProvider.queryDispatch(urls[0], "", FrameSearchFlag.GLOBAL);	  	
 	if(xDispatch == null)
 		throw new NOAException("The command URL is not valid");
 	return new Dispatch(xDispatch, urls[0]);
	}
	catch(Throwable throwable) {
		throw new NOAException(throwable);
	}
}
 
Example #2
Source File: TableManager.java    From yarg with Apache License 2.0 5 votes vote down vote up
public void copyRow(XDispatchHelper xDispatchHelper, XController xController, int row) throws com.sun.star.uno.Exception {
    selectRow(xController, row);
    XDispatchProvider xDispatchProvider = as(XDispatchProvider.class, xController.getFrame());
    copy(xDispatchHelper, xDispatchProvider);
    insertEmptyRow(row);
    selectRow(xController, row + 1);
    paste(xDispatchHelper, xDispatchProvider);
}
 
Example #3
Source File: TableManager.java    From yarg with Apache License 2.0 4 votes vote down vote up
public void copy(XDispatchHelper xDispatchHelper, XDispatchProvider xDispatchProvider) {
    xDispatchHelper.executeDispatch(xDispatchProvider, ".uno:Copy", "", 0, new PropertyValue[]{new PropertyValue()});
}
 
Example #4
Source File: TableManager.java    From yarg with Apache License 2.0 4 votes vote down vote up
public void paste(XDispatchHelper xDispatchHelper, XDispatchProvider xDispatchProvider) {
    xDispatchHelper.executeDispatch(xDispatchProvider, ".uno:Paste", "", 0, new PropertyValue[]{new PropertyValue()});
}
 
Example #5
Source File: Frame.java    From noa-libre with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
   * Returns slave dispatch provider.
   * 
   * @return slave dispatch provider
   * 
   * @author Andreas Bröker
   * @date 15.08.2006
   */
public XDispatchProvider getSlaveDispatchProvider() {
	return slaveDispatchProvider;
}
 
Example #6
Source File: Frame.java    From noa-libre with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
   * Sets slave dispatch provider.
   * 
   * @param slaveDispatchProvider slave dispatch provider to be set
   * 
   * @author Andreas Bröker
   * @date 15.08.2006
   */
public void setSlaveDispatchProvider(XDispatchProvider slaveDispatchProvider) {
	this.slaveDispatchProvider = slaveDispatchProvider;
}
 
Example #7
Source File: Frame.java    From noa-libre with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
   * Returns master dispatch provider.
   * 
   * @return master dispatch provider
   * 
   * @author Andreas Bröker
   * @date 15.08.2006
   */
public XDispatchProvider getMasterDispatchProvider() {
	return masterDispatchProvider;
}
 
Example #8
Source File: Frame.java    From noa-libre with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
   * Sets master dispatch provider.
   * 
   * @param masterDispatchProvider master dispatch provider to be set
   * 
   * @author Andreas Bröker
   * @date 15.08.2006
   */
public void setMasterDispatchProvider(XDispatchProvider masterDispatchProvider) {
	this.masterDispatchProvider = masterDispatchProvider;
}