Revision f0a072ff
Added by Patrick Plitzner over 10 years ago
- aligned linkt text for creation of new elements via pop-up dialog
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AgentSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
35 | 35 |
*/ |
36 | 36 |
public class AgentSelectionDialog extends |
37 | 37 |
AbstractFilteredCdmResourceSelectionDialog<AgentBase> { |
38 |
|
|
38 |
|
|
39 | 39 |
/** |
40 |
*
|
|
40 |
* |
|
41 | 41 |
*/ |
42 | 42 |
private static final String PERSON = "Person"; |
43 | 43 |
/** |
44 |
*
|
|
44 |
* |
|
45 | 45 |
*/ |
46 | 46 |
private static final String TEAM = "Team"; |
47 | 47 |
|
... | ... | |
58 | 58 |
"Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity); |
59 | 59 |
return getSelectionFromDialog(dialog); |
60 | 60 |
} |
61 |
|
|
61 |
|
|
62 | 62 |
/** |
63 | 63 |
* <p>Constructor for FilteredAgentSelectionDialog.</p> |
64 | 64 |
* |
... | ... | |
72 | 72 |
protected AgentSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, String settings, AgentBase agent) { |
73 | 73 |
super(shell, conversation, title, multi, settings, agent); |
74 | 74 |
} |
75 |
|
|
76 |
|
|
75 |
|
|
76 |
|
|
77 | 77 |
/** |
78 | 78 |
* @author p.ciardelli |
79 | 79 |
* @created 18.09.2009 |
... | ... | |
83 | 83 |
/* (non-Javadoc) |
84 | 84 |
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) |
85 | 85 |
*/ |
86 |
public String getText(Object element) { |
|
86 |
@Override |
|
87 |
public String getText(Object element) { |
|
87 | 88 |
AgentBase agent = getCdmObjectByUuid(((UuidAndTitleCache<AgentBase>) element).getUuid()); |
88 | 89 |
if (agent instanceof INomenclaturalAuthor) { |
89 |
return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitle() + "'";
|
|
90 |
return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitle() + "'"; |
|
90 | 91 |
} else { |
91 |
return "'" + agent.getTitleCache() + "' is not a nomenclatural author.";
|
|
92 |
return "'" + agent.getTitleCache() + "' is not a nomenclatural author."; |
|
92 | 93 |
} |
93 | 94 |
} |
94 | 95 |
} |
... | ... | |
121 | 122 |
protected String getNewWizardLinkText() { |
122 | 123 |
return String.format("Create a new <a>%1s</a> or <a>%2s</a>", TEAM, PERSON); |
123 | 124 |
} |
124 |
|
|
125 |
|
|
125 | 126 |
/* (non-Javadoc) |
126 | 127 |
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkSelectionListener() |
127 | 128 |
*/ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CollectionSelectionDialog.java | ||
---|---|---|
85 | 85 |
/** {@inheritDoc} */ |
86 | 86 |
@Override |
87 | 87 |
protected String getNewWizardLinkText() { |
88 |
return String.format("Click link to create a new <a>%1s</a>", "Collection ");
|
|
88 |
return String.format("Create a new <a>%1s</a>", "Collection "); |
|
89 | 89 |
} |
90 | 90 |
|
91 | 91 |
/* (non-Javadoc) |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/DerivedUnitSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
47 | 47 |
"Choose Unit", false, DerivedUnitSelectionDialog.class.getCanonicalName(), unit); |
48 | 48 |
return getSelectionFromDialog(dialog); |
49 | 49 |
} |
50 |
|
|
50 |
|
|
51 | 51 |
/** |
52 | 52 |
* <p>Constructor for FilteredDerivedUnitSelectionDialog.</p> |
53 | 53 |
* |
... | ... | |
62 | 62 |
boolean multi, String settings, DerivedUnit cdmObject) { |
63 | 63 |
super(shell, conversation, title, multi, settings, cdmObject); |
64 | 64 |
} |
65 |
|
|
65 |
|
|
66 | 66 |
/** {@inheritDoc} */ |
67 | 67 |
@Override |
68 | 68 |
protected DerivedUnit getPersistentObject(UUID uuid) { |
69 | 69 |
Object object = CdmStore.getService(IOccurrenceService.class).load(uuid); |
70 |
|
|
70 |
|
|
71 | 71 |
SpecimenOrObservationBase specimenObservationBase = (SpecimenOrObservationBase) HibernateProxyHelper.deproxy(object); |
72 |
|
|
73 |
if(specimenObservationBase instanceof DerivedUnit){
|
|
74 |
return (DerivedUnit) specimenObservationBase;
|
|
72 |
|
|
73 |
if(specimenObservationBase instanceof DerivedUnit){ |
|
74 |
return (DerivedUnit) specimenObservationBase; |
|
75 | 75 |
} |
76 | 76 |
StoreUtil.error(this.getClass(), "Selected unit is not a derived unit", null); |
77 |
return null;
|
|
77 |
return null; |
|
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
/** {@inheritDoc} */ |
... | ... | |
92 | 92 |
/** {@inheritDoc} */ |
93 | 93 |
@Override |
94 | 94 |
protected String getNewWizardLinkText() { |
95 |
return "Click link to create a new <A>Unit</A>.";
|
|
95 |
return String.format("Create a new <a>%1s</a>", "Unit ");
|
|
96 | 96 |
} |
97 | 97 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
41 | 41 |
*/ |
42 | 42 |
public class FeatureTreeSelectionDialog extends |
43 | 43 |
AbstractFilteredCdmResourceSelectionDialog<FeatureTree> { |
44 |
|
|
44 |
|
|
45 | 45 |
/** |
46 | 46 |
* Creates a filtered selection dialog to select a named area. |
47 | 47 |
* |
... | ... | |
56 | 56 |
"Choose a feature tree", false, featureTree); |
57 | 57 |
return getSelectionFromDialog(dialog); |
58 | 58 |
} |
59 |
|
|
59 |
|
|
60 | 60 |
/** |
61 | 61 |
* <p>Constructor for FilteredFeatureTreeSelectionDialog.</p> |
62 | 62 |
* |
... | ... | |
71 | 71 |
FeatureTree cdmObject) { |
72 | 72 |
super(shell, conversation, title, multi, FeatureTreeSelectionDialog.class.getCanonicalName(), cdmObject); |
73 | 73 |
} |
74 |
|
|
74 |
|
|
75 | 75 |
/* (non-Javadoc) |
76 | 76 |
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID) |
77 | 77 |
*/ |
... | ... | |
88 | 88 |
@Override |
89 | 89 |
protected void initModel() { |
90 | 90 |
List<FeatureTree> featureTrees = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null); |
91 |
|
|
91 |
|
|
92 | 92 |
if(model == null){ |
93 | 93 |
model = new ArrayList<UuidAndTitleCache<FeatureTree>>(); |
94 | 94 |
} |
95 | 95 |
model.clear(); |
96 | 96 |
for(FeatureTree featureTree : featureTrees){ |
97 |
UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(), featureTree.getTitleCache());
|
|
97 |
UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(), featureTree.getTitleCache()); |
|
98 | 98 |
model.add(element); |
99 | 99 |
} |
100 | 100 |
} |
... | ... | |
108 | 108 |
Link link = new Link(parent, SWT.NONE); |
109 | 109 |
link.setText(getNewWizardLinkText()); |
110 | 110 |
link.addListener (SWT.Selection, new Listener () { |
111 |
public void handleEvent(Event event) { |
|
112 |
|
|
111 |
@Override |
|
112 |
public void handleEvent(Event event) { |
|
113 |
|
|
113 | 114 |
FeatureTreeEditorWizard wizard = new FeatureTreeEditorWizard(); |
114 | 115 |
WizardDialog dialog = new WizardDialog(getShell(), wizard); |
115 | 116 |
int status = dialog.open(); |
116 |
|
|
117 |
|
|
117 | 118 |
if (status == IStatus.OK) { |
118 | 119 |
refresh(); |
119 | 120 |
} |
... | ... | |
121 | 122 |
}); |
122 | 123 |
return link; |
123 | 124 |
} |
124 |
|
|
125 |
|
|
125 | 126 |
/* (non-Javadoc) |
126 | 127 |
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText() |
127 | 128 |
*/ |
128 | 129 |
/** {@inheritDoc} */ |
129 | 130 |
@Override |
130 | 131 |
protected String getNewWizardLinkText() { |
131 |
return "Click <A>here</A> to create or edit a feature tree.";
|
|
132 |
return String.format("Create a new <a>%1s</a>" , "Feature tree ");
|
|
132 | 133 |
} |
133 | 134 |
|
134 | 135 |
/* (non-Javadoc) |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FieldObservationSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
33 | 33 |
*/ |
34 | 34 |
public class FieldObservationSelectionDialog extends |
35 | 35 |
AbstractFilteredCdmResourceSelectionDialog<FieldUnit> { |
36 |
|
|
36 |
|
|
37 | 37 |
/** |
38 | 38 |
* <p>select</p> |
39 | 39 |
* |
... | ... | |
58 | 58 |
* @param settings a {@link java.lang.String} object. |
59 | 59 |
* @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.FieldObservation} object. |
60 | 60 |
*/ |
61 |
protected FieldObservationSelectionDialog(Shell shell, ConversationHolder conversation,
|
|
61 |
protected FieldObservationSelectionDialog(Shell shell, ConversationHolder conversation, |
|
62 | 62 |
String title, boolean multi, String settings, |
63 | 63 |
FieldUnit cdmObject) { |
64 | 64 |
super(shell, conversation, title, multi, settings, cdmObject); |
65 | 65 |
} |
66 |
|
|
66 |
|
|
67 | 67 |
/* (non-Javadoc) |
68 | 68 |
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID) |
69 | 69 |
*/ |
... | ... | |
71 | 71 |
@Override |
72 | 72 |
protected FieldUnit getPersistentObject(UUID uuid) { |
73 | 73 |
Object object = CdmStore.getService(IOccurrenceService.class).load(uuid); |
74 |
|
|
74 |
|
|
75 | 75 |
SpecimenOrObservationBase specimenObservationBase = (SpecimenOrObservationBase) HibernateProxyHelper.deproxy(object); |
76 |
|
|
77 |
if(specimenObservationBase instanceof FieldUnit){
|
|
78 |
return (FieldUnit) specimenObservationBase;
|
|
76 |
|
|
77 |
if(specimenObservationBase instanceof FieldUnit){ |
|
78 |
return (FieldUnit) specimenObservationBase; |
|
79 | 79 |
} |
80 | 80 |
StoreUtil.error(this.getClass(), "Selected object is not a field observation", null); |
81 | 81 |
return null; |
... | ... | |
99 | 99 |
/** {@inheritDoc} */ |
100 | 100 |
@Override |
101 | 101 |
protected String getNewWizardLinkText() { |
102 |
return "Click link to create a new <A>Field Observation</A>.";
|
|
102 |
return String.format("Create a new <a>%1s</a>", "Field Observation ");
|
|
103 | 103 |
} |
104 | 104 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
33 | 33 |
public class GrantedAuthoritySelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<GrantedAuthorityImpl> { |
34 | 34 |
|
35 | 35 |
public static GrantedAuthority select(Shell shell, ConversationHolder conversation, GrantedAuthorityImpl authority){ |
36 |
|
|
36 |
|
|
37 | 37 |
GrantedAuthoritySelectionDialog dialog = new GrantedAuthoritySelectionDialog(shell, conversation, |
38 | 38 |
"Choose Granted Authority", false, GrantedAuthoritySelectionDialog.class.getCanonicalName(), authority); |
39 |
|
|
39 |
|
|
40 | 40 |
return getSelectionFromDialog(dialog); |
41 | 41 |
} |
42 |
|
|
42 |
|
|
43 | 43 |
/** |
44 | 44 |
* @param shell |
45 | 45 |
* @param conversation |
... | ... | |
60 | 60 |
@Override |
61 | 61 |
protected void initModel() { |
62 | 62 |
List<GrantedAuthorityImpl> authorities = CdmStore.getService(IGrantedAuthorityService.class).list(GrantedAuthorityImpl.class, null, null, null, null); |
63 |
|
|
63 |
|
|
64 | 64 |
model = new ArrayList<UuidAndTitleCache<GrantedAuthorityImpl>>(); |
65 |
|
|
65 |
|
|
66 | 66 |
for(GrantedAuthorityImpl authority : authorities){ |
67 | 67 |
model.add(new UuidAndTitleCache<GrantedAuthorityImpl>(GrantedAuthorityImpl.class, authority.getUuid(),String.format("%s", authority.getAuthority()))); |
68 |
}
|
|
68 |
} |
|
69 | 69 |
} |
70 | 70 |
|
71 | 71 |
/* (non-Javadoc) |
... | ... | |
73 | 73 |
*/ |
74 | 74 |
@Override |
75 | 75 |
protected String getNewWizardLinkText() { |
76 |
return "Create a new <A>GrantedAuthority</A>.";
|
|
76 |
return String.format("Create a new <a>%1s</a>", "GrantedAuthority ");
|
|
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
/* (non-Javadoc) |
... | ... | |
91 | 91 |
protected GrantedAuthorityImpl getPersistentObject(UUID uuid) { |
92 | 92 |
return CdmStore.getService(IGrantedAuthorityService.class).load(uuid); |
93 | 93 |
} |
94 |
|
|
94 |
|
|
95 | 95 |
@Override |
96 | 96 |
protected String getTitle(GrantedAuthorityImpl authority) { |
97 | 97 |
return authority != null ? authority.getAuthority() : ""; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GroupSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
37 | 37 |
"Choose Group", false, GroupSelectionDialog.class.getCanonicalName(), group); |
38 | 38 |
return getSelectionFromDialog(dialog); |
39 | 39 |
} |
40 |
|
|
40 |
|
|
41 | 41 |
/** |
42 | 42 |
* @param shell |
43 | 43 |
* @param conversation |
... | ... | |
58 | 58 |
@Override |
59 | 59 |
protected void initModel() { |
60 | 60 |
List<Group> groups = CdmStore.getService(IGroupService.class).list(Group.class, null, null, null, null); |
61 |
|
|
61 |
|
|
62 | 62 |
model = new ArrayList<UuidAndTitleCache<Group>>(); |
63 |
|
|
63 |
|
|
64 | 64 |
for(Group group : groups){ |
65 | 65 |
model.add(new UuidAndTitleCache<Group>(Group.class, group.getUuid(),String.format("%s", group.getName()))); |
66 |
}
|
|
66 |
} |
|
67 | 67 |
} |
68 | 68 |
|
69 | 69 |
/* (non-Javadoc) |
... | ... | |
71 | 71 |
*/ |
72 | 72 |
@Override |
73 | 73 |
protected String getNewWizardLinkText() { |
74 |
return "Create a new <A>Group</A>.";
|
|
74 |
return String.format("Create a new <a>%1s</a>", "Group ");
|
|
75 | 75 |
} |
76 | 76 |
|
77 | 77 |
/* (non-Javadoc) |
... | ... | |
89 | 89 |
protected Group getPersistentObject(UUID uuid) { |
90 | 90 |
return CdmStore.getService(IGroupService.class).load(uuid); |
91 | 91 |
} |
92 |
|
|
92 |
|
|
93 | 93 |
@Override |
94 | 94 |
protected String getTitle(Group group) { |
95 | 95 |
return group != null ? group.getName() : ""; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/InstitutionSelectionDialog.java | ||
---|---|---|
76 | 76 |
*/ |
77 | 77 |
@Override |
78 | 78 |
protected String getNewWizardLinkText() { |
79 |
return "Create a new <a>Institution</a>.";
|
|
79 |
return String.format("Create a new <a>%1s</a>", "Institution ");
|
|
80 | 80 |
} |
81 | 81 |
|
82 | 82 |
/* (non-Javadoc) |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
45 | 45 |
"Choose a name", false, name); |
46 | 46 |
return getSelectionFromDialog(dialog); |
47 | 47 |
} |
48 |
|
|
48 |
|
|
49 | 49 |
/** |
50 | 50 |
* <p>Constructor for FilteredNameSelectionDialog.</p> |
51 | 51 |
* |
... | ... | |
74 | 74 |
/** {@inheritDoc} */ |
75 | 75 |
@Override |
76 | 76 |
protected void initModel() { |
77 |
model = CdmStore.getService(INameService.class).getUuidAndTitleCache();
|
|
77 |
model = CdmStore.getService(INameService.class).getUuidAndTitleCache(); |
|
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
/** {@inheritDoc} */ |
... | ... | |
86 | 86 |
/** {@inheritDoc} */ |
87 | 87 |
@Override |
88 | 88 |
protected String getNewWizardLinkText() { |
89 |
return "Click <A>here</A> to create a new name.";
|
|
89 |
return String.format("Create a new <a>%1s</a>", "Name ");
|
|
90 | 90 |
} |
91 | 91 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorTeamSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
44 | 44 |
"Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team); |
45 | 45 |
return getSelectionFromDialog(dialog); |
46 | 46 |
} |
47 |
|
|
47 |
|
|
48 | 48 |
/** |
49 | 49 |
* <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p> |
50 | 50 |
* |
... | ... | |
59 | 59 |
boolean multi, String settings, Team agent) { |
60 | 60 |
super(shell, conversation, title, multi, settings, agent); |
61 | 61 |
} |
62 |
|
|
62 |
|
|
63 | 63 |
/** {@inheritDoc} */ |
64 | 64 |
@Override |
65 | 65 |
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) { |
... | ... | |
69 | 69 |
/** {@inheritDoc} */ |
70 | 70 |
@Override |
71 | 71 |
protected String getNewWizardLinkText() { |
72 |
return "Click link to create a new <A>Team</A>.";
|
|
72 |
return String.format("Create a new <a>%1s</a>", "Team ");
|
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PersonSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
30 | 30 |
*/ |
31 | 31 |
public class PersonSelectionDialog extends |
32 | 32 |
AbstractFilteredCdmResourceSelectionDialog<Person> { |
33 |
|
|
33 |
|
|
34 | 34 |
/** |
35 | 35 |
* <p>select</p> |
36 | 36 |
* |
... | ... | |
42 | 42 |
public static Person select(Shell shell, ConversationHolder conversation, Person person){ |
43 | 43 |
PersonSelectionDialog dialog = new PersonSelectionDialog(shell, conversation, |
44 | 44 |
"Choose a person", false, PersonSelectionDialog.class.getCanonicalName(), person); |
45 |
return getSelectionFromDialog(dialog);
|
|
45 |
return getSelectionFromDialog(dialog); |
|
46 | 46 |
} |
47 |
|
|
47 |
|
|
48 | 48 |
/** |
49 | 49 |
* <p>Constructor for FilteredPersonSelectionDialog.</p> |
50 | 50 |
* |
... | ... | |
89 | 89 |
/** {@inheritDoc} */ |
90 | 90 |
@Override |
91 | 91 |
protected String getNewWizardLinkText() { |
92 |
return "Click link to create a new <A>Person</A>.";
|
|
92 |
return String.format("Create a new <a>%1s</a>", "Person ");
|
|
93 | 93 |
} |
94 | 94 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java | ||
---|---|---|
100 | 100 |
/** {@inheritDoc} */ |
101 | 101 |
@Override |
102 | 102 |
protected String getNewWizardLinkText() { |
103 |
return "Click <A>here</A> to create a new reference.";
|
|
103 |
return String.format("Create a new <a>%1s</a>", "Reference ");
|
|
104 | 104 |
} |
105 | 105 |
|
106 | 106 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TeamSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
30 | 30 |
*/ |
31 | 31 |
public class TeamSelectionDialog extends |
32 | 32 |
AbstractFilteredCdmResourceSelectionDialog<Team> { |
33 |
|
|
33 |
|
|
34 | 34 |
/** |
35 | 35 |
* <p>select</p> |
36 | 36 |
* |
... | ... | |
44 | 44 |
"Choose Team", false, TeamSelectionDialog.class.getCanonicalName(), team); |
45 | 45 |
return getSelectionFromDialog(dialog); |
46 | 46 |
} |
47 |
|
|
47 |
|
|
48 | 48 |
/** |
49 | 49 |
* <p>Constructor for FilteredTeamSelectionDialog.</p> |
50 | 50 |
* |
... | ... | |
79 | 79 |
/** {@inheritDoc} */ |
80 | 80 |
@Override |
81 | 81 |
protected String getNewWizardLinkText() { |
82 |
return "Click link to create a new <A>Team</A>.";
|
|
82 |
return String.format("Create a new <a>%1s</a>", "Team ");
|
|
83 | 83 |
} |
84 | 84 |
|
85 | 85 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/UserSelectionDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
33 | 33 |
AbstractFilteredCdmResourceSelectionDialog<User> { |
34 | 34 |
|
35 | 35 |
/** |
36 |
*
|
|
36 |
* |
|
37 | 37 |
* @param shell |
38 | 38 |
* @param conversation |
39 | 39 |
* @param user |
... | ... | |
44 | 44 |
"Choose User", false, UserSelectionDialog.class.getCanonicalName(), user); |
45 | 45 |
return getSelectionFromDialog(dialog); |
46 | 46 |
} |
47 |
|
|
47 |
|
|
48 | 48 |
/** |
49 | 49 |
* @param shell |
50 | 50 |
* @param conversation |
... | ... | |
64 | 64 |
@Override |
65 | 65 |
protected void initModel() { |
66 | 66 |
List<User> users = CdmStore.getService(IUserService.class).list(User.class, null, null, null, null); |
67 |
|
|
67 |
|
|
68 | 68 |
model = new ArrayList<UuidAndTitleCache<User>>(); |
69 |
|
|
69 |
|
|
70 | 70 |
for(User user : users){ |
71 | 71 |
model.add(new UuidAndTitleCache<User>(User.class, user.getUuid(),String.format("%s, %s", user.getUsername(), user.getPerson()))); |
72 |
}
|
|
72 |
} |
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
/* (non-Javadoc) |
... | ... | |
77 | 77 |
*/ |
78 | 78 |
@Override |
79 | 79 |
protected String getNewWizardLinkText() { |
80 |
return "Create a new <A>User</A>.";
|
|
80 |
return String.format("Create a new <a>%1s</a>", "User ");
|
|
81 | 81 |
} |
82 | 82 |
|
83 | 83 |
/* (non-Javadoc) |
... | ... | |
100 | 100 |
protected String getTitle(User user) { |
101 | 101 |
return user != null ? user.getUsername() : ""; |
102 | 102 |
} |
103 |
|
|
103 |
|
|
104 | 104 |
} |
Also available in: Unified diff