// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
*/
public class AgentSelectionDialog extends
AbstractFilteredCdmResourceSelectionDialog<AgentBase> {
-
+
/**
- *
+ *
*/
private static final String PERSON = "Person";
/**
- *
+ *
*/
private static final String TEAM = "Team";
"Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity);
return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredAgentSelectionDialog.</p>
*
protected AgentSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, String settings, AgentBase agent) {
super(shell, conversation, title, multi, settings, agent);
}
-
-
+
+
/**
* @author p.ciardelli
* @created 18.09.2009
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
- public String getText(Object element) {
+ @Override
+ public String getText(Object element) {
AgentBase agent = getCdmObjectByUuid(((UuidAndTitleCache<AgentBase>) element).getUuid());
if (agent instanceof INomenclaturalAuthor) {
- return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitle() + "'";
+ return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitle() + "'";
} else {
- return "'" + agent.getTitleCache() + "' is not a nomenclatural author.";
+ return "'" + agent.getTitleCache() + "' is not a nomenclatural author.";
}
}
}
protected String getNewWizardLinkText() {
return String.format("Create a new <a>%1s</a> or <a>%2s</a>", TEAM, PERSON);
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkSelectionListener()
*/
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return String.format("Click link to create a new <a>%1s</a>", "Collection ");
+ return String.format("Create a new <a>%1s</a>", "Collection ");
}
/* (non-Javadoc)
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
"Choose Unit", false, DerivedUnitSelectionDialog.class.getCanonicalName(), unit);
return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
*
boolean multi, String settings, DerivedUnit cdmObject) {
super(shell, conversation, title, multi, settings, cdmObject);
}
-
+
/** {@inheritDoc} */
@Override
protected DerivedUnit getPersistentObject(UUID uuid) {
Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
-
+
SpecimenOrObservationBase specimenObservationBase = (SpecimenOrObservationBase) HibernateProxyHelper.deproxy(object);
-
- if(specimenObservationBase instanceof DerivedUnit){
- return (DerivedUnit) specimenObservationBase;
+
+ if(specimenObservationBase instanceof DerivedUnit){
+ return (DerivedUnit) specimenObservationBase;
}
StoreUtil.error(this.getClass(), "Selected unit is not a derived unit", null);
- return null;
+ return null;
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click link to create a new <A>Unit</A>.";
+ return String.format("Create a new <a>%1s</a>", "Unit ");
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
*/
public class FeatureTreeSelectionDialog extends
AbstractFilteredCdmResourceSelectionDialog<FeatureTree> {
-
+
/**
* Creates a filtered selection dialog to select a named area.
*
"Choose a feature tree", false, featureTree);
return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredFeatureTreeSelectionDialog.</p>
*
FeatureTree cdmObject) {
super(shell, conversation, title, multi, FeatureTreeSelectionDialog.class.getCanonicalName(), cdmObject);
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
*/
@Override
protected void initModel() {
List<FeatureTree> featureTrees = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null);
-
+
if(model == null){
model = new ArrayList<UuidAndTitleCache<FeatureTree>>();
}
model.clear();
for(FeatureTree featureTree : featureTrees){
- UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(), featureTree.getTitleCache());
+ UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(), featureTree.getTitleCache());
model.add(element);
}
}
Link link = new Link(parent, SWT.NONE);
link.setText(getNewWizardLinkText());
link.addListener (SWT.Selection, new Listener () {
- public void handleEvent(Event event) {
-
+ @Override
+ public void handleEvent(Event event) {
+
FeatureTreeEditorWizard wizard = new FeatureTreeEditorWizard();
WizardDialog dialog = new WizardDialog(getShell(), wizard);
int status = dialog.open();
-
+
if (status == IStatus.OK) {
refresh();
}
});
return link;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
*/
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click <A>here</A> to create or edit a feature tree.";
+ return String.format("Create a new <a>%1s</a>" , "Feature tree ");
}
/* (non-Javadoc)
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
*/
public class FieldObservationSelectionDialog extends
AbstractFilteredCdmResourceSelectionDialog<FieldUnit> {
-
+
/**
* <p>select</p>
*
* @param settings a {@link java.lang.String} object.
* @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.FieldObservation} object.
*/
- protected FieldObservationSelectionDialog(Shell shell, ConversationHolder conversation,
+ protected FieldObservationSelectionDialog(Shell shell, ConversationHolder conversation,
String title, boolean multi, String settings,
FieldUnit cdmObject) {
super(shell, conversation, title, multi, settings, cdmObject);
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
*/
@Override
protected FieldUnit getPersistentObject(UUID uuid) {
Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
-
+
SpecimenOrObservationBase specimenObservationBase = (SpecimenOrObservationBase) HibernateProxyHelper.deproxy(object);
-
- if(specimenObservationBase instanceof FieldUnit){
- return (FieldUnit) specimenObservationBase;
+
+ if(specimenObservationBase instanceof FieldUnit){
+ return (FieldUnit) specimenObservationBase;
}
StoreUtil.error(this.getClass(), "Selected object is not a field observation", null);
return null;
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click link to create a new <A>Field Observation</A>.";
+ return String.format("Create a new <a>%1s</a>", "Field Observation ");
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
public class GrantedAuthoritySelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<GrantedAuthorityImpl> {
public static GrantedAuthority select(Shell shell, ConversationHolder conversation, GrantedAuthorityImpl authority){
-
+
GrantedAuthoritySelectionDialog dialog = new GrantedAuthoritySelectionDialog(shell, conversation,
"Choose Granted Authority", false, GrantedAuthoritySelectionDialog.class.getCanonicalName(), authority);
-
+
return getSelectionFromDialog(dialog);
}
-
+
/**
* @param shell
* @param conversation
@Override
protected void initModel() {
List<GrantedAuthorityImpl> authorities = CdmStore.getService(IGrantedAuthorityService.class).list(GrantedAuthorityImpl.class, null, null, null, null);
-
+
model = new ArrayList<UuidAndTitleCache<GrantedAuthorityImpl>>();
-
+
for(GrantedAuthorityImpl authority : authorities){
model.add(new UuidAndTitleCache<GrantedAuthorityImpl>(GrantedAuthorityImpl.class, authority.getUuid(),String.format("%s", authority.getAuthority())));
- }
+ }
}
/* (non-Javadoc)
*/
@Override
protected String getNewWizardLinkText() {
- return "Create a new <A>GrantedAuthority</A>.";
+ return String.format("Create a new <a>%1s</a>", "GrantedAuthority ");
}
/* (non-Javadoc)
protected GrantedAuthorityImpl getPersistentObject(UUID uuid) {
return CdmStore.getService(IGrantedAuthorityService.class).load(uuid);
}
-
+
@Override
protected String getTitle(GrantedAuthorityImpl authority) {
return authority != null ? authority.getAuthority() : "";
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
"Choose Group", false, GroupSelectionDialog.class.getCanonicalName(), group);
return getSelectionFromDialog(dialog);
}
-
+
/**
* @param shell
* @param conversation
@Override
protected void initModel() {
List<Group> groups = CdmStore.getService(IGroupService.class).list(Group.class, null, null, null, null);
-
+
model = new ArrayList<UuidAndTitleCache<Group>>();
-
+
for(Group group : groups){
model.add(new UuidAndTitleCache<Group>(Group.class, group.getUuid(),String.format("%s", group.getName())));
- }
+ }
}
/* (non-Javadoc)
*/
@Override
protected String getNewWizardLinkText() {
- return "Create a new <A>Group</A>.";
+ return String.format("Create a new <a>%1s</a>", "Group ");
}
/* (non-Javadoc)
protected Group getPersistentObject(UUID uuid) {
return CdmStore.getService(IGroupService.class).load(uuid);
}
-
+
@Override
protected String getTitle(Group group) {
return group != null ? group.getName() : "";
*/
@Override
protected String getNewWizardLinkText() {
- return "Create a new <a>Institution</a>.";
+ return String.format("Create a new <a>%1s</a>", "Institution ");
}
/* (non-Javadoc)
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
"Choose a name", false, name);
return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredNameSelectionDialog.</p>
*
/** {@inheritDoc} */
@Override
protected void initModel() {
- model = CdmStore.getService(INameService.class).getUuidAndTitleCache();
+ model = CdmStore.getService(INameService.class).getUuidAndTitleCache();
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click <A>here</A> to create a new name.";
+ return String.format("Create a new <a>%1s</a>", "Name ");
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
"Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team);
return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
*
boolean multi, String settings, Team agent) {
super(shell, conversation, title, multi, settings, agent);
}
-
+
/** {@inheritDoc} */
@Override
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click link to create a new <A>Team</A>.";
+ return String.format("Create a new <a>%1s</a>", "Team ");
}
/** {@inheritDoc} */
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
*/
public class PersonSelectionDialog extends
AbstractFilteredCdmResourceSelectionDialog<Person> {
-
+
/**
* <p>select</p>
*
public static Person select(Shell shell, ConversationHolder conversation, Person person){
PersonSelectionDialog dialog = new PersonSelectionDialog(shell, conversation,
"Choose a person", false, PersonSelectionDialog.class.getCanonicalName(), person);
- return getSelectionFromDialog(dialog);
+ return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredPersonSelectionDialog.</p>
*
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click link to create a new <A>Person</A>.";
+ return String.format("Create a new <a>%1s</a>", "Person ");
}
}
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click <A>here</A> to create a new reference.";
+ return String.format("Create a new <a>%1s</a>", "Reference ");
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
*/
public class TeamSelectionDialog extends
AbstractFilteredCdmResourceSelectionDialog<Team> {
-
+
/**
* <p>select</p>
*
"Choose Team", false, TeamSelectionDialog.class.getCanonicalName(), team);
return getSelectionFromDialog(dialog);
}
-
+
/**
* <p>Constructor for FilteredTeamSelectionDialog.</p>
*
/** {@inheritDoc} */
@Override
protected String getNewWizardLinkText() {
- return "Click link to create a new <A>Team</A>.";
+ return String.format("Create a new <a>%1s</a>", "Team ");
}
/** {@inheritDoc} */
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
AbstractFilteredCdmResourceSelectionDialog<User> {
/**
- *
+ *
* @param shell
* @param conversation
* @param user
"Choose User", false, UserSelectionDialog.class.getCanonicalName(), user);
return getSelectionFromDialog(dialog);
}
-
+
/**
* @param shell
* @param conversation
@Override
protected void initModel() {
List<User> users = CdmStore.getService(IUserService.class).list(User.class, null, null, null, null);
-
+
model = new ArrayList<UuidAndTitleCache<User>>();
-
+
for(User user : users){
model.add(new UuidAndTitleCache<User>(User.class, user.getUuid(),String.format("%s, %s", user.getUsername(), user.getPerson())));
- }
+ }
}
/* (non-Javadoc)
*/
@Override
protected String getNewWizardLinkText() {
- return "Create a new <A>User</A>.";
+ return String.format("Create a new <a>%1s</a>", "User ");
}
/* (non-Javadoc)
protected String getTitle(User user) {
return user != null ? user.getUsername() : "";
}
-
+
}