Revision 30a27c33
Added by Andreas Kohlbecker over 10 years ago
.gitattributes | ||
---|---|---|
1152 | 1152 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewCollectionWizard.java -text |
1153 | 1153 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java -text |
1154 | 1154 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewFieldObservationWizard.java -text |
1155 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java -text |
|
1155 | 1156 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGroupWizard.java -text |
1156 | 1157 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java -text |
1157 | 1158 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java -text |
... | ... | |
1353 | 1354 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/operation/ChangeDescriptionElementType.java -text |
1354 | 1355 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java -text |
1355 | 1356 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailSection.java -text |
1356 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GrantedAuthorityDetailElement.java -text |
|
1357 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GrantedAuthorityDetailSection.java -text |
|
1357 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityCollectionElement.java -text |
|
1358 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailElement.java -text |
|
1359 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailSection.java -text |
|
1360 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailWizardPage.java -text |
|
1358 | 1361 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailElement.java -text |
1359 | 1362 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailSection.java -text |
1360 | 1363 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailWizardPage.java -text |
1364 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupSelectionElement.java -text |
|
1361 | 1365 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailElement.java -text |
1362 | 1366 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailSection.java -text |
1363 | 1367 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/GeographicalScopeDetailSection.java -text |
eu.etaxonomy.taxeditor.cdmlib/.classpath | ||
---|---|---|
114 | 114 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.13-SNAPSHOT-sources.jar"/> |
115 | 115 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.13-SNAPSHOT.jar"/> |
116 | 116 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT-sources.jar"/> |
117 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT.jar"/> |
|
117 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.13-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.0.13-SNAPSHOT-sources.jar"/>
|
|
118 | 118 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.13-SNAPSHOT-sources.jar"/> |
119 | 119 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.13-SNAPSHOT.jar"/> |
120 | 120 |
<classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.13-SNAPSHOT-sources.jar"/> |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.newWizard; |
|
12 |
|
|
13 |
import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService; |
|
14 |
import eu.etaxonomy.cdm.api.service.IGroupService; |
|
15 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
16 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
17 |
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailWizardPage; |
|
18 |
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailWizardPage; |
|
19 |
|
|
20 |
/** |
|
21 |
* @author a.kohlbecker |
|
22 |
* @created Sept 13 2012 |
|
23 |
*/ |
|
24 |
public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard<GrantedAuthorityImpl> { |
|
25 |
|
|
26 |
private GrantedAuthorityDetailWizardPage authorityPage; |
|
27 |
|
|
28 |
/* (non-Javadoc) |
|
29 |
* @see org.eclipse.jface.wizard.Wizard#addPages() |
|
30 |
*/ |
|
31 |
@Override |
|
32 |
public void addPages() { |
|
33 |
authorityPage = new GrantedAuthorityDetailWizardPage(formFactory, getConversationHolder(), getEntity()); |
|
34 |
super.addPage(authorityPage); |
|
35 |
} |
|
36 |
|
|
37 |
|
|
38 |
/* (non-Javadoc) |
|
39 |
* @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity() |
|
40 |
*/ |
|
41 |
@Override |
|
42 |
protected void saveEntity() { |
|
43 |
CdmStore.getService(IGrantedAuthorityService.class).saveOrUpdate(getEntity()); |
|
44 |
} |
|
45 |
|
|
46 |
/* (non-Javadoc) |
|
47 |
* @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#createNewEntity() |
|
48 |
*/ |
|
49 |
@Override |
|
50 |
protected GrantedAuthorityImpl createNewEntity() { |
|
51 |
return GrantedAuthorityImpl.NewInstance(); |
|
52 |
} |
|
53 |
|
|
54 |
/* (non-Javadoc) |
|
55 |
* @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#getEntityName() |
|
56 |
*/ |
|
57 |
@Override |
|
58 |
protected String getEntityName() { |
|
59 |
return "GrantedAuthority"; |
|
60 |
} |
|
61 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
25 | 25 |
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; |
26 | 26 |
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; |
27 |
import eu.etaxonomy.taxeditor.newWizard.NewGrantedAuthorityWizard; |
|
27 | 28 |
import eu.etaxonomy.taxeditor.newWizard.NewGroupWizard; |
28 | 29 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
29 | 30 |
|
... | ... | |
83 | 84 |
*/ |
84 | 85 |
@Override |
85 | 86 |
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) { |
86 |
return new NewGroupWizard();
|
|
87 |
return new NewGrantedAuthorityWizard();
|
|
87 | 88 |
} |
88 | 89 |
|
89 | 90 |
/* (non-Javadoc) |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java | ||
---|---|---|
16 | 16 |
import eu.etaxonomy.cdm.model.agent.Institution; |
17 | 17 |
import eu.etaxonomy.cdm.model.agent.Person; |
18 | 18 |
import eu.etaxonomy.cdm.model.agent.Team; |
19 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
19 | 20 |
import eu.etaxonomy.cdm.model.common.Group; |
20 | 21 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
21 | 22 |
import eu.etaxonomy.cdm.model.common.User; |
... | ... | |
101 | 102 |
if(clazz.equals(User.class)){ |
102 | 103 |
return (T) UserSelectionDialog.select(shell, conversation, (User) curentSelection); |
103 | 104 |
} |
105 |
if(clazz.equals(GrantedAuthorityImpl.class)){ |
|
106 |
return (T) GrantedAuthoritySelectionDialog.select(shell, conversation, (GrantedAuthorityImpl) curentSelection); |
|
107 |
} |
|
104 | 108 |
if (clazz.equals(Person.class)){ |
105 | 109 |
return (T) PersonSelectionDialog.select(shell, conversation, (Person) curentSelection); |
106 | 110 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java | ||
---|---|---|
49 | 49 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
50 | 50 |
import eu.etaxonomy.cdm.model.common.DescriptionElementSource; |
51 | 51 |
import eu.etaxonomy.cdm.model.common.Extension; |
52 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
52 | 53 |
import eu.etaxonomy.cdm.model.common.Group; |
53 | 54 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
54 | 55 |
import eu.etaxonomy.cdm.model.common.IDefinedTerm; |
... | ... | |
148 | 149 |
import eu.etaxonomy.taxeditor.ui.section.description.detail.TextDataDetailElement; |
149 | 150 |
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailElement; |
150 | 151 |
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection; |
151 |
import eu.etaxonomy.taxeditor.ui.section.group.GrantedAuthorityDetailElement; |
|
152 |
import eu.etaxonomy.taxeditor.ui.section.group.GrantedAuthorityDetailSection; |
|
152 |
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityCollectionElement; |
|
153 |
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailElement; |
|
154 |
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection; |
|
153 | 155 |
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailElement; |
154 | 156 |
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection; |
155 | 157 |
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailElement; |
... | ... | |
1373 | 1375 |
* |
1374 | 1376 |
*/ |
1375 | 1377 |
public static enum DetailType { |
1376 |
NONVIRALNAME, |
|
1377 |
SCIENTIFICNAME, |
|
1378 |
REFERENCEBASE, |
|
1379 |
NOMENCLATURALREFERENCE, |
|
1380 |
TAXONBASE, |
|
1381 | 1378 |
AUTHORSHIP, |
1382 |
TEAM, |
|
1383 |
PERSON, |
|
1379 |
CLASSIFICATION, |
|
1380 |
COLLECTION, |
|
1381 |
DERIVED_UNIT, |
|
1382 |
DERIVED_UNIT_FACADE, |
|
1383 |
DERIVED_UNIT_GENERAL, |
|
1384 | 1384 |
DESCRIPTION, |
1385 | 1385 |
DESCRIPTIONELEMENT, |
1386 |
PARSINGMESSAGE, |
|
1387 |
NAMERELATIONSHIP, |
|
1388 |
TEAMORPERSONBASE, |
|
1389 |
MEDIA, |
|
1386 |
DETERMINATION, |
|
1387 |
FEATURE_DISTRIBUTION, |
|
1390 | 1388 |
FIELD_OBSERVATION, |
1391 |
DERIVED_UNIT_FACADE, |
|
1392 | 1389 |
GATHERING_EVENT, |
1393 |
DERIVED_UNIT, |
|
1390 |
GRANTEDAUTHORITY, |
|
1391 |
GROUP, |
|
1392 |
HYBRID, |
|
1393 |
INSTITUTION, |
|
1394 |
MEDIA, |
|
1395 |
NAMED_AREA, |
|
1396 |
NAMED_AREA_LEVEL, |
|
1397 |
NAMERELATIONSHIP, |
|
1394 | 1398 |
NATURAL_LANGUAGE, |
1395 |
FEATURE_DISTRIBUTION,
|
|
1396 |
CLASSIFICATION,
|
|
1397 |
TAXON_NODE,
|
|
1398 |
COLLECTION,
|
|
1399 |
NOMENCLATURALREFERENCE,
|
|
1400 |
NONVIRALNAME,
|
|
1401 |
PARSINGMESSAGE,
|
|
1402 |
PERSON,
|
|
1399 | 1403 |
POLYTOMOUS_KEY, |
1400 | 1404 |
POLYTOMOUS_KEY_NODE, |
1401 |
INSTITUTION, |
|
1402 |
DERIVED_UNIT_GENERAL, |
|
1403 |
HYBRID, |
|
1404 |
USER, |
|
1405 |
GROUP, |
|
1406 |
DETERMINATION, |
|
1407 |
TAXON_RELATIONSHIP, |
|
1405 |
REFERENCEBASE, |
|
1408 | 1406 |
REFERENCED_ENTITY, |
1407 |
SCIENTIFICNAME, |
|
1408 |
TAXON_NODE, |
|
1409 |
TAXON_RELATIONSHIP, |
|
1410 |
TAXONBASE, |
|
1411 |
TEAM, |
|
1412 |
TEAMORPERSONBASE, |
|
1409 | 1413 |
TERM_VOCABULARY, |
1410 |
NAMED_AREA, |
|
1411 |
NAMED_AREA_LEVEL, |
|
1412 |
USE_RECORD |
|
1414 |
USE_RECORD, |
|
1415 |
USER |
|
1413 | 1416 |
} |
1414 | 1417 |
|
1415 | 1418 |
public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass, |
... | ... | |
1729 | 1732 |
case GROUP: |
1730 | 1733 |
element = new GroupDetailElement(this, parentElement); |
1731 | 1734 |
break; |
1735 |
case GRANTEDAUTHORITY: |
|
1736 |
element = new GrantedAuthorityDetailElement(this, parentElement); |
|
1737 |
break; |
|
1732 | 1738 |
case DETERMINATION: |
1733 | 1739 |
element = new DeterminationDetailElement(this, parentElement); |
1734 | 1740 |
break; |
... | ... | |
2083 | 2089 |
element = new MemberDetailElement(this, parentElement, |
2084 | 2090 |
(User) entity, removeListener, style); |
2085 | 2091 |
} else if (entity instanceof GrantedAuthority) { |
2086 |
element = new GrantedAuthorityDetailElement(this, parentElement,
|
|
2087 |
(GrantedAuthority) entity, removeListener, style); |
|
2092 |
element = new GrantedAuthorityCollectionElement(this, parentElement,
|
|
2093 |
(GrantedAuthorityImpl) entity, removeListener, style);
|
|
2088 | 2094 |
} else if (entity instanceof Group) { |
2089 | 2095 |
element = new GroupsByUserDetailElement(this, parentElement, |
2090 | 2096 |
(Group) entity, removeListener, style); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityCollectionElement.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2012 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority; |
|
12 |
|
|
13 |
import org.eclipse.swt.events.SelectionListener; |
|
14 |
import org.eclipse.swt.graphics.Color; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
17 |
import eu.etaxonomy.cdm.model.common.Group; |
|
18 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
|
19 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
20 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
21 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
|
22 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
23 |
|
|
24 |
/** |
|
25 |
* @author a.kohlbecker |
|
26 |
* @date Sept 12 2012 |
|
27 |
* |
|
28 |
*/ |
|
29 |
public class GrantedAuthorityCollectionElement extends AbstractEntityCollectionElement<GrantedAuthorityImpl> { |
|
30 |
|
|
31 |
private EntitySelectionElement<GrantedAuthorityImpl> selection_authority; |
|
32 |
|
|
33 |
|
|
34 |
public GrantedAuthorityCollectionElement(CdmFormFactory formFactory, |
|
35 |
AbstractFormSection section, GrantedAuthorityImpl entity, |
|
36 |
SelectionListener removeListener, int style) { |
|
37 |
super(formFactory, section, entity, removeListener, null, style); |
|
38 |
// TODO Auto-generated constructor stub |
|
39 |
} |
|
40 |
|
|
41 |
/* (non-Javadoc) |
|
42 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object) |
|
43 |
*/ |
|
44 |
@Override |
|
45 |
public void setEntity(GrantedAuthorityImpl entity) { |
|
46 |
selection_authority.setEntity(entity); |
|
47 |
|
|
48 |
} |
|
49 |
|
|
50 |
/* (non-Javadoc) |
|
51 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, int) |
|
52 |
*/ |
|
53 |
@Override |
|
54 |
public void createControls(ICdmFormElement element, int style) { |
|
55 |
selection_authority = formFactory.createSelectionElement( |
|
56 |
GrantedAuthorityImpl.class, getConversationHolder(), element, "", getEntity(), EntitySelectionElement.SELECTABLE, style); |
|
57 |
} |
|
58 |
|
|
59 |
/* (non-Javadoc) |
|
60 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object) |
|
61 |
*/ |
|
62 |
@Override |
|
63 |
public void handleEvent(Object eventSource) { |
|
64 |
if (eventSource == selection_authority) { |
|
65 |
setEntity(selection_authority.getEntity()); |
|
66 |
} |
|
67 |
} |
|
68 |
|
|
69 |
|
|
70 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailElement.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority; |
|
12 |
|
|
13 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
14 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
15 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
16 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
|
17 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; |
|
18 |
|
|
19 |
/** |
|
20 |
* @author n.hoffmann |
|
21 |
* @author a.kohlbecker |
|
22 |
* @created Mar 9, 2011 |
|
23 |
* @version 1.0 |
|
24 |
*/ |
|
25 |
public class GrantedAuthorityDetailElement extends AbstractCdmDetailElement<GrantedAuthorityImpl> { |
|
26 |
|
|
27 |
private TextWithLabelElement text_authority; |
|
28 |
|
|
29 |
/** |
|
30 |
* @param formFactory |
|
31 |
* @param formElement |
|
32 |
*/ |
|
33 |
public GrantedAuthorityDetailElement(CdmFormFactory formFactory, |
|
34 |
ICdmFormElement formElement) { |
|
35 |
super(formFactory, formElement); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
protected void createControls(ICdmFormElement formElement, |
|
40 |
GrantedAuthorityImpl entity, int style) { |
|
41 |
text_authority = formFactory.createTextWithLabelElement(formElement, "Authority", entity.getAuthority(), style); |
|
42 |
|
|
43 |
} |
|
44 |
|
|
45 |
@Override |
|
46 |
public void handleEvent(Object eventSource) { |
|
47 |
if(eventSource == text_authority){ |
|
48 |
getEntity().setAuthority(text_authority.getText()); |
|
49 |
} |
|
50 |
|
|
51 |
} |
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailSection.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority; |
|
12 |
|
|
13 |
import java.util.Collection; |
|
14 |
|
|
15 |
import org.springframework.security.core.GrantedAuthority; |
|
16 |
|
|
17 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
18 |
import eu.etaxonomy.cdm.model.common.Group; |
|
19 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
20 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.GrantedAuthoritySelectionDialog; |
|
21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
22 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
23 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; |
|
24 |
|
|
25 |
/** |
|
26 |
* @author n.hoffmann |
|
27 |
* @created Mar 9, 2011 |
|
28 |
* @version 1.0 |
|
29 |
*/ |
|
30 |
public class GrantedAuthorityDetailSection extends |
|
31 |
AbstractEntityCollectionSection<Group, GrantedAuthority> { |
|
32 |
|
|
33 |
/** |
|
34 |
* @param formFactory |
|
35 |
* @param conversation |
|
36 |
* @param parentElement |
|
37 |
* @param title |
|
38 |
* @param style |
|
39 |
*/ |
|
40 |
public GrantedAuthorityDetailSection(CdmFormFactory formFactory, |
|
41 |
ConversationHolder conversation, ICdmFormElement parentElement, |
|
42 |
int style) { |
|
43 |
super(formFactory, conversation, parentElement, "Granted Authorities", |
|
44 |
style); |
|
45 |
} |
|
46 |
|
|
47 |
/* |
|
48 |
* (non-Javadoc) |
|
49 |
* |
|
50 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
51 |
* getCollection(java.lang.Object) |
|
52 |
*/ |
|
53 |
@Override |
|
54 |
public Collection<GrantedAuthority> getCollection(Group entity) { |
|
55 |
return entity.getGrantedAuthorities(); |
|
56 |
} |
|
57 |
|
|
58 |
/* |
|
59 |
* (non-Javadoc) |
|
60 |
* |
|
61 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
62 |
* createNewElement() |
|
63 |
*/ |
|
64 |
@Override |
|
65 |
public GrantedAuthority createNewElement() { |
|
66 |
// StoreUtil |
|
67 |
// .warningDialog("Not implemented yet", getClass(), |
|
68 |
// "This functionality needs to be implemented in CDM Library first."); |
|
69 |
|
|
70 |
GrantedAuthority selection = GrantedAuthoritySelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null); |
|
71 |
return selection; |
|
72 |
} |
|
73 |
|
|
74 |
/* |
|
75 |
* (non-Javadoc) |
|
76 |
* |
|
77 |
* @see |
|
78 |
* eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement |
|
79 |
* (java.lang.Object) |
|
80 |
*/ |
|
81 |
@Override |
|
82 |
public void addElement(GrantedAuthority element) { |
|
83 |
getEntity().addGrantedAuthority(element); |
|
84 |
} |
|
85 |
|
|
86 |
/* |
|
87 |
* (non-Javadoc) |
|
88 |
* |
|
89 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
90 |
* removeElement(java.lang.Object) |
|
91 |
*/ |
|
92 |
@Override |
|
93 |
public void removeElement(GrantedAuthority element) { |
|
94 |
getEntity().removeGrantedAuthority(element); |
|
95 |
} |
|
96 |
|
|
97 |
/* |
|
98 |
* (non-Javadoc) |
|
99 |
* |
|
100 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
101 |
* getEmptyString() |
|
102 |
*/ |
|
103 |
@Override |
|
104 |
public String getEmptyString() { |
|
105 |
return "No Granted Authorities yet."; |
|
106 |
} |
|
107 |
|
|
108 |
/* |
|
109 |
* (non-Javadoc) |
|
110 |
* |
|
111 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
112 |
* getTooltipString() |
|
113 |
*/ |
|
114 |
@Override |
|
115 |
protected String getTooltipString() { |
|
116 |
return "Add a Granted Authority"; |
|
117 |
} |
|
118 |
|
|
119 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailWizardPage.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority; |
|
11 |
|
|
12 |
import org.eclipse.swt.SWT; |
|
13 |
|
|
14 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
15 |
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl; |
|
16 |
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage; |
|
17 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
18 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
19 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType; |
|
20 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; |
|
21 |
|
|
22 |
/** |
|
23 |
* @author a.kohlbecker |
|
24 |
* @created Sept 13 2012 |
|
25 |
*/ |
|
26 |
public class GrantedAuthorityDetailWizardPage extends AbstractCdmEntityWizardPage<GrantedAuthorityImpl> { |
|
27 |
|
|
28 |
public GrantedAuthorityDetailWizardPage(CdmFormFactory formFactory, |
|
29 |
ConversationHolder conversation, GrantedAuthorityImpl entity) { |
|
30 |
super(formFactory, conversation, entity); |
|
31 |
setTitle("GrantedAuthority"); |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public AbstractCdmDetailElement<GrantedAuthorityImpl> createElement( |
|
36 |
ICdmFormElement rootElement) { |
|
37 |
GrantedAuthorityDetailElement authorityElement = (GrantedAuthorityDetailElement) formFactory.createCdmDetailElement(DetailType.GRANTEDAUTHORITY, rootElement, SWT.NULL); |
|
38 |
authorityElement.setEntity(getEntity()); |
|
39 |
return authorityElement; |
|
40 |
} |
|
41 |
|
|
42 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GrantedAuthorityDetailElement.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.ui.section.group; |
|
12 |
|
|
13 |
import org.eclipse.swt.events.SelectionListener; |
|
14 |
import org.springframework.security.core.GrantedAuthority; |
|
15 |
|
|
16 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
|
17 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
18 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
19 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
|
20 |
|
|
21 |
/** |
|
22 |
* @author n.hoffmann |
|
23 |
* @created Mar 9, 2011 |
|
24 |
* @version 1.0 |
|
25 |
*/ |
|
26 |
public class GrantedAuthorityDetailElement extends AbstractEntityCollectionElement<GrantedAuthority> { |
|
27 |
|
|
28 |
/** |
|
29 |
* @param formFactory |
|
30 |
* @param section |
|
31 |
* @param entity |
|
32 |
* @param removeListener |
|
33 |
* @param backgroundColor |
|
34 |
* @param style |
|
35 |
*/ |
|
36 |
public GrantedAuthorityDetailElement(CdmFormFactory formFactory, |
|
37 |
AbstractFormSection section, GrantedAuthority entity, |
|
38 |
SelectionListener removeListener, int style) { |
|
39 |
super(formFactory, section, entity, removeListener, null, style); |
|
40 |
} |
|
41 |
|
|
42 |
/* (non-Javadoc) |
|
43 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object) |
|
44 |
*/ |
|
45 |
@Override |
|
46 |
public void setEntity(GrantedAuthority entity) { |
|
47 |
// TODO Auto-generated method stub |
|
48 |
|
|
49 |
} |
|
50 |
|
|
51 |
/* (non-Javadoc) |
|
52 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, int) |
|
53 |
*/ |
|
54 |
@Override |
|
55 |
public void createControls(ICdmFormElement element, int style) { |
|
56 |
// TODO Auto-generated method stub |
|
57 |
|
|
58 |
} |
|
59 |
|
|
60 |
/* (non-Javadoc) |
|
61 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object) |
|
62 |
*/ |
|
63 |
@Override |
|
64 |
public void handleEvent(Object eventSource) { |
|
65 |
// TODO Auto-generated method stub |
|
66 |
|
|
67 |
} |
|
68 |
|
|
69 |
|
|
70 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GrantedAuthorityDetailSection.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.ui.section.group; |
|
12 |
|
|
13 |
import java.util.Collection; |
|
14 |
|
|
15 |
import org.springframework.security.core.GrantedAuthority; |
|
16 |
|
|
17 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
18 |
import eu.etaxonomy.cdm.model.common.Group; |
|
19 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
20 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.GrantedAuthoritySelectionDialog; |
|
21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
22 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
23 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; |
|
24 |
|
|
25 |
/** |
|
26 |
* @author n.hoffmann |
|
27 |
* @created Mar 9, 2011 |
|
28 |
* @version 1.0 |
|
29 |
*/ |
|
30 |
public class GrantedAuthorityDetailSection extends |
|
31 |
AbstractEntityCollectionSection<Group, GrantedAuthority> { |
|
32 |
|
|
33 |
/** |
|
34 |
* @param formFactory |
|
35 |
* @param conversation |
|
36 |
* @param parentElement |
|
37 |
* @param title |
|
38 |
* @param style |
|
39 |
*/ |
|
40 |
public GrantedAuthorityDetailSection(CdmFormFactory formFactory, |
|
41 |
ConversationHolder conversation, ICdmFormElement parentElement, |
|
42 |
int style) { |
|
43 |
super(formFactory, conversation, parentElement, "Granted Authorities", |
|
44 |
style); |
|
45 |
} |
|
46 |
|
|
47 |
/* |
|
48 |
* (non-Javadoc) |
|
49 |
* |
|
50 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
51 |
* getCollection(java.lang.Object) |
|
52 |
*/ |
|
53 |
@Override |
|
54 |
public Collection<GrantedAuthority> getCollection(Group entity) { |
|
55 |
return entity.getGrantedAuthorities(); |
|
56 |
} |
|
57 |
|
|
58 |
/* |
|
59 |
* (non-Javadoc) |
|
60 |
* |
|
61 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
62 |
* createNewElement() |
|
63 |
*/ |
|
64 |
@Override |
|
65 |
public GrantedAuthority createNewElement() { |
|
66 |
// StoreUtil |
|
67 |
// .warningDialog("Not implemented yet", getClass(), |
|
68 |
// "This functionality needs to be implemented in CDM Library first."); |
|
69 |
|
|
70 |
GrantedAuthority selection = GrantedAuthoritySelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null); |
|
71 |
return selection; |
|
72 |
} |
|
73 |
|
|
74 |
/* |
|
75 |
* (non-Javadoc) |
|
76 |
* |
|
77 |
* @see |
|
78 |
* eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement |
|
79 |
* (java.lang.Object) |
|
80 |
*/ |
|
81 |
@Override |
|
82 |
public void addElement(GrantedAuthority element) { |
|
83 |
getEntity().addGrantedAuthority(element); |
|
84 |
} |
|
85 |
|
|
86 |
/* |
|
87 |
* (non-Javadoc) |
|
88 |
* |
|
89 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
90 |
* removeElement(java.lang.Object) |
|
91 |
*/ |
|
92 |
@Override |
|
93 |
public void removeElement(GrantedAuthority element) { |
|
94 |
getEntity().removeGrantedAuthority(element); |
|
95 |
} |
|
96 |
|
|
97 |
/* |
|
98 |
* (non-Javadoc) |
|
99 |
* |
|
100 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
101 |
* getEmptyString() |
|
102 |
*/ |
|
103 |
@Override |
|
104 |
public String getEmptyString() { |
|
105 |
return "No Granted Authorities yet."; |
|
106 |
} |
|
107 |
|
|
108 |
/* |
|
109 |
* (non-Javadoc) |
|
110 |
* |
|
111 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection# |
|
112 |
* getTooltipString() |
|
113 |
*/ |
|
114 |
@Override |
|
115 |
protected String getTooltipString() { |
|
116 |
return "Add a Granted Authority"; |
|
117 |
} |
|
118 |
|
|
119 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupSelectionElement.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2012 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
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. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.ui.section.group; |
|
11 |
|
|
12 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
13 |
import eu.etaxonomy.cdm.model.common.Group; |
|
14 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
15 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
16 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author a.kohlbecker |
|
20 |
* |
|
21 |
*/ |
|
22 |
public class GroupSelectionElement extends EntitySelectionElement<Group> { |
|
23 |
|
|
24 |
public GroupSelectionElement(CdmFormFactory formFactory, |
|
25 |
ConversationHolder conversation, ICdmFormElement parentElement, |
|
26 |
String labelString, Group entity, int mode, |
|
27 |
int style) { |
|
28 |
super(formFactory, conversation, parentElement, Group.class, labelString, entity, |
|
29 |
mode, style); |
|
30 |
} |
|
31 |
|
|
32 |
/* (non-Javadoc) |
|
33 |
* @see eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement#getTitle() |
|
34 |
*/ |
|
35 |
@Override |
|
36 |
protected String getTitle() { |
|
37 |
if (getEntity() != null) { |
|
38 |
return getEntity().getName(); |
|
39 |
} |
|
40 |
return super.getTitle(); |
|
41 |
} |
|
42 |
|
|
43 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/GroupsByUserDetailElement.java | ||
---|---|---|
56 | 56 |
public void createControls(ICdmFormElement element, int style) { |
57 | 57 |
selection_group = formFactory |
58 | 58 |
.createSelectionElement(Group.class, |
59 |
getConversationHolder(), element, "Group", getEntity(),
|
|
59 |
getConversationHolder(), element, "", getEntity(), |
|
60 | 60 |
EntitySelectionElement.NOTHING, style); |
61 | 61 |
} |
62 | 62 |
|
... | ... | |
70 | 70 |
@Override |
71 | 71 |
public void handleEvent(Object eventSource) { |
72 | 72 |
if (eventSource == selection_group) { |
73 |
|
|
73 |
setEntity(selection_group.getEntity()); |
|
74 | 74 |
} |
75 | 75 |
} |
76 | 76 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java | ||
---|---|---|
14 | 14 |
import org.eclipse.swt.widgets.Composite; |
15 | 15 |
import org.eclipse.swt.widgets.Label; |
16 | 16 |
import org.eclipse.swt.widgets.Shell; |
17 |
import org.springframework.security.core.GrantedAuthority; |
|
17 | 18 |
|
18 | 19 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
19 | 20 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
20 | 21 |
import eu.etaxonomy.cdm.common.CdmUtils; |
22 |
import eu.etaxonomy.cdm.model.common.Group; |
|
21 | 23 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
22 | 24 |
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity; |
23 | 25 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
... | ... | |
289 | 291 |
* @return a {@link java.lang.String} object. |
290 | 292 |
*/ |
291 | 293 |
protected String getTitle() { |
292 |
if (entity != null && entity instanceof IIdentifiableEntity) { |
|
293 |
return ((IIdentifiableEntity) entity).getTitleCache(); |
|
294 |
if (entity != null){ |
|
295 |
if(entity instanceof IIdentifiableEntity) { |
|
296 |
return ((IIdentifiableEntity) entity).getTitleCache(); |
|
297 |
} else if(entity instanceof Group){ |
|
298 |
return ((Group) entity).getName(); |
|
299 |
} else if(entity instanceof GrantedAuthority){ |
|
300 |
return ((GrantedAuthority) entity).getAuthority(); |
|
301 |
} |
|
294 | 302 |
} |
295 | 303 |
return ""; |
296 | 304 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java | ||
---|---|---|
66 | 66 |
import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection; |
67 | 67 |
import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection; |
68 | 68 |
import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection; |
69 |
import eu.etaxonomy.taxeditor.ui.section.group.GrantedAuthorityDetailSection;
|
|
69 |
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
|
|
70 | 70 |
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection; |
71 | 71 |
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection; |
72 | 72 |
import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection; |
Also available in: Unified diff
solved #2990 (implement missing parts of Groups admin details view)