Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/TableLayout.d @ 80:b3daa78bc913
Fix cyclic dependency in TableLayout. Changing static this to lazy initialization.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 25 May 2008 05:22:47 +0200 |
parents | 4878bef4a38e |
children | 04b47443bb01 |
comparison
equal
deleted
inserted
replaced
79:0953c252a764 | 80:b3daa78bc913 |
---|---|
47 * To ensure there are N pixels available for the content of the column, | 47 * To ensure there are N pixels available for the content of the column, |
48 * assign N+COLUMN_TRIM for the column width. | 48 * assign N+COLUMN_TRIM for the column width. |
49 * | 49 * |
50 * @since 3.1 | 50 * @since 3.1 |
51 */ | 51 */ |
52 private static int COLUMN_TRIM; | 52 private static int COLUMN_TRIM_ = -1; |
53 | 53 private static int COLUMN_TRIM(){ |
54 static this() { | 54 if( COLUMN_TRIM_ is -1 ){ |
55 if ("win32".equals(DWT.getPlatform())) { //$NON-NLS-1$ | 55 synchronized( TableLayout.classinfo ){ |
56 COLUMN_TRIM = 4; | 56 if( COLUMN_TRIM_ is -1 ){ |
57 } else if ("carbon".equals(DWT.getPlatform())) { //$NON-NLS-1$ | 57 if ("win32".equals(DWT.getPlatform())) { //$NON-NLS-1$ |
58 COLUMN_TRIM = 24; | 58 COLUMN_TRIM_ = 4; |
59 } else { | 59 } else if ("carbon".equals(DWT.getPlatform())) { //$NON-NLS-1$ |
60 COLUMN_TRIM = 3; | 60 COLUMN_TRIM_ = 24; |
61 } | 61 } else { |
62 COLUMN_TRIM_ = 3; | |
63 } | |
64 } | |
65 } | |
66 } | |
67 return COLUMN_TRIM_; | |
62 } | 68 } |
63 | 69 |
64 /** | 70 /** |
65 * The list of column layout data (element type: | 71 * The list of column layout data (element type: |
66 * <code>ColumnLayoutData</code>). | 72 * <code>ColumnLayoutData</code>). |