eeAtom.setObjID(objectId); eeAtom.setDrawAspect(ExOleObjAtom.DRAW_ASPECT_VISIBLE); eeAtom.setType(ExOleObjAtom.TYPE_EMBEDDED);
/** * 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 */ @SuppressWarnings("unused") 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; }
eeAtom.setObjID(objectId); return objectId;
private ExEmbed getExEmbed(boolean create) { if (_exEmbed == null) { HSLFSlideShow ppt = getSheet().getSlideShow(); ExObjList lst = ppt.getDocumentRecord().getExObjList(create); if(lst == null){ LOG.log(POILogger.WARN, "ExObjList not found"); return null; } int id = getObjectID(); for (Record ch : lst.getChildRecords()) { if(ch instanceof ExEmbed){ ExEmbed embd = (ExEmbed)ch; if( embd.getExOleObjAtom().getObjID() == id) { _exEmbed = embd; } } } if (_exEmbed == null && create) { _exEmbed = new ExEmbed(); _exEmbed.getExOleObjAtom().setObjID(id); lst.appendChildRecord(_exEmbed); } } return _exEmbed; }
ExControl ctrl = new ExControl(); ExOleObjAtom oleObj = ctrl.getExOleObjAtom(); oleObj.setObjID(objectId); oleObj.setDrawAspect(ExOleObjAtom.DRAW_ASPECT_VISIBLE); oleObj.setType(ExOleObjAtom.TYPE_CONTROL);