table

16:53:27.347 INFO  jd.cli.Main - Decompiling table.jar
package com.sun.star.wizards.table;

import com.sun.star.beans.PropertyValue;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.lib.uno.helper.PropertySet;
import com.sun.star.task.XJobExecutor;
import com.sun.star.uno.Type;
import com.sun.star.wizards.common.Properties;
import com.sun.star.wizards.common.PropertyNames;
import java.io.PrintStream;

public class CallTableWizard$TableWizardImplementation
  extends PropertySet
  implements XInitialization, XServiceInfo, XTypeProvider, XJobExecutor
{
  private PropertyValue[] m_wizardContext;
  public String Command;
  public final Integer CommandType = Integer.valueOf(0);
  private static final String __serviceName = "com.sun.star.wizards.table.CallTableWizard";
  private XMultiServiceFactory m_serviceFactory;
  
  public CallTableWizard$TableWizardImplementation(XMultiServiceFactory paramXMultiServiceFactory)
  {
    m_serviceFactory = paramXMultiServiceFactory;
    registerProperty(PropertyNames.COMMAND, (short)17);
    registerProperty(PropertyNames.COMMAND_TYPE, (short)16);
  }
  
  public void trigger(String paramString)
  {
    try
    {
      if (paramString.compareTo(PropertyNames.START) == 0)
      {
        TableWizard localTableWizard = new TableWizard(m_serviceFactory, m_wizardContext);
        Command = localTableWizard.startTableWizard();
      }
    }
    catch (Exception localException)
    {
      System.err.println(localException);
    }
    System.gc();
  }
  
  public void initialize(Object[] paramArrayOfObject)
    throws com.sun.star.uno.Exception
  {
    m_wizardContext = Properties.convertToPropertyValueArray(paramArrayOfObject);
  }
  
  public String[] getSupportedServiceNames()
  {
    String[] arrayOfString = new String[1];
    
    arrayOfString[0] = "com.sun.star.wizards.table.CallTableWizard";
    
    return arrayOfString;
  }
  
  public boolean supportsService(String paramString)
  {
    boolean bool = false;
    if (paramString.equals("com.sun.star.wizards.table.CallTableWizard")) {
      bool = true;
    }
    return bool;
  }
  
  public byte[] getImplementationId()
  {
    byte[] arrayOfByte = new byte[0];
    try
    {
      arrayOfByte = (PropertyNames.EMPTY_STRING + hashCode()).getBytes();
    }
    catch (Exception localException)
    {
      System.err.println(localException);
    }
    return arrayOfByte;
  }
  
  public String getImplementationName()
  {
    return TableWizardImplementation.class.getName();
  }
  
  public Type[] getTypes()
  {
    Type[] arrayOfType = new Type[0];
    try
    {
      arrayOfType = new Type[] { new Type(XJobExecutor.class), new Type(XTypeProvider.class), new Type(XServiceInfo.class), new Type(XInitialization.class) };
    }
    catch (Exception localException)
    {
      System.err.println(localException);
    }
    return arrayOfType;
  }
}

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

import com.sun.star.beans.PropertyValue;
import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.lib.uno.helper.PropertySet;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.task.XJobExecutor;
import com.sun.star.uno.Type;
import com.sun.star.wizards.common.Properties;
import com.sun.star.wizards.common.PropertyNames;
import java.io.PrintStream;

public class CallTableWizard
{
  public static XSingleServiceFactory __getServiceFactory(String paramString, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
  {
    XSingleServiceFactory localXSingleServiceFactory = null;
    if (paramString.equals(TableWizardImplementation.class.getName())) {
      localXSingleServiceFactory = FactoryHelper.getServiceFactory(TableWizardImplementation.class, "com.sun.star.wizards.table.CallTableWizard", paramXMultiServiceFactory, paramXRegistryKey);
    }
    return localXSingleServiceFactory;
  }
  
  public static class TableWizardImplementation
    extends PropertySet
    implements XInitialization, XServiceInfo, XTypeProvider, XJobExecutor
  {
    private PropertyValue[] m_wizardContext;
    public String Command;
    public final Integer CommandType = Integer.valueOf(0);
    private static final String __serviceName = "com.sun.star.wizards.table.CallTableWizard";
    private XMultiServiceFactory m_serviceFactory;
    
    public TableWizardImplementation(XMultiServiceFactory paramXMultiServiceFactory)
    {
      m_serviceFactory = paramXMultiServiceFactory;
      registerProperty(PropertyNames.COMMAND, (short)17);
      registerProperty(PropertyNames.COMMAND_TYPE, (short)16);
    }
    
    public void trigger(String paramString)
    {
      try
      {
        if (paramString.compareTo(PropertyNames.START) == 0)
        {
          TableWizard localTableWizard = new TableWizard(m_serviceFactory, m_wizardContext);
          Command = localTableWizard.startTableWizard();
        }
      }
      catch (Exception localException)
      {
        System.err.println(localException);
      }
      System.gc();
    }
    
    public void initialize(Object[] paramArrayOfObject)
      throws com.sun.star.uno.Exception
    {
      m_wizardContext = Properties.convertToPropertyValueArray(paramArrayOfObject);
    }
    
    public String[] getSupportedServiceNames()
    {
      String[] arrayOfString = new String[1];
      
      arrayOfString[0] = "com.sun.star.wizards.table.CallTableWizard";
      
      return arrayOfString;
    }
    
    public boolean supportsService(String paramString)
    {
      boolean bool = false;
      if (paramString.equals("com.sun.star.wizards.table.CallTableWizard")) {
        bool = true;
      }
      return bool;
    }
    
    public byte[] getImplementationId()
    {
      byte[] arrayOfByte = new byte[0];
      try
      {
        arrayOfByte = (PropertyNames.EMPTY_STRING + hashCode()).getBytes();
      }
      catch (Exception localException)
      {
        System.err.println(localException);
      }
      return arrayOfByte;
    }
    
    public String getImplementationName()
    {
      return TableWizardImplementation.class.getName();
    }
    
    public Type[] getTypes()
    {
      Type[] arrayOfType = new Type[0];
      try
      {
        arrayOfType = new Type[] { new Type(XJobExecutor.class), new Type(XTypeProvider.class), new Type(XServiceInfo.class), new Type(XInitialization.class) };
      }
      catch (Exception localException)
      {
        System.err.println(localException);
      }
      return arrayOfType;
    }
  }
}

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

import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Configuration;

public class CGCategory
{
  public String Name;
  public int Index;
  private String[] Tables;
  private final String CGROOTPATH = "/org.openoffice.Office.TableWizard/TableWizard/";
  XMultiServiceFactory xMSF;
  XNameAccess xNameAccessTablesNode;
  XNameAccess xNameAccessCurBusinessNode;
  Object oconfigView;
  
  public CGCategory(XMultiServiceFactory paramXMultiServiceFactory)
  {
    xMSF = paramXMultiServiceFactory;
  }
  
  public void initialize(String paramString)
  {
    try
    {
      oconfigView = Configuration.getConfigurationRoot(xMSF, "/org.openoffice.Office.TableWizard/TableWizard/", false);
      xNameAccessCurBusinessNode = Configuration.getChildNodebyName((XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, oconfigView), paramString);
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
  }
  
  public String[] getTableNames()
  {
    try
    {
      xNameAccessTablesNode = ((XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, xNameAccessCurBusinessNode.getByName("Tables")));
      return Configuration.getNodeDisplayNames(xNameAccessTablesNode);
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
}

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

import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.PropertyNames;

public class CGTable
{
  XMultiServiceFactory xMSF;
  XNameAccess xNameAccessFieldsNode;
  XNameAccess xNameAccessTableNode;
  public String Index;
  public String Name;
  private Object oconfigView;
  private final String CGROOTPATH = "/org.openoffice.Office.TableWizard/TableWizard/";
  
  public CGTable(XMultiServiceFactory paramXMultiServiceFactory)
  {
    xMSF = paramXMultiServiceFactory;
  }
  
  public void initialize(XNameAccess paramXNameAccess, int paramInt)
  {
    try
    {
      xNameAccessTableNode = Configuration.getChildNodebyIndex(paramXNameAccess, paramInt);
      xNameAccessFieldsNode = Configuration.getChildNodebyName(xNameAccessTableNode, "Fields");
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
  }
  
  public String[] getFieldNames(boolean paramBoolean, int paramInt)
  {
    try
    {
      String[] arrayOfString = null;
      if (paramBoolean)
      {
        arrayOfString = Configuration.getNodeChildNames(xNameAccessFieldsNode, "ShortName");
        for (i = 0; i < arrayOfString.length; i++) {
          if (arrayOfString[i].length() > paramInt) {
            arrayOfString[i] = arrayOfString[i].substring(0, paramInt);
          }
        }
      }
      else
      {
        arrayOfString = Configuration.getNodeChildNames(xNameAccessFieldsNode, PropertyNames.PROPERTY_NAME);
      }
      for (int i = 0; i < arrayOfString.length; i++) {
        arrayOfString[i] = Desktop.removeSpecialCharacters(xMSF, Configuration.getOfficeLocale(xMSF), arrayOfString[i]);
      }
      return arrayOfString;
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return null;
  }
}

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

import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.XPropertySetInfo;
import com.sun.star.container.XNameAccess;
import com.sun.star.lang.Locale;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.Properties;
import com.sun.star.wizards.common.PropertyNames;
import java.util.Vector;

public class FieldDescription
{
  private String tablename = PropertyNames.EMPTY_STRING;
  private String keyname;
  private XNameAccess xNameAccessTableNode;
  private XPropertySet xPropertySet;
  private Vector aPropertyValues;
  private Integer Type;
  private Integer Scale;
  private Integer Precision;
  private Boolean DefaultValue;
  private String Name;
  private XMultiServiceFactory xMSF;
  private Locale aLocale;
  
  public FieldDescription(XMultiServiceFactory paramXMultiServiceFactory, Locale paramLocale, ScenarioSelector paramScenarioSelector, String paramString1, String paramString2, int paramInt)
  {
    xMSF = paramXMultiServiceFactory;
    aLocale = paramLocale;
    tablename = paramScenarioSelector.getTableName();
    Name = paramString1;
    keyname = paramString2;
    aPropertyValues = new Vector();
    xNameAccessTableNode = oCGTable.xNameAccessFieldsNode;
    XNameAccess localXNameAccess;
    if (bcolumnnameislimited) {
      localXNameAccess = Configuration.getChildNodebyDisplayName(xMSF, aLocale, xNameAccessTableNode, keyname, "ShortName", paramInt);
    } else {
      localXNameAccess = Configuration.getChildNodebyDisplayName(xMSF, aLocale, xNameAccessTableNode, keyname, PropertyNames.PROPERTY_NAME, paramInt);
    }
    setFieldProperties(localXNameAccess);
  }
  
  public FieldDescription(String paramString)
  {
    Name = paramString;
    aPropertyValues = new Vector();
    Type = new Integer(12);
    aPropertyValues.addElement(Properties.createProperty(PropertyNames.PROPERTY_NAME, paramString));
    aPropertyValues.addElement(Properties.createProperty("Type", Type));
  }
  
  public void setName(String paramString)
  {
    for (int i = 0; i < aPropertyValues.size(); i++)
    {
      PropertyValue localPropertyValue = (PropertyValue)aPropertyValues.get(i);
      if (Name.equals(PropertyNames.PROPERTY_NAME))
      {
        Value = paramString;
        aPropertyValues.set(i, localPropertyValue);
        Name = paramString;
        return;
      }
    }
  }
  
  public String getName()
  {
    return Name;
  }
  
  public String gettablename()
  {
    return tablename;
  }
  
  private boolean propertyexists(String paramString)
  {
    boolean bool = false;
    try
    {
      if (xPropertySet.getPropertySetInfo().hasPropertyByName(paramString))
      {
        Object localObject = xPropertySet.getPropertyValue(paramString);
        bool = !AnyConverter.isVoid(localObject);
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    return bool;
  }
  
  public void setFieldProperties(XNameAccess paramXNameAccess)
  {
    try
    {
      xPropertySet = ((XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, paramXNameAccess));
      if (propertyexists(PropertyNames.PROPERTY_NAME)) {
        aPropertyValues.addElement(Properties.createProperty(PropertyNames.PROPERTY_NAME, Name));
      }
      if (propertyexists("Type")) {
        aPropertyValues.addElement(Properties.createProperty("Type", xPropertySet.getPropertyValue("Type")));
      }
      if (propertyexists("Scale")) {
        aPropertyValues.addElement(Properties.createProperty("Scale", xPropertySet.getPropertyValue("Scale")));
      }
      if (propertyexists("Precision")) {
        aPropertyValues.addElement(Properties.createProperty("Precision", xPropertySet.getPropertyValue("Precision")));
      }
      if (propertyexists("DefaultValue")) {
        aPropertyValues.addElement(Properties.createProperty("DefaultValue", xPropertySet.getPropertyValue("DefaultValue")));
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
  }
  
  public PropertyValue[] getPropertyValues()
  {
    if (aPropertyValues != null)
    {
      PropertyValue[] arrayOfPropertyValue = new PropertyValue[aPropertyValues.size()];
      aPropertyValues.toArray(arrayOfPropertyValue);
      return arrayOfPropertyValue;
    }
    return null;
  }
}

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

import com.sun.star.awt.FontDescriptor;
import com.sun.star.awt.ItemEvent;
import com.sun.star.awt.XButton;
import com.sun.star.awt.XItemListener;
import com.sun.star.awt.XListBox;
import com.sun.star.awt.XTextComponent;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.Resource;
import com.sun.star.wizards.db.TableDescriptor;
import com.sun.star.wizards.ui.PeerConfig;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.UnoDialog;
import java.util.Hashtable;

public class FieldFormatter
  implements XItemListener
{
  TableWizard CurUnoDialog;
  TableDescriptor curTableDescriptor;
  Object oColumnDescriptorModel;
  XTextComponent txtfieldname;
  XListBox xlstFieldNames;
  XButton btnplus;
  XButton btnminus;
  XButton btnShiftUp;
  XButton btnShiftDown;
  short curtabindex;
  String TOGGLEBUTTONS = "toggleButtons";
  String ADDFIELDNAME = "addFieldName";
  String REMOVEFIELDNAME = "removeFieldName";
  String MODIFYFIELDNAME = "modifyFieldName";
  String[] fieldnames;
  String suntitled;
  Integer IFieldFormatStep;
  
  public FieldFormatter(TableWizard paramTableWizard, TableDescriptor paramTableDescriptor)
  {
    CurUnoDialog = paramTableWizard;
    curtabindex = 200;
    IFieldFormatStep = new Integer(2);
    String str1 = CurUnoDialog.m_oResource.getResText(2523);
    String str2 = CurUnoDialog.m_oResource.getResText(2525);
    String str3 = CurUnoDialog.m_oResource.getResText(2520);
    String str4 = CurUnoDialog.m_oResource.getResText(2545);
    String str5 = CurUnoDialog.m_oResource.getResText(2546);
    
    suntitled = CurUnoDialog.m_oResource.getResText(2543);
    
    CurUnoDialog.insertLabel("lblFieldNames", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { UIConsts.INTEGERS[8], str2, Integer.valueOf(91), Integer.valueOf(27), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(90) });
    try
    {
      xlstFieldNames = CurUnoDialog.insertListBox("lstfieldnames", 3, null, this, new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Integer.valueOf(133), "HID:WIZARDS_HID_DLGTABLE_LB_SELFIELDNAMES", Integer.valueOf(92), Integer.valueOf(37), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(62) });
    }
    catch (Exception localException)
    {
      localException.printStackTrace(System.out);
    }
    FontDescriptor localFontDescriptor = new FontDescriptor();
    Name = "StarSymbol";
    
    btnShiftUp = CurUnoDialog.insertButton("btnShiftUp", "shiftFieldNameUp", this, new String[] { PropertyNames.PROPERTY_ENABLED, PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Boolean.FALSE, localFontDescriptor, Integer.valueOf(14), "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDUP", String.valueOf('?'), Integer.valueOf(158), Integer.valueOf(139), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(14) });
    
    btnShiftDown = CurUnoDialog.insertButton("btnShiftDown", "shiftFieldNameDown", this, new String[] { PropertyNames.PROPERTY_ENABLED, PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Boolean.FALSE, localFontDescriptor, Integer.valueOf(14), "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDDOWN", String.valueOf('?'), Integer.valueOf(158), Integer.valueOf(156), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(14) });
    
    localFontDescriptor = new FontDescriptor();
    Weight = 150.0F;
    Height = 13;
    btnminus = CurUnoDialog.insertButton("btnminus", "removeFieldName", this, new String[] { PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { localFontDescriptor, Integer.valueOf(14), "HID:WIZARDS_HID_DLGTABLE_CMDMINUS", "-", Integer.valueOf(118), Integer.valueOf(175), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(14) });
    
    btnplus = CurUnoDialog.insertButton("btnplus", "addFieldName", this, new String[] { PropertyNames.FONT_DESCRIPTOR, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { localFontDescriptor, Integer.valueOf(14), "HID:WIZARDS_HID_DLGTABLE_CMDPLUS", "+", Integer.valueOf(137), Integer.valueOf(175), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(14) });
    
    CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "ColDescriptorHeader", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.ORIENTATION, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Integer.valueOf(8), str3, Integer.valueOf(0), Integer.valueOf(158), Integer.valueOf(27), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(165) });
    
    CurUnoDialog.insertLabel("lblFieldName", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { UIConsts.INTEGERS[8], str1, Integer.valueOf(158), Integer.valueOf(39), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(94) });
    
    txtfieldname = CurUnoDialog.insertTextField("txtfieldname", MODIFYFIELDNAME, this, new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH }, new Object[] { UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_COLNAME", Integer.valueOf(274), Integer.valueOf(37), IFieldFormatStep, new Short(curtabindex++), PropertyNames.EMPTY_STRING, Integer.valueOf(50) });
    
    txtfieldname.addTextListener(CurUnoDialog);
    CurUnoDialog.getPeerConfiguration().setAccessibleName(btnplus, str4);
    CurUnoDialog.getPeerConfiguration().setAccessibleName(btnminus, str5);
  }
  
  public void initialize(TableDescriptor paramTableDescriptor, String[] paramArrayOfString)
  {
    if (oColumnDescriptorModel == null)
    {
      oColumnDescriptorModel = CurUnoDialog.insertControlModel("com.sun.star.sdb.ColumnDescriptorControlModel", "oColumnDescriptor", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH, "EditWidth" }, new Object[] { Integer.valueOf(85), Integer.valueOf(158), Integer.valueOf(49), IFieldFormatStep, new Short(curtabindex++), Integer.valueOf(166), Integer.valueOf(50) });
      
      curTableDescriptor = paramTableDescriptor;
      Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, DBConnection);
      txtfieldname.setMaxTextLen((short)curTableDescriptor.getMaxColumnNameLength());
    }
    else
    {
      int i = ((Integer)Helper.getUnoPropertyValue(oColumnDescriptorModel, PropertyNames.PROPERTY_STEP)).intValue();
      if (i > IFieldFormatStep.intValue())
      {
        Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.PROPERTY_STEP, IFieldFormatStep);
        CurUnoDialog.repaintDialogStep();
      }
    }
    Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, paramArrayOfString);
    Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { 0 });
    
    updateColumnDescriptor(paramArrayOfString[0], curTableDescriptor.getByName(paramArrayOfString[0]));
    toggleButtons();
    CurUnoDialog.setFocus("lstfieldnames");
  }
  
  public void toggleButtons()
  {
    boolean bool1 = false;
    boolean bool2 = false;
    int i = Helper.getUnoArrayPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS) != null ? 1 : 0;
    int j = UnoDialog.getListBoxItemCount(xlstFieldNames);
    boolean bool3 = j > 0;
    if (i != 0)
    {
      int k = xlstFieldNames.getSelectedItemPos();
      bool1 = k != 0;
      bool2 = k != j - 1;
    }
    Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftUp), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bool1));
    Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftDown), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bool2));
    Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bool3));
    CurUnoDialog.setcompleted(2, bool3);
  }
  
  public void addFieldName()
  {
    String str = Desktop.getUniqueName(xlstFieldNames.getItems(), suntitled, PropertyNames.EMPTY_STRING);
    short s = xlstFieldNames.getItemCount();
    if (CurUnoDialog.verifyfieldcount(s))
    {
      xlstFieldNames.addItem(str, s);
      Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { s });
      
      toggleButtons();
      FieldDescription localFieldDescription = new FieldDescription(str);
      CurUnoDialog.fielditems.put(str, localFieldDescription);
      curTableDescriptor.addColumn(localFieldDescription.getPropertyValues());
      updateColumnDescriptor(str, curTableDescriptor.getByName(str));
      CurUnoDialog.setControlVisible("oColumnDescriptor", true);
      CurUnoDialog.repaintDialogStep();
    }
  }
  
  public void removeFieldName()
  {
    String[] arrayOfString = (String[])Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST);
    int i = UnoDialog.getSelectedItemPos(xlstFieldNames);
    String str1 = arrayOfString[i];
    xlstFieldNames.removeItems(i, (short)1);
    CurUnoDialog.fielditems.remove(str1);
    int j = UnoDialog.getListBoxItemCount(xlstFieldNames);
    if (i < j)
    {
      Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { i });
    }
    else if (j > -1)
    {
      i = (short)((short)j - 1);
      Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { i });
    }
    curTableDescriptor.dropColumnbyName(str1);
    arrayOfString = (String[])Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST);
    boolean bool = (i > -1) && (i < arrayOfString.length);
    if (bool)
    {
      String str2 = arrayOfString[i];
      updateColumnDescriptor(str2, curTableDescriptor.getByName(str2));
      toggleButtons();
    }
    else
    {
      Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", PropertyNames.EMPTY_STRING);
      Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bool));
      CurUnoDialog.setcompleted(2, bool);
    }
    Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bool));
    CurUnoDialog.setControlVisible("oColumnDescriptor", bool);
    CurUnoDialog.repaintDialogStep();
  }
  
  public void modifyFieldName()
  {
    String str1 = txtfieldname.getText();
    String str2 = xlstFieldNames.getSelectedItem();
    if (!str1.equals(str2)) {
      if (curTableDescriptor.modifyColumnName(str2, str1))
      {
        Object localObject = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column");
        Helper.setUnoPropertyValue(localObject, PropertyNames.PROPERTY_NAME, str1);
        FieldDescription localFieldDescription = (FieldDescription)CurUnoDialog.fielditems.get(str2);
        CurUnoDialog.fielditems.remove(str2);
        localFieldDescription.setName(str1);
        CurUnoDialog.fielditems.put(str1, localFieldDescription);
        String[] arrayOfString = xlstFieldNames.getItems();
        int i = xlstFieldNames.getSelectedItemPos();
        arrayOfString[i] = str1;
        Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, arrayOfString);
        Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { i });
      }
    }
  }
  
  public void shiftFieldNameUp()
  {
    int i = xlstFieldNames.getSelectedItemPos();
    String[] arrayOfString = shiftArrayItem(xlstFieldNames.getItems(), i, -1);
    Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, arrayOfString);
    if (i - 1 > -1)
    {
      Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { (short)(i - 1) });
      
      curTableDescriptor.moveColumn(i, i - 1);
    }
    toggleButtons();
  }
  
  public void shiftFieldNameDown()
  {
    int i = xlstFieldNames.getSelectedItemPos();
    String[] arrayOfString = shiftArrayItem(xlstFieldNames.getItems(), i, 1);
    Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST, arrayOfString);
    if (i + 1 < xlstFieldNames.getItemCount())
    {
      Helper.setUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.SELECTED_ITEMS, new short[] { (short)(i + 1) });
      
      curTableDescriptor.moveColumn(i, i + 1);
    }
    toggleButtons();
  }
  
  public String[] shiftArrayItem(String[] paramArrayOfString, int paramInt1, int paramInt2)
  {
    int i = paramInt1 + paramInt2;
    if ((i >= 0) && (i < paramArrayOfString.length))
    {
      String str = paramArrayOfString[i];
      paramArrayOfString[i] = paramArrayOfString[paramInt1];
      paramArrayOfString[paramInt1] = str;
    }
    return paramArrayOfString;
  }
  
  public boolean updateColumnofColumnDescriptor()
  {
    Object localObject = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column");
    XPropertySet localXPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, localObject);
    if (localXPropertySet != null)
    {
      curTableDescriptor.modifyColumn(txtfieldname.getText(), localXPropertySet);
      return true;
    }
    return false;
  }
  
  private void updateColumnDescriptor(String paramString, XPropertySet paramXPropertySet)
  {
    updateColumnofColumnDescriptor();
    XPropertySet localXPropertySet = curTableDescriptor.clonePropertySet(paramString, paramXPropertySet);
    if (localXPropertySet != null) {
      Helper.setUnoPropertyValue(oColumnDescriptorModel, "Column", localXPropertySet);
    }
    txtfieldname.setText(paramString);
  }
  
  public XPropertySet clonePropertySet(XPropertySet paramXPropertySet)
  {
    return null;
  }
  
  public void itemStateChanged(ItemEvent paramItemEvent)
  {
    String str = xlstFieldNames.getSelectedItem();
    XPropertySet localXPropertySet = curTableDescriptor.getByName(str);
    updateColumnDescriptor(str, localXPropertySet);
    toggleButtons();
  }
  
  public boolean iscompleted()
  {
    String[] arrayOfString = (String[])Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST);
    return arrayOfString.length > 0;
  }
  
  public String[] getFieldNames()
  {
    return (String[])Helper.getUnoPropertyValue(UnoDialog.getModel(xlstFieldNames), PropertyNames.STRING_ITEM_LIST);
  }
  
  public void disposing(EventObject paramEventObject) {}
}

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

import com.sun.star.awt.XListBox;
import com.sun.star.awt.XRadioButton;
import com.sun.star.awt.XTextComponent;
import com.sun.star.beans.XPropertySet;
import com.sun.star.sdbc.SQLException;
import com.sun.star.sdbc.XConnection;
import com.sun.star.sdbc.XDatabaseMetaData;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.Resource;
import com.sun.star.wizards.db.TableDescriptor;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.UnoDialog;

public class Finalizer
{
  TableWizard CurUnoDialog;
  short curtabindex;
  XRadioButton optModifyTable;
  XRadioButton optWorkWithTable;
  XRadioButton optStartFormWizard;
  XTextComponent txtTableName;
  XListBox xCatalogListBox;
  XListBox xSchemaListBox;
  TableDescriptor curtabledescriptor;
  public String SETCOMPLETIONFLAG = "setCompletionFlag";
  public static int WORKWITHTABLEMODE = 0;
  public static int MODIFYTABLEMODE = 1;
  public static int STARTFORMWIZARDMODE = 2;
  
  public Finalizer(TableWizard paramTableWizard, TableDescriptor paramTableDescriptor)
  {
    try
    {
      CurUnoDialog = paramTableWizard;
      curtabledescriptor = paramTableDescriptor;
      curtabindex = 400;
      Integer localInteger = new Integer(4);
      String str1 = CurUnoDialog.m_oResource.getResText(2534);
      String str2 = CurUnoDialog.m_oResource.getResText(2536);
      String str3 = CurUnoDialog.m_oResource.getResText(2538);
      String str4 = CurUnoDialog.m_oResource.getResText(2539);
      String str5 = CurUnoDialog.m_oResource.getResText(2537);
      String str6 = CurUnoDialog.m_oResource.getResText(2535);
      String str7 = CurUnoDialog.m_oResource.getResText(2549);
      String str8 = CurUnoDialog.m_oResource.getResText(2550);
      String[] arrayOfString1 = curtabledescriptor.getCatalogNames();
      String[] arrayOfString2 = curtabledescriptor.getSchemaNames();
      int i = 97;
      int j = 0;
      int k = 0;
      int m = 0;
      
      CurUnoDialog.insertLabel("lblTableName", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH }, new Object[] { UIConsts.INTEGERS[8], str1, Integer.valueOf(97), Integer.valueOf(25), localInteger, Integer.valueOf(220) });
      
      txtTableName = CurUnoDialog.insertTextField("txtTableName", SETCOMPLETIONFLAG, this, new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH }, new Object[] { UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_TXT_NAME", Integer.valueOf(97), Integer.valueOf(35), localInteger, new Short(curtabindex++), PropertyNames.EMPTY_STRING, Integer.valueOf(223) });
      
      txtTableName.addTextListener(CurUnoDialog);
      txtTableName.setMaxTextLen((short)curtabledescriptor.getMaxTableNameLength());
      String str9;
      if (curtabledescriptor.xDBMetaData.supportsCatalogsInTableDefinitions()) {
        if (arrayOfString1 != null) {
          if (arrayOfString1.length > 0)
          {
            m = 1;
            str9 = PropertyNames.EMPTY_STRING;
            try
            {
              str9 = curtabledescriptor.DBConnection.getCatalog();
            }
            catch (SQLException localSQLException2)
            {
              localSQLException2.printStackTrace(System.out);
            }
            CurUnoDialog.insertLabel("lblCatalog", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Integer.valueOf(8), str7, new Integer(i), Integer.valueOf(52), localInteger, new Short(curtabindex++), Integer.valueOf(120) });
            try
            {
              xCatalogListBox = CurUnoDialog.insertListBox("lstCatalog", null, null, new String[] { "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Boolean.TRUE, Integer.valueOf(12), "HID:WIZARDS_HID_DLGTABLE_LST_CATALOG", new Short(UnoDialog.getListBoxLineCount()), new Integer(i), Integer.valueOf(62), localInteger, arrayOfString1, new Short(curtabindex++), Integer.valueOf(80) });
              
              int n = JavaTools.FieldInList(arrayOfString1, str9);
              if (n < 0) {
                n = 0;
              }
              CurUnoDialog.setControlProperty("lstCatalog", PropertyNames.SELECTED_ITEMS, new short[] { (short)n });
            }
            catch (Exception localException1)
            {
              localException1.printStackTrace(System.out);
            }
            i = 200;
          }
        }
      }
      if (curtabledescriptor.xDBMetaData.supportsSchemasInTableDefinitions()) {
        if (arrayOfString2 != null) {
          if (arrayOfString2.length > 0)
          {
            k = 1;
            str9 = PropertyNames.EMPTY_STRING;
            try
            {
              str9 = (String)curtabledescriptor.getDataSourcePropertySet().getPropertyValue("User");
            }
            catch (Exception localException2)
            {
              localException2.printStackTrace(System.out);
            }
            CurUnoDialog.insertLabel("lblSchema", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Integer.valueOf(8), str8, new Integer(i), Integer.valueOf(52), localInteger, new Short(curtabindex++), Integer.valueOf(80) });
            try
            {
              xSchemaListBox = CurUnoDialog.insertListBox("lstSchema", null, null, new String[] { "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.STRING_ITEM_LIST, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH }, new Object[] { Boolean.TRUE, Integer.valueOf(12), "HID:WIZARDS_HID_DLGTABLE_LST_SCHEMA", new Short(UnoDialog.getListBoxLineCount()), new Integer(i), Integer.valueOf(62), localInteger, arrayOfString2, new Short(curtabindex++), Integer.valueOf(80) });
              
              int i1 = JavaTools.FieldInList(arrayOfString2, str9);
              if (i1 < 0) {
                i1 = 0;
              }
              CurUnoDialog.setControlProperty("lstSchema", PropertyNames.SELECTED_ITEMS, new short[] { (short)i1 });
            }
            catch (Exception localException3)
            {
              localException3.printStackTrace(System.out);
            }
          }
        }
      }
      if ((m == 0) && (k == 0)) {
        CurUnoDialog.insertLabel("lblcongratulations", new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERT
1 2 3

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