2 * Copyright (C) 2017 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.
9 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
11 import java
.util
.UUID
;
13 import org
.eclipse
.swt
.widgets
.Shell
;
15 import eu
.etaxonomy
.cdm
.api
.service
.IRightsService
;
16 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
17 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
18 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 public class RightsSelectionDialog
extends AbstractFilteredCdmResourceSelectionDialog
<Rights
> {
30 public static Rights
select(Shell shell
, //ConversationHolder conversation,
32 RightsSelectionDialog dialog
= new RightsSelectionDialog(shell
, //conversation,
33 "Choose Rights", false, RightsSelectionDialog
.class.getCanonicalName(), rights
);
34 return getSelectionFromDialog(dialog
);
38 * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
40 protected RightsSelectionDialog(Shell shell
, //ConversationHolder conversation,
42 boolean multi
, String settings
, Rights rights
) {
43 super(shell
, //conversation,
44 title
, multi
, settings
, rights
);
51 protected Rights
getPersistentObject(UUID uuid
) {
52 Object object
= CdmStore
.getService(IRightsService
.class).load(uuid
);
54 Rights rights
= (Rights
) HibernateProxyHelper
.deproxy(object
);
59 MessagingUtils
.error(this.getClass(), "Selected element is not rights", null);
67 protected String
[] getNewWizardText() {
75 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
76 // TODO Auto-generated method stub
84 protected void callService(String pattern
) {
85 model
= CdmStore
.getService(IRightsService
.class).getUuidAndLabelText(limitOfInitialElements
,pattern
);