Beispiel #1
0
  /**
   * Add a control in this presentation
   *
   * @param name name of the control, e.g. "Shockwave Flash Object"
   * @param progId OLE Programmatic Identifier, e.g. "ShockwaveFlash.ShockwaveFlash.9"
   * @return 0-based index of the control
   */
  public int addControl(String name, String progId) {
    ExControl ctrl = new ExControl();
    ctrl.setProgId(progId);
    ctrl.setMenuName(name);
    ctrl.setClipboardName(name);

    ExOleObjAtom oleObj = ctrl.getExOleObjAtom();
    oleObj.setDrawAspect(ExOleObjAtom.DRAW_ASPECT_VISIBLE);
    oleObj.setType(ExOleObjAtom.TYPE_CONTROL);
    oleObj.setSubType(ExOleObjAtom.SUBTYPE_DEFAULT);

    int objectId = addToObjListAtom(ctrl);
    oleObj.setObjID(objectId);
    return objectId;
  }