Changeset 1207

Show
Ignore:
Timestamp:
10/31/07 16:18:49 (1 year ago)
Author:
nozawa
Message:

add icons to PropertyControlPairsPage?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.jalcedo.generator/trunk/org.jalcedo.generator.masterdetail.ui/src/org/jalcedo/generator/masterdetail/ui/internal/detail/PropertyControlPairLabelProvider.java

    r1185 r1207  
    1414import org.eclipse.jface.viewers.CellLabelProvider; 
    1515import org.eclipse.jface.viewers.ViewerCell; 
     16import org.eclipse.swt.graphics.Image; 
     17import org.jalcedo.generator.masterdetail.core.controls.CComboStyle; 
     18import org.jalcedo.generator.masterdetail.core.controls.CLabelStyle; 
     19import org.jalcedo.generator.masterdetail.core.controls.CheckBoxStyle; 
     20import org.jalcedo.generator.masterdetail.core.controls.ComboStyle; 
     21import org.jalcedo.generator.masterdetail.core.controls.ComboViewerStyle; 
    1622import org.jalcedo.generator.masterdetail.core.controls.ControlStyle; 
     23import org.jalcedo.generator.masterdetail.core.controls.LabelStyle; 
     24import org.jalcedo.generator.masterdetail.core.controls.ListViewerStyle; 
     25import org.jalcedo.generator.masterdetail.core.controls.PushButtonStyle; 
     26import org.jalcedo.generator.masterdetail.core.controls.RadioButtonStyle; 
     27import org.jalcedo.generator.masterdetail.core.controls.ScaleStyle; 
     28import org.jalcedo.generator.masterdetail.core.controls.SpinnerStyle; 
     29import org.jalcedo.generator.masterdetail.core.controls.TableViewerStyle; 
     30import org.jalcedo.generator.masterdetail.core.controls.TextStyle; 
    1731import org.jalcedo.generator.masterdetail.core.detail.PropertyControlFieldPair; 
     32import org.jalcedo.generator.masterdetail.ui.MasterDetailUIPlugin; 
     33import org.jalcedo.generator.masterdetail.ui.internal.resources.IImageKeys; 
    1834 
    1935/** 
     
    3854            switch (cell.getColumnIndex()) { 
    3955            case 0: 
    40                 cell.setText(pwp.getProperty().getName()); 
     56                String displayName = pwp.getProperty().getName() + " (" 
     57                        + pwp.getProperty().getFQTN() + ") "; 
     58                cell.setText(displayName); 
     59                cell.setImage(MasterDetailUIPlugin.getDefault().getImage( 
     60                        IImageKeys.METHPUB_OBJ)); 
    4161                break; 
    4262            case 1: 
     
    4969 
    5070                cell.setText(styleName); 
     71                cell.setImage(getImage(style)); 
     72 
    5173                break; 
    5274            default: 
     
    5577        } 
    5678    } 
     79 
     80    private Image getImage(ControlStyle style) { 
     81 
     82        String imagePath = null; 
     83        if (style instanceof TextStyle) { 
     84            imagePath = IImageKeys.TEXT_OBJ; 
     85        } else if (style instanceof LabelStyle) { 
     86            imagePath = IImageKeys.LABEL_OBJ; 
     87        } else if (style instanceof CLabelStyle) { 
     88            imagePath = IImageKeys.CLABEL_OBJ; 
     89        } else if (style instanceof ComboStyle) { 
     90            imagePath = IImageKeys.CHOICE_OBJ; 
     91        } else if (style instanceof CComboStyle) { 
     92            imagePath = IImageKeys.CCOMBO_OBJ; 
     93        } else if (style instanceof PushButtonStyle) { 
     94            imagePath = IImageKeys.BUTTON_OBJ; 
     95        } else if (style instanceof CheckBoxStyle) { 
     96            imagePath = IImageKeys.CHECKBOX_OBJ; 
     97        } else if (style instanceof RadioButtonStyle) { 
     98            imagePath = IImageKeys.RADIOBUTTON_OBJ; 
     99        } else if (style instanceof SpinnerStyle) { 
     100            imagePath = IImageKeys.SPINNER_OBJ; 
     101        } else if (style instanceof ScaleStyle) { 
     102            imagePath = IImageKeys.SCALE_OBJ; 
     103        } else if (style instanceof ListViewerStyle) { 
     104            imagePath = IImageKeys.LISTVIEWER_OBJ; 
     105        } else if (style instanceof ComboViewerStyle) { 
     106            imagePath = IImageKeys.COMBOVIEWER_OBJ; 
     107        } else if (style instanceof TableViewerStyle) { 
     108            imagePath = IImageKeys.TABLEVIEWER_OBJ; 
     109        } 
     110 
     111        if (imagePath != null) { 
     112            return MasterDetailUIPlugin.getDefault().getImage(imagePath); 
     113        } else { 
     114            return null; 
     115        } 
     116    } 
    57117}