1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 package com.sun.star.wizards.table; 24 25 import com.sun.star.awt.XCheckBox; 26 import com.sun.star.awt.XFixedText; 27 import com.sun.star.awt.XListBox; 28 import com.sun.star.awt.XRadioButton; 29 import com.sun.star.beans.XPropertySet; 30 import com.sun.star.lang.IllegalArgumentException; 31 import com.sun.star.uno.AnyConverter; 32 import com.sun.star.wizards.common.Helper; 33 import com.sun.star.wizards.common.JavaTools; 34 import com.sun.star.wizards.common.PropertyNames; 35 import com.sun.star.wizards.db.TableDescriptor; 36 import com.sun.star.wizards.db.TypeInspector; 37 import com.sun.star.wizards.ui.FieldSelection; 38 import com.sun.star.wizards.ui.UIConsts; 39 import com.sun.star.wizards.ui.UnoDialog; 40 import com.sun.star.wizards.ui.XFieldSelectionListener; 41 42 public class PrimaryKeyHandler implements XFieldSelectionListener 43 { 44 45 private TableWizard CurUnoDialog; 46 private short curtabindex; 47 private final static String SPRIMEKEYMODE = "togglePrimeKeyFields"; 48 private final static String SSINGLEKEYMODE = "toggleSinglePrimeKeyFields"; 49 private final static String SSEVERALKEYMODE = "toggleSeveralPrimeKeyFields"; 50 private XRadioButton optAddAutomatically; 51 private XRadioButton optUseExisting; 52 private XRadioButton optUseSeveral; 53 private XCheckBox chkUsePrimaryKey; 54 private XCheckBox chkcreatePrimaryKey; 55 private XCheckBox chkApplyAutoValueExisting; 56 private XCheckBox chkApplyAutoValueAutomatic; 57 private XListBox lstSinglePrimeKey; 58 private XFixedText lblPrimeFieldName; 59 private FieldSelection curPrimaryKeySelection; 60 private String[] fieldnames; 61 private TableDescriptor curTableDescriptor; 62 private int nAutoPrimeKeyDataType; 63 private boolean bAutoPrimaryKeysupportsAutoIncrmentation; 64 private final static String SAUTOMATICKEYFIELDNAME = "ID"; 65 PrimaryKeyHandler(TableWizard _CurUnoDialog, TableDescriptor _curTableDescriptor)66 public PrimaryKeyHandler(TableWizard _CurUnoDialog, TableDescriptor _curTableDescriptor) 67 { 68 this.CurUnoDialog = _CurUnoDialog; 69 curTableDescriptor = _curTableDescriptor; 70 bAutoPrimaryKeysupportsAutoIncrmentation = isAutoPrimeKeyAutoIncrementationsupported(); 71 curtabindex = (short) ((TableWizard.SOPRIMARYKEYPAGE * 100) - 20); 72 Integer IPRIMEKEYSTEP = new Integer(TableWizard.SOPRIMARYKEYPAGE); 73 final String sExplanations = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 26); 74 final String screatePrimaryKey = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 27); 75 final String slblPrimeFieldName = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 31); 76 final String sApplyAutoValue = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 33); 77 final String sAddAutomatically = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 28); 78 final String sUseExisting = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 29); 79 final String sUseSeveral = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 30); 80 final String slblAvailableFields = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 4); 81 final String slblSelPrimaryFields = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 32); 82 CurUnoDialog.insertLabel("lblExplanation", 83 new String[] 84 { 85 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 86 }, 87 new Object[] 88 { 89 40, sExplanations, Boolean.TRUE, 91, 27, IPRIMEKEYSTEP, new Short(curtabindex++), 233 90 }); 91 92 chkcreatePrimaryKey = CurUnoDialog.insertCheckBox("chkcreatePrimaryKey", SPRIMEKEYMODE, this, 93 new String[] 94 { 95 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 96 }, 97 new Object[] 98 { 99 UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CHK_USEPRIMEKEY", screatePrimaryKey, 97, 70, new Short((short) 1), IPRIMEKEYSTEP, new Short(curtabindex++), 160 100 }); 101 102 optAddAutomatically = CurUnoDialog.insertRadioButton("optAddAutomatically", SPRIMEKEYMODE, this, 103 new String[] 104 { 105 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 106 }, 107 new Object[] 108 { 109 UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_AUTOMATIC", sAddAutomatically, 106, 82, new Short((short) 1), IPRIMEKEYSTEP, new Short(curtabindex++), 200 110 }); 111 112 optUseExisting = CurUnoDialog.insertRadioButton("optUseExisting", SPRIMEKEYMODE, this, 113 new String[] 114 { 115 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 116 }, //94 117 new Object[] 118 { 119 UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SINGLE", sUseExisting, 106, 104, IPRIMEKEYSTEP, new Short(curtabindex++), 200 120 }); 121 122 optUseSeveral = CurUnoDialog.insertRadioButton("optUseSeveral", SPRIMEKEYMODE, this, 123 new String[] 124 { 125 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 126 }, 127 new Object[] 128 { 129 UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SEVERAL", sUseSeveral, 106, 132, IPRIMEKEYSTEP, new Short(curtabindex++), 200 130 }); 131 132 chkApplyAutoValueAutomatic = CurUnoDialog.insertCheckBox("chkApplyAutoValueAutomatic", SPRIMEKEYMODE, this, 133 new String[] 134 { 135 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 136 }, //107 137 new Object[] 138 { 139 UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE_AUTOMATIC", sApplyAutoValue, 116, 92, IPRIMEKEYSTEP, new Short(curtabindex++), 68 140 }); 141 142 lblPrimeFieldName = CurUnoDialog.insertLabel("lblPrimeFieldName", 143 new String[] 144 { 145 PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH 146 }, 147 new Object[] 148 { 149 Boolean.FALSE, UIConsts.INTEGERS[8], slblPrimeFieldName, 116, 117, IPRIMEKEYSTEP, new Short(curtabindex++), 46 150 }); 151 152 lstSinglePrimeKey = CurUnoDialog.insertListBox("lstSinglePrimeKey", "onPrimeKeySelected", null, this, 153 new String[] 154 { 155 "Dropdown", 156 PropertyNames.PROPERTY_ENABLED, 157 PropertyNames.PROPERTY_HEIGHT, 158 PropertyNames.PROPERTY_HELPURL, 159 "LineCount", 160 PropertyNames.PROPERTY_POSITION_X, 161 PropertyNames.PROPERTY_POSITION_Y, 162 PropertyNames.PROPERTY_STEP, 163 PropertyNames.PROPERTY_TABINDEX, 164 PropertyNames.PROPERTY_WIDTH 165 }, 166 new Object[] 167 { 168 Boolean.TRUE, 169 Boolean.FALSE, 170 12, 171 "HID:WIZARDS_HID_DLGTABLE_LB_PK_FIELDNAME", 172 Short.valueOf(UnoDialog.getListBoxLineCount()), 173 162, 174 115, 175 IPRIMEKEYSTEP, 176 new Short(curtabindex++), 177 80 178 }); 179 180 chkApplyAutoValueExisting = CurUnoDialog.insertCheckBox("chkApplyAutoValueExisting", SPRIMEKEYMODE, this, 181 new String[] 182 { 183 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 184 }, //107 185 new Object[] 186 { 187 UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE", sApplyAutoValue, 248, 117, IPRIMEKEYSTEP, new Short(curtabindex++), 66 188 }); 189 curPrimaryKeySelection = new FieldSelection(CurUnoDialog, IPRIMEKEYSTEP.intValue(), 116, 142, 208, 47, slblAvailableFields, slblSelPrimaryFields, 41234, false); 190 curPrimaryKeySelection.addFieldSelectionListener(this); 191 192 } 193 initialize()194 public void initialize() 195 { 196 // boolean breselect; 197 fieldnames = curTableDescriptor.getNonBinaryFieldNames(); 198 String[] skeyfieldnames = curPrimaryKeySelection.getSelectedFieldNames(); 199 curPrimaryKeySelection.initialize(fieldnames, false); 200 if (skeyfieldnames != null) 201 { 202 if (skeyfieldnames.length > 0) 203 { 204 String[] snewkeyfieldnames = JavaTools.removeOutdatedFields(skeyfieldnames, fieldnames); 205 curPrimaryKeySelection.setSelectedFieldNames(snewkeyfieldnames); 206 } 207 } 208 String selfield = lstSinglePrimeKey.getSelectedItem(); 209 Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), PropertyNames.STRING_ITEM_LIST, fieldnames); 210 if (selfield != null) 211 { 212 if (JavaTools.FieldInList(fieldnames, selfield) > -1) 213 { 214 lstSinglePrimeKey.selectItem(selfield, true); 215 } 216 } 217 togglePrimeKeyFields(); 218 } 219 isAutoPrimeKeyAutoIncrementationsupported()220 private boolean isAutoPrimeKeyAutoIncrementationsupported() 221 { 222 TypeInspector.TypeInfo aAutoPrimeTypeInfo; 223 aAutoPrimeTypeInfo = curTableDescriptor.oTypeInspector.findAutomaticPrimaryKeyType(); 224 return aAutoPrimeTypeInfo.bisAutoIncrementable; 225 } 226 iscompleted()227 public boolean iscompleted() 228 { 229 if (chkcreatePrimaryKey.getState() == 0) 230 { 231 return true; 232 } 233 if (this.optAddAutomatically.getState()) 234 { 235 return true; 236 } 237 if (optUseExisting.getState()) 238 { 239 fieldnames = curTableDescriptor.getNonBinaryFieldNames(); 240 String selfield = lstSinglePrimeKey.getSelectedItem(); 241 if (selfield != null) 242 { 243 return (JavaTools.FieldInList(fieldnames, selfield) > -1); 244 } 245 } 246 if (optUseSeveral.getState()) 247 { 248 fieldnames = curTableDescriptor.getNonBinaryFieldNames(); 249 String[] skeyfieldnames = curPrimaryKeySelection.getSelectedFieldNames(); 250 String[] snewkeyfieldnames = JavaTools.removeOutdatedFields(skeyfieldnames, fieldnames); 251 return (snewkeyfieldnames.length > 0); 252 } 253 return false; 254 } 255 togglePrimeKeyFields()256 public void togglePrimeKeyFields() 257 { 258 boolean bdoEnable = (this.chkcreatePrimaryKey.getState() == 1); 259 Helper.setUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); 260 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bAutoPrimaryKeysupportsAutoIncrmentation && bdoEnable)); 261 Helper.setUnoPropertyValue(UnoDialog.getModel(optUseExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); 262 Helper.setUnoPropertyValue(UnoDialog.getModel(optUseSeveral), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoEnable)); 263 //toggle subcontrols of the radiobuttons... 264 toggleAutomaticAutoValueCheckBox(); 265 boolean benableSinglePrimekeyControls = bdoEnable && optUseExisting.getState(); 266 toggleSinglePrimeKeyFields(benableSinglePrimekeyControls); 267 boolean benableSeveralPrimekeyControls = bdoEnable && optUseSeveral.getState(); 268 curPrimaryKeySelection.toggleListboxControls(Boolean.valueOf(benableSeveralPrimekeyControls)); 269 // toggle the following steps of the dialog... 270 if (!bdoEnable) 271 { 272 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, true); 273 } 274 else 275 { 276 if (benableSeveralPrimekeyControls) 277 { 278 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, (curPrimaryKeySelection.getSelectedFieldNames().length > 0)); 279 } 280 else if (benableSinglePrimekeyControls) 281 { 282 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, UnoDialog.isListBoxSelected(lstSinglePrimeKey)); //.getSelectedItemPos() != -1); 283 } 284 else if (optAddAutomatically.getState()) 285 { 286 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, true); 287 } 288 } 289 } 290 isAutoIncrementatable(String _fieldname)291 private boolean isAutoIncrementatable(String _fieldname) 292 { 293 boolean bisAutoIncrementable = false; 294 try 295 { 296 XPropertySet xColPropertySet = curTableDescriptor.getByName(_fieldname); 297 if (xColPropertySet != null) 298 { 299 if (curTableDescriptor.getDBDataTypeInspector() != null) 300 { 301 return curTableDescriptor.getDBDataTypeInspector().isAutoIncrementable(xColPropertySet); 302 } 303 } 304 } 305 catch (Exception e) 306 { 307 e.printStackTrace(System.out); 308 } 309 return false; 310 } 311 isAutomaticMode()312 public boolean isAutomaticMode() 313 { 314 boolean bisAutomaticMode = false; 315 if (chkcreatePrimaryKey.getState() == 1) 316 { 317 bisAutomaticMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1; 318 } 319 return bisAutomaticMode; 320 } 321 getAutomaticFieldName()322 public String getAutomaticFieldName() 323 { 324 return SAUTOMATICKEYFIELDNAME; 325 } 326 isAutoIncremented()327 public boolean isAutoIncremented() 328 { 329 boolean bischecked = false; 330 if (chkcreatePrimaryKey.getState() == 1) 331 { 332 boolean bisAutomaticMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1; 333 boolean bisExistingMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optUseExisting), PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1; 334 if (bisAutomaticMode) 335 { 336 bischecked = chkApplyAutoValueAutomatic.getState() == (short) 1; 337 } 338 else if (bisExistingMode) 339 { 340 bischecked = chkApplyAutoValueExisting.getState() == (short) 1; 341 } 342 } 343 return bischecked; 344 } 345 onPrimeKeySelected()346 public void onPrimeKeySelected() 347 { 348 try 349 { 350 String selfieldname = lstSinglePrimeKey.getSelectedItem(); 351 boolean bdoenable = isAutoIncrementatable(selfieldname); 352 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, lstSinglePrimeKey.getSelectedItemPos() != -1); 353 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); 354 XPropertySet xColPropertySet = curTableDescriptor.getByName(selfieldname); 355 boolean bIsAutoIncremented = ((Boolean) xColPropertySet.getPropertyValue("IsAutoIncrement")).booleanValue(); 356 if (bIsAutoIncremented) 357 { 358 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_STATE, new Short((short) 1)); 359 } 360 else 361 { 362 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_STATE, new Short((short) 0)); 363 } 364 } 365 catch (Exception e) 366 { 367 e.printStackTrace(System.out); 368 } 369 } 370 toggleAutomaticAutoValueCheckBox()371 private void toggleAutomaticAutoValueCheckBox() 372 { 373 try 374 { 375 boolean bisAutomaticMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED)); 376 boolean bdoenable = bAutoPrimaryKeysupportsAutoIncrmentation && optAddAutomatically.getState() && bisAutomaticMode; 377 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenable)); 378 } 379 catch (IllegalArgumentException e) 380 { 381 e.printStackTrace(System.out); 382 } 383 } 384 toggleSinglePrimeKeyFields(boolean _bdoenable)385 private void toggleSinglePrimeKeyFields(boolean _bdoenable) 386 { 387 Helper.setUnoPropertyValue(UnoDialog.getModel(lblPrimeFieldName), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); 388 Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); 389 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bdoenable)); 390 boolean bdoenableAutoValueCheckBox = (isAutoIncrementatable(lstSinglePrimeKey.getSelectedItem()) && _bdoenable); 391 Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(bdoenableAutoValueCheckBox)); 392 } 393 toggleSeveralPrimeKeyFields()394 private void toggleSeveralPrimeKeyFields() 395 { 396 boolean bdoEnable = (this.optUseSeveral.getState()); 397 curPrimaryKeySelection.toggleListboxControls(Boolean.valueOf(bdoEnable)); 398 } 399 getPrimaryKeyFields(TableDescriptor _curtabledescriptor)400 public String[] getPrimaryKeyFields(TableDescriptor _curtabledescriptor) 401 { 402 if (chkcreatePrimaryKey.getState() == 0) 403 { 404 return null; 405 } 406 if (fieldnames == null) 407 { 408 initialize(); 409 } 410 if (optUseSeveral.getState()) 411 { 412 return curPrimaryKeySelection.getSelectedFieldNames(); 413 } 414 else if (optUseExisting.getState()) 415 { 416 return (new String[] 417 { 418 lstSinglePrimeKey.getSelectedItem() 419 }); 420 } 421 else if (optAddAutomatically.getState()) 422 { 423 return (new String[] 424 { 425 SAUTOMATICKEYFIELDNAME 426 }); 427 } 428 return null; 429 } 430 getID()431 public int getID() 432 { 433 return 0; 434 } 435 moveItemDown(String Selitem)436 public void moveItemDown(String Selitem) 437 { 438 } 439 moveItemUp(String Selitem)440 public void moveItemUp(String Selitem) 441 { 442 } 443 setID(String sIncSuffix)444 public void setID(String sIncSuffix) 445 { 446 } 447 shiftFromLeftToRight(String[] SelItems, String[] NewItems)448 public void shiftFromLeftToRight(String[] SelItems, String[] NewItems) 449 { 450 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, (curPrimaryKeySelection.getSelectedFieldNames().length > 0)); 451 } 452 shiftFromRightToLeft(String[] OldSelItems, String[] NewItems)453 public void shiftFromRightToLeft(String[] OldSelItems, String[] NewItems) 454 { 455 CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, (curPrimaryKeySelection.getSelectedFieldNames().length > 0)); 456 } 457 } 458