com.sun.star.uno.Any.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(166)

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

Any.<init>介绍

[英]Constructs a new any with a given type and value
[中]构造具有给定类型和值的新any

代码示例

代码示例来源:origin: cuba-platform/yarg

public static Any createAny(Object o) {
    return new Any(new Type(o.getClass()), o);
  }
}

代码示例来源:origin: com.haulmont.yarg/yarg

public static Any createAny(Object o) {
    return new Any(new Type(o.getClass()), o);
  }
}

代码示例来源:origin: org.openoffice/ridl

/**
  Complete a UNO <code>ANY</code> (make sure it is wrapped up as an
  <code>Any</code> instance).
  @param any a Java value representing a UNO <code>ANY</code> value.
  @return a complete Java value (that is, an <code>Any</code> instance)
  representing the same UNO <code>ANY</code> value as the given argument.
  @since UDK 3.2.3
*/
public static final Any complete(Object any) {
  return any instanceof Any
    ? (Any) any
    : new Any(
      new Type(any == null ? XInterface.class : any.getClass()), any);
}

代码示例来源:origin: org.libreoffice/ridl

/**
 * Complete a UNO <code>ANY</code> (make sure it is wrapped up as an
 * <code>Any</code> instance).
 *
 * @param any a Java value representing a UNO <code>ANY</code> value.
 * @return a complete Java value (that is, an <code>Any</code> instance)
 * representing the same UNO <code>ANY</code> value as the given argument.
 * @since UDK 3.2.3
*/
public static final Any complete(Object any) {
  return any instanceof Any
    ? (Any) any
    : new Any(
      new Type(any == null ? XInterface.class : any.getClass()), any);
}

代码示例来源:origin: org.libreoffice/officebean

/**
 * Returns an Any containing a sequences of com.sun.star.beans.NamedValue. One NamedValue
 * contains the name "WINDOW" and the value is a Long representing the window handle.
 * The second NamedValue  has the name "XEMBED" and the value is true, when the XEmbed
 * protocol shall be used fore embedding the native Window.
*/
protected Any getWrappedWindowHandle()
{
  NamedValue window = new NamedValue(
    "WINDOW", new Any(new Type(Long.class), Long.valueOf(getNativeWindow())));
  NamedValue xembed = new NamedValue(
    "XEMBED", new Any(new Type(Boolean.class), Boolean.FALSE));
  if (getNativeWindowSystemType() == SystemDependent.SYSTEM_XWINDOW )
  {
    String vendor = System.getProperty("java.vendor");
    if ((vendor.equals("Sun Microsystems Inc.") || vendor.equals("Oracle Corporation"))
      && Boolean.getBoolean("sun.awt.xembedserver"))
    {
      xembed = new NamedValue(
        "XEMBED",
        new Any(new Type(Boolean.class), Boolean.TRUE));
    }
  }
  return new Any(
    new Type("[]com.sun.star.beans.NamedValue"),
    new NamedValue[] {window, xembed});
}

代码示例来源:origin: org.libreoffice/jurt

/**
 * Dispatches a <code>queryInterface</code> call.
 *
 * @return  the result of the call (should be an <code>Any</code>).
 */
protected Object dispatch_queryInterface(Type type) {
  Class<?> zInterface = type.getTypeDescription().getZClass();
  Object result = null;
  Object face = UnoRuntime.queryInterface(zInterface, _object);
  // the hell knows why, but empty interfaces a given back as void anys
  if(face != null)
    result = new Any(type, face);
  return result;
}

代码示例来源:origin: org.openoffice/jurt

/**
 * Dispatches a <code>queryInterface</code> call
 * <p>
 * @return  the result of the call (should be an <code>Any</code>)
 * @param message       the parameter for the call
 * @param resultClass   the result type as an out parameter
 * @param status        the status as an out parameter
 * @param o_outs        the out parameters of the call as out parameters
 * @param o_out_sig     the out signature as an out parameter
 */
protected Object dispatch_queryInterface(Type type) {
  Class zInterface = type.getTypeDescription().getZClass();
  Object result = null;
  Object face = UnoRuntime.queryInterface(zInterface, _object);
  // the hell knows why, but empty interfaces a given back as void anys
  if(face != null)
    result = new Any(type, face);
  return result;
}

代码示例来源:origin: org.openoffice/juh

public Object getPropertyValue(String name) throws UnknownPropertyException, WrappedTargetException
{   
  Object ret= null;
  if (bInDispose || bDisposed)
    throw new com.sun.star.lang.DisposedException("The component has been disposed already");
  Property prop= getProperty(name);
  if (prop == null)
    throw new UnknownPropertyException("The property " + name + " is unknown");
  
  synchronized (this) 
  {
    ret= getPropertyValue(prop);
  }
  // null must not be returned. Either a void any is returned or an any containing
  // an interface type and a null reference.
  if (ret == null)
  {
    if (prop.Type.getTypeClass() == TypeClass.INTERFACE)
      ret= new Any(prop.Type, null);
    else
      ret= new Any(new Type(void.class), null);
  }
  return ret;
}

代码示例来源:origin: org.libreoffice/juh

public Object getPropertyValue(String name) throws UnknownPropertyException, WrappedTargetException
{
  Object ret= null;
  if (bInDispose || bDisposed)
    throw new com.sun.star.lang.DisposedException("The component has been disposed already");
  Property prop= getProperty(name);
  if (prop == null)
    throw new UnknownPropertyException("The property " + name + " is unknown");
  synchronized (this)
  {
    ret= getPropertyValue(prop);
  }
  // null must not be returned. Either a void any is returned or an any containing
  // an interface type and a null reference.
  if (ret == null)
  {
    if (prop.Type.getTypeClass() == TypeClass.INTERFACE)
      ret= new Any(prop.Type, null);
    else
      ret= new Any(new Type(void.class), null);
  }
  return ret;
}

代码示例来源:origin: com.haulmont.yarg/yarg

public void selectRow(XController xController, int row) throws com.sun.star.uno.Exception {
  List<String> thisRowCells = getCellNamesForTheRow(row);
  String firstCellName = thisRowCells.get(0);
  String lastCellName = thisRowCells.get(thisRowCells.size() - 1);
  XTextTableCursor xTextTableCursor = xTextTable.createCursorByCellName(firstCellName);
  xTextTableCursor.gotoCellByName(lastCellName, true);
  // It works only if XCellRange was created via cursor. why????
  if (firstCellName.equalsIgnoreCase(lastCellName)) {
    XCell cell = as(XCellRange.class, xTextTable).getCellByPosition(0, row);
    as(XSelectionSupplier.class, xController).select(new Any(new Type(XCell.class), cell));
  } else {
    XCellRange xCellRange = as(XCellRange.class, xTextTable).getCellRangeByName(xTextTableCursor.getRangeName());
    // and why do we need Any here?
    as(XSelectionSupplier.class, xController).select(new Any(new Type(XCellRange.class), xCellRange));
  }
}

代码示例来源:origin: cuba-platform/yarg

public void selectRow(XController xController, int row) throws com.sun.star.uno.Exception {
  List<String> thisRowCells = getCellNamesForTheRow(row);
  String firstCellName = thisRowCells.get(0);
  String lastCellName = thisRowCells.get(thisRowCells.size() - 1);
  XTextTableCursor xTextTableCursor = xTextTable.createCursorByCellName(firstCellName);
  xTextTableCursor.gotoCellByName(lastCellName, true);
  // It works only if XCellRange was created via cursor. why????
  if (firstCellName.equalsIgnoreCase(lastCellName)) {
    XCell cell = as(XCellRange.class, xTextTable).getCellByPosition(0, row);
    as(XSelectionSupplier.class, xController).select(new Any(new Type(XCell.class), cell));
  } else {
    XCellRange xCellRange = as(XCellRange.class, xTextTable).getCellRangeByName(xTextTableCursor.getRangeName());
    // and why do we need Any here?
    as(XSelectionSupplier.class, xController).select(new Any(new Type(XCellRange.class), xCellRange));
  }
}

代码示例来源:origin: org.openoffice/juh

convObj= new Any(new Type(XInterface.class), xint);
  convObj= new Any(new Type(), null);
else
  convObj= new Any( ((Any)curVal[0]).getType(), null);
convObj= new Any(new Type(setVal.getClass()), setVal);

代码示例来源:origin: org.libreoffice/juh

convObj= new Any(new Type(XInterface.class), xint);
  convObj= new Any(new Type(), null);
else
  convObj= new Any( ((Any)curVal[0]).getType(), null);
convObj= new Any(new Type(setVal.getClass()), setVal);

代码示例来源:origin: org.libreoffice/jurt

return new Any(Type.UNSIGNED_SHORT, readShortValue());
return new Any(Type.UNSIGNED_LONG, readLongValue());
return new Any(Type.UNSIGNED_HYPER, readHyperValue());
  case TypeClass.UNSIGNED_LONG_value:
  case TypeClass.UNSIGNED_HYPER_value:
    return new Any(new Type(type), value);
      return new Any(new Type(type), value);
    ? new Any(new Type(type), value) : value;
    ? value : new Any(new Type(type), value);

代码示例来源:origin: org.openoffice/jurt

return new Any(Type.UNSIGNED_SHORT, readShortValue());
return new Any(Type.UNSIGNED_LONG, readLongValue());
return new Any(Type.UNSIGNED_HYPER, readHyperValue());
  case TypeClass.UNSIGNED_LONG_value:
  case TypeClass.UNSIGNED_HYPER_value:
    return new Any(new Type(type), value);
      return new Any(new Type(type), value);
    ? new Any(new Type(type), value) : value;
    ? value : new Any(new Type(type), value);

代码示例来源:origin: org.libreoffice/juh

try {
  value = field.get(
    new Any(type, UnoRuntime.queryInterface(type, object)));
} catch (com.sun.star.lang.IllegalArgumentException e) {
  throw new RuntimeException(e);

代码示例来源:origin: org.openoffice/juh

try {
  value = field.get(
    new Any(type, UnoRuntime.queryInterface(type, object)));
} catch (com.sun.star.lang.IllegalArgumentException e) {
  throw new RuntimeException(

代码示例来源:origin: org.libreoffice/juh

XIdlField2.class, idlClass.getField(name));
Object[] o = new Object[] {
    new Any(type, UnoRuntime.queryInterface(type, object)) };
Object v = wrapValue(
  value,

代码示例来源:origin: org.openoffice/juh

XIdlField2.class, idlClass.getField(name));
Object[] o = new Object[] {
    new Any(type, UnoRuntime.queryInterface(type, object)) };
Object v = wrapValue(
  value,

相关文章

微信公众号

最新文章

更多