1*a1b4a26bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*a1b4a26bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a1b4a26bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a1b4a26bSAndrew Rist  * distributed with this work for additional information
6*a1b4a26bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a1b4a26bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a1b4a26bSAndrew Rist  * "License"); you may not use this file except in compliance
9*a1b4a26bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*a1b4a26bSAndrew Rist  *
11*a1b4a26bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*a1b4a26bSAndrew Rist  *
13*a1b4a26bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a1b4a26bSAndrew Rist  * software distributed under the License is distributed on an
15*a1b4a26bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a1b4a26bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*a1b4a26bSAndrew Rist  * specific language governing permissions and limitations
18*a1b4a26bSAndrew Rist  * under the License.
19*a1b4a26bSAndrew Rist  *
20*a1b4a26bSAndrew Rist  *************************************************************/
21*a1b4a26bSAndrew Rist 
22*a1b4a26bSAndrew Rist 
23cdf0e10cSrcweir package com.sun.star.wizards.table;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir import com.sun.star.awt.XListBox;
26cdf0e10cSrcweir import com.sun.star.awt.XRadioButton;
27cdf0e10cSrcweir import com.sun.star.awt.XTextComponent;
28cdf0e10cSrcweir import com.sun.star.sdbc.SQLException;
29cdf0e10cSrcweir import com.sun.star.wizards.common.Desktop;
30cdf0e10cSrcweir import com.sun.star.wizards.common.JavaTools;
31cdf0e10cSrcweir import com.sun.star.wizards.common.PropertyNames;
32cdf0e10cSrcweir import com.sun.star.wizards.db.TableDescriptor;
33cdf0e10cSrcweir import com.sun.star.wizards.ui.*;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir public class Finalizer
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir     TableWizard CurUnoDialog;
39cdf0e10cSrcweir     short curtabindex;
40cdf0e10cSrcweir     XRadioButton optModifyTable;
41cdf0e10cSrcweir     XRadioButton optWorkWithTable;
42cdf0e10cSrcweir     XRadioButton optStartFormWizard;
43cdf0e10cSrcweir     XTextComponent txtTableName;
44cdf0e10cSrcweir     XListBox xCatalogListBox;
45cdf0e10cSrcweir     XListBox xSchemaListBox;
46cdf0e10cSrcweir     TableDescriptor curtabledescriptor;
47cdf0e10cSrcweir     public String SETCOMPLETIONFLAG = "setCompletionFlag";
48cdf0e10cSrcweir     public static int WORKWITHTABLEMODE = 0;
49cdf0e10cSrcweir     public static int MODIFYTABLEMODE = 1;
50cdf0e10cSrcweir     public static int STARTFORMWIZARDMODE = 2;
51cdf0e10cSrcweir 
Finalizer(TableWizard _CurUnoDialog, TableDescriptor _curtabledescriptor)52cdf0e10cSrcweir     public Finalizer(TableWizard _CurUnoDialog, TableDescriptor _curtabledescriptor)
53cdf0e10cSrcweir     {
54cdf0e10cSrcweir         try
55cdf0e10cSrcweir         {
56cdf0e10cSrcweir             this.CurUnoDialog = _CurUnoDialog;
57cdf0e10cSrcweir             this.curtabledescriptor = _curtabledescriptor;
58cdf0e10cSrcweir             curtabindex = (short) (TableWizard.SOFINALPAGE * 100);
59cdf0e10cSrcweir             Integer IFINALSTEP = new Integer(TableWizard.SOFINALPAGE);
60cdf0e10cSrcweir             String slblTableName = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 34);
61cdf0e10cSrcweir             String slblProceed = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 36);
62cdf0e10cSrcweir             String sWorkWithTable = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 38);
63cdf0e10cSrcweir             String sStartFormWizard = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 39);
64cdf0e10cSrcweir             String sModifyTable = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 37);
65cdf0e10cSrcweir             String sCongratulations = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 35);
66cdf0e10cSrcweir             String slblCatalog = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 49);
67cdf0e10cSrcweir             String slblSchema = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 50);
68cdf0e10cSrcweir             String[] sCatalogNames = curtabledescriptor.getCatalogNames();
69cdf0e10cSrcweir             String[] sSchemaNames = curtabledescriptor.getSchemaNames();
70cdf0e10cSrcweir             int nListBoxPosX = 97;
71cdf0e10cSrcweir             int ndiffPosY = 0;
72cdf0e10cSrcweir             boolean bsupportsSchemata = false;
73cdf0e10cSrcweir             boolean bsupportsCatalogs = false;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir             CurUnoDialog.insertLabel("lblTableName",
76cdf0e10cSrcweir                     new String[]
77cdf0e10cSrcweir                     {
78cdf0e10cSrcweir                         PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
79cdf0e10cSrcweir                     },
80cdf0e10cSrcweir                     new Object[]
81cdf0e10cSrcweir                     {
82cdf0e10cSrcweir                         UIConsts.INTEGERS[8], slblTableName, 97, 25, IFINALSTEP, 220
83cdf0e10cSrcweir                     });
84cdf0e10cSrcweir             txtTableName = CurUnoDialog.insertTextField("txtTableName", SETCOMPLETIONFLAG, this,
85cdf0e10cSrcweir                     new String[]
86cdf0e10cSrcweir                     {
87cdf0e10cSrcweir                         PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
88cdf0e10cSrcweir                     },
89cdf0e10cSrcweir                     new Object[]
90cdf0e10cSrcweir                     {
91cdf0e10cSrcweir                         UIConsts.INTEGER_12, "HID:WIZARDS_HID_DLGTABLE_TXT_NAME", 97, 35, IFINALSTEP, new Short(curtabindex++), PropertyNames.EMPTY_STRING, 223
92cdf0e10cSrcweir                     });
93cdf0e10cSrcweir             txtTableName.addTextListener(CurUnoDialog);
94cdf0e10cSrcweir             txtTableName.setMaxTextLen((short) this.curtabledescriptor.getMaxTableNameLength());
95cdf0e10cSrcweir             if (this.curtabledescriptor.xDBMetaData.supportsCatalogsInTableDefinitions())
96cdf0e10cSrcweir             {
97cdf0e10cSrcweir                 if (sCatalogNames != null)
98cdf0e10cSrcweir                 {
99cdf0e10cSrcweir                     if (sCatalogNames.length > 0)
100cdf0e10cSrcweir                     {
101cdf0e10cSrcweir                         bsupportsCatalogs = true;
102cdf0e10cSrcweir                         String sCatalog = PropertyNames.EMPTY_STRING;
103cdf0e10cSrcweir                         try
104cdf0e10cSrcweir                         {
105cdf0e10cSrcweir                             sCatalog = curtabledescriptor.DBConnection.getCatalog();
106cdf0e10cSrcweir                         }
107cdf0e10cSrcweir                         catch (SQLException e1)
108cdf0e10cSrcweir                         {
109cdf0e10cSrcweir                             e1.printStackTrace(System.out);
110cdf0e10cSrcweir                         }
111cdf0e10cSrcweir                         CurUnoDialog.insertLabel("lblCatalog",
112cdf0e10cSrcweir                                 new String[]
113cdf0e10cSrcweir                                 {
114cdf0e10cSrcweir                                     PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
115cdf0e10cSrcweir                                 },
116cdf0e10cSrcweir                                 new Object[]
117cdf0e10cSrcweir                                 {
118cdf0e10cSrcweir                                     8, slblCatalog, new Integer(nListBoxPosX), 52, IFINALSTEP, new Short(curtabindex++), 120
119cdf0e10cSrcweir                                 });
120cdf0e10cSrcweir 
121cdf0e10cSrcweir                         try
122cdf0e10cSrcweir                         {
123cdf0e10cSrcweir                             xCatalogListBox = CurUnoDialog.insertListBox("lstCatalog", null, null,
124cdf0e10cSrcweir                                     new String[]
125cdf0e10cSrcweir                                     {
126cdf0e10cSrcweir                                         "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
127cdf0e10cSrcweir                                     },
128cdf0e10cSrcweir                                     new Object[]
129cdf0e10cSrcweir                                     {
130cdf0e10cSrcweir                                         Boolean.TRUE, 12, "HID:WIZARDS_HID_DLGTABLE_LST_CATALOG", new Short(UnoDialog.getListBoxLineCount()), new Integer(nListBoxPosX), 62, IFINALSTEP, sCatalogNames, new Short(curtabindex++), 80
131cdf0e10cSrcweir                                     });
132cdf0e10cSrcweir                             int isel = JavaTools.FieldInList(sCatalogNames, sCatalog);
133cdf0e10cSrcweir                             if (isel < 0)
134cdf0e10cSrcweir                             {
135cdf0e10cSrcweir                                 isel = 0;
136cdf0e10cSrcweir                             }
137cdf0e10cSrcweir                             CurUnoDialog.setControlProperty("lstCatalog", PropertyNames.SELECTED_ITEMS, new short[]
138cdf0e10cSrcweir                                     {
139cdf0e10cSrcweir                                         (short) isel
140cdf0e10cSrcweir                                     });
141cdf0e10cSrcweir                         }
142cdf0e10cSrcweir                         catch (Exception e)
143cdf0e10cSrcweir                         {
144cdf0e10cSrcweir                             e.printStackTrace(System.out);
145cdf0e10cSrcweir                         }
146cdf0e10cSrcweir                         nListBoxPosX = 200;
147cdf0e10cSrcweir                     }
148cdf0e10cSrcweir                 }
149cdf0e10cSrcweir             }
150cdf0e10cSrcweir             if (this.curtabledescriptor.xDBMetaData.supportsSchemasInTableDefinitions())
151cdf0e10cSrcweir             {
152cdf0e10cSrcweir                 if (sSchemaNames != null)
153cdf0e10cSrcweir                 {
154cdf0e10cSrcweir                     if (sSchemaNames.length > 0)
155cdf0e10cSrcweir                     {
156cdf0e10cSrcweir                         bsupportsSchemata = true;
157cdf0e10cSrcweir                         String sSchema = PropertyNames.EMPTY_STRING;
158cdf0e10cSrcweir                         try
159cdf0e10cSrcweir                         {
160cdf0e10cSrcweir                             sSchema = (String) curtabledescriptor.getDataSourcePropertySet().getPropertyValue("User");
161cdf0e10cSrcweir                         }
162cdf0e10cSrcweir                         catch (Exception e1)
163cdf0e10cSrcweir                         {
164cdf0e10cSrcweir                             e1.printStackTrace(System.out);
165cdf0e10cSrcweir                         }
166cdf0e10cSrcweir                         CurUnoDialog.insertLabel("lblSchema",
167cdf0e10cSrcweir                                 new String[]
168cdf0e10cSrcweir                                 {
169cdf0e10cSrcweir                                     PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
170cdf0e10cSrcweir                                 },
171cdf0e10cSrcweir                                 new Object[]
172cdf0e10cSrcweir                                 {
173cdf0e10cSrcweir                                     8, slblSchema, new Integer(nListBoxPosX), 52, IFINALSTEP, new Short(curtabindex++), 80
174cdf0e10cSrcweir                                 });
175cdf0e10cSrcweir 
176cdf0e10cSrcweir                         try
177cdf0e10cSrcweir                         {
178cdf0e10cSrcweir                             xSchemaListBox = CurUnoDialog.insertListBox("lstSchema", null, null,
179cdf0e10cSrcweir                                     new String[]
180cdf0e10cSrcweir                                     {
181cdf0e10cSrcweir                                         "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
182cdf0e10cSrcweir                                     },
183cdf0e10cSrcweir                                     new Object[]
184cdf0e10cSrcweir                                     {
185cdf0e10cSrcweir                                         Boolean.TRUE, 12, "HID:WIZARDS_HID_DLGTABLE_LST_SCHEMA", new Short(UnoDialog.getListBoxLineCount()), new Integer(nListBoxPosX), 62, IFINALSTEP, sSchemaNames, new Short(curtabindex++), 80
186cdf0e10cSrcweir                                     });
187cdf0e10cSrcweir                             int isel = JavaTools.FieldInList(sSchemaNames, sSchema);
188cdf0e10cSrcweir                             if (isel < 0)
189cdf0e10cSrcweir                             {
190cdf0e10cSrcweir                                 isel = 0;
191cdf0e10cSrcweir                             }
192cdf0e10cSrcweir                             CurUnoDialog.setControlProperty("lstSchema", PropertyNames.SELECTED_ITEMS, new short[]
193cdf0e10cSrcweir                                     {
194cdf0e10cSrcweir                                         (short) isel
195cdf0e10cSrcweir                                     });
196cdf0e10cSrcweir                         }
197cdf0e10cSrcweir                         catch (Exception e)
198cdf0e10cSrcweir                         {
199cdf0e10cSrcweir                             e.printStackTrace(System.out);
200cdf0e10cSrcweir                         }
201cdf0e10cSrcweir                     }
202cdf0e10cSrcweir                 }
203cdf0e10cSrcweir             }
204cdf0e10cSrcweir             if ((!bsupportsCatalogs) && (!bsupportsSchemata))
205cdf0e10cSrcweir             {
206cdf0e10cSrcweir                 CurUnoDialog.insertLabel("lblcongratulations",
207cdf0e10cSrcweir                         new String[]
208cdf0e10cSrcweir                         {
209cdf0e10cSrcweir                             PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
210cdf0e10cSrcweir                         },
211cdf0e10cSrcweir                         new Object[]
212cdf0e10cSrcweir                         {
213cdf0e10cSrcweir                             16, sCongratulations, Boolean.TRUE, 97, 62, IFINALSTEP, new Short(curtabindex++), 226
214cdf0e10cSrcweir                         });
215cdf0e10cSrcweir             }
216cdf0e10cSrcweir             else
217cdf0e10cSrcweir             {
218cdf0e10cSrcweir                 ndiffPosY = 10;
219cdf0e10cSrcweir             }
220cdf0e10cSrcweir             CurUnoDialog.insertLabel("lblProceed",
221cdf0e10cSrcweir                     new String[]
222cdf0e10cSrcweir                     {
223cdf0e10cSrcweir                         PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
224cdf0e10cSrcweir                     },
225cdf0e10cSrcweir                     new Object[]
226cdf0e10cSrcweir                     {
227cdf0e10cSrcweir                         UIConsts.INTEGERS[8], slblProceed, 97, new Integer(82 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), 227
228cdf0e10cSrcweir                     });
229cdf0e10cSrcweir             optWorkWithTable = CurUnoDialog.insertRadioButton("optWorkWithTable", null,
230cdf0e10cSrcweir                     new String[]
231cdf0e10cSrcweir                     {
232cdf0e10cSrcweir                         PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
233cdf0e10cSrcweir                     },
234cdf0e10cSrcweir                     new Object[]
235cdf0e10cSrcweir                     {
236cdf0e10cSrcweir                         UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_WORKWITHTABLE", sWorkWithTable, 101, new Integer(97 + ndiffPosY), new Short((short) 1), IFINALSTEP, new Short(curtabindex++), 177
237cdf0e10cSrcweir                     });
238cdf0e10cSrcweir             optModifyTable = CurUnoDialog.insertRadioButton("optModifyTable", null,
239cdf0e10cSrcweir                     new String[]
240cdf0e10cSrcweir                     {
241cdf0e10cSrcweir                         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
242cdf0e10cSrcweir                     },
243cdf0e10cSrcweir                     new Object[]
244cdf0e10cSrcweir                     {
245cdf0e10cSrcweir                         UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_MODIFYTABLE", sModifyTable, 101, new Integer(109 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), 177
246cdf0e10cSrcweir                     });
247cdf0e10cSrcweir             optStartFormWizard = CurUnoDialog.insertRadioButton("optStartFormWizard", null,
248cdf0e10cSrcweir                     new String[]
249cdf0e10cSrcweir                     {
250cdf0e10cSrcweir                         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
251cdf0e10cSrcweir                     },
252cdf0e10cSrcweir                     new Object[]
253cdf0e10cSrcweir                     {
254cdf0e10cSrcweir                         UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_STARTFORMWIZARD", sStartFormWizard, 101, new Integer(121 + ndiffPosY), IFINALSTEP, new Short(curtabindex++), 177
255cdf0e10cSrcweir                     });
256cdf0e10cSrcweir         }
257cdf0e10cSrcweir         catch (SQLException e)
258cdf0e10cSrcweir         {
259cdf0e10cSrcweir             e.printStackTrace(System.out);
260cdf0e10cSrcweir         }
261cdf0e10cSrcweir     }
262cdf0e10cSrcweir 
initialize(String _firsttablename)263cdf0e10cSrcweir     public void initialize(String _firsttablename)
264cdf0e10cSrcweir     {
265cdf0e10cSrcweir         setTableName(_firsttablename);
266cdf0e10cSrcweir     }
267cdf0e10cSrcweir 
finish()268cdf0e10cSrcweir     public int finish()
269cdf0e10cSrcweir     {
270cdf0e10cSrcweir         if (optWorkWithTable.getState())
271cdf0e10cSrcweir         {
272cdf0e10cSrcweir             return WORKWITHTABLEMODE;
273cdf0e10cSrcweir         }
274cdf0e10cSrcweir         else if (optModifyTable.getState())
275cdf0e10cSrcweir         {
276cdf0e10cSrcweir             return MODIFYTABLEMODE;
277cdf0e10cSrcweir         }
278cdf0e10cSrcweir         else
279cdf0e10cSrcweir         {
280cdf0e10cSrcweir             return STARTFORMWIZARDMODE;
281cdf0e10cSrcweir         }
282cdf0e10cSrcweir     }
283cdf0e10cSrcweir 
getComposedTableName(String _stablename)284cdf0e10cSrcweir     public String getComposedTableName(String _stablename)
285cdf0e10cSrcweir     {
286cdf0e10cSrcweir         String scatalogname = null;
287cdf0e10cSrcweir         String sschemaname = null;
288cdf0e10cSrcweir         if (xCatalogListBox != null)
289cdf0e10cSrcweir         {
290cdf0e10cSrcweir             scatalogname = xCatalogListBox.getSelectedItem();
291cdf0e10cSrcweir         }
292cdf0e10cSrcweir         if (xSchemaListBox != null)
293cdf0e10cSrcweir         {
294cdf0e10cSrcweir             sschemaname = xSchemaListBox.getSelectedItem();
295cdf0e10cSrcweir         }
296cdf0e10cSrcweir         return curtabledescriptor.getComposedTableName(scatalogname, sschemaname, _stablename);
297cdf0e10cSrcweir     }
298cdf0e10cSrcweir 
setTableName(String _tablename)299cdf0e10cSrcweir     public void setTableName(String _tablename)
300cdf0e10cSrcweir     {
301cdf0e10cSrcweir         if (txtTableName.getText().equals(PropertyNames.EMPTY_STRING))
302cdf0e10cSrcweir         {
303cdf0e10cSrcweir             String ssuffix = Desktop.getIncrementSuffix(curtabledescriptor.getTableNamesAsNameAccess(), getComposedTableName(_tablename));
304cdf0e10cSrcweir             txtTableName.setText(_tablename + ssuffix);
305cdf0e10cSrcweir             setCompletionFlag();
306cdf0e10cSrcweir         }
307cdf0e10cSrcweir     }
308cdf0e10cSrcweir 
getTableName()309cdf0e10cSrcweir     public String getTableName()
310cdf0e10cSrcweir     {
311cdf0e10cSrcweir         return txtTableName.getText();
312cdf0e10cSrcweir     }
313cdf0e10cSrcweir 
getTableName(String _firsttablename)314cdf0e10cSrcweir     public String getTableName(String _firsttablename)
315cdf0e10cSrcweir     {
316cdf0e10cSrcweir         if (txtTableName.getText().equals(PropertyNames.EMPTY_STRING))
317cdf0e10cSrcweir         {
318cdf0e10cSrcweir             setTableName(_firsttablename);
319cdf0e10cSrcweir         }
320cdf0e10cSrcweir         return txtTableName.getText();
321cdf0e10cSrcweir     }
322cdf0e10cSrcweir 
getSchemaName()323cdf0e10cSrcweir     public String getSchemaName()
324cdf0e10cSrcweir     {
325cdf0e10cSrcweir         if (xSchemaListBox != null)
326cdf0e10cSrcweir         {
327cdf0e10cSrcweir             return this.xSchemaListBox.getSelectedItem();
328cdf0e10cSrcweir         }
329cdf0e10cSrcweir         else
330cdf0e10cSrcweir         {
331cdf0e10cSrcweir             return PropertyNames.EMPTY_STRING;
332cdf0e10cSrcweir         }
333cdf0e10cSrcweir     }
334cdf0e10cSrcweir 
getCatalogName()335cdf0e10cSrcweir     public String getCatalogName()
336cdf0e10cSrcweir     {
337cdf0e10cSrcweir         if (xCatalogListBox != null)
338cdf0e10cSrcweir         {
339cdf0e10cSrcweir             return this.xCatalogListBox.getSelectedItem();
340cdf0e10cSrcweir         }
341cdf0e10cSrcweir         else
342cdf0e10cSrcweir         {
343cdf0e10cSrcweir             return PropertyNames.EMPTY_STRING;
344cdf0e10cSrcweir         }
345cdf0e10cSrcweir     }
346cdf0e10cSrcweir 
iscompleted()347cdf0e10cSrcweir     public boolean iscompleted()
348cdf0e10cSrcweir     {
349cdf0e10cSrcweir         return (txtTableName.getText().length() > 0);
350cdf0e10cSrcweir     }
351cdf0e10cSrcweir 
setCompletionFlag()352cdf0e10cSrcweir     public void setCompletionFlag()
353cdf0e10cSrcweir     {
354cdf0e10cSrcweir         CurUnoDialog.setcompleted(TableWizard.SOFINALPAGE, iscompleted());
355cdf0e10cSrcweir     }
356cdf0e10cSrcweir 
setFocusToTableNameControl()357cdf0e10cSrcweir     public void setFocusToTableNameControl()
358cdf0e10cSrcweir     {
359cdf0e10cSrcweir         CurUnoDialog.setFocus("txtTableName");
360cdf0e10cSrcweir     }
361cdf0e10cSrcweir }
362