当前位置: 首页>>代码示例>>Java>>正文


Java UnoRuntime.areSame方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:LibreOffice,项目名称:noa-libre,代码行数:39,代码来源:FormService.java

示例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);
  }
  
}
 
开发者ID:LibreOffice,项目名称:noa-libre,代码行数:46,代码来源:FormService.java

示例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;
}
 
开发者ID:LibreOffice,项目名称:noa-libre,代码行数:22,代码来源:AbstractDocument.java


注:本文中的com.sun.star.uno.UnoRuntime.areSame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。