1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
|
10
|
|
11
|
import org.eclipse.swt.events.DisposeEvent;
|
12
|
import org.eclipse.swt.events.DisposeListener;
|
13
|
import org.eclipse.swt.widgets.Composite;
|
14
|
import org.eclipse.swt.widgets.Display;
|
15
|
import org.eclipse.ui.forms.widgets.FormToolkit;
|
16
|
import org.eclipse.swt.layout.GridLayout;
|
17
|
import org.eclipse.swt.widgets.Label;
|
18
|
import org.eclipse.swt.SWT;
|
19
|
import org.eclipse.swt.layout.GridData;
|
20
|
import org.eclipse.swt.custom.CLabel;
|
21
|
|
22
|
/**
|
23
|
* Table header widget for {@link CdmAuthorityComposite}
|
24
|
*
|
25
|
* @author cmathew
|
26
|
* @created Mar 28, 2013
|
27
|
*
|
28
|
*/
|
29
|
public class CdmAuthorityTableHeader extends Composite {
|
30
|
|
31
|
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
|
32
|
|
33
|
/**
|
34
|
* Create the composite, with 5 header fields.
|
35
|
*
|
36
|
* @param parent
|
37
|
* @param style
|
38
|
*/
|
39
|
public CdmAuthorityTableHeader(Composite parent, int style) {
|
40
|
super(parent, SWT.NONE);
|
41
|
addDisposeListener(new DisposeListener() {
|
42
|
public void widgetDisposed(DisposeEvent e) {
|
43
|
toolkit.dispose();
|
44
|
}
|
45
|
});
|
46
|
toolkit.adapt(this);
|
47
|
toolkit.paintBordersFor(this);
|
48
|
setLayout(new GridLayout(4, false));
|
49
|
|
50
|
Label lblDirtyFlag = new Label(this, SWT.NONE);
|
51
|
GridData gd_lblDirtyFlag = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
|
52
|
gd_lblDirtyFlag.widthHint = 15;
|
53
|
lblDirtyFlag.setLayoutData(gd_lblDirtyFlag);
|
54
|
|
55
|
toolkit.adapt(lblDirtyFlag, true, true);
|
56
|
|
57
|
CLabel lblEntity = new CLabel(this, SWT.NONE);
|
58
|
lblEntity.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
|
59
|
lblEntity.setAlignment(SWT.CENTER);
|
60
|
GridData gd_lblEntity = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
|
61
|
gd_lblEntity.widthHint = 200;
|
62
|
lblEntity.setLayoutData(gd_lblEntity);
|
63
|
toolkit.adapt(lblEntity);
|
64
|
toolkit.paintBordersFor(lblEntity);
|
65
|
lblEntity.setText("ENTITY");
|
66
|
|
67
|
CLabel lblUuid = new CLabel(this, SWT.NONE);
|
68
|
lblUuid.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
|
69
|
lblUuid.setAlignment(SWT.CENTER);
|
70
|
GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
|
71
|
gd_lblUuid.widthHint = 270;
|
72
|
lblUuid.setLayoutData(gd_lblUuid);
|
73
|
toolkit.adapt(lblUuid);
|
74
|
toolkit.paintBordersFor(lblUuid);
|
75
|
lblUuid.setText("UUID");
|
76
|
|
77
|
CLabel lblOperation = new CLabel(this, SWT.NONE);
|
78
|
lblOperation.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
|
79
|
lblOperation.setAlignment(SWT.CENTER);
|
80
|
GridData gd_lblOperation = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
|
81
|
gd_lblOperation.widthHint = 150;
|
82
|
lblOperation.setLayoutData(gd_lblOperation);
|
83
|
toolkit.adapt(lblOperation);
|
84
|
toolkit.paintBordersFor(lblOperation);
|
85
|
lblOperation.setText("OPERATION");
|
86
|
|
87
|
}
|
88
|
|
89
|
}
|