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.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
12 import java
.util
.UUID
;
14 import org
.eclipse
.swt
.widgets
.Composite
;
15 import org
.eclipse
.swt
.widgets
.Control
;
16 import org
.eclipse
.swt
.widgets
.Shell
;
17 import org
.eclipse
.swt
.widgets
.Text
;
19 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
20 import eu
.etaxonomy
.cdm
.api
.service
.IClassificationService
;
21 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
22 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
23 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * FilteredClassificationSelectionDialog class.
31 * @created Sep 21, 2009
34 public class ClassificationSelectionDialog
extends
35 AbstractFilteredCdmResourceSelectionDialog
<Classification
> {
43 * a {@link org.eclipse.swt.widgets.Shell} object.
45 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
47 * @param curentSelection
48 * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
50 public static Classification
select(Shell shell
,
51 ConversationHolder conversation
, Classification curentSelection
) {
52 ClassificationSelectionDialog dialog
= new ClassificationSelectionDialog(
53 shell
, conversation
, "Choose a Classification", false, "", null);
54 return getSelectionFromDialog(dialog
);
59 * Constructor for FilteredClassificationSelectionDialog.
63 * a {@link org.eclipse.swt.widgets.Shell} object.
65 * a {@link java.lang.String} object.
69 * a {@link java.lang.String} object.
71 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
73 * @param classification
74 * a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
76 protected ClassificationSelectionDialog(Shell shell
,
77 ConversationHolder conversation
, String title
, boolean multi
,
78 String settings
, Classification classification
) {
79 super(shell
, conversation
, title
, multi
, settings
, classification
);
86 * org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea
87 * (org.eclipse.swt.widgets.Composite)
91 protected Control
createExtendedContentArea(Composite parent
) {
99 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
100 * #getPersistentObject(java.util.UUID)
104 protected Classification
getPersistentObject(UUID cdmUuid
) {
105 return CdmStore
.getService(IClassificationService
.class).load(cdmUuid
);
112 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
117 protected void initModel() {
118 Control control
= getPatternControl();
119 String pattern
= null;
120 if (control
!= null){
121 pattern
= ((Text
)control
).getText();
125 model
= CdmStore
.getService(IClassificationService
.class)
126 .getUuidAndTitleCache(limitOfInitialElements
, pattern
);
131 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
137 protected String
getNewWizardLinkText() {