*
*/
protected static final String TEAM = "Team";
+
+ protected static boolean selectTeamMember;
/**
* <p>select</p>
* @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
* @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
*/
- public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) {
+ public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity, boolean selectTeamMember) {
AgentSelectionDialog dialog = new AgentSelectionDialog(shell, conversation,
- "Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity);
+ "Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity, selectTeamMember);
return getSelectionFromDialog(dialog);
}
* @param multi a boolean.
* @param settings a {@link java.lang.String} object.
*/
- protected AgentSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, String settings, AgentBase agent) {
+ protected AgentSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, String settings, AgentBase agent, boolean selectTeamMember) {
super(shell, conversation, title, multi, settings, agent);
+ this.selectTeamMember = selectTeamMember;
}
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
+ if (this.selectTeamMember){
+ return String.format("Create a new <a>%1s</a>", PERSON);
+ }
return String.format("Create a new <a>%1s</a> or <a>%2s</a>", TEAM, PERSON);
}
* @param agent
*/
protected NomenclaturalAuthorSelectionDialog(Shell shell, ConversationHolder conversation, String title,
- boolean multi, String settings, AgentBase agent) {
- super(shell, conversation, title, multi, settings, agent);
+ boolean multi, String settings, AgentBase agent, boolean teamMemberSelection) {
+ super(shell, conversation, title, multi, settings, agent, teamMemberSelection);
// TODO Auto-generated constructor stub
}
* @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
* @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
*/
- public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) {
+ public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity, boolean teamMemberSelection) {
NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, conversation,
- "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity);
+ "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity, teamMemberSelection);
return getSelectionFromDialog(dialog);
}
* @param agent
*/
protected NomenclaturalPersonAuthorSelectionDialog(Shell shell, ConversationHolder conversation, String title,
- boolean multi, String settings, AgentBase agent) {
- super(shell, conversation, title, multi, settings, agent);
+ boolean multi, String settings, AgentBase agent, boolean teamMemberSelection) {
+ super(shell, conversation, title, multi, settings, agent, teamMemberSelection);
// TODO Auto-generated constructor stub
}
* @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
* @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
*/
- public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) {
+ public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity, boolean teamMemberSelection) {
NomenclaturalPersonAuthorSelectionDialog dialog = new NomenclaturalPersonAuthorSelectionDialog(shell, conversation,
- "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity);
+ "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity,teamMemberSelection);
return getSelectionFromDialog(dialog);
}
return (T) TeamSelectionDialog.select(shell, conversation, (Team) currentSelection);
}
if(clazz.equals(TeamOrPersonBase.class) && parentElement instanceof AuthorshipDetailElement){
- return (T) NomenclaturalAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) NomenclaturalAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, false);
}else if(clazz.equals(TeamOrPersonBase.class)){
//TODO: add TeamOrPersonBaseSelectionDialog (see ticket #4545)
- return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, false);
}
if(clazz.equals(Person.class) && parentElement instanceof TeamMemberElement){
- return (T) NomenclaturalPersonAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) NomenclaturalPersonAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, true);
}
if(clazz.equals(AgentBase.class)){
- return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, false);
}
if(clazz.equals(Feature.class)){
return (T) FeatureSelectionDialog.select(shell, conversation, (Feature) currentSelection);