| Grid - how do you provide image for row header? [message #59660] | 
Mon, 29 September 2008 17:54   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
I am using  Grid and GridTableViewer. I am able to see text but not the  
image on RowHeader.  What am I doing wrong? 
  
grid.setHeaderVisible(true); 
grid.setRowHeaderVisible(true); 
gtv.setRowHeaderLabelProvider(new OppRowHeaderLabelProvider()); 
 
class OppRowHeaderLabelProvider extends CellLabelProvider  
  { 
	 
    public void update(ViewerCell cell) 
       { 
    	  
     
    	String text = ""; 
    	String id = ""; 
 
    	 
    	Brand br = (Brand)cell.getViewerRow().getElement(); 
     	text = br.getDesc(); 
      cell.setText(text); 
    	cell.setImage(ViewUtils.getImage(ViewUtils.WINDOW_16)); 
    } 
    } 
 
 
Thanks, 
 
Dhiresh
 |  
 |  
  | 
 | 
 | 
| Re: Grid - how do you provide image for row header? [message #59731 is a reply to message #59708] | 
Mon, 29 September 2008 18:52   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Not until I filed [1] and committed the changes to CVS. You can only get 
them from the header_footer branch in CVS and it looks like there's 
still a problem if the size of the image is bigger than the default 
height of a row, I'm just investigating this. 
 
Tom 
 
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=249056 
 
Dhiresh schrieb: 
> Hi Tom, 
> So, is there any other way to provide image for Row Header? 
>  
> Thanks, 
>  
> Dhiresh 
 
 
--  
B e s t S o l u t i o n . at 
 ------------------------------------------------------------ -------- 
Tom Schindl                                          JFace-Committer 
 ------------------------------------------------------------ --------
 |  
 |  
  | 
| Re: Grid - how do you provide image for row header? [message #592421 is a reply to message #59660] | 
Mon, 29 September 2008 18:00   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
I don't think the RowHeaderRenderer and the GridItem take this into 
account though I haven't looked at the sources yet. 
 
Tom 
 
Dhiresh schrieb: 
> I am using  Grid and GridTableViewer. I am able to see text but not the 
> image on RowHeader.  What am I doing wrong? 
>  
> grid.setHeaderVisible(true); 
> grid.setRowHeaderVisible(true); 
> gtv.setRowHeaderLabelProvider(new OppRowHeaderLabelProvider()); 
>  
> class OppRowHeaderLabelProvider extends CellLabelProvider  { 
>      
>    public void update(ViewerCell cell) 
>       { 
>                   String text = ""; 
>        String id = ""; 
>  
>        
>        Brand br = (Brand)cell.getViewerRow().getElement(); 
>         text = br.getDesc(); 
>      cell.setText(text); 
>        cell.setImage(ViewUtils.getImage(ViewUtils.WINDOW_16)); 
>    } 
>    } 
>  
>  
> Thanks, 
>  
> Dhiresh 
>  
>  
>  
>  
 
 
--  
B e s t S o l u t i o n . at 
 ------------------------------------------------------------ -------- 
Tom Schindl                                          JFace-Committer 
 ------------------------------------------------------------ --------
 |  
 |  
  | 
 | 
| Re: Grid - how do you provide image for row header? [message #592441 is a reply to message #59708] | 
Mon, 29 September 2008 18:52   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Not until I filed [1] and committed the changes to CVS. You can only get 
them from the header_footer branch in CVS and it looks like there's 
still a problem if the size of the image is bigger than the default 
height of a row, I'm just investigating this. 
 
Tom 
 
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=249056 
 
Dhiresh schrieb: 
> Hi Tom, 
> So, is there any other way to provide image for Row Header? 
>  
> Thanks, 
>  
> Dhiresh 
 
 
--  
B e s t S o l u t i o n . at 
 ------------------------------------------------------------ -------- 
Tom Schindl                                          JFace-Committer 
 ------------------------------------------------------------ --------
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.04188 seconds