Changeset 7410
- Timestamp:
- 05/01/08 10:05:46 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/jsnyder/ComponentProject/src/edu/vt/ossie/dialogs/ConnectDialog.java
r7384 r7410 2 2 3 3 import org.eclipse.jface.dialogs.Dialog; 4 import org.eclipse.jface.viewers.TreeViewer; 4 5 import org.eclipse.swt.SWT; 5 6 import org.eclipse.swt.layout.FormData; … … 17 18 import org.eclipse.swt.widgets.Tree; 18 19 20 import edu.vt.ossie.views.ResourceTreeContentProvider; 21 import edu.vt.ossie.views.ResourceTreeLabelProvider; 22 import edu.vt.ossie.wavedev.Component; 23 24 25 /** 26 * This code was edited or generated using CloudGarden's Jigloo 27 * SWT/Swing GUI Builder, which is free for non-commercial 28 * use. If Jigloo is being used commercially (ie, by a corporation, 29 * company or business for any purpose whatever) then you 30 * should purchase a license for each developer using Jigloo. 31 * Please visit www.cloudgarden.com for details. 32 * Use of Jigloo implies acceptance of these licensing terms. 33 * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR 34 * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED 35 * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. 36 */ 19 37 public class ConnectDialog extends Dialog 20 38 { … … 33 51 private Label connectionsLabel; 34 52 private Text connectionsBox; 53 private Component component; 54 private TreeViewer transmitterPortsTreeViewer; 35 55 36 protected ConnectDialog(Shell parentShell )56 protected ConnectDialog(Shell parentShell, Component comp) 37 57 { 38 58 super(parentShell); 59 component = comp; 39 60 // TODO Auto-generated constructor stub 61 } 62 protected ConnectDialog(Shell parentShell) 63 { 64 super(parentShell); 40 65 } 41 66 … … 54 79 availablePortsLabel = new Label(comp, SWT.NONE); 55 80 availablePortsLabel.setText("Available ports to connect to:"); 56 availablePortsLabel.setBounds(3 79, 10, 167, 30);81 availablePortsLabel.setBounds(350, 10, 196, 30); 57 82 //END << availablePortsLabel 58 83 //START >> transmitterPortsTree 59 84 transmitterPortsTree = new Tree(comp, SWT.NONE); 60 transmitterPortsTree.setBounds(12, 38, 157, 226); 85 transmitterPortsTree.setBounds(12, 38, 177, 226); 86 if(component != null) 87 { 88 transmitterPortsTreeViewer = new TreeViewer(transmitterPortsTree); 89 transmitterPortsTreeViewer.setContentProvider(new ResourceTreeContentProvider()); 90 transmitterPortsTreeViewer.setLabelProvider(new ResourceTreeLabelProvider()); 91 transmitterPortsTreeViewer.setInput(component); 92 } 61 93 //END << transmitterPortsTree 62 94 //START >> availablePortsTree 63 95 availablePortsTree = new Tree(comp, SWT.NONE); 64 availablePortsTree.setBounds(3 79, 38, 169, 226);96 availablePortsTree.setBounds(350, 38, 198, 226); 65 97 //END << availablePortsTree 66 98 //START >> connectButton 67 99 connectButton = new Button(comp, SWT.PUSH | SWT.CENTER); 68 100 connectButton.setText("Connect"); 69 connectButton.setBounds(2 25, 116, 82, 30);101 connectButton.setBounds(213, 116, 107, 30); 70 102 //END << connectButton 71 103 //START >> legend … … 113 145 public static void main(String[] args) 114 146 { 147 System.out.println("here"); 115 148 Display display = new Display(); 116 149 Shell shell = new Shell(display); 117 ConnectDialog dlg = new ConnectDialog(shell); 118 dlg.open(); 150 try 151 { 152 ConnectDialog dlg = new ConnectDialog(shell); 153 154 dlg.open(); 155 } 156 catch(Exception e) 157 { 158 e.printStackTrace(); 159 } 119 160 120 161 while (!shell.isDisposed()) {