- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.sun.star.lang.XMultiServiceFactory
类的一些代码示例,展示了XMultiServiceFactory
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMultiServiceFactory
类的具体详情如下:
包路径:com.sun.star.lang.XMultiServiceFactory
类名称:XMultiServiceFactory
暂无
代码示例来源:origin: org.openoffice/jurt
public void setInstance(String serviceName) throws com.sun.star.uno.Exception {
_instance = _serviceManager.createInstance(serviceName);
_serviceName = serviceName;
}
代码示例来源: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: org.libreoffice/jurt
public void setInstance(String serviceName) throws com.sun.star.uno.Exception {
_instance = _serviceManager.createInstance(serviceName);
_serviceName = serviceName;
}
代码示例来源: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: stackoverflow.com
XNameContainer.class, xMSF.createInstance(
"com.sun.star.drawing.BitmapTable"));
xImage = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xMSF.createInstance(
"com.sun.star.text.TextGraphicObject"));
XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(
代码示例来源: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: org.cogroo.lang.pt_br/cogroo-addon-pt_br
protected void init(XMultiServiceFactory factory) {
try {
this.configProvider = (XMultiServiceFactory) UnoRuntime
.queryInterface(XMultiServiceFactory.class, factory
.createInstance(CONFIGURATION_SERVICE));
} catch (Throwable e) {
e.printStackTrace();
}
}
代码示例来源: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: cogroo/cogroo4
protected void init(XMultiServiceFactory factory) {
try {
this.configProvider = (XMultiServiceFactory) UnoRuntime
.queryInterface(XMultiServiceFactory.class, factory
.createInstance(CONFIGURATION_SERVICE));
} catch (Throwable e) {
e.printStackTrace();
}
}
代码示例来源: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: stackoverflow.com
Object bitmapTable = factory.createInstance("com.sun.star.drawing.BitmapTable");
XNameContainer bitmapContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, bitmapTable);
代码示例来源: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
(XMultiServiceFactory)UnoRuntime.queryInterface(
XMultiServiceFactory.class, xComponent);
Object drawShape = xDrawFactory.createInstance(
"com.sun.star.drawing.RectangleShape");
XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(
代码示例来源:origin: stackoverflow.com
XInterface xElement = (XInterface) xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments);
XNameAccess xChildAccess = UnoRuntime.queryInterface(XNameAccess.class, xElement);
代码示例来源:origin: stackoverflow.com
public static void createAnnotation( XComponentContext xContext, XTextRange xTextRange )
{
// per-document stuff
XMultiComponentFactory xServiceManager= xContext.getServiceManager();
Object desktop= xServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", xContext);
XComponent xComponent= xDesktop.getCurrentComponent();
XTextDocument xTextDocument= UnoRunime.queryInterface(XTextDocument.class, xComponent);
XText xText= xTextDocument.getText();
XMultiServiceFactory xWriterFactory= UnoRuntime.queryInterface(XMultiServiceFactory.class, xComponent);
// per-annotation stuff
Object annotation= xWriterFactory.createInstance("com.sun.star.text.textfield.nnotation");
XPropertySet annotProps= UnoRuntime.queryInterface(XPropertySet.class, annotation);
annotProps.setValue("Content", "It's a me!")
annotProps.setValue("Author", "Mario");
XTextField annotTextField= UnoRuntime.queryInterface(XTextfield.class, annotation);
xText.insertTextContent( xTextRange, annotTextField, true ); // "true" spans the range
}
代码示例来源:origin: com.artofsolving/jodconverter
XInterface xElement = (XInterface) xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments);
XNameAccess xChildAccess =
(XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xElement);
代码示例来源:origin: org.libreoffice/officebean
/** Returns the XDesktop interface of the OOo instance used by this OOoBean.
@throws NoConnectionException
if no connection is established and no default connection can be established.
*/
public synchronized com.sun.star.frame.XDesktop getOOoDesktop()
throws NoConnectionException
{
if ( xDesktop == null )
{
try
{
Object aObject = getMultiServiceFactory().createInstance( "com.sun.star.frame.Desktop");
xDesktop = UnoRuntime.queryInterface(
com.sun.star.frame.XDesktop.class, aObject );
}
catch ( com.sun.star.uno.Exception aExc )
{} // TBD: what if no connection exists?
}
return xDesktop;
}
代码示例来源: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
public void addImage(String url, String name, int x, int y, int width,
int height, boolean scale) throws Exception {
Object imageModel = multiServiceFactory.createInstance("com.sun.star.awt.UnoControlImageControlModel");
XPropertySet imageProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, imageModel);
imageProperties.setPropertyValue("PositionX", new Integer(x));
imageProperties.setPropertyValue("PositionY", new Integer(y));
imageProperties.setPropertyValue("Width", new Integer(width));
imageProperties.setPropertyValue("Height", new Integer(height));
imageProperties.setPropertyValue("Name", name);
imageProperties.setPropertyValue("ScaleImage", new Boolean(scale));
imageProperties.setPropertyValue("ImageURL", new String(url));
this.nameContainer.insertByName(name, imageModel);
}
代码示例来源:origin: org.cogroo.lang.pt_br/cogroo-addon-pt_br
public void addImage(String url, String name, int x, int y, int width,
int height, boolean scale) throws Exception {
Object imageModel = multiServiceFactory.createInstance("com.sun.star.awt.UnoControlImageControlModel");
XPropertySet imageProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, imageModel);
imageProperties.setPropertyValue("PositionX", new Integer(x));
imageProperties.setPropertyValue("PositionY", new Integer(y));
imageProperties.setPropertyValue("Width", new Integer(width));
imageProperties.setPropertyValue("Height", new Integer(height));
imageProperties.setPropertyValue("Name", name);
imageProperties.setPropertyValue("ScaleImage", new Boolean(scale));
imageProperties.setPropertyValue("ImageURL", new String(url));
this.nameContainer.insertByName(name, imageModel);
}
在 Tomcat 6/Ubuntu 12.04 上启动 Grails 2.1.0 应用程序时出现以下错误。 Error 500 - Internal Server Error. groovy.lang
在运行 Storm 拓扑时,我收到此错误。拓扑完美运行 5 分钟,没有任何错误,然后失败。我正在使用 Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS as 300 sec i
我有一个 jsp 代码在其中一台机器上运行良好。但是当我复制到另一台机器时,我得到了这个 no such method found 异常。我是 Spring 的新手。有人可以解释我错过了什么吗? 以下
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我的代码在下面给出了一个错误; Exception in thread "main" java.lang.NoSuchMethodError: com/myApp/Client.cypherCBC(L
我正在尝试一个 Restful web 服务示例,所以当我要访问 url 时,我遇到了异常 java.lang.NoSuchMethodError: jersey.repackaged.com.goo
我正在将一个 Spring web 项目转换为一个 Maven 项目,但我收到了这个错误: java.lang.NoSuchMethodError: org.jboss.logging.Logger.
在我的项目中,我有一个像这样的枚举: public enum MyEnum { FIRST(1), SECOND(2); private int value; private MyEnum(int v
我创建了这个简单的示例,用于读取 Linux 正常运行时间: public String getMachineUptime() throws IOException { String[] di
我正在使用 Eclipse,并且正在使用 Java。我的目标是使用 bogoSort 方法对 vector 进行排序在一个 vector (vectorExample)中适应我的 vector 类型,
我正在运行以下查询。它显示一条错误消息。如何解决这个错误? ListrouteList=null; List companyList = session.createS
我有以下模型类: @Entity @Table(name="user_content") @org.hibernate.annotations.NamedQueries({ @org.
我有那个错误。这是我的代码: GmailSettingsService service = new GmailSettingsService(APPLICATION_NAME, DOMAIN_NAME
实际上我在执行我的java程序时遇到了下面提到的错误 Exception in thread "pool-1-thread-1" java.lang.ClassCastException: jav
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.String 我在以下代码中遇到此异常: Strin
我正在尝试从 linkedhashset 中检索随机元素。下面是我的代码,但它每次都给我异常。 private static void generateRandomUserId(Set userIds
我已经完成了 Android 中的代码: List spinnerArray = new ArrayList(); for (int i = 0; i item = (LinkedTreeMap)
这个问题已经有答案了: Explanation of ClassCastException in Java (12 个回答) 已关闭 6 年前。 我已经编写了 java 到 Json 的代码,同时从页
这个问题在这里已经有了答案: ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn (4 个答案) 关闭 6 年前
我在运行时遇到问题来编译这段代码,这给我一个错误,java.lang.Integer 无法转换为 Java.lang.Double。如果有人帮助我更正此代码,我将非常高兴 double x; pu
我是一名优秀的程序员,十分优秀!