Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ca9fe3e8cff73ed6d136f977562c79620a50807a (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**********************************************************************
 * Copyright (c) 2004 QNX Software Systems and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors: 
 * QNX Software Systems - Initial API and implementation
***********************************************************************/

package org.eclipse.cdt.debug.internal.ui.views.signals;

import org.eclipse.cdt.debug.internal.ui.PixelConverter;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;


/**
 * Signals viewer.
 *
 * @since: Mar 8, 2004
 */
public class SignalsViewer extends TableViewer {

	// String constants
	protected static final String YES_VALUE = SignalsMessages.getString( "SignalsViewer.8" ); //$NON-NLS-1$
	protected static final String NO_VALUE = SignalsMessages.getString( "SignalsViewer.9" ); //$NON-NLS-1$

	// Column properties
	private static final String CP_NAME = "name"; //$NON-NLS-1$
	private static final String CP_PASS = "pass"; //$NON-NLS-1$
	private static final String CP_SUSPEND = "suspend"; //$NON-NLS-1$
	private static final String CP_DESCRIPTION = "description"; //$NON-NLS-1$

	// Column labels
	private static final String CL_NAME = SignalsMessages.getString( "SignalsViewer.4" ); //$NON-NLS-1$
	private static final String CL_PASS = SignalsMessages.getString( "SignalsViewer.5" ); //$NON-NLS-1$
	private static final String CL_SUSPEND = SignalsMessages.getString( "SignalsViewer.6" ); //$NON-NLS-1$
	private static final String CL_DESCRIPTION = SignalsMessages.getString( "SignalsViewer.7" ); //$NON-NLS-1$

	/**
	 * Constructor for SignalsViewer
	 * 
	 * @param parent
	 * @param style
	 */
	public SignalsViewer( Composite parent, int style ) {
		super( parent, style );
		Table table = getTable();
		table.setLinesVisible( true );
		table.setHeaderVisible( true );		
		table.setLayoutData( new GridData( GridData.FILL_BOTH ) );

		// Create the table columns
		new TableColumn( table, SWT.NULL );
		new TableColumn( table, SWT.NULL );
		new TableColumn( table, SWT.NULL );
		new TableColumn( table, SWT.NULL );
		TableColumn[] columns = table.getColumns();
		columns[0].setResizable( true );
		columns[1].setResizable( false );
		columns[2].setResizable( false );
		columns[3].setResizable( true );

		columns[0].setText( CL_NAME );
		columns[1].setText( CL_PASS );
		columns[2].setText( CL_SUSPEND );
		columns[3].setText( CL_DESCRIPTION );

		PixelConverter pc = new PixelConverter( parent );
		columns[0].setWidth( pc.convertWidthInCharsToPixels( 20 ) );
		columns[1].setWidth( pc.convertWidthInCharsToPixels( 15 ) );
		columns[2].setWidth( pc.convertWidthInCharsToPixels( 15 ) );
		columns[3].setWidth( pc.convertWidthInCharsToPixels( 50 ) );

		setColumnProperties( new String[]{ CP_NAME, CP_PASS, CP_SUSPEND, CP_DESCRIPTION } );
	}
}

Back to the top