Examples of XGridColumnFactory


Examples of com.sun.star.form.XGridColumnFactory

        XGraphics aGraphic = null;
        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XGridColumnFactory columns = null;

        //Insert a ControlShape and get the ControlModel
        XControlShape aShape = createGrid(xTextDoc, 3000, 4500, 15000, 10000);

        XControlModel the_Model = aShape.getControl();

        WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);

        XLoadable formLoader = FormTools.bindForm(xTextDoc);

        //Try to query XControlAccess
        XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
                                            XControlAccess.class,
                                            xTextDoc.getCurrentController());

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, the_Model);
            aControl = columns.createColumn("TextField");
            aControl.setPropertyValue("DataField", "Identifier");
            aControl.setPropertyValue("Label", "Identifier");
            aControl2 = columns.createColumn("TextField");
            aControl2.setPropertyValue("DataField", "Publisher");
            aControl2.setPropertyValue("Label", "Publisher");
            aControl3 = columns.createColumn("TextField");
            aControl3.setPropertyValue("DataField", "Author");
            aControl3.setPropertyValue("Label", "Author");
            aControl4 = columns.createColumn("TextField");
            aControl4.setPropertyValue("DataField", "Title");
            aControl4.setPropertyValue("Label", "Title");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XPropertySet aControl5 = null;
       
        try {
            XGridColumnFactory columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
            aControl5 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XPropertySet aControl5 = null;
        XGridColumnFactory columns = null;


        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println("creating a test environment");

        //get GridControlModel
        String objName = "Grid";
        XControlShape shape = FormTools.insertControlShape(xDrawDoc, 5000,
                                                           7000, 2000, 2000,
                                                           "GridControl");
        oObj = shape.getControl();

        log.println("creating a new environment for drawpage object");

        TestEnvironment tEnv = new TestEnvironment(oObj);

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
            aControl5 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, oObj);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.container.ElementExistException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        }

        //Relations for XSelectionSupplier
        tEnv.addObjRelation("Selections", new Object[] { aControl, aControl2 });

        // COMPARER
       
        int THRCNT = 1;
        String count = (String)Param.get("THRCNT");
        if (count != null)
            THRCNT = Integer.parseInt(count);


        // INSTANCEn : _XNameContainer; _XNameReplace
        log.println("adding INSTANCEn as obj relation to environment");

        try {
            for (int n = 1; n < (3 * THRCNT + 1); n++) {
                log.println("adding INSTANCE" + n +
                            " as obj relation to environment");
                oInstance = columns.createColumn("TextField");
                tEnv.addObjRelation("INSTANCE" + n, oInstance);
            }
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Can't create 'INSTANCEn' relations", e);
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

    throws com.sun.star.uno.Exception
  {
    // the container to insert columns into
    XIndexContainer xColumnContainer = UNO.queryIndexContainer( aGridModel );
    // the factory for creating column models
    XGridColumnFactory xColumnFactory = (XGridColumnFactory)UnoRuntime.queryInterface(
      XGridColumnFactory.class, aGridModel );

    // (let) create the new col
    XInterface xNewCol = (XInterface)xColumnFactory.createColumn( sColumnService );
    XPropertySet xColProps = UNO.queryPropertySet( xNewCol );

    // some props
    // the field the column is bound to
    xColProps.setPropertyValue( "DataField", sDataField );
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XPropertySet aControl5 = null;
       
        try {
            XGridColumnFactory columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
            aControl5 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XPropertySet aControl5 = null;
        XGridColumnFactory columns = null;


        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println("creating a test environment");

        //get GridControlModel
        String objName = "Grid";
        XControlShape shape = FormTools.insertControlShape(xDrawDoc, 5000,
                                                           7000, 2000, 2000,
                                                           "GridControl");
        oObj = shape.getControl();

        log.println("creating a new environment for drawpage object");

        TestEnvironment tEnv = new TestEnvironment(oObj);

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
            aControl5 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, oObj);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.container.ElementExistException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        }

        //Relations for XSelectionSupplier
        tEnv.addObjRelation("Selections", new Object[] { aControl, aControl2 });

        // COMPARER
       
        int THRCNT = 1;
        String count = (String)Param.get("THRCNT");
        if (count != null)
            THRCNT = Integer.parseInt(count);


        // INSTANCEn : _XNameContainer; _XNameReplace
        log.println("adding INSTANCEn as obj relation to environment");

        try {
            for (int n = 1; n < (3 * THRCNT + 1); n++) {
                log.println("adding INSTANCE" + n +
                            " as obj relation to environment");
                oInstance = columns.createColumn("TextField");
                tEnv.addObjRelation("INSTANCE" + n, oInstance);
            }
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Can't create 'INSTANCEn' relations", e);
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XInterface oInstance = null;
        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XGridColumnFactory columns = null;


        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println("creating a test environment");

        //get GridControlModel
        String objName = "Grid";
        XControlShape shape = FormTools.insertControlShape(xDrawDoc, 5000,
                                                           7000, 2000, 2000,
                                                           "GridControl");
        oObj = shape.getControl();

        log.println("creating a new environment for drawpage object");

        TestEnvironment tEnv = new TestEnvironment(oObj);

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, oObj);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.container.ElementExistException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        }


        //Relations for XSelectionSupplier
        tEnv.addObjRelation("Selections", new Object[] { aControl, aControl2 });
        tEnv.addObjRelation("Comparer",
                            new Comparator() {
            public int compare(Object o1, Object o2) {
                XNamed named1 = (XNamed) UnoRuntime.queryInterface(
                                        XNamed.class, o1);
                XNamed named2 = (XNamed) UnoRuntime.queryInterface(
                                        XNamed.class, o2);

                if (named1.getName().equals(named2.getName())) {
                    return 0;
                }

                return -1;
            }

            public boolean equals(Object obj) {
                return compare(this, obj) == 0;
            }
        });

        int THRCNT = 1;
        String count = (String)Param.get("THRCNT");
        if (count != null)
            THRCNT = Integer.parseInt(count);


        // INSTANCEn : _XNameContainer; _XNameReplace
        log.println("adding INSTANCEn as obj relation to environment");

        try {
            for (int n = 1; n < (3 * THRCNT + 1); n++) {
                log.println("adding INSTANCE" + n +
                            " as obj relation to environment");
                oInstance = columns.createColumn("TextField");
                tEnv.addObjRelation("INSTANCE" + n, oInstance);
            }
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Can't create 'INSTANCEn' relations", e);
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XPropertySet aControl5 = null;
       
        try {
            XGridColumnFactory columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
            aControl5 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XPropertySet aControl5 = null;
        XGridColumnFactory columns = null;


        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println("creating a test environment");

        //get GridControlModel
        String objName = "Grid";
        XControlShape shape = FormTools.insertControlShape(xDrawDoc, 5000,
                                                           7000, 2000, 2000,
                                                           "GridControl");
        oObj = shape.getControl();

        log.println("creating a new environment for drawpage object");

        TestEnvironment tEnv = new TestEnvironment(oObj);

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, oObj);
            aControl = columns.createColumn("TextField");
            aControl2 = columns.createColumn("DateField");
            aControl3 = columns.createColumn("TextField");
            aControl4 = columns.createColumn("TextField");
            aControl5 = columns.createColumn("TextField");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, oObj);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.container.ElementExistException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        }

        //Relations for XSelectionSupplier
        tEnv.addObjRelation("Selections", new Object[] { aControl, aControl2 });

        // COMPARER
       
        int THRCNT = 1;
        String count = (String)Param.get("THRCNT");
        if (count != null)
            THRCNT = Integer.parseInt(count);


        // INSTANCEn : _XNameContainer; _XNameReplace
        log.println("adding INSTANCEn as obj relation to environment");

        try {
            for (int n = 1; n < (3 * THRCNT + 1); n++) {
                log.println("adding INSTANCE" + n +
                            " as obj relation to environment");
                oInstance = columns.createColumn("TextField");
                tEnv.addObjRelation("INSTANCE" + n, oInstance);
            }
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Can't create 'INSTANCEn' relations", e);
View Full Code Here

Examples of com.sun.star.form.XGridColumnFactory

        XGraphics aGraphic = null;
        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XGridColumnFactory columns = null;

        //Insert a ControlShape and get the ControlModel
        XControlShape aShape = createGrid(xTextDoc, 3000, 4500, 15000, 10000);

        XControlModel the_Model = aShape.getControl();

        WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);

        XLoadable formLoader = FormTools.bindForm(xTextDoc);

        //Try to query XControlAccess
        XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
                                            XControlAccess.class,
                                            xTextDoc.getCurrentController());

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, the_Model);
            aControl = columns.createColumn("TextField");
            aControl.setPropertyValue("DataField", "Identifier");
            aControl.setPropertyValue("Label", "Identifier");
            aControl2 = columns.createColumn("TextField");
            aControl2.setPropertyValue("DataField", "Publisher");
            aControl2.setPropertyValue("Label", "Publisher");
            aControl3 = columns.createColumn("TextField");
            aControl3.setPropertyValue("DataField", "Author");
            aControl3.setPropertyValue("Label", "Author");
            aControl4 = columns.createColumn("TextField");
            aControl4.setPropertyValue("DataField", "Title");
            aControl4.setPropertyValue("Label", "Title");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
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.