3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.propertysheet
.name
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.jface
.viewers
.CellEditor
;
15 import org
.eclipse
.jface
.viewers
.ComboBoxCellEditor
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.custom
.CCombo
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.ui
.views
.properties
.ComboBoxPropertyDescriptor
;
26 public class EditorComboBoxPropertyDescriptor
extends
27 ComboBoxPropertyDescriptor
{
28 private static final Logger logger
= Logger
29 .getLogger(EditorComboBoxPropertyDescriptor
.class);
30 private String
[] labels
;
37 public EditorComboBoxPropertyDescriptor(Object id
, String displayName
,
38 String
[] labelsArray
) {
39 super(id
, displayName
, labelsArray
);
40 this.labels
= labelsArray
;
43 public CellEditor
createPropertyEditor(Composite parent
) {
44 CellEditor editor
= new ComboBoxCellEditor(parent
, labels
,
46 if (getValidator() != null) {
47 editor
.setValidator(getValidator());
49 ((CCombo
) editor
.getControl()).setVisibleItemCount(20);