View | Details | Raw Unified | Return to bug 177213
Collapse All | Expand All

(-)src/org/eclipse/jface/viewers/TableLayout.java (+12 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Cerner Corporation - bug 177213
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jface.viewers;
12
package org.eclipse.jface.viewers;
12
13
Lines 233-236 Link Here
233
		}
234
		}
234
		return ((Table) composite).getColumns();
235
		return ((Table) composite).getColumns();
235
	}
236
	}
237
    
238
    /**
239
     * Returns the {@link ColumnLayoutData ColumnLayoutDatas} in the order provided to configure the
240
     * layout.
241
     * 
242
     * @return datas, empty array if none provided
243
     * @since 3.3
244
     */
245
    public ColumnLayoutData[] getColumnDatas() {
246
        return (ColumnLayoutData[]) columns.toArray(new ColumnLayoutData[columns.size()]);
247
    }
236
}
248
}
(-)Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java (+2 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Cerner Corporation - bug 177213
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jface.tests.viewers;
12
package org.eclipse.jface.tests.viewers;
12
13
Lines 51-55 Link Here
51
		addTestSuite(Bug138608Test.class);
52
		addTestSuite(Bug138608Test.class);
52
		addTestSuite(ComboViewerComparerTest.class);
53
		addTestSuite(ComboViewerComparerTest.class);
53
		addTestSuite(ListViewerRefreshTest.class);
54
		addTestSuite(ListViewerRefreshTest.class);
55
        addTestSuite(TableLayoutTest.class);
54
	}
56
	}
55
}
57
}
(-)Eclipse (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 Cerner Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Cerner Corporation - initial API and implementation
10
 ******************************************************************************/
11
12
package org.eclipse.jface.tests.viewers;
13
14
import java.util.Arrays;
15
16
import junit.framework.TestCase;
17
18
import org.eclipse.jface.viewers.ColumnLayoutData;
19
import org.eclipse.jface.viewers.ColumnPixelData;
20
import org.eclipse.jface.viewers.ColumnWeightData;
21
import org.eclipse.jface.viewers.TableLayout;
22
23
/**
24
 * @since 3.3
25
 */
26
public class TableLayoutTest extends TestCase {
27
    public void testGetColumnDatasNoResultsReturnsEmptyArray() throws Exception {
28
        assertEquals(0, new TableLayout().getColumnDatas().length);
29
    }
30
    
31
    public void testGetColumnDatasWithResults() throws Exception {
32
        ColumnWeightData data1 = new ColumnWeightData(1);
33
        ColumnPixelData data2 = new ColumnPixelData(1);
34
        
35
        TableLayout layout = new TableLayout();
36
        layout.addColumnData(data1);
37
        layout.addColumnData(data2);
38
        
39
        ColumnLayoutData[] datas = new ColumnLayoutData[] {data1, data2};
40
        
41
        assertTrue(Arrays.equals(datas, layout.getColumnDatas()));
42
    }
43
}

Return to bug 177213