Changeset 7708
- Timestamp:
- 05/31/08 16:31:34 (5 years ago)
- Location:
- ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie
- Files:
-
- 2 modified
-
dialogs/AddPortDialog.java (modified) (6 diffs)
-
editors/ComponentEditor.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie/dialogs/AddPortDialog.java
r7692 r7708 11 11 import org.eclipse.swt.widgets.Composite; 12 12 import org.eclipse.swt.widgets.Control; 13 import org.eclipse.swt.widgets.Display;14 13 import org.eclipse.swt.widgets.Label; 15 14 import org.eclipse.swt.widgets.Shell; 16 15 import org.eclipse.swt.widgets.Text; 17 16 import org.eclipse.swt.widgets.Tree; 18 import org.python.core.PyList;19 17 20 18 import edu.vt.ossie.OWDPlugin; 21 import edu.vt.ossie.jyinterface.interfaces.MainFrame; 19 import edu.vt.ossie.editors.ComponentEditor; 20 import edu.vt.ossie.wavedev.MainFrameTreeNode; 22 21 import edu.vt.ossie.wavedev.treemodel.ContentProvider; 23 22 import edu.vt.ossie.wavedev.treemodel.LabelProvider; … … 33 32 extends Dialog 34 33 { 35 36 private MainFrame mainFrame; 37 private static final Logger log = 38 OWDPlugin.getLogManager().getLogger(AddPortDialog.class); 34 //~ Constructor ........................................................... 39 35 40 36 // ---------------------------------------------------------- … … 42 38 * @param parentShell 43 39 */ 44 public AddPortDialog(Shell parentShell )40 public AddPortDialog(Shell parentShell, ComponentEditor parent) 45 41 { 46 42 super(parentShell); 43 owner = parent; 44 } 47 45 48 } 46 47 //~ Methods ............................................................... 49 48 50 49 // ---------------------------------------------------------- … … 74 73 try 75 74 { 76 PyList interfaces = mainFrame().importStandardIDL(); 77 log.debug(interfaces.toString()); 78 interfacesTreeViewer.setInput(interfaces); 75 MainFrameTreeNode interfaces = (MainFrameTreeNode)owner 76 .wavedevFactory().wrap(owner.mainFrame().importStandardIDL()); 77 log.debug(interfaces.toString()); 78 interfacesTreeViewer.setInput(interfaces); 79 79 } 80 80 catch (Exception e) … … 82 82 log.error("failure importing standard idl:", e); 83 83 } 84 85 // interfacesTreeViewer.setInput(mainFrame().importStandardIDL());86 84 87 85 Button importButton = new Button(interfaceComposite, SWT.PUSH); … … 107 105 portTypeCombo.setText("Uses"); 108 106 109 110 111 112 113 114 107 return comp; 115 108 } 116 109 117 private MainFrame mainFrame()118 {119 if (mainFrame == null)120 {121 mainFrame = OWDPlugin.createMainFrame();122 }123 return mainFrame;124 }125 110 126 111 // ---------------------------------------------------------- 127 @Override 128 protected void configureShell(Shell newShell) 129 { 130 // TODO Auto-generated method stub 131 super.configureShell(newShell); 132 newShell.setText("Add Port"); 133 } 112 // @Override 113 // protected void configureShell(Shell newShell) 114 // { 115 // // TODO Auto-generated method stub 116 // super.configureShell(newShell); 117 // newShell.setText("Add Port"); 118 // } 119 // 120 // public static void main(String[] args) 121 // { 122 // Display display = new Display(); 123 // Shell shell = new Shell(display); 124 // AddPortDialog apd = new AddPortDialog(shell); 125 // apd.open(); 126 // 127 // while (!shell.isDisposed()) { 128 // if (!display.readAndDispatch()) { 129 // // If no more entries in event queue 130 // display.sleep(); 131 // } 132 // } 133 // } 134 134 135 public static void main(String[] args)136 {137 Display display = new Display();138 Shell shell = new Shell(display);139 AddPortDialog apd = new AddPortDialog(shell);140 apd.open();141 135 142 while (!shell.isDisposed()) { 143 if (!display.readAndDispatch()) { 144 // If no more entries in event queue 145 display.sleep(); 146 } 147 } 148 } 136 //~ Instance/static variables ............................................. 149 137 138 ComponentEditor owner; 139 140 private static final Logger log = 141 OWDPlugin.getLogManager().getLogger(AddPortDialog.class); 150 142 } -
ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie/editors/ComponentEditor.java
r7701 r7708 302 302 public void widgetSelected(SelectionEvent e) 303 303 { 304 AddPortDialog apd = new AddPortDialog(null); 304 AddPortDialog apd = new AddPortDialog( 305 getSite().getShell(), ComponentEditor.this); 305 306 apd.open(); 306 307 } … … 855 856 856 857 // ---------------------------------------------------------- 857 private MainFrame mainFrame() 858 // Public so that dialogs can use it 859 public MainFrame mainFrame() 858 860 { 859 861 if (mainFrame == null) … … 866 868 867 869 // ---------------------------------------------------------- 868 private Factory wavedevFactory() 870 // Public so that dialogs can use it 871 public Factory wavedevFactory() 869 872 { 870 873 if (wavedevFactory == null)