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
.editor
.description
;
13 import java
.util
.HashSet
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.events
.MouseEvent
;
18 import org
.eclipse
.swt
.events
.MouseListener
;
19 import org
.eclipse
.swt
.widgets
.Button
;
20 import org
.eclipse
.swt
.widgets
.Composite
;
22 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
23 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
24 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
25 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
32 public class DistributionFeatureGroupComposite
extends DescriptionFeatureGroupComposite
implements MouseListener
{
34 private Set
<Distribution
> distributions
;
36 private Button showMapButton
;
38 public DistributionFeatureGroupComposite(TaxonDescriptionEditor editor
, Composite parent
,
39 TaxonDescription description
, Feature feature
) {
40 super(editor
, parent
, description
, feature
);
42 distributions
= new HashSet
<Distribution
>();
44 for(DescriptionElementBase descriptionElement
: description
.getElements()){
45 if(descriptionElement
.getFeature().equals(Feature
.DISTRIBUTION())){
46 distributions
.add((Distribution
) descriptionElement
);
50 showMapButton
= new Button(parent
, SWT
.PUSH
);
51 showMapButton
.setText("Show Map");
52 showMapButton
.addMouseListener(this);
56 * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
58 public void mouseUp(MouseEvent event
) {
59 if(event
.widget
== showMapButton
){
61 DistributionMapDialog dialog
= new DistributionMapDialog(editor
, this.getShell(), distributions
);
67 public void mouseDoubleClick(MouseEvent e
) {}
69 public void mouseDown(MouseEvent e
) {}