| 403 | | |
| | 404 | |
| | 405 | // PyList CFInterfaces = mainFrame().getCFInterfaces(); |
| | 406 | // PyList StandardInterfaces = mainFrame().getStandardInterfaces(); |
| | 407 | // PyList CustomInterfaces = mainFrame().getCustomInterfaces(); |
| | 408 | // log.debug("cf: " + CFInterfaces.__len__()); |
| | 409 | // log.debug("standard: " + StandardInterfaces.__len__()); |
| | 410 | // log.debug("custom: " + CustomInterfaces.__len__()); |
| | 411 | // int count = 0; |
| | 412 | // int[] counts = new int[3]; |
| | 413 | // int i = 0; |
| | 414 | // int j = 0; |
| | 415 | // |
| | 416 | // String[] tmpInterfaceChoices = new String[100]; |
| | 417 | // String tmp; |
| | 418 | // PyList interfaceList = mainFrame().importStandardIDL(); |
| | 419 | // log.debug(interfaceList.__len__()); |
| | 420 | // while(interfaceList.__len__() > 0) |
| | 421 | // { |
| | 422 | // PyObject customInts = interfaceList.pop(); |
| | 423 | // log.debug(customInts.__getattr__("name")); |
| | 424 | // PyList ci = (PyList)customInts.__getattr__("contents"); |
| | 425 | // |
| | 426 | // while(ci.__len__() > 0) |
| | 427 | // { |
| | 428 | // tmp = ci.pop().__getattr__("name").toString(); |
| | 429 | // log.debug("adding " + tmp + " to interfaceChoices"); |
| | 430 | // tmpInterfaceChoices[count] = tmp; |
| | 431 | // count++; |
| | 432 | // counts[i]++; |
| | 433 | // j++; |
| | 434 | // } |
| | 435 | // log.debug("added " + counts[i]); |
| | 436 | // |
| | 437 | // if(interfaceList.__len__() > 0) |
| | 438 | // { |
| | 439 | // tmpInterfaceChoices[count] = ""; |
| | 440 | // count++; |
| | 441 | // } |
| | 442 | // i++; |
| | 443 | // } |
| | 444 | // interfaceChoices = new String[count]; |
| | 445 | // log.debug("printing contents of array"); |
| | 446 | // for(int k = 0; k < count; k++) |
| | 447 | // { |
| | 448 | // interfaceChoices[k] = tmpInterfaceChoices[k]; |
| | 449 | // log.debug(interfaceChoices[k]); |
| | 450 | // } |
| | 462 | |
| | 463 | // portInterfaceColumn.setEditingSupport(new EditingSupport(portsTableViewer) |
| | 464 | // { |
| | 465 | // |
| | 466 | // @Override |
| | 467 | // protected boolean canEdit(Object element) |
| | 468 | // { |
| | 469 | // return true; |
| | 470 | // } |
| | 471 | // |
| | 472 | // @Override |
| | 473 | // protected CellEditor getCellEditor(Object element) |
| | 474 | // { |
| | 475 | // // TODO Auto-generated method stub |
| | 476 | // return editor; |
| | 477 | // } |
| | 478 | // |
| | 479 | // @Override |
| | 480 | // protected Object getValue(Object element) |
| | 481 | // { |
| | 482 | // Integer result = -1; |
| | 483 | // String iface = ((Port)element).getInterface().getName(); |
| | 484 | // for(int i = 0; i < interfaceChoices.length; i++) |
| | 485 | // if(interfaceChoices[i].equals(iface)) |
| | 486 | // { |
| | 487 | // result = i; |
| | 488 | // break; |
| | 489 | // } |
| | 490 | // return result; |
| | 491 | // } |
| | 492 | // |
| | 493 | // @Override |
| | 494 | // protected void setValue(Object element, Object value) |
| | 495 | // { |
| | 496 | // ((Port)element).setInterface(interfaceChoices[(Integer)value]); |
| | 497 | // getViewer().update(element, null); |
| | 498 | // setIsDirty(true); |
| | 499 | // |
| | 500 | // } |
| | 501 | // private CellEditor editor = |
| | 502 | // new ComboBoxCellEditor(portsTable, interfaceChoices, SWT.READ_ONLY); |
| | 503 | // |
| | 504 | // }); |