gpt4 book ai didi

com.sun.star.lang.XMultiServiceFactory.createInstanceWithArguments()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 23:47:05 35 4
gpt4 key购买 nike

本文整理了Java中com.sun.star.lang.XMultiServiceFactory.createInstanceWithArguments()方法的一些代码示例,展示了XMultiServiceFactory.createInstanceWithArguments()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMultiServiceFactory.createInstanceWithArguments()方法的具体详情如下:
包路径:com.sun.star.lang.XMultiServiceFactory
类名称:XMultiServiceFactory
方法名:createInstanceWithArguments

XMultiServiceFactory.createInstanceWithArguments介绍

暂无

代码示例

代码示例来源:origin: org.cogroo.lang.pt_br/cogroo-addon-pt_br

public Object getRootNode(String configPath, boolean readonly) {
  try {
    if (readonly) {
      com.sun.star.beans.PropertyValue path = new com.sun.star.beans.PropertyValue();
      path.Name = "nodepath";
      path.Value = configPath;
      Object[] args = new Object[1];
      args[0] = path;
      return this.configProvider.createInstanceWithArguments(
          CONFIGURATION_READ_ONLY_VIEW, args);
    } else {
      com.sun.star.beans.PropertyValue aPathArgument = new com.sun.star.beans.PropertyValue();
      aPathArgument.Name = "nodepath";
      aPathArgument.Value = configPath;
      com.sun.star.beans.PropertyValue aModeArgument = new com.sun.star.beans.PropertyValue();
      aModeArgument.Name = "EnableAsync";
      aModeArgument.Value = new Boolean(true);
      Object[] args = new Object[2];
      args[0] = aPathArgument;
      args[1] = aModeArgument;
      return this.configProvider.createInstanceWithArguments(
          CONFIGURATION_UPDATABLE_VIEW, args);
    }
  } catch (Throwable e) {
    e.printStackTrace();
  }
  return null;
}

代码示例来源:origin: cogroo/cogroo4

public Object getRootNode(String configPath, boolean readonly) {
  try {
    if (readonly) {
      com.sun.star.beans.PropertyValue path = new com.sun.star.beans.PropertyValue();
      path.Name = "nodepath";
      path.Value = configPath;
      Object[] args = new Object[1];
      args[0] = path;
      return this.configProvider.createInstanceWithArguments(
          CONFIGURATION_READ_ONLY_VIEW, args);
    } else {
      com.sun.star.beans.PropertyValue aPathArgument = new com.sun.star.beans.PropertyValue();
      aPathArgument.Name = "nodepath";
      aPathArgument.Value = configPath;
      com.sun.star.beans.PropertyValue aModeArgument = new com.sun.star.beans.PropertyValue();
      aModeArgument.Name = "EnableAsync";
      aModeArgument.Value = new Boolean(true);
      Object[] args = new Object[2];
      args[0] = aPathArgument;
      args[1] = aModeArgument;
      return this.configProvider.createInstanceWithArguments(
          CONFIGURATION_UPDATABLE_VIEW, args);
    }
  } catch (Throwable e) {
    e.printStackTrace();
  }
  return null;
}

代码示例来源:origin: org.cogroo.lang.pt_br/cogroo-addon-pt_br

private synchronized static void init() {
  if (m_xDemoOptions == null) {
    XMultiServiceFactory xConfig;
    try {
      xConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class,
          m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider",
          m_xContext));
      Object[] args = new Object[1];
      args[0] = new PropertyValue("nodepath", 0, "/org.cogroo.addon.CogrooConfiguration/Options",
          PropertyState.DIRECT_VALUE);
      m_xDemoOptions = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
          xConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",
          args));
    } catch (Exception ex) {
      Logger.getLogger(Resources.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
}

代码示例来源:origin: cogroo/cogroo4

private synchronized static void init() {
  if (m_xDemoOptions == null) {
    XMultiServiceFactory xConfig;
    try {
      xConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class,
          m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider",
          m_xContext));
      Object[] args = new Object[1];
      args[0] = new PropertyValue("nodepath", 0, "/org.cogroo.addon.CogrooConfiguration/Options",
          PropertyState.DIRECT_VALUE);
      m_xDemoOptions = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
          xConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",
          args));
    } catch (Exception ex) {
      Logger.getLogger(Resources.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
}

代码示例来源:origin: org.cogroo.lang.pt_br/cogroo-addon-pt_br

/**
 * @param _sKeyName
 * @return
 */
public XNameAccess getRegistryKeyContent(String _sKeyName){
  try {
    Object oConfigProvider;
    PropertyValue[] aNodePath = new PropertyValue[1];
    oConfigProvider = m_xMCF.createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider", this.m_xContext);
    aNodePath[0] = new PropertyValue();
    aNodePath[0].Name = "nodepath";
    aNodePath[0].Value = _sKeyName;
    XMultiServiceFactory xMSFConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider);
    Object oNode = xMSFConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath);
    XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oNode);
    return xNameAccess;
  } catch (Exception exception) {
    exception.printStackTrace(System.out);
    return null;
  }
}

代码示例来源:origin: cogroo/cogroo4

/**
 * @param _sKeyName
 * @return
 */
public XNameAccess getRegistryKeyContent(String _sKeyName){
  try {
    Object oConfigProvider;
    PropertyValue[] aNodePath = new PropertyValue[1];
    oConfigProvider = m_xMCF.createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider", this.m_xContext);
    aNodePath[0] = new PropertyValue();
    aNodePath[0].Name = "nodepath";
    aNodePath[0].Value = _sKeyName;
    XMultiServiceFactory xMSFConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider);
    Object oNode = xMSFConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath);
    XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oNode);
    return xNameAccess;
  } catch (Exception exception) {
    exception.printStackTrace(System.out);
    return null;
  }
}

代码示例来源:origin: stackoverflow.com

XInterface xElement = (XInterface) xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments);
XNameAccess xChildAccess = UnoRuntime.queryInterface(XNameAccess.class, xElement);

代码示例来源:origin: com.artofsolving/jodconverter

XInterface xElement = (XInterface) xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments);
XNameAccess xChildAccess =
  (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xElement);

代码示例来源:origin: org.cogroo.lang.pt_br/cogroo-addon-pt_br

args[1] = aModeArgument;
Object xViewRoot = this.configProvider.createInstanceWithArguments(
    CONFIGURATION_UPDATABLE_VIEW, args);

代码示例来源:origin: cogroo/cogroo4

args[1] = aModeArgument;
Object xViewRoot = this.configProvider.createInstanceWithArguments(
    CONFIGURATION_UPDATABLE_VIEW, args);

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com