4 package eu
.etaxonomy
.taxeditor
.propertysheet
;
8 import org
.eclipse
.jface
.viewers
.CellEditor
;
9 import org
.eclipse
.jface
.viewers
.DialogCellEditor
;
10 import org
.eclipse
.swt
.widgets
.Composite
;
11 import org
.eclipse
.swt
.widgets
.Control
;
12 import org
.eclipse
.swt
.widgets
.Dialog
;
13 import org
.eclipse
.ui
.views
.properties
.PropertyDescriptor
;
15 import eu
.etaxonomy
.cdm
.model
.description
.TaxonNameDescription
;
16 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
17 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
23 public abstract class ProtologuePropertyDescriptor
extends PropertyDescriptor
{
24 private TaxonNameDescription description
;
26 public ProtologuePropertyDescriptor(Object id
, String displayName
, TaxonNameDescription description
) {
27 super(id
, displayName
);
28 this.description
= description
;
31 public CellEditor
createPropertyEditor(Composite parent
) {
32 CellEditor editor
= new DialogCellEditor(parent
) {
34 protected Dialog dialog
;
37 protected Object
openDialogBox(
38 Control cellEditorWindow
) {
39 dialog
= new ProtologuesDialog(cellEditorWindow
.getShell(), description
);
40 Object result
= ((ProtologuesDialog
) dialog
).open();
41 if (result
instanceof Set
) {
43 Set
<TextData
> protologues
= (Set
<TextData
>) result
;
44 saveProtologue(protologues
);
45 return new ProtologuePropertySource(description
);
51 if (getValidator() != null) {
52 editor
.setValidator(getValidator());
57 abstract protected void saveProtologue(Set
<?
> set
);