Package com.sun.star.frame

Examples of com.sun.star.frame.XDesktop


  }

  public static XFrame getActiveFrame(XMultiServiceFactory msf) {
    try {
        Object desk = msf.createInstance("com.sun.star.frame.Desktop");
        XDesktop xDesk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,desk);
        return xDesk.getCurrentFrame();
    } catch (com.sun.star.uno.Exception e) {
        System.out.println("Couldn't get active Component");
    }

    return null;
View Full Code Here


        this.log = log;
        try {
            this.xMSF = xMSF;
            Object oInterface = xMSF.createInstance(
                                                "com.sun.star.frame.Desktop");
            XDesktop oDesktop = (XDesktop) UnoRuntime.queryInterface(
                                                XDesktop.class, oInterface);
            XComponentLoader oCLoader = (XComponentLoader)
                                        UnoRuntime.queryInterface(
                                        XComponentLoader.class, oDesktop);
           
View Full Code Here

                {
                    GlobalLogWriter.get().println("MultiServiceFactory in GraphicalTestArgument not set.");
                    return null;
                }
                Object oDsk = _aGTA.getMultiServiceFactory().createInstance("com.sun.star.frame.Desktop");
                XDesktop aDesktop = (XDesktop)UnoRuntime.queryInterface(XDesktop.class, oDsk);
               
                if (aDesktop != null)
                {
                    GlobalLogWriter.get().println("com.sun.star.frame.Desktop created.");
                    // String sInputURL = aCurrentParameter.sInputURL;
View Full Code Here

     * @param xMSF the MultiServiceFactory
     * @return the gained XComponentLoader
     */
    public static XComponentLoader getCLoader(XMultiServiceFactory xMSF)
    {
        XDesktop oDesktop = (XDesktop) UnoRuntime.queryInterface(
                XDesktop.class, createDesktop(xMSF));

        XComponentLoader oCLoader = (XComponentLoader) UnoRuntime.queryInterface(
                XComponentLoader.class, oDesktop);

View Full Code Here

     * @param xMSF the XMultiServiceFactory
     * @return XEnumeration of all components on the desktop
     */
    public static XEnumeration getAllComponents(XMultiServiceFactory xMSF)
    {
        XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(
                XDesktop.class, createDesktop(xMSF));
        return xDesktop.getComponents().createEnumeration();
    }
View Full Code Here

     * @param xMSF the XMultiServiceFactory
     * @return XComponent of the current component on the desktop
     */
    public static XComponent getCurrentComponent(XMultiServiceFactory xMSF)
    {
        XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(
                XDesktop.class, createDesktop(xMSF));
        return xDesktop.getCurrentComponent();
    }
View Full Code Here

     * @param xMSF the XMultiServiceFactory
     * @return XComponent of the current component on the desktop
     */
    public static XFrame getCurrentFrame(XMultiServiceFactory xMSF)
    {
        XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(
                XDesktop.class, createDesktop(xMSF));
        return xDesktop.getCurrentFrame();
    }
View Full Code Here

     * @return returns an array of all open documents
     */
    public static Object[] getAllOpenDocuments(XMultiServiceFactory xMSF)
    {
        Vector components = new Vector();
        XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(
                XDesktop.class, createDesktop(xMSF));

        XEnumeration allComp = getAllComponents(xMSF);

        while (allComp.hasMoreElements())
View Full Code Here

    // get the service manager from the office
    XMultiComponentFactory xMCF = getConnection ().getComponentContext ().getServiceManager();

    // create a new instance of the the desktop
    Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", getConnection ().getComponentContext ());
    XDesktop desktop = (XDesktop)(UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, oDesktop));

    XEnumerationAccess components = desktop.getComponents ();
    for (XEnumeration xEnum = components.createEnumeration () ; xEnum.hasMoreElements() ; ) {
      XComponent comp = (XComponent)((Any)(xEnum.nextElement ())).getObject ();
      XModel model = (XModel)(UnoRuntime.queryInterface(XModel.class, comp));
      if (model != null) {
        if (uri.equals (model.getURL())) {
View Full Code Here

    }

    //creates an instance of TextDocument and creates a frame with an empty document
    public TextDocument(XMultiServiceFactory xMSF, boolean bshowStatusIndicator, boolean bgetCurrentFrame, XTerminateListener listener, String _sUrl, boolean bShowPreview) {
        this.xMSF = xMSF;
        XDesktop xDesktop = Desktop.getDesktop(xMSF);
        if (bgetCurrentFrame) {
            XFramesSupplier xFrameSupplier = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, xDesktop);
            xFrame = xFrameSupplier.getActiveFrame();
            xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFrame.getController().getModel());
            xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent);
View Full Code Here

TOP

Related Classes of com.sun.star.frame.XDesktop

Copyright © 2018 www.massapicom. 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.