Revision 720b900a
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AgentSelectionDialog.java | ||
---|---|---|
46 | 46 |
* |
47 | 47 |
*/ |
48 | 48 |
protected static final String TEAM = "Team"; |
49 |
|
|
50 |
protected static boolean selectTeamMember; |
|
49 | 51 |
|
50 | 52 |
/** |
51 | 53 |
* <p>select</p> |
... | ... | |
55 | 57 |
* @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object. |
56 | 58 |
* @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object. |
57 | 59 |
*/ |
58 |
public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) { |
|
60 |
public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity, boolean selectTeamMember) {
|
|
59 | 61 |
AgentSelectionDialog dialog = new AgentSelectionDialog(shell, conversation, |
60 |
"Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity); |
|
62 |
"Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity, selectTeamMember);
|
|
61 | 63 |
return getSelectionFromDialog(dialog); |
62 | 64 |
} |
63 | 65 |
|
... | ... | |
71 | 73 |
* @param multi a boolean. |
72 | 74 |
* @param settings a {@link java.lang.String} object. |
73 | 75 |
*/ |
74 |
protected AgentSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, String settings, AgentBase agent) { |
|
76 |
protected AgentSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, String settings, AgentBase agent, boolean selectTeamMember) {
|
|
75 | 77 |
super(shell, conversation, title, multi, settings, agent); |
78 |
this.selectTeamMember = selectTeamMember; |
|
76 | 79 |
} |
77 | 80 |
|
78 | 81 |
|
... | ... | |
122 | 125 |
/** {@inheritDoc} */ |
123 | 126 |
@Override |
124 | 127 |
protected String getNewWizardLinkText() { |
128 |
if (this.selectTeamMember){ |
|
129 |
return String.format("Create a new <a>%1s</a>", PERSON); |
|
130 |
} |
|
125 | 131 |
return String.format("Create a new <a>%1s</a> or <a>%2s</a>", TEAM, PERSON); |
126 | 132 |
} |
127 | 133 |
|
Also available in: Unified diff
fix #5977: create a new teammember should allow only persons