1 11 package org.eclipse.jdt.internal.ui.macbundler; 12 13 import java.util.Enumeration ; 14 15 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.events.*; 17 import org.eclipse.swt.events.SelectionAdapter; 18 import org.eclipse.swt.layout.GridData; 19 import org.eclipse.swt.widgets.*; 20 import org.eclipse.swt.widgets.Composite; 21 22 import org.eclipse.jface.util.PropertyChangeEvent; 23 24 25 public class BundleWizardPage3 extends BundleWizardBasePage { 26 27 Text fIdentifier; 28 Text fSignature; 29 Text fVMOptions; 30 Table fProperties; 31 32 protected BundleWizardPage3(BundleDescription bd) { 33 super("page3", bd); } 35 36 public void createContents(Composite c) { 37 38 Composite c1= createComposite(c, 4); 39 40 createLabel(c1, Util.getString("page3.identifier.label"), GridData.VERTICAL_ALIGN_CENTER); fIdentifier= createText(c1, IDENTIFIER, 1); 42 43 createLabel(c1, Util.getString("page3.signature.label"), GridData.VERTICAL_ALIGN_CENTER); fSignature= createText(c1, SIGNATURE, 1); 45 46 createLabel(c, Util.getString("page3.vmOptions.label"), GridData.VERTICAL_ALIGN_CENTER); fVMOptions= createText(c, VMOPTIONS, 2); 48 49 Group g= createGroup(c, Util.getString("page3.propertiesGroup.label"), 1); fProperties= new Table(g, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI); 51 fProperties.setHeaderVisible(true); 52 fProperties.setLinesVisible(true); 53 fProperties.addSelectionListener(new SelectionAdapter() { 54 public void widgetSelected(SelectionEvent e) { 55 } 57 }); 58 setHeightHint(fProperties, 60); 59 60 TableColumn col0= new TableColumn(fProperties, SWT.NONE); 61 col0.setText(Util.getString("page3.keys.column.label")); col0.setWidth(150); 63 64 TableColumn col1= new TableColumn(fProperties, SWT.NONE); 65 col1.setText(Util.getString("page3.values.column.label")); col1.setWidth(150); 67 } 68 69 public void propertyChange(PropertyChangeEvent event) { 70 if (fProperties == null) 71 return; 72 fIdentifier.setText(fBundleDescription.get(IDENTIFIER, "")); fSignature.setText(fBundleDescription.get(SIGNATURE, "")); fVMOptions.setText(fBundleDescription.get(VMOPTIONS, "")); 76 fProperties.removeAll(); 77 if (fBundleDescription.fProperties2 != null && fBundleDescription.fProperties2.size() > 0) { 78 Enumeration iter= fBundleDescription.fProperties2.keys(); 79 for (int i= 0; iter.hasMoreElements(); i++) { 80 String key= (String ) iter.nextElement(); 81 String value= (String ) fBundleDescription.fProperties2.get(key); 82 TableItem ti= new TableItem(fProperties, SWT.NONE); 83 ti.setText(0, key); 84 ti.setText(1, value); 85 } 86 } 87 } 88 89 public boolean isPageComplete() { 90 return true; 91 } 92 } 93 | Popular Tags |