void disposeTextLayout (TextLayout layout) { if (layouts != null) { for (int i = 0; i < layouts.length; i++) { if (layouts[i] == layout) return; } } layout.dispose(); } void drawBullet(Bullet bullet, GC gc, int paintX, int paintY, int index, int lineAscent, int lineDescent) {
void disposeTextLayout (TextLayout layout) { if (layouts != null) { for (int i = 0; i < layouts.length; i++) { if (layouts[i] == layout) return; } } layout.dispose(); } void drawBullet(Bullet bullet, GC gc, int paintX, int paintY, int index, int lineAscent, int lineDescent) {
void disposeTextLayout (TextLayout layout) { if (layouts != null) { for (int i = 0; i < layouts.length; i++) { if (layouts[i] == layout) return; } } layout.dispose(); } void drawBullet(Bullet bullet, GC gc, int paintX, int paintY, int index, int lineAscent, int lineDescent) {
void disposeTextLayout (TextLayout layout) { if (layouts != null) { for (int i = 0; i < layouts.length; i++) { if (layouts[i] == layout) return; } } layout.dispose(); } void drawBullet(Bullet bullet, GC gc, int paintX, int paintY, int index, int lineAscent, int lineDescent) {
void disposeTextLayout (TextLayout layout) { if (layouts != null) { for (int i = 0; i < layouts.length; i++) { if (layouts[i] == layout) return; } } layout.dispose(); } void drawBullet(Bullet bullet, GC gc, int paintX, int paintY, int index, int lineAscent, int lineDescent) {
private void widgetDisposed() { fSharedLayout.dispose(); } }
private void widgetDisposed() { fSharedLayout.dispose(); } }
@Override protected void handleDispose() { if (fTextLayout != null) { fTextLayout.dispose(); fTextLayout= null; } fBrowser= null; super.handleDispose(); }
@Override protected void handleDispose() { if (fTextLayout != null) { fTextLayout.dispose(); fTextLayout= null; } fBrowser= null; super.handleDispose(); }
@Override public void dispose() { if (this.cachedTextLayout != null) { cachedTextLayout.dispose(); cachedTextLayout = null; } this.viewer= null; this.column= null; super.dispose(); }
@Override public void dispose() { if (this.cachedTextLayout != null) { cachedTextLayout.dispose(); cachedTextLayout = null; } this.viewer= null; this.column= null; super.dispose(); }
@Override void releaseWidget () { super.releaseWidget (); if (layout != null) layout.dispose (); layout = null; disabledColor = null; offsets = null; ids = null; mnemonics = null; text = null; }
private void doDispose() { if (textLayout != null && !textLayout.isDisposed()) { textLayout.dispose(); } if (resourceManager != null) { // Disposing the resource manager will dispose the color resourceManager.dispose(); resourceManager = null; } }
@Override void releaseWidget () { super.releaseWidget (); if (layout != null) layout.dispose (); layout = null; linkColor = null; if (disabledColor != null) disabledColor.dispose (); disabledColor = null; offsets = null; ids = null; mnemonics = null; text = null; }
@Override void releaseWidget () { super.releaseWidget (); if (layout != null) layout.dispose (); layout = null; linkColor = null; if (disabledColor != null) disabledColor.dispose (); disabledColor = null; offsets = null; ids = null; mnemonics = null; text = null; }
@Override void releaseWidget () { super.releaseWidget (); if (layout != null) layout.dispose (); layout = null; linkColor = null; if (disabledColor != null) disabledColor.dispose (); disabledColor = null; offsets = null; ids = null; mnemonics = null; text = null; }
protected String endShortenText(GC gc, String t, int width, int w) { TextLayout layout = new TextLayout (getDisplay()); layout.setText(t); String result = t; int len = gc.textExtent(result, DRAW_FLAGS).x; while ( len + w > width && result.length () > 0 ) { result = result.substring ( 0, validateOffset ( layout, result.length () - 1 ) ); len = gc.textExtent(result, DRAW_FLAGS).x; } layout.dispose(); return result + ellipsis; } protected String centerShortenText(GC gc, String t, int width, int w) {
protected String endShortenText(GC gc, String t, int width, int w) { TextLayout layout = new TextLayout (getDisplay()); layout.setText(t); String result = t; int len = gc.textExtent(result, DRAW_FLAGS).x; while ( len + w > width && result.length () > 0 ) { result = result.substring ( 0, validateOffset ( layout, result.length () - 1 ) ); len = gc.textExtent(result, DRAW_FLAGS).x; } layout.dispose(); return result + ellipsis; } protected String centerShortenText(GC gc, String t, int width, int w) {
protected String beginShortenText(GC gc, String t, int width, int w) { TextLayout layout = new TextLayout (getDisplay()); layout.setText(t); String result = t; int len = gc.textExtent(result, DRAW_FLAGS).x; while ( len + w > width && result.length () > 0 ) { result = result.substring ( validateOffsetInverse ( layout, 1 ) ); len = gc.textExtent(result, DRAW_FLAGS).x; } layout.dispose(); return ellipsis + result; } protected String endShortenText(GC gc, String t, int width, int w) {
public void dispose() { if (fTextLayout != null) { fTextLayout.dispose(); fTextLayout= null; } if (!fControl.isDisposed()) { fControl.removeListener(SWT.PaintItem, this); fControl.removeListener(SWT.EraseItem, this); fControl.removeListener(SWT.Dispose, this); } } }