Changeset 673
- Timestamp:
- 05/24/07 18:20:55 (2 years ago)
- Files:
-
- org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/.project (modified) (1 diff)
- org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectDetailComposite.java (modified) (5 diffs)
- org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectListComposite.java (modified) (3 diffs)
- org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectView.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/.project
r443 r673 23 23 </buildSpec> 24 24 <natures> 25 <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 25 26 <nature>org.eclipse.pde.PluginNature</nature> 26 27 <nature>org.eclipse.jdt.core.javanature</nature> 28 <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> 27 29 </natures> 28 30 </projectDescription> org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectDetailComposite.java
r672 r673 7 7 import org.eclipse.swt.widgets.Label; 8 8 import org.eclipse.swt.widgets.Text; 9 import org.eclipse.swt.widgets.Group; 10 import org.eclipse.swt.widgets.Button; 9 11 10 12 public class ProjectDetailComposite extends Composite { … … 17 19 private Text descText = null; 18 20 21 private Group detailGroup = null; 22 23 private Button applyButton = null; 24 19 25 public ProjectDetailComposite(Composite parent, int style) { 20 26 super(parent, style); 21 27 initialize(); 28 } 29 30 public Button getApplyButton() { 31 return applyButton; 22 32 } 23 33 … … 47 57 gridData1.verticalAlignment = GridData.FILL; 48 58 this.setLayout(gridLayout1); 59 createDetailGroup(); 49 60 this.setLayoutData(gridData1); 50 createDetailComposite();51 61 52 62 setLayout(new GridLayout()); … … 61 71 GridLayout gridLayout = new GridLayout(); 62 72 gridLayout.numColumns = 2; 63 detailComposite = new Composite( this, SWT.NONE);73 detailComposite = new Composite(detailGroup, SWT.NONE); 64 74 detailComposite.setLayout(gridLayout); 65 75 … … 74 84 descText.setLayoutData(gridData2); 75 85 } 86 87 /** 88 * This method initializes detailGroup 89 * 90 */ 91 private void createDetailGroup() { 92 GridData gridData3 = new GridData(); 93 gridData3.horizontalAlignment = GridData.END; 94 gridData3.verticalAlignment = GridData.CENTER; 95 detailGroup = new Group(this, SWT.NONE); 96 detailGroup.setLayout(new GridLayout()); 97 createDetailComposite(); 98 applyButton = new Button(detailGroup, SWT.NONE); 99 applyButton.setText("Apply"); 100 applyButton.setLayoutData(gridData3); 101 } 76 102 } org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectListComposite.java
r672 r673 8 8 import org.eclipse.swt.widgets.Button; 9 9 import org.eclipse.swt.widgets.Composite; 10 import org.eclipse.swt.widgets.Label;11 10 import org.eclipse.swt.widgets.List; 12 11 13 12 public class ProjectListComposite extends Composite { 14 13 15 private Composite headerComposite = null; 16 private Label titleLabel = null; 17 private Label descriptionLabel = null; 18 private Composite footerComposite = null; 14 private Composite menuComposite = null; 19 15 private Button addButton = null; 20 16 private Button fetchButton = null; … … 27 23 } 28 24 29 public Composite getHeaderComposite() { 30 return headerComposite; 31 } 32 33 public Label getTitleLabel() { 34 return titleLabel; 35 } 36 37 public Label getDescriptionLabel() { 38 return descriptionLabel; 39 } 40 41 public Composite getFooterComposite() { 42 return footerComposite; 25 public Composite getMenuComposite() { 26 return menuComposite; 43 27 } 44 28 … … 60 44 61 45 private void initialize() { 46 GridLayout gridLayout1 = new GridLayout(); 47 gridLayout1.numColumns = 2; 62 48 GridData gridData1 = new GridData(); 63 49 gridData1.horizontalAlignment = GridData.FILL; 64 50 gridData1.grabExcessVerticalSpace = true; 51 gridData1.grabExcessHorizontalSpace = true; 65 52 gridData1.verticalAlignment = GridData.FILL; 66 createHeaderComposite();53 this.setLayout(gridLayout1); 67 54 68 55 List list = new List(this, SWT.BORDER); 69 56 list.setLayoutData(gridData1); 70 57 listViewer = new ListViewer(list); 58 createMenuComposite(); 71 59 72 createFooterComposite();73 60 setSize(new Point(441, 303)); 74 setLayout(new GridLayout());75 61 } 76 62 77 private void createHeaderComposite() { 78 GridData gridData = new GridData(); 79 gridData.horizontalAlignment = GridData.BEGINNING; 80 gridData.grabExcessHorizontalSpace = true; 81 gridData.verticalAlignment = GridData.CENTER; 82 headerComposite = new Composite(this, SWT.NONE); 83 headerComposite.setLayout(new GridLayout()); 84 headerComposite.setLayoutData(gridData); 85 titleLabel = new Label(headerComposite, SWT.NONE); 86 titleLabel.setText("Proiects"); 87 descriptionLabel = new Label(headerComposite, SWT.NONE); 88 descriptionLabel.setText("descriptionLabel"); 89 } 90 91 private void createFooterComposite() { 63 private void createMenuComposite() { 64 GridData gridData5 = new GridData(); 65 gridData5.horizontalAlignment = GridData.FILL; 66 gridData5.verticalAlignment = GridData.CENTER; 67 GridData gridData4 = new GridData(); 68 gridData4.horizontalAlignment = GridData.FILL; 69 gridData4.verticalAlignment = GridData.CENTER; 70 GridData gridData3 = new GridData(); 71 gridData3.grabExcessHorizontalSpace = false; 72 gridData3.verticalAlignment = GridData.CENTER; 73 gridData3.horizontalAlignment = GridData.FILL; 92 74 GridLayout gridLayout = new GridLayout(); 93 gridLayout.numColumns = 3;75 gridLayout.numColumns = 1; 94 76 GridData gridData2 = new GridData(); 95 gridData2.horizontalAlignment = GridData. END;77 gridData2.horizontalAlignment = GridData.CENTER; 96 78 gridData2.grabExcessHorizontalSpace = false; 97 gridData2.verticalAlignment = GridData. CENTER;98 footerComposite = new Composite(this, SWT.NONE);99 footerComposite.setLayoutData(gridData2);100 footerComposite.setLayout(gridLayout);79 gridData2.verticalAlignment = GridData.BEGINNING; 80 menuComposite = new Composite(this, SWT.NONE); 81 menuComposite.setLayoutData(gridData2); 82 menuComposite.setLayout(gridLayout); 101 83 102 fetchButton = new Button( footerComposite, SWT.NONE);84 fetchButton = new Button(getMenuComposite(), SWT.NONE); 103 85 fetchButton.setText("Fetch"); 104 removeButton = new Button(footerComposite, SWT.NONE); 86 fetchButton.setLayoutData(gridData3); 87 removeButton = new Button(menuComposite, SWT.NONE); 105 88 removeButton.setText("Remove"); 106 addButton = new Button(footerComposite, SWT.NONE); 89 removeButton.setLayoutData(gridData4); 90 addButton = new Button(getMenuComposite(), SWT.NONE); 107 91 addButton.setText("Add"); 92 addButton.setLayoutData(gridData5); 108 93 } 109 94 } org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectView.java
r672 r673 2 2 3 3 import org.eclipse.swt.SWT; 4 import org.eclipse.swt.layout.GridData; 5 import org.eclipse.swt.layout.GridLayout; 4 6 import org.eclipse.swt.widgets.Composite; 5 7 import org.eclipse.ui.part.ViewPart; … … 11 13 12 14 public void createPartControl(Composite parent) { 15 parent.setLayout(new GridLayout()); 16 13 17 ProjectComponentsFactory factory = ProjectComponentsFactory.getFactory(); 14 18 15 factory.createComposite(ProjectListComposite.class, parent, SWT.NONE); 16 factory.createComposite(ProjectDetailComposite.class, parent, SWT.NONE); 19 createListComposite(parent, factory); 20 createDetailComposite(parent, factory); 21 } 22 23 private void createDetailComposite(Composite parent, 24 ProjectComponentsFactory factory) { 25 GridData gridData = new GridData(); 26 //gridData.horizontalAlignment = GridData.FILL; 27 //gridData.grabExcessHorizontalSpace = true; 28 //gridData.grabExcessVerticalSpace = true; 29 //gridData.verticalAlignment = GridData.FILL; 30 Composite composite = factory.createComposite(ProjectDetailComposite.class, parent, SWT.NONE); 31 composite.setLayoutData(gridData); 32 } 33 34 private void createListComposite(Composite parent, 35 ProjectComponentsFactory factory) { 36 GridData gridData = new GridData(); 37 gridData.horizontalAlignment = GridData.FILL; 38 gridData.grabExcessHorizontalSpace = true; 39 gridData.verticalAlignment = GridData.CENTER; 40 Composite composite = factory.createComposite(ProjectListComposite.class, parent, SWT.NONE); 41 //composite.setLayout(new GridLayout()); 42 composite.setLayoutData(gridData); 17 43 } 18 44
