Package com.sun.star.frame

Examples of com.sun.star.frame.XDispatch


      URL[] aParseURL = new URL[1];
      aParseURL[0] = new URL();
      aParseURL[0].Complete = url;
      xParser.parseStrict(aParseURL);
      URL aURL = aParseURL[0];
      XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
      if( xDispatcher != null )
    xDispatcher.dispatch( aURL, null );
  } catch (com.sun.star.uno.Exception e) {
      System.out.println("Couldn't open dialog!!!");
      throw new StatusException( "Couldn't open dialog!!!", e );
  }
    }
View Full Code Here


    public InspectorAddonImpl(XComponentContext _xContext) {
        m_xContext = _xContext;
    }
   
        public XDispatch queryDispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/String sTargetFrameName, /*IN*/int iSearchFlags ) {
            XDispatch xRet = null;
            if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.Inspector:") == 0 ) {
                if ( aURL.Path.compareTo( "inspect" ) == 0 ){
                    xRet = this;
                }
            }
View Full Code Here

    private XDispatch getXDispatcher(com.sun.star.util.URL oURL) {
    try {
        com.sun.star.util.URL[] oURLArray = new com.sun.star.util.URL[1];
        oURLArray[0] = oURL;
        XDispatchProvider xDispatchProvider = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, getCurrentFrame());
        XDispatch xDispatch = xDispatchProvider.queryDispatch(oURLArray[0], "_top", FrameSearchFlag.ALL); // "_self"
        return xDispatch;
    } catch (Exception e) {
        e.printStackTrace(System.out);
        return null;
    }}               
View Full Code Here

        "",      // string Arguments
        "");    // string Mark
      office.mURLTransformer.parseSmart(url, "slot");
      // workaround bug in dispatch
      url[0].Complete  = url[0].Main;
      XDispatch  dispatcher  = office.mDispatcher.queryDispatch(
        url[0], "", 0);
      dispatcher.dispatch(url[0], (PropertyValue[])mProps.toArray(
        new PropertyValue[mProps.size()]));
    }
    // Good things come to those who wait...
    notifyAll();
  }
View Full Code Here


        XDispatchProvider aProv = (XDispatchProvider)
            UnoRuntime.queryInterface(XDispatchProvider.class,secondController);

        XDispatch getting = null;

        log.println( "opening DatasourceBrowser" );
        URL the_url = new URL();
        the_url.Complete = ".component:DB/DataSourceBrowser";
        getting = aProv.queryDispatch(the_url,"_beamer",12);
        PropertyValue[] noArgs = new PropertyValue[0];
        getting.dispatch(the_url,noArgs);

        shortWait();

        XFrame the_frame1 = the_Desk.getCurrentFrame();
View Full Code Here

       
        XDispatchProvider aProv = (XDispatchProvider)UnoRuntime.queryInterface(
            XDispatchProvider.class,
            secondController);
       
        XDispatch getting = null;
       
        log.println("opening DatasourceBrowser");
       
        URL the_url = new URL();
        the_url.Complete = ".component:DB/DataSourceBrowser";
        getting = aProv.queryDispatch(the_url, "_beamer", 12);
       
        PropertyValue[] noArgs = new PropertyValue[0];
        getting.dispatch(the_url, noArgs);
       
        shortWait();
       
        XFrame the_frame1 = the_Desk.getCurrentFrame();
       
View Full Code Here

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't create URLTransformer", e);
        }

        XDispatch getting = null;
        log.println("opening HyperlinkDialog");

        URL[] url = new URL[1];
        url[0] = new URL();
        url[0].Complete = ".uno:HyperlinkDialog";
        urlTransf.parseStrict(url);
        getting = aProv.queryDispatch(url[0], "", 0);

        PropertyValue[] noArgs = new PropertyValue[0];
        getting.dispatch(url[0], noArgs);

        shortWait();

        XInterface oObj = null;
View Full Code Here

            aParseURL[0].Complete = URL;
            xParser.parseStrict(aParseURL);

            URL aURL = aParseURL[0];

            XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
            xDispatcher.dispatch(aURL, null);

            utils.shortWait(3000);

        } catch (Exception e) {
            throw new Exception("ERROR: could not dispatch URL '" + URL + "': " + e.toString());
View Full Code Here

        aParseURL[0] = new URL();
        aParseURL[0].Complete = "macro://./" + MacroName; //Standard.Stock.GetSymbol('micro','')";
        mParser.parseStrict(aParseURL);

        URL aURL = aParseURL[0];
        XDispatch xDispatcher = mDispProv.queryDispatch(aURL, "", 0);

        if (xDispatcher != null) {
            xDispatcher.dispatch(aURL, null);
        } else {
            throw new Exception("Could not run Macro " + MacroName);
        }
    }
View Full Code Here

        XInterface oObj = null;

        XDispatchProvider aProv = (XDispatchProvider)
                UnoRuntime.queryInterface(XDispatchProvider.class,xDesk);

        XDispatch getting = null;
        XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF();

          XNameAccess xNameAccess = null;
           
            // we use the first datasource
        XDataSource xDS = null;
        try {
            xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
        } catch (Exception ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get Databasecontext", ex );
        }
        try {
            xDS = (XDataSource) UnoRuntime.queryInterface(
                    XDataSource.class, xNameAccess.getByName( "Bibliography" ));
        } catch (NoSuchElementException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XDataSource", ex );
        } catch (WrappedTargetException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XDataSource", ex );
        }
        try {
            xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
                        XNameAccess.class,
                        xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
        } catch (Exception ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get DatabaseConext", ex );
        }
     
            log.println("check XMultiServiceFactory");

        try {
            xConn = xDS.getConnection(new String(), new String());
        } catch (SQLException ex) {
            ex.printStackTrace( log );
            throw new StatusException( "Could not get XConnection", ex );
        }

        log.println( "opening QueryDesign" );
        URL the_url = new URL();
        the_url.Complete = ".component:DB/QueryDesign";
        getting = aProv.queryDispatch(the_url,"Query",12);
        PropertyValue[] Args = new PropertyValue[2];
        PropertyValue param1 = new PropertyValue();
        param1.Name = "DataSourceName";
        param1.Value = "Bibliography";
        Args[0] = param1;
        PropertyValue param2 = new PropertyValue();
        param2.Name = "QueryDesignView";
        param2.Value = new Boolean(false);
        Args[1] = param2;
        param1.Name = "ActiveConnection";
        param1.Value = xConn;
        Args[1] = param2;
        getting.dispatch(the_url,Args);

        shortWait();

        Object oDBC = null;
       
View Full Code Here

TOP

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

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.