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
.ui
.dialog
.selection
;
13 import java
.util
.UUID
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.swt
.widgets
.Control
;
17 import org
.eclipse
.swt
.widgets
.Shell
;
18 import org
.eclipse
.swt
.widgets
.Text
;
20 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
21 import eu
.etaxonomy
.cdm
.api
.service
.IClassificationService
;
22 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
23 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
24 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 * FilteredClassificationSelectionDialog class.
32 * @created Sep 21, 2009
35 public class ClassificationSelectionDialog
extends
36 AbstractFilteredCdmResourceSelectionDialog
<Classification
> {
44 * a {@link org.eclipse.swt.widgets.Shell} object.
46 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
48 * @param curentSelection
49 * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
51 public static Classification
select(Shell shell
,
52 ConversationHolder conversation
, Classification curentSelection
) {
53 ClassificationSelectionDialog dialog
= new ClassificationSelectionDialog(
54 shell
, conversation
, "Choose a Classification", false, "", null);
55 return getSelectionFromDialog(dialog
);
60 * Constructor for FilteredClassificationSelectionDialog.
64 * a {@link org.eclipse.swt.widgets.Shell} object.
66 * a {@link java.lang.String} object.
70 * a {@link java.lang.String} object.
72 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
74 * @param classification
75 * a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
77 protected ClassificationSelectionDialog(Shell shell
,
78 ConversationHolder conversation
, String title
, boolean multi
,
79 String settings
, Classification classification
) {
80 super(shell
, conversation
, title
, multi
, settings
, classification
);
87 * org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea
88 * (org.eclipse.swt.widgets.Composite)
92 protected Control
createExtendedContentArea(Composite parent
) {
100 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
101 * #getPersistentObject(java.util.UUID)
105 protected Classification
getPersistentObject(UUID cdmUuid
) {
106 return CdmStore
.getService(IClassificationService
.class).load(cdmUuid
);
113 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
118 protected void initModel() {
119 Control control
= getPatternControl();
120 String pattern
= null;
121 if (control
!= null){
122 pattern
= ((Text
)control
).getText();
126 model
= CdmStore
.getService(IClassificationService
.class)
127 .getUuidAndTitleCache(limitOfInitialElements
, pattern
);
132 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
138 protected String
getNewWizardLinkText() {