Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ad3b532f9c7d4230be0fa6019fd450c6b9f0ccc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************************
 * Copyright (c) 2011 Mia-Software.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Nicolas Bros (Mia-Software) - initial API and implementation
 *    Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
 *******************************************************************************/
package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;

import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.SelectionListener;

/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TreeColumn} */
public class TreeColumn implements Column {
	private final org.eclipse.swt.widgets.TreeColumn column;

	public TreeColumn(final org.eclipse.swt.widgets.TreeColumn column) {
		this.column = column;
	}

	public void setText(final String columnText) {
		this.column.setText(columnText);
	}

	public void setWidth(final int width) {
		this.column.setWidth(width);

	}

	public void addControlListener(final ControlListener controlListener) {
		this.column.addControlListener(controlListener);
	}

	public void addSelectionListener(final SelectionListener selectionListener) {
		this.column.addSelectionListener(selectionListener);
	}

	public int getWidth() {
		return this.column.getWidth();
	}

	public org.eclipse.swt.widgets.TreeColumn getColumn() {
		return this.column;
	}
}

Back to the top