setting Table font [message #444647] |
Mon, 18 October 2004 21:26  |
Eclipse User |
|
|
|
Hi,
I am trying to change the font on a table row, is there a method that I can
put in my implementaion of an ITableLabelProvider class that also extends
LabelProvider?
Something along the lines of a method like below:
public Label getColumnLabel(Object element, int columnIndex){
Label columnLabel = super.getColumnLabel(element, columnIndex);
Color color = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
columnLabel.addPaintListener(new PaintListener(){
public void paintControl(PaintEvent event){
event.gc.setForeground(color);
event.gc.drawText(columnLabel.getText(), 0, 0);
}
});
}
I just chose the Label control since I am familiar with that control, if
there is another control that is more suited here that would be fine too.
Thanks in advance for any help,
Mike
mikealti@us.ibm.com
|
|
|
Re: setting Table font COLOR [message #444648 is a reply to message #444647] |
Mon, 18 October 2004 21:28   |
Eclipse User |
|
|
|
Oops I meant the color of the text, but even just being able to bold the
text would probably suffice.
Thanks,
Mike
"Mike" <mikealti@us.ibm.com> wrote in message
news:cl1q5p$ilk$1@eclipse.org...
> Hi,
>
> I am trying to change the font on a table row, is there a method that I
can
> put in my implementaion of an ITableLabelProvider class that also extends
> LabelProvider?
>
> Something along the lines of a method like below:
>
> public Label getColumnLabel(Object element, int columnIndex){
> Label columnLabel = super.getColumnLabel(element, columnIndex);
> Color color = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
> columnLabel.addPaintListener(new PaintListener(){
> public void paintControl(PaintEvent event){
> event.gc.setForeground(color);
> event.gc.drawText(columnLabel.getText(), 0, 0);
> }
> });
> }
>
> I just chose the Label control since I am familiar with that control, if
> there is another control that is more suited here that would be fine too.
>
> Thanks in advance for any help,
> Mike
> mikealti@us.ibm.com
>
>
|
|
|
Re: setting Table font [message #444684 is a reply to message #444647] |
Wed, 20 October 2004 10:07  |
Eclipse User |
|
|
|
See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=57688
TableViewer support for the 3.0 SWT Table font capabilities was added in
3.1.
"Mike" <mikealti@us.ibm.com> wrote in message
news:cl1q5p$ilk$1@eclipse.org...
> Hi,
>
> I am trying to change the font on a table row, is there a method that I
> can
> put in my implementaion of an ITableLabelProvider class that also extends
> LabelProvider?
>
> Something along the lines of a method like below:
>
> public Label getColumnLabel(Object element, int columnIndex){
> Label columnLabel = super.getColumnLabel(element, columnIndex);
> Color color = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
> columnLabel.addPaintListener(new PaintListener(){
> public void paintControl(PaintEvent event){
> event.gc.setForeground(color);
> event.gc.drawText(columnLabel.getText(), 0, 0);
> }
> });
> }
>
> I just chose the Label control since I am familiar with that control, if
> there is another control that is more suited here that would be fine too.
>
> Thanks in advance for any help,
> Mike
> mikealti@us.ibm.com
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04138 seconds