Java Code Examples for org.eclipse.swt.widgets.Table.getGridLineWidth()

The following are Jave code examples for showing how to use getGridLineWidth() of the org.eclipse.swt.widgets.Table class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: gw4e.project   File: TableHelper.java   View Source Code Vote up 6 votes
public static void handleEvent(Event event) {

		Table table = (Table) event.widget;
		int columnCount = table.getColumnCount();
		if (columnCount == 0)
			return;
		Rectangle area = table.getClientArea();
		int totalAreaWdith = area.width;
		int lineWidth = table.getGridLineWidth();
		int totalGridLineWidth = (columnCount - 1) * lineWidth;
		int totalColumnWidth = 0;
		for (TableColumn column : table.getColumns()) {
			totalColumnWidth = totalColumnWidth + column.getWidth();
		}
		int diff = totalAreaWdith - (totalColumnWidth + totalGridLineWidth);

		TableColumn lastCol = table.getColumns()[columnCount - 1];

		lastCol.setWidth(diff + lastCol.getWidth());

	}