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

  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

        if (success) {
            try {
                String keyName = "/" + __implName +
                                 "/DATA/SupportedComponents";
                XRegistryKey newKey = regKey.createKey(keyName);

                String[] supportedComponents = { testComponent };
                newKey.setAsciiListValue(supportedComponents);
            } catch (Exception ex) {
                success = false; // prevent startup loop
                System.out.println("can't register component");
            }
        }
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

   */
  public static boolean writeRegistryServiceInfo(XRegistryKey regKey) {
      boolean result = false;
     
      try {
          XRegistryKey newKey = regKey.createKey("/" + JavaLoader.class.getName() + "/UNO/SERVICE");
        
          for (int i=0; i<supportedServices.length; i++)
              newKey.createKey(supportedServices[i]);
         
          result = true;
      }
      catch (Exception ex) {
          if (DEBUG) System.err.println(">>>JavaLoader.writeRegistryServiceInfo " + ex);
View Full Code Here

Examples of com.sun.star.registry.XRegistryKey

   */
  static public boolean writeRegistryServiceInfo(String implName, String serviceName, XRegistryKey regKey) {
      boolean result = false;
     
        try {
          XRegistryKey newKey = regKey.createKey("/" + implName + "/UNO/SERVICES");
        
      newKey.createKey(serviceName);
         
          result = true;
        }
        catch (Exception ex) {
            System.err.println(">>>Connection_Impl.writeRegistryServiceInfo " + ex);
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

        {
            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

        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

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
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.