Examples of XEnumerationAccess


Examples of com.sun.star.container.XEnumerationAccess

       
        return result;
    }
   
    protected boolean closeAllWindows(XDesktop desk) {
        XEnumerationAccess compEnumAccess = desk.getComponents();
        XEnumeration compEnum = compEnumAccess.createEnumeration();
        boolean res = true;
       
        try {
            while (compEnum.hasMoreElements()) {
                XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

        public void refresh() {
            System.out.println("Refreshing Document");
            /* Refresh all text fields */
            XTextFieldsSupplier xTFS = (XTextFieldsSupplier)
                    UnoRuntime.queryInterface(XTextFieldsSupplier.class, xTextDocument);
            XEnumerationAccess xEA = xTFS.getTextFields();
            /* Get XRefreshable interface */
            XRefreshable xRef= (XRefreshable)
                    UnoRuntime.queryInterface(XRefreshable.class,xEA);
            /* Refresh fields */
            xRef.refresh();
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

        // table anchors don't have a position in the text!!!!
        // So we have to iterate through text contents to find this table..
        // The idea for this code came from:
        // http://www.oooforum.org/forum/viewtopic.phtml?t=60451
        XTextRange textRange = null;
        XEnumerationAccess xParaAccess = (XEnumerationAccess) UnoRuntime.queryInterface(
                XEnumerationAccess.class, table.getAnchor().getText());
        XEnumeration xParaEnum = xParaAccess.createEnumeration();
        while (retval == null && xParaEnum.hasMoreElements()){
            Object elt = xParaEnum.nextElement();
            XServiceInfo xInfo = (XServiceInfo) UnoRuntime.queryInterface(
                    XServiceInfo.class, elt);
            if (xInfo.supportsService("com.sun.star.text.TextTable")) {
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

            // example for use of XEnumerationAccess
            XCellRangesQuery xCellQuery = (XCellRangesQuery)
                UnoRuntime.queryInterface(XCellRangesQuery.class, sheet);
            XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells(
                (short)com.sun.star.sheet.CellFlags.FORMULA);
            XEnumerationAccess xFormulas = xFormulaCells.getCells();
            XEnumeration xFormulaEnum = xFormulas.createEnumeration();
            while (xFormulaEnum.hasMoreElements()) {
                Object formulaCell = xFormulaEnum.nextElement();
                xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
                XCellAddressable xCellAddress = (XCellAddressable)
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)
            UnoRuntime.queryInterface(XBookmarksSupplier.class, xTemplateComponent);
       
        // access the TextFields and the TextFieldMasters collections
        XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters();
        XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields();
       
        // iterate over hashtable and insert values into field masters
        java.util.Enumeration keys = recipient.keys();
        while(keys.hasMoreElements()) {
            // get column name
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

            // The service 'com.sun.star.text.Text' supports the XEnumerationAccess
            // interface to provide an enumeration of the paragraphs contained by
            // the text the service refers to.

            // Here, we access this interface
            XEnumerationAccess xParaAccess = (XEnumerationAccess)
                UnoRuntime.queryInterface(XEnumerationAccess.class, mxDocText );
            // Call the XEnumerationAccess's only method to access the actual
            // Enumeration
            XEnumeration xParaEnum = xParaAccess.createEnumeration();

            // While there are paragraphs, do things to them
            while ( xParaEnum.hasMoreElements() )
            {
                // Get a reference to the next paragraphs XServiceInfo interface.
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

            log.println("...done");

            log.println("Checking mapping...");

            XEnumerationAccess xTextEnum = (XEnumerationAccess)
                UnoRuntime.queryInterface(XEnumerationAccess.class,
                    xText.getText());
            Object o = xTextEnum.createEnumeration().nextElement();
            XMetadatable xMeta1 = (XMetadatable) UnoRuntime.queryInterface(
                        XMetadatable.class, o);

            XURI uri;
            XMetadatable xMeta;
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

            XTextDocument xTextDoc = (XTextDocument)
                UnoRuntime.queryInterface(XTextDocument.class, xComp);

            XText xText = xTextDoc.getText();

            XEnumerationAccess xEA = (XEnumerationAccess)
                UnoRuntime.queryInterface(XEnumerationAccess.class, xText);
            XEnumeration xEnum = xEA.createEnumeration();

            log.println("...done");

            log.println("Checking RDFa in loaded test document...");
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

            new PropertyValue("Command", 0, "biblio", PropertyState.DIRECT_VALUE)
        };
       
        final XFrame beamer = frame.findFrame("_beamer", 0);
        assure(beamer != null);
        final XEnumerationAccess evtBc = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, getORB().createInstance("com.sun.star.frame.GlobalEventBroadcaster"));
        XEnumeration enumeration = evtBc.createEnumeration();
        int count = -1;
        while (enumeration.hasMoreElements())
        {
            enumeration.nextElement();
            ++count;
        }
        final XSelectionSupplier selSup = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, beamer.getController());
        selSup.select(props);
        final com.sun.star.util.XCloseable close = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, frame);
        close.close(false);

        enumeration = evtBc.createEnumeration();
        int count2 = 0;
        while (enumeration.hasMoreElements())
        {
            enumeration.nextElement();
            ++count2;
View Full Code Here

Examples of com.sun.star.container.XEnumerationAccess

                    XMetadatable xMeta = (XMetadatable)
                        UnoRuntime.queryInterface(XMetadatable.class, xField);
                    StringPair xmlid = xMeta.getMetadataReference();
                    node = new MetaFieldNode(xmlid);
                    m_Stack.push(node);
                    XEnumerationAccess xEA = (XEnumerationAccess)
                        UnoRuntime.queryInterface(XEnumerationAccess.class,
                        xMeta);
                    XEnumeration xEnumChildren = xEA.createEnumeration();
                    TreeNode node2 = convertChildren(xEnumChildren);
                    m_T.assure("stack error: meta-field", node == node2);
                } else {
                    XPropertySet xFieldPropSet = (XPropertySet)
                        UnoRuntime.queryInterface(XPropertySet.class, xField);
                    String content = (String)
                        xFieldPropSet.getPropertyValue("Content");
                    boolean isFixed = (Boolean)
                        xFieldPropSet.getPropertyValue("IsFixed");
                    m_T.assure("field not fixed?", isFixed);
                    node = new TextFieldNode(content);
                }
            } else if (type.equals("Footnote")) {
                Object xNote = xPropSet.getPropertyValue("Footnote");
                XFootnote xFootnote = (XFootnote)
                    UnoRuntime.queryInterface(XFootnote.class, xNote);
                String label = xFootnote.getLabel();
                node = new FootnoteNode(label);
            } else if (type.equals("Frame")) {
                XContentEnumerationAccess xCEA = (XContentEnumerationAccess)
                    UnoRuntime.queryInterface(XContentEnumerationAccess.class,
                        xPortion);
                XEnumeration xContentEnum = xCEA.createContentEnumeration("");
                while (xContentEnum.hasMoreElements()) {
                    Object xFrame = xContentEnum.nextElement();
                    XPropertySet xFramePropSet = (XPropertySet)
                        UnoRuntime.queryInterface(XPropertySet.class, xFrame);
                    TextContentAnchorType anchor = (TextContentAnchorType)
                        xFramePropSet.getPropertyValue("AnchorType");
                    XNamed xNamed = (XNamed)
                        UnoRuntime.queryInterface(XNamed.class, xFrame);
                    String name = xNamed.getName();
                    node = new FrameNode(name, anchor);
                    m_Stack.peek().appendChild(node);
                }
                continue;
            } else if (type.equals("ControlCharacter")) {
                short c = (Short)
                    xPropSet.getPropertyValue("ControlCharacter");
                node = new ControlCharacterNode(c);
            } else if (type.equals("Bookmark")) {
                Object xMark = xPropSet.getPropertyValue("Bookmark");
                XNamed xNamed = (XNamed)
                    UnoRuntime.queryInterface(XNamed.class, xMark);
                String name = xNamed.getName();
                XMetadatable xMetadatable = (XMetadatable)
                    UnoRuntime.queryInterface(XMetadatable.class, xMark);
                StringPair xmlid = xMetadatable.getMetadataReference();
                boolean isCollapsed = (Boolean)
                    xPropSet.getPropertyValue("IsCollapsed");
                if (isCollapsed) {
                    node = new BookmarkNode(name, xmlid);
                } else {
                    boolean isStart = (Boolean)
                        xPropSet.getPropertyValue("IsStart");
                    if (isStart) {
                        node = new BookmarkStartNode(name, xmlid);
                    } else {
                        node = new BookmarkEndNode(name, xmlid);
                    }
                }
            } else if (type.equals("ReferenceMark")) {
                Object xMark = xPropSet.getPropertyValue("ReferenceMark");
                XNamed xNamed = (XNamed)
                    UnoRuntime.queryInterface(XNamed.class, xMark);
                String name = xNamed.getName();
                boolean isCollapsed = (Boolean)
                    xPropSet.getPropertyValue("IsCollapsed");
                if (isCollapsed) {
                    node = new ReferenceMarkNode(name);
                } else {
                    boolean isStart = (Boolean)
                        xPropSet.getPropertyValue("IsStart");
                    if (isStart) {
                        node = new ReferenceMarkStartNode(name);
                    } else {
                        node = new ReferenceMarkEndNode(name);
                    }
                }
            } else if (type.equals("DocumentIndexMark")) {
                Object xMark = xPropSet.getPropertyValue("DocumentIndexMark");
                XPropertySet xMarkSet = (XPropertySet)
                    UnoRuntime.queryInterface(XPropertySet.class, xMark);
                String name = (String) xMarkSet.getPropertyValue("PrimaryKey");
                boolean isCollapsed = (Boolean)
                    xPropSet.getPropertyValue("IsCollapsed");
                if (isCollapsed) {
                    node = new DocumentIndexMarkNode(name);
                } else {
                    boolean isStart = (Boolean)
                        xPropSet.getPropertyValue("IsStart");
                    if (isStart) {
                        node = new DocumentIndexMarkStartNode(name);
                    } else {
                        node = new DocumentIndexMarkEndNode(name);
                    }
                }
            } else if (type.equals("SoftPageBreak")) {
                node = new SoftPageBreakNode();
            } else if (type.equals("Ruby")) {
                boolean isStart = (Boolean)
                    xPropSet.getPropertyValue("IsStart");
                if (isStart) {
                    // ARRGH!!! stupid api...
                    // the text is ONLY at the start!
                    String ruby = (String)
                        xPropSet.getPropertyValue("RubyText");
                    node = new RubyNode(ruby);
                    m_Stack.push(node);
                    continue;
                } else {
                    node = m_Stack.pop();
                    m_T.assure("stack error: Ruby expected; is: " +
                            node.toString(), node instanceof RubyNode);
//                    m_T.assure("stack error: ruby",
//                            ruby.equals(((RubyNode)node).getRubyText()));
                }
            } else if (type.equals("InContentMetadata")) {
                Object xMeta = xPropSet.getPropertyValue("InContentMetadata");
                XMetadatable xMetadatable = (XMetadatable)
                    UnoRuntime.queryInterface(XMetadatable.class, xMeta);
                StringPair xmlid = xMetadatable.getMetadataReference();
                node = new MetaNode(xmlid);
                m_Stack.push(node);
                XEnumerationAccess xEA = (XEnumerationAccess)
                    UnoRuntime.queryInterface(XEnumerationAccess.class, xMeta);
                XEnumeration xEnumChildren = xEA.createEnumeration();
                TreeNode node2 = convertChildren(xEnumChildren);
                m_T.assure("stack error: meta", node == node2);
//            } else if (type.equals("MetadataField")) {
//                    Object xMeta = xPropSet.getPropertyValue("MetadataField");
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.