本文整理汇总了Java中com.sun.star.uno.UnoRuntime.areSame方法的典型用法代码示例。如果您正苦于以下问题:Java UnoRuntime.areSame方法的具体用法?Java UnoRuntime.areSame怎么用?Java UnoRuntime.areSame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.star.uno.UnoRuntime
的用法示例。
在下文中一共展示了UnoRuntime.areSame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getXEventAttacherManager
import com.sun.star.uno.UnoRuntime; //导入方法依赖的package包/类
/**
* Returns the OpenOffice.org XEventAttacherManager interface for the given form,
* or null if not available.
*
* @param form the form to be used
*
* @return the OpenOffice.org XEventAttacherManager interface for the given form,
* or null
*
* @throws NOAException if the return of OpenOffice.org XEventAttacherManager interface fails
*
* @author Markus Krüger
* @date 26.01.2007
*/
public XEventAttacherManager getXEventAttacherManager(IForm form) throws NOAException {
try {
if(form != null) {
XFormsSupplier formsSupplier = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
if(formsSupplier != null) {
XNameContainer nameContainer = formsSupplier.getForms();
XIndexContainer indexContainer = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, nameContainer);
int len = indexContainer.getCount();
for(int i = 0; i < len; i++) {
XForm tmpForm = (XForm) UnoRuntime.queryInterface(XForm.class, indexContainer.getByIndex(i));
if(tmpForm != null && UnoRuntime.areSame(form.getXFormComponent(),tmpForm)) {
XEventAttacherManager tmpEventAttacherManager =
(XEventAttacherManager) UnoRuntime.queryInterface(XEventAttacherManager.class, tmpForm);
return tmpEventAttacherManager;
}
}
}
}
return null;
}
catch(Throwable throwable) {
throw new NOAException(throwable);
}
}
示例2: getIndexInForm
import com.sun.star.uno.UnoRuntime; //导入方法依赖的package包/类
/**
* Returns the index of the given form component in the given form, or -1 if not found.
*
* @param form the form to check index in
* @param formComponent the form component to get index for
*
* @return the index of the given form component in the given form, or -1
*
* @throws NOAException if anything fails
*
* @author Markus Krüger
* @date 25.01.2007
*/
public int getIndexInForm(IForm form, IFormComponent formComponent) throws NOAException {
try {
if(form!= null && formComponent != null) {
XFormsSupplier formsSupplier = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
if(formsSupplier != null) {
XNameContainer nameContainer = formsSupplier.getForms();
XIndexContainer indexContainer = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, nameContainer);
int len = indexContainer.getCount();
for(int i = 0; i < len; i++) {
XForm tmpForm = (XForm) UnoRuntime.queryInterface(XForm.class, indexContainer.getByIndex(i));
if(tmpForm != null && UnoRuntime.areSame(form.getXFormComponent(),tmpForm)) {
XIndexContainer container = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, tmpForm);
int lenFormPComponents = container.getCount();
for(int j = 0; j < lenFormPComponents; j++) {
Object tmpObject = container.getByIndex(j);
if(tmpObject != null) {
XFormComponent tmpFormComponent = (XFormComponent) UnoRuntime.queryInterface(XFormComponent.class, tmpObject);
if(tmpFormComponent != null && UnoRuntime.areSame(tmpFormComponent,formComponent.getXFormComponent()))
return j;
}
}
}
}
}
}
return -1;
}
catch(Throwable throwable) {
throw new NOAException(throwable);
}
}
示例3: equalsTo
import com.sun.star.uno.UnoRuntime; //导入方法依赖的package包/类
/**
* Checks if the document equals another document.
*
* @param compareDocument
* document to be compared
*
* @return true if they are equal, flase if they are different
*
* @author Markus Krüger
* @author Andreas Bröker
*/
public boolean equalsTo(IDocument compareDocument) {
if (compareDocument == null) {
return false;
}
if (UnoRuntime.areSame(xComponent, compareDocument.getXComponent())) {
return true;
}
return false;
}