Changeset 7878

Show
Ignore:
Timestamp:
06/16/08 13:40:54 (5 years ago)
Author:
Snyder.Jason
Message:

working on making the interface column editable in the component editor. It's not working yet so most of it is commented out for now.

Location:
ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie/editors/ComponentEditor.java

    r7851 r7878  
    6060import org.python.core.Py; 
    6161import org.python.core.PyList; 
     62import org.python.core.PyObject; 
    6263import org.python.core.PyString; 
    6364import edu.vt.ossie.OWDPlugin; 
     
    191192 
    192193 
    193     private TableViewer portsTableViewer; 
     194     
    194195 
    195196 
     
    401402        }); 
    402403         
    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//        } 
    404451        TableViewerColumn portInterfaceColumn = 
    405452            new TableViewerColumn(portsTableViewer, SWT.LEFT); 
     
    413460            } 
    414461        }); 
     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//        }); 
    415505         
    416506         
     
    12581348    private Button removePropertyButton; 
    12591349    private String[] templateChoices; 
     1350    private TableViewer portsTableViewer; 
     1351    protected String[] interfaceChoices = {"realShort", "realLong"}; 
    12601352 
    12611353    private Component component; 
  • ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie/jyinterface/interfaces/MainFrame.java

    r7832 r7878  
    3333    PyList getTemplates(); 
    3434    PyList formatSequenceValues(String values); 
    35     PyList getInterfaceList(); 
     35    PyList getCFInterfaces(); 
     36    PyList getStandardInterfaces(); 
     37    PyList getCustomInterfaces(); 
    3638     
    3739} 
  • ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie/wavedev/Port.java

    r7832 r7878  
    245245        put(INTERFACE, iface); 
    246246    } 
     247     
     248    public void setInterface(String iface) 
     249    { 
     250        put(INTERFACE, iface); 
     251    } 
    247252 
    248253