2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.ui
.group
.grantedauthority
;
11 import org
.eclipse
.swt
.SWT
;
12 import org
.eclipse
.swt
.custom
.CLabel
;
13 import org
.eclipse
.swt
.events
.DisposeEvent
;
14 import org
.eclipse
.swt
.events
.DisposeListener
;
15 import org
.eclipse
.swt
.layout
.GridData
;
16 import org
.eclipse
.swt
.layout
.GridLayout
;
17 import org
.eclipse
.swt
.widgets
.Composite
;
18 import org
.eclipse
.swt
.widgets
.Display
;
19 import org
.eclipse
.swt
.widgets
.Label
;
20 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
23 * Table header widget for {@link CdmAuthorityComposite}
26 * @created Mar 28, 2013
29 public class CdmAuthorityTableHeader
extends Composite
{
31 private final FormToolkit toolkit
= new FormToolkit(Display
.getCurrent());
34 * Create the composite, with 5 header fields.
39 public CdmAuthorityTableHeader(Composite parent
, int style
) {
40 super(parent
, SWT
.NONE
);
41 addDisposeListener(new DisposeListener() {
42 public void widgetDisposed(DisposeEvent e
) {
47 toolkit
.paintBordersFor(this);
48 setLayout(new GridLayout(4, false));
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
);
55 toolkit
.adapt(lblDirtyFlag
, true, true);
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");
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");
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");