commonwizards

16:34:55.029 INFO  jd.cli.Main - Decompiling commonwizards.jar
package com.sun.star.wizards.common;

import java.io.PrintStream;
import java.lang.reflect.Field;

public class ConfigGroup
  implements ConfigNode
{
  public Object root;
  
  public void writeConfiguration(Object paramObject1, Object paramObject2)
  {
    Field[] arrayOfField = getClass().getFields();
    for (int i = 0; i < arrayOfField.length; i++) {
      if (arrayOfField[i].getName().startsWith((String)paramObject2)) {
        try
        {
          writeField(arrayOfField[i], paramObject1, (String)paramObject2);
        }
        catch (Exception localException)
        {
          System.out.println("Error writing field: " + arrayOfField[i].getName());
          localException.printStackTrace();
        }
      }
    }
  }
  
  private void writeField(Field paramField, Object paramObject, String paramString)
    throws Exception
  {
    String str = paramField.getName().substring(paramString.length());
    
    Class localClass = paramField.getType();
    if (ConfigNode.class.isAssignableFrom(localClass))
    {
      Object localObject = Configuration.addConfigNode(paramObject, str);
      ConfigNode localConfigNode = (ConfigNode)paramField.get(this);
      localConfigNode.writeConfiguration(localObject, paramString);
    }
    else if (localClass.isPrimitive())
    {
      Configuration.set(convertValue(paramField), str, paramObject);
    }
    else if (localClass.equals(String.class))
    {
      Configuration.set(paramField.get(this), str, paramObject);
    }
  }
  
  public Object convertValue(Field paramField)
    throws IllegalAccessException
  {
    if (paramField.getType().equals(Boolean.TYPE)) {
      return paramField.getBoolean(this) ? Boolean.TRUE : Boolean.FALSE;
    }
    if (paramField.getType().equals(Integer.TYPE)) {
      return new Integer(paramField.getInt(this));
    }
    if (paramField.getType().equals(Short.TYPE)) {
      return new Short(paramField.getShort(this));
    }
    if (paramField.getType().equals(Float.TYPE)) {
      return new Double(paramField.getFloat(this));
    }
    if (paramField.getType().equals(Double.TYPE)) {
      return new Double(paramField.getDouble(this));
    }
    return null;
  }
  
  public void readConfiguration(Object paramObject1, Object paramObject2)
  {
    Field[] arrayOfField = getClass().getFields();
    for (int i = 0; i < arrayOfField.length; i++) {
      if (arrayOfField[i].getName().startsWith((String)paramObject2)) {
        try
        {
          readField(arrayOfField[i], paramObject1, (String)paramObject2);
        }
        catch (Exception localException)
        {
          System.out.println("Error reading field: " + arrayOfField[i].getName());
          localException.printStackTrace();
        }
      }
    }
  }
  
  private void readField(Field paramField, Object paramObject, String paramString)
    throws Exception
  {
    String str = paramField.getName().substring(paramString.length());
    
    Class localClass = paramField.getType();
    if (ConfigNode.class.isAssignableFrom(localClass))
    {
      ConfigNode localConfigNode = (ConfigNode)paramField.get(this);
      localConfigNode.setRoot(root);
      localConfigNode.readConfiguration(Configuration.getNode(str, paramObject), paramString);
    }
    else if (localClass.isPrimitive())
    {
      if (localClass.equals(Boolean.TYPE)) {
        paramField.setBoolean(this, Configuration.getBoolean(str, paramObject));
      } else if (localClass.equals(Integer.TYPE)) {
        paramField.setInt(this, Configuration.getInt(str, paramObject));
      } else if (localClass.equals(Short.TYPE)) {
        paramField.setShort(this, Configuration.getShort(str, paramObject));
      } else if (localClass.equals(Float.TYPE)) {
        paramField.setFloat(this, Configuration.getFloat(str, paramObject));
      } else if (localClass.equals(Double.TYPE)) {
        paramField.setDouble(this, Configuration.getDouble(str, paramObject));
      }
    }
    else if (localClass.equals(String.class))
    {
      paramField.set(this, Configuration.getString(str, paramObject));
    }
  }
  
  public void setRoot(Object paramObject)
  {
    root = paramObject;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.common.ConfigGroup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.common;

public abstract interface ConfigNode
{
  public abstract void readConfiguration(Object paramObject1, Object paramObject2);
  
  public abstract void writeConfiguration(Object paramObject1, Object paramObject2);
  
  public abstract void setRoot(Object paramObject);
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.common.ConfigNode
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.common;

import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Vector;
import javax.swing.ListModel;
import javax.swing.event.EventListenerList;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import org.w3c.dom.Node;

public class ConfigSet
  implements ConfigNode, XMLProvider, ListModel
{
  private Class childClass;
  private Map childrenMap = new HashMap();
  private List childrenList = new Vector();
  public Object root;
  protected boolean noNulls = true;
  private EventListenerList listenerList = null;
  
  public ConfigSet(Class paramClass)
  {
    childClass = paramClass;
  }
  
  public void add(String paramString, Object paramObject)
  {
    childrenMap.put(paramString, paramObject);
    try
    {
      int i = ((Indexable)paramObject).getIndex();
      int j = getSize();
      while (getSize() <= i) {
        childrenList.add(null);
      }
      childrenList.set(i, paramObject);
      if (j > i) {
        j = i;
      }
      fireListDataListenerIntervalAdded(j, i);
    }
    catch (ClassCastException localClassCastException)
    {
      childrenList.add(paramObject);
      fireListDataListenerIntervalAdded(getSize() - 1, getSize() - 1);
    }
  }
  
  public void add(int paramInt, Object paramObject)
  {
    int i = paramInt;
    while (getElement(PropertyNames.EMPTY_STRING + i) != null) {
      i++;
    }
    childrenMap.put(PropertyNames.EMPTY_STRING + i, paramObject);
    childrenList.add(paramInt, paramObject);
    
    fireListDataListenerIntervalAdded(paramInt, paramInt);
  }
  
  protected Object createChild()
    throws InstantiationException, IllegalAccessException
  {
    return childClass.newInstance();
  }
  
  public void writeConfiguration(Object paramObject1, Object paramObject2)
  {
    Object[] arrayOfObject = childrenMap.keySet().toArray();
    if (ConfigNode.class.isAssignableFrom(childClass))
    {
      String[] arrayOfString = Configuration.getChildrenNames(paramObject1);
      for (int i = 0; i < arrayOfString.length; i++) {
        try
        {
          Configuration.removeNode(paramObject1, arrayOfString[i]);
        }
        catch (Exception localException1)
        {
          localException1.printStackTrace();
        }
      }
      for (i = 0; i < arrayOfObject.length; i++) {
        try
        {
          ConfigNode localConfigNode = (ConfigNode)getElement(arrayOfObject[i]);
          Object localObject = Configuration.addConfigNode(paramObject1, (String)arrayOfObject[i]);
          localConfigNode.writeConfiguration(localObject, paramObject2);
        }
        catch (Exception localException2)
        {
          localException2.printStackTrace();
        }
      }
    }
    else
    {
      throw new IllegalArgumentException("Unable to write primitive sets to configuration (not implemented)");
    }
  }
  
  public void readConfiguration(Object paramObject1, Object paramObject2)
  {
    String[] arrayOfString = Configuration.getChildrenNames(paramObject1);
    int i;
    if (ConfigNode.class.isAssignableFrom(childClass))
    {
      for (i = 0; i < arrayOfString.length; i++) {
        try
        {
          ConfigNode localConfigNode = (ConfigNode)createChild();
          localConfigNode.setRoot(root);
          localConfigNode.readConfiguration(Configuration.getNode(arrayOfString[i], paramObject1), paramObject2);
          add(arrayOfString[i], localConfigNode);
        }
        catch (Exception localException1)
        {
          localException1.printStackTrace();
        }
      }
      if (noNulls) {
        for (i = 0; i < childrenList.size(); i++) {
          if (childrenList.get(i) == null) {
            childrenList.remove(i--);
          }
        }
      }
    }
    else
    {
      for (i = 0; i < arrayOfString.length; i++) {
        try
        {
          Object localObject = Configuration.getNode(arrayOfString[i], paramObject1);
          add(arrayOfString[i], localObject);
        }
        catch (Exception localException2)
        {
          localException2.printStackTrace();
        }
      }
    }
  }
  
  public void remove(Object paramObject)
  {
    Object localObject = getKey(paramObject);
    childrenMap.remove(localObject);
    int i = childrenList.indexOf(paramObject);
    childrenList.remove(paramObject);
    fireListDataListenerIntervalRemoved(i, i);
  }
  
  public void remove(int paramInt)
  {
    Object localObject = getElementAt(paramInt);
    remove(localObject);
  }
  
  public void clear()
  {
    childrenMap.clear();
    childrenList.clear();
  }
  
  public void update(int paramInt)
  {
    fireListDataListenerContentsChanged(paramInt, paramInt);
  }
  
  public Node createDOM(Node paramNode)
  {
    Object[] arrayOfObject = items();
    for (int i = 0; i < arrayOfObject.length; i++)
    {
      Object localObject = arrayOfObject[i];
      if ((localObject instanceof XMLProvider)) {
        ((XMLProvider)localObject).createDOM(paramNode);
      }
    }
    return paramNode;
  }
  
  public Object[] items()
  {
    return childrenList.toArray();
  }
  
  public Object getKey(Object paramObject)
  {
    for (Iterator localIterator = childrenMap.entrySet().iterator(); localIterator.hasNext();)
    {
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      if (localEntry.getValue() == paramObject) {
        return localEntry.getKey();
      }
    }
    return null;
  }
  
  public Object getKey(int paramInt)
  {
    int i = 0;
    while (paramInt > -1)
    {
      if (getElementAt(i) != null) {
        paramInt--;
      }
      i++;
    }
    if (i == 0) {
      return null;
    }
    return getKey(getElementAt(i - 1));
  }
  
  public void setRoot(Object paramObject)
  {
    root = paramObject;
  }
  
  public synchronized void addListDataListener(ListDataListener paramListDataListener)
  {
    if (listenerList == null) {
      listenerList = new EventListenerList();
    }
    listenerList.add(ListDataListener.class, paramListDataListener);
  }
  
  public synchronized void removeListDataListener(ListDataListener paramListDataListener)
  {
    listenerList.remove(ListDataListener.class, paramListDataListener);
  }
  
  private void fireListDataListenerIntervalAdded(int paramInt1, int paramInt2)
  {
    ListDataEvent localListDataEvent = new ListDataEvent(this, 1, paramInt1, paramInt2);
    if (listenerList == null) {
      return;
    }
    Object[] arrayOfObject = listenerList.getListenerList();
    for (int i = arrayOfObject.length - 2; i >= 0; i -= 2) {
      if (arrayOfObject[i] == ListDataListener.class) {
        ((ListDataListener)arrayOfObject[(i + 1)]).intervalAdded(localListDataEvent);
      }
    }
  }
  
  private void fireListDataListenerIntervalRemoved(int paramInt1, int paramInt2)
  {
    ListDataEvent localListDataEvent = new ListDataEvent(this, 2, paramInt1, paramInt2);
    if (listenerList == null) {
      return;
    }
    Object[] arrayOfObject = listenerList.getListenerList();
    for (int i = arrayOfObject.length - 2; i >= 0; i -= 2) {
      if (arrayOfObject[i] == ListDataListener.class) {
        ((ListDataListener)arrayOfObject[(i + 1)]).intervalRemoved(localListDataEvent);
      }
    }
  }
  
  private void fireListDataListenerContentsChanged(int paramInt1, int paramInt2)
  {
    ListDataEvent localListDataEvent = new ListDataEvent(this, 0, paramInt1, paramInt2);
    if (listenerList == null) {
      return;
    }
    Object[] arrayOfObject = listenerList.getListenerList();
    for (int i = arrayOfObject.length - 2; i >= 0; i -= 2) {
      if (arrayOfObject[i] == ListDataListener.class) {
        ((ListDataListener)arrayOfObject[(i + 1)]).contentsChanged(localListDataEvent);
      }
    }
  }
  
  public Object getElementAt(int paramInt)
  {
    return childrenList.get(paramInt);
  }
  
  public Object getElement(Object paramObject)
  {
    return childrenMap.get(paramObject);
  }
  
  public int getSize()
  {
    return childrenList.size();
  }
  
  public Set keys()
  {
    return childrenMap.keySet();
  }
  
  public int getIndexOf(Object paramObject)
  {
    return childrenList.indexOf(paramObject);
  }
  
  public void reindexSet(Object paramObject, String paramString1, String paramString2)
    throws Exception
  {
    String[] arrayOfString = Configuration.getChildrenNames(paramObject);
    Vector localVector = new Vector(arrayOfString.length);
    Object localObject = null;
    int i = 0;
    for (int j = 0; j < arrayOfString.length; j++) {
      if (!arrayOfString[j].equals(paramString1))
      {
        localObject = Configuration.getConfigurationNode(arrayOfString[j], paramObject);
        i = Configuration.getInt(paramString2, localObject);
        while (i >= localVector.size()) {
          localVector.add(null);
        }
        localVector.setElementAt(localObject, i);
      }
    }
    i = 1;
    for (j = 0; j < localVector.size(); j++)
    {
      localObject = localVector.get(j);
      if (localObject != null) {
        Configuration.set(i++, paramString2, localObject);
      }
    }
  }
  
  public void sort(Comparator paramComparator)
  {
    Collections.sort(childrenList, paramComparator);
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.common.ConfigSet
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.common;

import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.PropertyVetoException;
import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.XHierarchicalPropertySet;
import com.sun.star.container.ElementExistException;
import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XNameAccess;
import com.sun.star.container.XNameContainer;
import com.sun.star.container.XNameReplace;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.Locale;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XChangesBatch;

public abstract class Configuration
{
  public static int getInt(String paramString, Object paramObject)
    throws Exception
  {
    Object localObject = getNode(paramString, paramObject);
    if (AnyConverter.isVoid(localObject)) {
      return 0;
    }
    return AnyConverter.toInt(localObject);
  }
  
  public static short getShort(String paramString, Object paramObject)
    throws Exception
  {
    Object localObject = getNode(paramString, paramObject);
    if (AnyConverter.isVoid(localObject)) {
      return 0;
    }
    return AnyConverter.toShort(localObject);
  }
  
  public static float getFloat(String paramString, Object paramObject)
    throws Exception
  {
    Object localObject = getNode(paramString, paramObject);
    if (AnyConverter.isVoid(localObject)) {
      return 0.0F;
    }
    return AnyConverter.toFloat(localObject);
  }
  
  public static double getDouble(String paramString, Object paramObject)
    throws Exception
  {
    Object localObject = getNode(paramString, paramObject);
    if (AnyConverter.isVoid(localObject)) {
      return 0.0D;
    }
    return AnyConverter.toDouble(localObject);
  }
  
  public static String getString(String paramString, Object paramObject)
    throws Exception
  {
    Object localObject = getNode(paramString, paramObject);
    if (AnyConverter.isVoid(localObject)) {
      return PropertyNames.EMPTY_STRING;
    }
    return (String)localObject;
  }
  
  public static boolean getBoolean(String paramString, Object paramObject)
    throws Exception
  {
    Object localObject = getNode(paramString, paramObject);
    if (AnyConverter.isVoid(localObject)) {
      return false;
    }
    return AnyConverter.toBoolean(localObject);
  }
  
  public static Object getNode(String paramString, Object paramObject)
    throws Exception
  {
    return ((XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, paramObject)).getByName(paramString);
  }
  
  public static void set(int paramInt, String paramString, Object paramObject)
    throws Exception
  {
    set(new Integer(paramInt), paramString, paramObject);
  }
  
  public static void set(short paramShort, String paramString, Object paramObject)
    throws Exception
  {
    set(new Short(paramShort), paramString, paramObject);
  }
  
  public static void set(String paramString1, String paramString2, Object paramObject)
    throws Exception
  {
    set(paramString1, paramString2, paramObject);
  }
  
  public static void set(boolean paramBoolean, String paramString, Object paramObject)
    throws Exception
  {
    if (paramBoolean) {
      set(Boolean.TRUE, paramString, paramObject);
    } else {
      set(Boolean.FALSE, paramString, paramObject);
    }
  }
  
  public static void set(Object paramObject1, String paramString, Object paramObject2)
    throws IllegalArgumentException, PropertyVetoException, UnknownPropertyException, WrappedTargetException
  {
    ((XHierarchicalPropertySet)UnoRuntime.queryInterface(XHierarchicalPropertySet.class, paramObject2)).setHierarchicalPropertyValue(paramString, paramObject1);
  }
  
  public static Object getConfigurationNode(String paramString, Object paramObject)
    throws Exception
  {
    return ((XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, paramObject)).getByName(paramString);
  }
  
  public static Object getConfigurationRoot(XMultiServiceFactory paramXMultiServiceFactory, String paramString, boolean paramBoolean)
    throws Exception
  {
    Object localObject = paramXMultiServiceFactory.createInstance("com.sun.star.configuration.ConfigurationProvider");
    XMultiServiceFactory localXMultiServiceFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, localObject);
    
    String str = paramBoolean ? "com.sun.star.configuration.ConfigurationUpdateAccess" : "com.sun.star.configuration.ConfigurationAccess";
    
    Object[] arrayOfObject = new Object[paramBoolean ? 2 : 1];
    
    PropertyValue localPropertyValue1 = new PropertyValue();
    Name = "nodepath";
    Value = paramString;
    
    arrayOfObject[0] = localPropertyValue1;
    if (paramBoolean)
    {
      PropertyValue localPropertyValue2 = new PropertyValue();
      Name = "lazywrite";
      Value = Boolean.FALSE;
      
      arrayOfObject[1] = localPropertyValue2;
    }
    return localXMultiServiceFactory.createInstanceWithArguments(str, arrayOfObject);
  }
  
  public static String[] getChildrenNames(Object paramObject)
  {
    XNameAccess localXNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, paramObject);
    return localXNameAccess.getElementNames();
  }
  
  public static String getProductName(XMultiServiceFactory paramXMultiServiceFactory)
  {
    try
    {
      Object localObject = getConfigurationRoot(paramXMultiServiceFactory, "org.openoffice.Setup/Product", false);
      return (String)Helper.getUnoObjectbyName(localObject, "ooName");
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
  
  public static String getOfficeLocaleString(XMultiServiceFactory paramXMultiServiceFactory)
  {
    String str = PropertyNames.EMPTY_STRING;
    try
    {
      Locale localLocale = new Locale();
      Object localObject = getConfigurationRoot(paramXMultiServiceFactory, "org.openoffice.Setup/L10N/", false);
      str = (String)Helper.getUnoObjectbyName(localObject, "ooLocale");
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return str;
  }
  
  public static Locale getOfficeLocale(XMultiServiceFactory paramXMultiServiceFactory)
  {
    Locale localLocale = new Locale();
    
    String str = getOfficeLocaleString(paramXMultiServiceFactory);
    String[] arrayOfString = JavaTools.ArrayoutofString(str, "-");
    Language = arrayOfString[0];
    if (arrayOfString.length > 1) {
      Country = arrayOfString[1];
    }
    return localLocale;
  }
  
  public static String getOfficeLinguistic(XMultiServiceFactory paramXMultiServiceFactory)
  {
    try
    {
      Object localObject = getConfigurationRoot(paramXMultiServiceFactory, "org.openoffice.Setup/L10N/", false);
      return (String)Helper.getUnoObjectbyName(localObject, "ooLocale");
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return null;
  }
  
  public static Object addConfigNode(Object paramObject, String paramString)
    throws WrappedTargetException, ElementExistException, NoSuchElementException, Exception
  {
    XNameContainer localXNameContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, paramObject);
    if (localXNameContainer == null)
    {
      localObject1 = (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, paramObject);
      return ((XNameReplace)localObject1).getByName(paramString);
    }
    Object localObject1 = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class, paramObject);
    
    Object localObject2 = ((XSingleServiceFactory)localObject1).createInstance();
    
    localXNameContainer.insertByName(paramString, localObject2);
    
    return localObject2;
  }
  
  public static void removeNode(Object paramObject, String paramString)
    throws NoSuchElementException, WrappedTargetException
  {
    XNameContainer localXNameContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, paramObject);
    if (localXNameContainer.hasByName(paramString)) {
      localXNameContainer.removeByName(paramString);
    }
  }
  
  public static void commit(Object paramObject)
    throws WrappedTargetException
  {
    XChangesBatch localXChangesBatch = (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, paramObject);
    localXChangesBatch.commitChanges();
  }
  
  public static void updateConfiguration(XMultiServiceFactory paramXMultiServiceFactory, String paramString1, String paramString2, ConfigNode paramConfigNode, Object paramObject)
    throws Exception, ElementExistException, NoSuchElementException, WrappedTargetException
  {
    Object localObject = getConfigurationRoot(paramXMultiServiceFactory, paramString1, true);
    addConfigNode(paramString1, paramString2);
    paramConfigNode.writeConfiguration(localObject, paramObject);
    XChangesBatch localXChangesBatch = (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, localObject);
    localXChangesBatch.commitChanges();
  }
  
  public static void removeNode(XMultiServiceFactory paramXMultiServiceFactory, String paramString1, String paramString2)
    throws Exception, ElementExistException, NoSuchElementException, WrappedTargetException
  {
    Object localObject = getConfigurationRoot(paramXMultiServiceFactory, paramString1, true);
    removeNode(localObject, paramString2);
    XChangesBatch localXChangesBatch = (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, localObject);
    localXChangesBatch.commitChanges();
  }
  
  public static String[] getNodeDisplayNames(XNameAccess paramXNameAccess)
  {
    Object localObject = null;
    return getNodeChildNames(paramXNameAccess, PropertyNames.PROPERTY_NAME);
  }
  
  public static String[] getNodeChildNames(XNameAccess paramXNameAccess, String paramString)
  {
    String[] arrayOfString1 = null;
    try
    {
      arrayOfString1 = paramXNameAccess.getElementNames();
      String[] arrayOfString2 = new String[arrayOfString1.length];
      for (int i = 0; i < arrayOfString1.length; i++)
      {
        Object localObject = Helper.getUnoPropertyValue(paramXNameAccess.getByName(arrayOfString1[i]), paramString);
        if (!AnyConverter.isVoid(localObject)) {
          arrayOfString2[i] = ((String)Helper.getUnoPropertyValue(paramXNameAccess.getByName(arrayOfString1[i]), paramString));
        } else {
          arrayOfString2[i] = arrayOfString1[i];
        }
      }
      return arrayOfString2;
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return arrayOfString1;
  }
  
  public static XNameAccess getChildNodebyIndex(XNameAccess paramXNameAccess, int paramInt)
  {
    try
    {
      String[] arrayOfString = paramXNameAccess.getElementNames();
      Object localObject = paramXNameAccess.getByName(arrayOfString[paramInt]);
      return (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, localObject);
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
  
  public static XNameAccess getChildNodebyName(XNameAccess paramXNameAccess, String paramString)
  {
    try
    {
      if (paramXNameAccess.hasByName(paramString)) {
        return (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, paramXNameAccess.getByName(paramString));
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
  
  public static XNameAccess getChildNodebyDisplayName(XNameAccess paramXNameAccess, String paramString)
  {
    Object localObject = null;
    return getChildNodebyDisplayName(paramXNameAccess, paramString, PropertyNames.PROPERTY_NAME);
  }
  
  public static XNameAccess getChildNodebyDisplayName(XNameAccess paramXNameAccess, String paramString1, String paramString2)
  {
    String[] arrayOfString1 = null;
    try
    {
      arrayOfString1 = paramXNameAccess.getElementNames();
      String[] arrayOfString2 = new String[arrayOfString1.length];
      for (int i = 0; i < arrayOfString1.length; i++)
      {
        String str = (String)Helper.getUnoPropertyValue(paramXNameAccess.getByName(arrayOfString1[i]), paramString2);
        if (str.equals(paramString1)) {
          return (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, paramXNameAccess.getByName(arrayOfString1[i]));
        }
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
  
  public static XNameAccess getChildNodebyDisplayName(XMultiServiceFactory paramXMultiServiceFactory, Locale paramLocale, XNameAccess paramXNameAccess, String paramString1, String paramString2, int paramInt)
  {
    String[] arrayOfString1 = null;
    try
    {
      arrayOfString1 = paramXNameAccess.getElementNames();
      String[] arrayOfString2 = new String[arrayOfString1.length];
      for (int i = 0; i < arrayOfString1.length; i++)
      {
        String str = (String)Helper.getUnoPropertyValue(paramXNameAccess.getByName(arrayOfString1[i]), paramString2);
        if ((paramInt > 0) && (paramInt < str.length())) {
          str = str.substring(0, paramInt);
        }
        str = Desktop.removeSpecialCharacters(paramXMultiServiceFactory, paramLocale, str);
        if (str.equals(paramString1)) {
          return (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, paramXNameAccess.getByName(arrayOfString1[i]));
        }
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.common.Configuration
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.common;

public class DebugHelper
{
  public static void exception(String paramString1, com.sun.star.uno.Exception paramException, int paramInt, String paramString2)
    throws java.lang.Exception
  {}
  
  public static void exception(int paramInt, String paramString)
    throws java.lang.Exception
  {}
  
  public static void exception(com.sun.star.uno.Exception paramException)
    throws java.lang.Exception
  {}
  
  public static void writeInfo(String paramString) {}
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.common.DebugHelper
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.common;

import com.sun.star.lang.XMultiServiceFactory;

/**
 * @deprecated
 */
public class Desktop$OfficePathRetriever
{
  public String TemplatePath;
  public String BitmapPath;
  public String UserTemplatePath;
  public String WorkPath;
  
  public Desktop$OfficePathRetriever(Desktop paramDesktop, XMultiServiceFactory paramXMultiServiceFactory)
  {
    try
    {
      TemplatePath = FileAccess.getOfficePath(paramXMultiServiceFactory, "Template", "share", "/wizard");
      UserTemplatePath = FileAccess.getOfficePath(paramXMultiServiceFactory, "Template", "user", PropertyNames.EMPTY_STRING);
      BitmapPath = FileAccess.combinePaths(paramXMultiServiceFactory, TemplatePath, "/../wizard/bitmap");
      WorkPath = FileAccess.getOfficePath(paramXMultiServiceFactory, "Work", PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING);
    }
    catch (NoValidPathException localNoValidPathException) {}
  }
}

/* Location:
 * Qualified Name:     com.sun.star.wizards.common.Desktop.OfficePathRetriever
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.star.wizards.common;

import com.sun.star.beans.PropertyValue;
import com.sun.star.bridge.XUnoUrlResolver;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.container.NoSuchElementException;
import com.sun.star.container.XEnumeration;
import com.sun.star.container.XEnumerationAccess;
import com.sun.star.container.XHierarchicalNameAccess;
import com.sun.star.container.XNameAccess;
import com.sun.star.frame.XController;
import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XDispatch;
import com.sun.star.frame.XDispatchProvider;
import com.sun.star.frame.XFrame;
import com.sun.star.frame.XFramesSupplier;
import com.sun.star.frame.XModel;
import com.sun.star.i18n.ParseResult;
import com.sun.star.i18n.XCharacterClassification;
import com.sun.star.lang.Locale;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sheet.XSpreadsheetDocument;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.Any;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.XInterface;
import com.sun.star.util.URL;
import com.sun.star.util.XStringSubstitution;
import com.sun.star.util.XURLTransformer;
import java.io.PrintStream;

public class Desktop
{
  public static XDesktop getDesktop(XMultiServiceFactory paramXMultiServiceFactory)
  {
    XInterface localXInterface = null;
    XDesktop localXDesktop = null;
    if (paramXMultiServiceFactory != null) {
      try
      {
        localXInterface = (XInterface)paramXMultiServiceFactory.createInstance("com.sun.star.frame.Desktop");
        localXDesktop = (XDesktop)UnoRuntime.queryInterface(XDesktop.class, localXInterface);
      }
      catch (Exception localException)
      {
        localException.printStackTrace(System.out);
      }
    } else {
      System.out.println("Can't create a desktop. null pointer !");
    }
    return localXDesktop;
  }
  
  public static XFrame getActiveFrame(XMultiServiceFactory paramXMultiServiceFactory)
  {
    XDesktop localXDesktop = getDesktop(paramXMultiServiceFactory);
    XFramesSupplier localXFramesSupplier = (XFramesSupplier)UnoRuntime.queryInterface(XFramesSupplier.class, localXDesktop);
    return localXFramesSupplier.getActiveFrame();
  }
  
  public static XComponent getActiveComponent(XMultiServiceFactory paramXMultiServiceFactory)
  {
    XFrame localXFrame = getActiveFrame(paramXMultiServiceFactory);
    return (XComponent)UnoRuntime.queryInterface(XComponent.class, localXFrame.getController().getModel());
  }
  
  public static XTextDocument getActiveTextDocument(XMultiServiceFactory paramXMultiServiceFactory)
  {
    XComponent localXComponent = getActiveComponent(paramXMultiServiceFactory);
    return (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, localXComponent);
  }
  
  public static XSpreadsheetDocument getActiveSpreadsheetDocument(XMultiServiceFactory paramXMultiServiceFactory)
  {
    XComponent localXComponent = getActiveComponent(paramXMultiServiceFactory);
    return (XSpreadsheetDocument)UnoRuntime.queryInterface(XSpreadsheetDocument.class, localXComponent);
  }
  
  public static XDispatch getDispatcher(XMultiServiceFactory paramXMultiServiceFactory, XFrame paramXFrame, String paramString, URL paramURL)
  {
    try
    {
      URL[] arrayOfURL = new URL[1];
      arrayOfURL[0] = paramURL;
      XDispatchProvider localXDispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, paramXFrame);
      return localXDispatchProvider.queryDispatch(arrayOfURL[0], paramString, 23);
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
  
  public static URL getDispatchURL(XMultiServiceFactory paramXMultiServiceFactory, String paramString)
  {
    try
    {
      Object localObject = paramXMultiServiceFactory.createInstance("com.sun.star.util.URLTransformer");
      XURLTransformer localXURLTransformer = (XURLTransformer)UnoRuntime.queryInterface(XURLTransformer.class, localObject);
      URL[] arrayOfURL = new URL[1];
      arrayOfURL[0] = new URL();
      0Complete = paramString;
      localXURLTransformer.parseStrict(arrayOfURL);
      return arrayOfURL[0];
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
  
  public static void dispatchURL(XMultiServiceFactory paramXMultiServiceFactory, String paramString1, XFrame paramXFrame, String paramString2)
  {
    URL localURL = getDispatchURL(paramXMultiServiceFactory, paramString1);
    XDispatch localXDispatch = getDispatcher(paramXMultiServiceFactory, paramXFrame, paramString2, localURL);
    dispatchURL(localXDispatch, localURL);
  }
  
  public static void dispatchURL(XMultiServiceFactory paramXMultiServiceFactory, String paramString, XFrame paramXFrame)
  {
    dispatchURL(paramXMultiServiceFactory, paramString, paramXFrame, PropertyNames.EMPTY_STRING);
  }
  
  public static void dispatchURL(XDispatch paramXDispatch, URL paramURL)
  {
    PropertyValue[] arrayOfPropertyValue = new PropertyValue[0];
    paramXDispatch.dispatch(paramURL, arrayOfPropertyValue);
  }
  
  public static XMultiComponentFactory getMultiComponentFactory()
    throws com.sun.star.uno.Exception, java.lang.RuntimeException, java.lang.Exception
  {
    XComponentContext localXComponentContext = Bootstrap.createInitialComponentContext(null);
    
    return localXComponentContext.getServiceManager();
  }
  
  public static XMultiServiceFactory connect(String paramString)
    throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException, java.lang.Exception
  {
    XMultiComponentFactory localXMultiComponentFactory = getMultiComponentFactory();
    Object localObject = localXMultiComponentFactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", null);
    XUnoUrlResolver localXUnoUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(XUnoUrlResolver.class, localObject);
    return (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, localXUnoUrlResolver.resolve(paramString));
  }
  
  public static String getIncrementSuffix(XNameAccess paramXNameAccess, String paramString)
  {
    boolean bool = true;
    int i = 1;
    String str1 = PropertyNames.EMPTY_STRING;
    String str2 = paramString;
    while (bool)
    {
      bool = paramXNameAccess.hasByName(paramString);
      if (bool)
      {
        i++;
        paramString = str2 + Integer.toString(i);
      }
    }
    if (i > 1) {
      str1 = Integer.toString(i);
    }
    return str1;
  }
  
  public static String getIncrementSuffix(XHierarchicalNameAccess paramXHierarchicalNameAccess, String paramString)
  {
    boolean bool = true;
    int i = 1;
    String str1 = PropertyNames.EMPTY_STRING;
    String str2 = paramString;
    while (bool)
    {
      bool = paramXHierarchicalNameAccess.hasByHierarchicalName(paramString);
      if (bool)
      {
        i++;
        paramString = str2 + Integer.toString(i);
      }
    }
    if (i > 1) {
      str1 = Integer.toString(i);
    }
    return str1;
  }
  
  public static int checkforfirstSpecialCharacter(XMultiServiceFactory paramXMultiServiceFactory, String paramString, Locale paramLocale)
  {
    try
    {
      int i = 1044495;
      Object localObject = paramXMultiServiceFactory.createInstance("com.sun.star.i18n.CharacterClassification");
      XCharacterClassification localXCharacterClassification = (XCharacterClassification)UnoRuntime.queryInterface(XCharacterClassification.class, localObject);
      ParseResult localParseResult = localXCharacterClassification.parsePredefinedToken(4, paramString, 0, paramLocale, i, PropertyNames.EMPTY_STRING, i, PropertyNames.SPACE);
      return EndPos;
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return -1;
  }
  
  public static String removeSpecialCharacters(XMultiServiceFactory paramXMultiServiceFactory, Locale paramLocale, String paramString)
  {
    String str1 = paramString;
    int i = 0;
    while (i < str1.length())
    {
      i = checkforfirstSpecialCharacter(paramXMultiServiceFactory, str1, paramLocale);
      if (i < str1.length())
      {
        String str2 = str1.substring(i, i + 1);
        str1 = JavaTools.replaceSubString(str1, PropertyNames.EMPTY_STRING, str2);
      }
    }
    return str1;
  }
  
  public static String getUniqueName(XNameAccess paramXNameAccess, String paramString)
  {
    String str = getIncrementSuffix(paramXNameAccess, paramString);
    return paramString + str;
  }
  
  public static String getUniqueName(XHierarchicalNameAccess paramXHierarchicalNameAccess, String paramString)
  {
    String str = getIncrementSuffix(paramXHierarchicalNameAccess, paramString);
    return paramString + str;
  }
  
  public static String getUniqueName(String[] paramArrayOfString, String paramString1, String paramString2)
  {
    int i = 2;
    String str = paramString1;
    int j = 1;
    if (paramArrayOfString == null) {
      return paramString1;
    }
    if (paramArrayOfString.length == 0) {
      return paramString1;
    }
    while (j != 0)
    {
      for (int k = 0; k < paramArrayOfString.length; k++) {
        if (JavaTools.FieldInList(paramArrayOfString, str) == -1) {
          return str;
        }
      }
      str = paramString1 + paramString2 + i++;
    }
    return PropertyNames.EMPTY_STRING;
  }
  
  /**
   * @deprecated
   */
  public static XInterface getRegistryKeyContent(XMultiServiceFactory paramXMultiServiceFactory, String paramString, boolean paramBoolean)
  {
    try
    {
      PropertyValue[] arrayOfPropertyValue = new PropertyValue[1];
      Object localObject = paramXMultiServiceFactory.crea
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd