Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » setting Table font
setting Table font [message #444647] Tue, 19 October 2004 01:26 Go to next message
Mike Altieri is currently offline Mike AltieriFriend
Messages: 4
Registered: July 2009
Junior Member
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] Tue, 19 October 2004 01:28 Go to previous messageGo to next message
Mike Altieri is currently offline Mike AltieriFriend
Messages: 4
Registered: July 2009
Junior Member
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 14:07 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
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
>
>
Previous Topic:Custom event and listeners
Next Topic:java spider help
Goto Forum:
  


Current Time: Sun Oct 25 17:38:49 GMT 2020

Powered by FUDForum. Page generated in 0.02314 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top