Changeset 673

Show
Ignore:
Timestamp:
05/24/07 18:20:55 (2 years ago)
Author:
yuanying
Message:

UI design is changed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/.project

    r443 r673  
    2323    </buildSpec> 
    2424    <natures> 
     25        <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 
    2526        <nature>org.eclipse.pde.PluginNature</nature> 
    2627        <nature>org.eclipse.jdt.core.javanature</nature> 
     28        <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> 
    2729    </natures> 
    2830</projectDescription> 
  • org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectDetailComposite.java

    r672 r673  
    77import org.eclipse.swt.widgets.Label; 
    88import org.eclipse.swt.widgets.Text; 
     9import org.eclipse.swt.widgets.Group; 
     10import org.eclipse.swt.widgets.Button; 
    911 
    1012public class ProjectDetailComposite extends Composite { 
     
    1719    private Text    descText = null; 
    1820 
     21    private Group detailGroup = null; 
     22 
     23    private Button applyButton = null; 
     24 
    1925    public ProjectDetailComposite(Composite parent, int style) { 
    2026        super(parent, style); 
    2127        initialize(); 
     28    } 
     29 
     30    public Button getApplyButton() { 
     31        return applyButton; 
    2232    } 
    2333 
     
    4757        gridData1.verticalAlignment = GridData.FILL; 
    4858        this.setLayout(gridLayout1); 
     59        createDetailGroup(); 
    4960        this.setLayoutData(gridData1); 
    50         createDetailComposite(); 
    5161         
    5262        setLayout(new GridLayout()); 
     
    6171        GridLayout gridLayout = new GridLayout(); 
    6272        gridLayout.numColumns = 2; 
    63         detailComposite = new Composite(this, SWT.NONE); 
     73        detailComposite = new Composite(detailGroup, SWT.NONE); 
    6474        detailComposite.setLayout(gridLayout); 
    6575         
     
    7484        descText.setLayoutData(gridData2); 
    7585    } 
     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    } 
    76102} 
  • org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectListComposite.java

    r672 r673  
    88import org.eclipse.swt.widgets.Button; 
    99import org.eclipse.swt.widgets.Composite; 
    10 import org.eclipse.swt.widgets.Label; 
    1110import org.eclipse.swt.widgets.List; 
    1211 
    1312public class ProjectListComposite extends Composite { 
    1413     
    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; 
    1915    private Button addButton = null; 
    2016    private Button fetchButton = null; 
     
    2723    } 
    2824 
    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; 
    4327    } 
    4428 
     
    6044     
    6145    private void initialize() { 
     46        GridLayout gridLayout1 = new GridLayout(); 
     47        gridLayout1.numColumns = 2; 
    6248        GridData gridData1 = new GridData(); 
    6349        gridData1.horizontalAlignment = GridData.FILL; 
    6450        gridData1.grabExcessVerticalSpace = true; 
     51        gridData1.grabExcessHorizontalSpace = true; 
    6552        gridData1.verticalAlignment = GridData.FILL; 
    66         createHeaderComposite(); 
     53        this.setLayout(gridLayout1); 
    6754         
    6855        List list = new List(this, SWT.BORDER); 
    6956        list.setLayoutData(gridData1); 
    7057        listViewer = new ListViewer(list); 
     58        createMenuComposite(); 
    7159         
    72         createFooterComposite(); 
    7360        setSize(new Point(441, 303)); 
    74         setLayout(new GridLayout()); 
    7561    } 
    7662     
    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; 
    9274        GridLayout gridLayout = new GridLayout(); 
    93         gridLayout.numColumns = 3
     75        gridLayout.numColumns = 1
    9476        GridData gridData2 = new GridData(); 
    95         gridData2.horizontalAlignment = GridData.END
     77        gridData2.horizontalAlignment = GridData.CENTER
    9678        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); 
    10183 
    102         fetchButton = new Button(footerComposite, SWT.NONE); 
     84        fetchButton = new Button(getMenuComposite(), SWT.NONE); 
    10385        fetchButton.setText("Fetch"); 
    104         removeButton = new Button(footerComposite, SWT.NONE); 
     86        fetchButton.setLayoutData(gridData3); 
     87        removeButton = new Button(menuComposite, SWT.NONE); 
    10588        removeButton.setText("Remove"); 
    106         addButton = new Button(footerComposite, SWT.NONE); 
     89        removeButton.setLayoutData(gridData4); 
     90        addButton = new Button(getMenuComposite(), SWT.NONE); 
    10791        addButton.setText("Add"); 
     92        addButton.setLayoutData(gridData5); 
    10893    } 
    10994} 
  • org.jalcedo.client.examples/trunk/org.jalcedo.client.examples.rails/src/org/jalcedo/client/examples/rails/views/project/ProjectView.java

    r672 r673  
    22 
    33import org.eclipse.swt.SWT; 
     4import org.eclipse.swt.layout.GridData; 
     5import org.eclipse.swt.layout.GridLayout; 
    46import org.eclipse.swt.widgets.Composite; 
    57import org.eclipse.ui.part.ViewPart; 
     
    1113 
    1214    public void createPartControl(Composite parent) { 
     15        parent.setLayout(new GridLayout()); 
     16         
    1317        ProjectComponentsFactory factory = ProjectComponentsFactory.getFactory(); 
    1418         
    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); 
    1743    } 
    1844