Examples of XRegistryKey


Examples of com.sun.star.registry.XRegistryKey

   
    if (subKeys == null || subKeys.length == 0) return ;
   
    for (int i = 0; i < subKeys.length; i++) {
      printKeyInfo(key, subKeys[i], out, margin) ;
      XRegistryKey subKey = key.openKey
        (getShortKeyName(subKeys[i])) ;
      printTreeInfo(subKey, out, margin + "  ") ;
      subKey.closeKey() ;
    }
  }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

    String keyName, PrintWriter out, String margin)
    throws com.sun.star.registry.InvalidRegistryException {
   
    out.print(margin) ;
    keyName = getShortKeyName(keyName) ;
    XRegistryKey key = parentKey.openKey(keyName) ;
    if (key != null)
      out.print("/" + getShortKeyName(key.getKeyName()) + " ") ;
    else {
      out.println("(null)") ;
      return ;
    }
   
    if (!key.isValid()) {
      out.println("(not valid)") ;
      return ;
    }
   
    if (key.isReadOnly()) {
      out.print("(read only) ") ;
    }
   
    if (parentKey.getKeyType(keyName) == RegistryKeyType.LINK) {
      out.println("(link to " + parentKey.getLinkTarget(keyName) + ")") ;
      return ;
    }
   
    RegistryValueType type ;
    try {
      type = key.getValueType() ;
   
      if (type.equals(RegistryValueType.ASCII)) {
        out.println("[ASCII] = '" + key.getAsciiValue() + "'") ;
      } else
      if (type.equals(RegistryValueType.STRING)) {
        out.println("[STRING] = '" + key.getStringValue() + "'") ;
      } else
      if (type.equals(RegistryValueType.LONG)) {
        out.println("[LONG] = " + key.getLongValue()) ;
      } else                                                       
      if (type.equals(RegistryValueType.BINARY)) {
        out.print("[BINARY] = {") ;
        byte[] bin = key.getBinaryValue() ;
        for (int i = 0; i < bin.length; i++)
          out.print("" + bin[i] + ",") ;
        out.println("}") ;
      } else
      if (type.equals(RegistryValueType.ASCIILIST)) {
        out.print("[ASCIILIST] = {") ;
        String[] list = key.getAsciiListValue() ;
        for (int i = 0; i < list.length; i++)
          out.print("'" + list[i] + "',") ;
        out.println("}") ;
      } else
      if (type.equals(RegistryValueType.STRINGLIST)) {
        out.print("[STRINGLIST] = {") ;
        String[] list = key.getStringListValue() ;
        for (int i = 0; i < list.length; i++)
          out.print("'" + list[i] + "',") ;
        out.println("}") ;
      } else
      if (type.equals(RegistryValueType.LONGLIST)) {
        out.print("[LONGLIST] = {") ;
        int[] list = key.getLongListValue() ;
        for (int i = 0; i < list.length; i++)
          out.print("" + list[i] + ",") ;
        out.println("}") ;
      } else {
        out.println("") ;
      }
    } catch (com.sun.star.uno.Exception e) {
      out.println("Exception occured : ") ;
      e.printStackTrace(out) ;
    } finally {
      key.closeKey() ;
    }
  }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

    XSimpleRegistry xSimpleRegistry = null;
    try {
      xSimpleRegistry = (XSimpleRegistry) args[0];
            if (xSimpleRegistry != null)
            {
                XRegistryKey rootkey = xSimpleRegistry.getRootKey();
               
                XRegistryKey implkey_xRegistryKey = rootkey.openKey("Implementations");
                if(implkey_xRegistryKey != null) {
                    XRegistryKey xRegistryKeys[] = implkey_xRegistryKey.openKeys();
                   
                    for(int i = 0; i < xRegistryKeys.length; ++ i) {
                        xaddFactories(new String[]{xRegistryKeys[i].getStringValue()});
                    }
                }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

  public static boolean writeRegistryServiceInfo(
        String impl_name, String supported_services [], XRegistryKey xKey )
    {
        try
        {
          XRegistryKey xNewKey = xKey.createKey( "/" + impl_name + "/UNO/SERVICES" );
            for ( int nPos = 0; nPos < supported_services.length; ++nPos )
            {
                xNewKey.createKey( supported_services[ nPos ] );
            }
          return true;
        }
        catch (com.sun.star.registry.InvalidRegistryException exc)
        {
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

    XSimpleRegistry xSimpleRegistry  ;
    try {
      xSimpleRegistry = (XSimpleRegistry) args[0];
            if (xSimpleRegistry != null)
            {
                XRegistryKey rootkey = xSimpleRegistry.getRootKey();
               
                XRegistryKey implkey_xRegistryKey = rootkey.openKey("Implementations");
                if(implkey_xRegistryKey != null) {
                    XRegistryKey xRegistryKeys[] = implkey_xRegistryKey.openKeys();
                   
                    for(int i = 0; i < xRegistryKeys.length; ++ i) {
                        xaddFactories(new String[]{xRegistryKeys[i].getStringValue()});
                    }
                }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

        {
            String currentLocale = null;
            try
            {
                simpleReg.open(path, true, false);
                final XRegistryKey xRegistryRootKey = simpleReg.getRootKey();
                // read locale
                final XRegistryKey locale = xRegistryRootKey.openKey(value);
                if (locale != null)
                {
                    final String newLocale = locale.getStringValue();
                    if (newLocale != null)
                    {
                        currentLocale = newLocale.replace('-', '_');
                    }
                }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

        boolean result = false;

        try {
            openReg(oObj, openF, false, true);

            XRegistryKey rootKey = oObj.getRootKey();
            result = rootKey != null;
            closeReg(oObj);
        } catch (InvalidRegistryException e) {
            e.printStackTrace(log);
            result = false;
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

        }

        openReg(reg, mergeF, false, true);

        try {
            XRegistryKey key = oObj.getRootKey().openKey("MergeKey");
            XRegistryKey mergeKey = reg.getRootKey();
            isEqual = RegistryTools.compareKeyTrees(key, mergeKey);
        } catch (com.sun.star.registry.InvalidRegistryException e) {
            log.print("Can't get root key: ");
            e.printStackTrace(log);
            tRes.tested("mergeKey()", false);
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

    * write some info into the registry root key. After all registry
    * is destroyed.<p>
    * Has OK status if some info was written into registry.
    */
    public void _writeRegistryInfo() {
        XRegistryKey key ;
        XSimpleRegistry xReg = null ;

        String tmpDir = util.utils.getOfficeTempDir((XMultiServiceFactory)tParam.getMSF());

        try {
            xReg = RegistryTools.createRegistryService
                ((XMultiServiceFactory)tParam.getMSF()) ;

            xReg.open(tmpDir + "XImpLoader_tmp.rdb", false, true) ;

            key = xReg.getRootKey() ;
        } catch (com.sun.star.uno.Exception e) {
            log.println("Can not create registry for writing") ;
            e.printStackTrace(log) ;
            tRes.tested("writeRegistryInfo()", false) ;
            return ;
        }

        boolean rc ;
        try {
            rc = oObj.writeRegistryInfo(key, implLoader, implUrl) ;
        } catch (CannotRegisterImplementationException e) {
            throw new StatusException("Can not register implementation", e) ;
        }

        if (rc == false)
            log.println("Method returned false value") ;

        String[] keys ;
        try {
            keys = key.getKeyNames() ;
        } catch (com.sun.star.uno.Exception e) {
            log.println("Error retrieving key names from registry") ;
            tRes.tested("writeRegistryInfo()", false) ;
            return ;
        }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

        return false ;
       
      for (int i = 0; i < keyNames1.length; i++) {
     
        String keyName = getShortKeyName(keyNames1[i]) ;
        XRegistryKey key2 = tree2.openKey(keyName) ;
       
        if (key2 == null)
        // key with the same name doesn't exist in the second tree
          return false ;
     
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.