/** * Free the managed resource if it hasn't already been done and if this is not a system font * */ public void dispose() { // System color and already disposed off colors don't need to be disposed! if ( !systemFont && !font.isDisposed() ) { font.dispose(); } }
private void refreshTextNote() { int swt = SWT.NORMAL; if ( wFontBold.getSelection() ) { swt = SWT.BOLD; } if ( wFontItalic.getSelection() ) { swt = swt | SWT.ITALIC; } // dispose of old font only after setting it on wDesc Font oldFont = font; font = new Font( shell.getDisplay(), wFontName.getText(), wFontSize.getSelection(), swt ); wDesc.setFont( font ); if ( oldFont != null && !oldFont.isDisposed() ) { oldFont.dispose(); } for ( Control control : wDesc.getChildren() ) { control.setBackground( bgColor ); } wFontColor.setBackground( fontColor ); wBackGroundColor.setBackground( bgColor ); wBorderColor.setBackground( borderColor ); } }
public void dispose() { props.setScreen( new WindowProperty( shell ) ); fontColor.dispose(); bgColor.dispose(); borderColor.dispose(); if ( font != null && !font.isDisposed() ) { font.dispose(); } shell.dispose(); }
if ( font != null && !font.isDisposed() ) { control.setFont( font );
if ( ( (Font) object ).isDisposed() ) { return;
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Font {*DISPOSED*}"; return "Font {" + handle + "}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Font {*DISPOSED*}"; return "Font {" + handle + "}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Font {*DISPOSED*}"; return "Font {" + handle + "}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ public String toString () { if (isDisposed()) return "Font {*DISPOSED*}"; return "Font {" + handle + "}"; }
@Override public void widgetDisposed(DisposeEvent e) { if (!newFont.isDisposed()) { newFont.dispose(); } } });
public void widgetDisposed(DisposeEvent event) { if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) fStatusTextFont.dispose(); fStatusTextFont= null; fShell= null; fText= null; }
private void delete() { if (viewComposite != null && !viewComposite.isDisposed()) { viewComposite.dispose(); } if(textFont1 != null && ! textFont1.isDisposed()) { textFont1.dispose(); } if(textFont2 != null && ! textFont2.isDisposed()) { textFont2.dispose(); } }
@Override public void widgetDisposed(DisposeEvent event) { if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) fStatusTextFont.dispose(); fStatusTextFont= null; if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) fStatusTextForegroundColor.dispose(); fStatusTextForegroundColor= null; fTextFont= null; fShell= null; fText= null; }
@Override public void widgetDisposed(DisposeEvent event) { if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) fStatusTextFont.dispose(); fStatusTextFont= null; if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) fStatusTextForegroundColor.dispose(); fStatusTextForegroundColor= null; fTextFont= null; fShell= null; fText= null; }
private void addDisposeListener() { if (gcFont != null && !gcFont.isDisposed()) gcFont.dispose(); if (currentImage != null && !currentImage.isDisposed()) currentImage.dispose(); }
public static Font getAnyFontBoldItalic(GC gc) { if (fontBoldItalic == null || fontBoldItalic.isDisposed()) { FontData[] fontData = gc.getFont().getFontData(); for (FontData fd : fontData) { fd.setStyle(SWT.BOLD | SWT.ITALIC); } fontBoldItalic = new Font(gc.getDevice(), fontData); } return fontBoldItalic; }
public static Font getAnyFontItalic(GC gc) { if (fontItalic == null || fontItalic.isDisposed()) { FontData[] fontData = gc.getFont().getFontData(); for (FontData fd : fontData) { fd.setStyle(SWT.ITALIC); } fontItalic = new Font(gc.getDevice(), fontData); } return fontItalic; }
public static Font getAnyFontBold(GC gc) { if (fontBold == null || fontBold.isDisposed()) { FontData[] fontData = gc.getFont().getFontData(); for (FontData fd : fontData) { fd.setStyle(SWT.BOLD); } fontBold = new Font(gc.getDevice(), fontData); } return fontBold; }
public static void restoreDefaultFont(CTabItem item) { Font defaultFont = (Font) item.getData(DEFAULT_FONT); if (defaultFont != null) { if (defaultFont.isDisposed()) { defaultFont = item.getDisplay().getSystemFont(); } if (!equals(defaultFont, item.getFont())) { item.setFont(defaultFont); } } }
public static void restoreDefaultFont(Control control) { Font defaultFont = (Font) control.getData(DEFAULT_FONT); if (defaultFont != null) { if (defaultFont.isDisposed()) { defaultFont = control.getDisplay().getSystemFont(); } if (!equals(defaultFont, control.getFont())) { control.setFont(defaultFont); } } }