@Override public void setFont(int columnIndex, Font font) { item.setFont(columnIndex, font); }
@Override public void setFont(int columnIndex, Font font) { item.setFont(columnIndex, font); }
public void setFont(int columnIndex, Font font) { item.setFont(columnIndex, font); }
@Override public void setFonts(Widget widget, FontData[] fontDatas) { TableItem item = (TableItem) widget; if (fontDatas != null) { for (int i = 0; i < fontDatas.length; i++) { Font font = getFont(fontDatas[i]); item.setFont(i, font); } } }
public static void bold(TableItem item, int index) { item.setFont(index, bold(item.getFont(), item.getDisplay())); }
@Override public void applyFontsAndColors(TableItem control) { if(colorProvider == null){ if(usedDecorators){ //If there is no provider only apply set values if(background != null) { control.setBackground(background); } if(foreground != null) { control.setForeground(foreground); } } } else{ //Always set the value if there is a provider control.setBackground(background); control.setForeground(foreground); } if(fontProvider == null){ if(usedDecorators && font != null) { control.setFont(font); } } else { control.setFont(font); } clear(); }
/** * Apply the fonts and colors to the control if * required. * @param control */ public void applyFontsAndColors(TableItem control) { if(usedDecorators){ //If there is no provider only apply set values if(background != null) { control.setBackground(background); } if(foreground != null) { control.setForeground(foreground); } if(font != null) { control.setFont(font); } } clear(); }
@Override public void applyFontsAndColors(TableItem control) { if(colorProvider == null){ if(usedDecorators){ //If there is no provider only apply set values if(background != null) { control.setBackground(background); } if(foreground != null) { control.setForeground(foreground); } } } else{ //Always set the value if there is a provider control.setBackground(background); control.setForeground(foreground); } if(fontProvider == null){ if(usedDecorators && font != null) { control.setFont(font); } } else { control.setFont(font); } clear(); }
/** * Apply the fonts and colors to the control if * required. * @param control */ public void applyFontsAndColors(TableItem control) { if(usedDecorators){ //If there is no provider only apply set values if(background != null) { control.setBackground(background); } if(foreground != null) { control.setForeground(foreground); } if(font != null) { control.setFont(font); } } clear(); }
/** * Apply the fonts and colors to the control if * required. * @param control */ public void applyFontsAndColors(TableItem control) { if(usedDecorators){ //If there is no provider only apply set values if(background != null) { control.setBackground(background); } if(foreground != null) { control.setForeground(foreground); } if(font != null) { control.setFont(font); } } clear(); }
/** * Sets the font that the receiver will use to paint textual information * for this item to the font specified by the argument, or to the default font * for that kind of control if the argument is null. * * @param font the new font (or null) * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @since 3.0 */ public void setFont (Font font){ checkWidget (); if (font != null && font.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } if (tableItem != null) { tableItem.setFont(font); } this.font = font; } /**
/** * Sets the font that the receiver will use to paint textual information * for this item to the font specified by the argument, or to the default font * for that kind of control if the argument is null. * * @param font the new font (or null) * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @since 3.0 */ public void setFont (Font font){ checkWidget (); if (font != null && font.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } if (tableItem != null) { tableItem.setFont(font); } this.font = font; } /**
/** * Sets the font of TableItem 0. */ void setItemFont () { if (!instance.startup) { table1.getItem (0).setFont (itemFont); } /* Set the font item's image to match the font of the item. */ Font ft = itemFont; if (ft == null) ft = table1.getItem (0).getFont (); TableItem item = colorAndFontTable.getItem(ITEM_FONT); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (fontImage(ft)); item.setFont(ft); colorAndFontTable.layout (); }
/** * Sets the font of the Row 0 TableItem in column 1. */ void setCellFont () { if (!instance.startup) { table1.getItem (0).setFont (1, cellFont); } /* Set the font item's image to match the font of the item. */ Font ft = cellFont; if (ft == null) ft = table1.getItem (0).getFont (1); TableItem item = colorAndFontTable.getItem(CELL_FONT); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (fontImage(ft)); item.setFont(ft); colorAndFontTable.layout (); }
/** * Sets the font of the Node 1 TreeItems in column 1. */ void setCellFont () { if (!instance.startup) { textNode1.setFont (1, cellFont); imageNode1.setFont (1, cellFont); } /* Set the font item's image to match the font of the item. */ Font ft = cellFont; if (ft == null) ft = textNode1.getFont (1); TableItem item = colorAndFontTable.getItem(CELL_FONT); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (fontImage(ft)); item.setFont(ft); colorAndFontTable.layout (); }
/** * Sets the font of the Node 1 TreeItems. */ void setItemFont () { if (!instance.startup) { textNode1.setFont (itemFont); imageNode1.setFont (itemFont); } /* Set the font item's image to match the font of the item. */ Font ft = itemFont; if (ft == null) ft = textNode1.getFont (); TableItem item = colorAndFontTable.getItem(ITEM_FONT); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (fontImage(ft)); item.setFont(ft); colorAndFontTable.layout (); }
@Override public void reset() { TableItem tableItem = getTableItem(); Table parent = tableItem.getParent(); if (!parent.isDisposed()) { parent.setForeground(null); parent.setBackground(null); CSSSWTFontHelper.restoreDefaultFont(parent); } tableItem.setForeground(null); tableItem.setBackground(null); CSSSWTImageHelper.restoreDefaultImage(tableItem); tableItem.setFont(null); // in such case the parent's font will be taken super.reset(); } }
/** * Sets the font of the "Example" widgets. */ void setExampleWidgetFont () { if (colorAndFontTable == null) return; // user cannot change color/font on this tab Control [] controls = getExampleControls (); if (!instance.startup) { for (Control control : controls) { control.setFont(font); } } /* Set the font item's image and font to match the font of the example widget(s). */ Font ft = font; if (controls.length == 0) return; if (ft == null) ft = controls [0].getFont (); TableItem item = colorAndFontTable.getItem(FONT); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (fontImage (ft)); item.setFont(ft); colorAndFontTable.layout (); }
/** * Sets the font of CTabItem 0. */ void setItemFont () { if (!instance.startup) { tabFolder1.getItem (0).setFont (itemFont); setExampleWidgetSize(); } /* Set the font item's image to match the font of the item. */ Font ft = itemFont; if (ft == null) ft = tabFolder1.getItem (0).getFont (); TableItem item = colorAndFontTable.getItem(ITEM_FONT); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (fontImage(ft)); item.setFont(ft); colorAndFontTable.layout (); } }
private void setProperties( TableItem item, ChatParticipant p ) { if ( p.isIgnored() || p.isSpammer()){ item.setForeground( 0, Colors.grey ); }else{ if ( p.isPinned()){ item.setForeground( 0, Colors.fadedGreen ); }else{ if ( p.isMe()){ item.setForeground( 0, Colors.fadedGreen ); item.setFont( 0, italic_font ); }else if ( p.isNickClash()){ item.setForeground( 0, Colors.red ); }else{ if ( p.hasNickname()){ item.setForeground( 0, Colors.blues[Colors.FADED_DARKEST] ); }else{ item.setForeground( 0, Colors.black ); } } } } }