import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.texteditor.IDocumentProvider;
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.api.service.IReferenceService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);
try {
- CdmApplicationController controller;
- controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+ ICdmApplicationConfiguration controller;
+ controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
//persistenceService.delete(object);
if (object instanceof SpecimenOrObservationBase){
lib/odfdom-0.8.jar,
lib/h2mig_pagestore_addon.jar,
lib/spring-security-remoting-3.1.3.RELEASE.jar
+Import-Package: eu.etaxonomy.cdm.api.application
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
+
//parent.removeChild(node);
- CdmApplicationController controller;
+ ICdmApplicationConfiguration controller;
- controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+ controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
IPolytomousKeyNodeService service = controller.getPolytomousKeyNodeService();
-
- service.delete(node, true);
-
+ if (node.getChildren().size()>0){
+ if(! MessageDialog.openQuestion(null, "Confirm deletion of children", "The selected node has children, do you want to delete them, too?")) {
+ service.delete(node, false);
+ }
+ } else{
+ service.delete(node, true);
+ }
return postExecute(null);
}
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
// Remove synonym from taxon
- CdmApplicationController controller;
+ ICdmApplicationConfiguration controller;
- controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+ controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
ITaxonService service = controller.getTaxonService();
if (synonym.getId() == 0){
import org.eclipse.ui.PartInitException;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
\r
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;\r
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
import eu.etaxonomy.cdm.api.service.ITaxonService;\r
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;\r
import eu.etaxonomy.cdm.model.taxon.Synonym;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;\r
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
bind();\r
\r
\r
- CdmApplicationController controller;\r
+ ICdmApplicationConfiguration controller;\r
\r
- controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();\r
+ controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();\r
\r
ITaxonService service = controller.getTaxonService();\r
try {\r
// $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.
*/
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
/**
* @created Jan 24, 2011
* @version 1.0
*/
-public class ConceptViewPart extends AbstractCdmEditorViewPart {
+public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails{
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept";
-
+
private ListViewer viewer;
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
showEmptyPage();
return;
}
-
+
if(part instanceof BulkEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof AbstractGraphKeyEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof MultiPageTaxonEditor){
if(! part.equals(this.part)){
IEditorInput input = ((IEditorPart) part).getEditorInput();
@Override
public void createViewer(Composite parent) {
viewer = new ListViewer(parent);
-
+
viewer.setContentProvider(new ConceptContentProvider());
viewer.setLabelProvider(new ConceptLabelProvider());
-
-
+
+
viewer.setSorter(new ConceptViewerSorter());
-
+
getSite().setSelectionProvider(viewer);
-
+
createMenu();
-
+
createToolbar();
}
-
+
private void createMenu(){
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
+
getSite().registerContextMenu(menuManager, viewer);
-
+
Control control = viewer.getControl();
Menu menu = menuManager.createContextMenu(control);
-
- control.setMenu(menu);
+
+ control.setMenu(menu);
}
-
+
private void createToolbar() {
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
// toolBarManager.add();
// toolBarManager.add();
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.editor.view.AbstractCdmEditorViewPart#changed(java.lang.Object)
*/
// $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.
*/
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive";
-
+
protected TreeViewer viewer;
-
+
protected Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache = new HashMap<TaxonDescription, FeatureNodeContainerTree>();
protected ToggleDescriptionAction showAllElementsAction;
protected ToggleDescriptionAction hideAllElementsAction;
protected int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
-
+
/** {@inheritDoc} */
@Override
public void createViewer(Composite parent) {
viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION));
- viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));
+ viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));
viewer.setLabelProvider(new DescriptiveLabelProvider());
viewer.setSorter(new DescriptiveViewerSorter());
viewer.setAutoExpandLevel(2);
this));
viewer.addDropSupport(dndOperations, transfers,
new DescriptionElementDropAdapter(viewer));
-
+
// Propagate selection from viewer
getSite().setSelectionProvider(viewer);
-
- showAllElementsAction = new ToggleDescriptionAction(false);
+
+ showAllElementsAction = new ToggleDescriptionAction(false);
hideAllElementsAction = new ToggleDescriptionAction(true);
-
+
// Add context menu to tree
createMenu();
-
+
createToolbar();
-
+
// set initial input
// if(getEditor() != null){
// viewer.setInput(getEditor().getEditorInput());
// }
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
*/
protected ISelection getInitialSelection() {
if(getEditor() != null){
return new StructuredSelection(getEditor().getEditorInput());
- }
-
+ }
+
return super.getInitialSelection();
}
toolBarManager.add(showAllElementsAction);
toolBarManager.add(hideAllElementsAction);
}
-
+
/*
* TODO add to the views menu
*/
protected void createMenu(){
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
+
getSite().registerContextMenu(menuManager, viewer);
// FIXME for some reason this is not working
menuManager.add(showAllElementsAction);
menuManager.add(hideAllElementsAction);
-
+
Control control = viewer.getControl();
Menu menu = menuManager.createContextMenu(control);
-
- control.setMenu(menu);
+
+ control.setMenu(menu);
}
/** {@inheritDoc} */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if(EditorUtil.getActiveEditor() == null){
showEmptyPage();
return;
}
-
+
if(part instanceof BulkEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof AbstractGraphKeyEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof DefinedTermEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof MultiPageTaxonEditor){
if(! part.equals(this.part)){
IEditorInput input = ((IEditorPart) part).getEditorInput();
showViewer();
}
}
-
+
/**
- *
+ *
* @author n.hoffmann
* @created May 28, 2010
* @version 1.0
*/
protected class ToggleDescriptionAction extends Action{
- private boolean expanded;
-
+ private final boolean expanded;
+
public ToggleDescriptionAction(boolean expand){
super(null, Action.AS_PUSH_BUTTON);
expanded = expand;
setImageAndTooltip();
}
-
+
private void setImageAndTooltip(){
setImageDescriptor(new ImageDescriptor() {
@Override
return ImageResources.getImage(resource).getImageData();
}
});
-
- String toolTipText = expanded ? "Collapse all" : "Show all descriptive data";
+
+ String toolTipText = expanded ? "Collapse all" : "Show all factual data";
setToolTipText(toolTipText);
}
-
+
@Override
public void run() {
if(expanded){
containerTree.buildTree();
}
viewer.refresh();
-
+
if(object instanceof DescriptionElementBase){
DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
DescriptionBase description = descriptionElement.getInDescription();
FeatureNodeContainerTree containerTree = featureNodeContainerCache.get(description);
-
+
FeatureNodeContainer featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement);
viewer.expandToLevel(featureNodeContainer, 1);
-
+
}
if(object != null){
*
* @return a boolean.
*/
- public boolean onComplete() {
+ @Override
+ public boolean onComplete() {
return false;
}
}
AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
} catch (Exception e) {
AbstractUtility.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
+ e.printStackTrace();
}
}
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.handlers.HandlerUtil;
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.IClassificationService;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.progress.IProgressConstants;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.io.common.IIoConfigurator;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
/**
* <p>
*
* @param applicationController
* a
- * {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
+ * {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
* object.
* @param <CONFIGURATOR>
* a CONFIGURATOR object.
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPart;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.io.common.CdmDefaultExport;
import eu.etaxonomy.cdm.io.common.IExportConfigurator;
import eu.etaxonomy.cdm.io.common.IIoConfigurator;
import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
import eu.etaxonomy.taxeditor.store.StoreUtil;
*
* @param applicationConfiguration
* a
- * {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
+ * {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
* object.
* @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object.
*/
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Display;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
*
* @param applicationConfiguration
* a
- * {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
+ * {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
* object.
* @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object.
*/
// $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.
*/
private NormalExplicitImportConfigurator configurator;
private ImportFromFileDataSourceWizardPage dataSourcePage;
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
*/
URI source = dataSourcePage.getUri();
configurator.setSource(source);
configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-
+
CdmStore.getImportManager().run(configurator);
-
+
return true;
}
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
/** {@inheritDoc} */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
super.init(workbench, selection);
configurator = CdmStore.getImportManager().NormalExplicitConfigurator();
}
@Override
public void addPages() {
super.addPages();
-
- dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose NormalExplicit",
- "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xls"});
+
+ dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose NormalExplicit",
+ "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xls" ,"*.xlsx", "*.*"});
addPage(dataSourcePage);
}
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.ext.ipni.IIpniService;
import eu.etaxonomy.cdm.ext.ipni.IpniService;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
if(SpecimenOrObservationType.Media.equals(specOrObsType) ||
((specOrObsType.getKindOf() != null) &&
specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
- return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
+ return MediaSpecimen.NewInstance(specOrObsType);
} else if (specOrObsType.equals(SpecimenOrObservationType.FieldUnit)) {
return FieldUnit.NewInstance();
} else {
MatchMatrix matchMatrix = findMatches(parsedName);
- resolveDuplicates(parsedName, matchMatrix);
+// resolveDuplicates(parsedName, matchMatrix);
return parsedName;
}
* @return A <code>List</code> of possibly matching TaxonNameBase's.
*/
private List<TaxonNameBase> findMatchingLatinNames(TaxonNameBase taxonNameBase) {
-
- try {
- return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
-
- } catch (MatchException e) {
- StoreUtil.error(this.getClass(), "Error finding matching names", e);
- }
+//
+// try {
+// return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
+//
+// } catch (MatchException e) {
+// StoreUtil.error(this.getClass(), "Error finding matching names", e);
+// }
return null;
}
}
/**
* 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.
*/
* <p>
* PreferencesUtil class.
* </p>
- *
+ *
* @author p.ciardelli
* @author n.hoffmann
* @created 05.12.2008
public class PreferencesUtil implements IPreferenceKeys {
/**
- *
+ *
*/
public static final String PREFERRED_TERMS_CHANGE = "preferred_terms";
* <p>
* getPreferenceStore
* </p>
- *
+ *
* @return a {@link org.eclipse.jface.preference.IPreferenceStore} object.
*/
public static IPreferenceStore getPreferenceStore() {
* <p>
* setPreferredNomenclaturalCode
* </p>
- *
+ *
* @param preferredCode
* a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode}
* object.
* <p>
* getPreferredNomenclaturalCode
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode} object.
*/
public static NomenclaturalCode getPreferredNomenclaturalCode() {
/**
* Get the match strategy for the given class that was stored in preferences
* or the default strategy if it was not stored in preferences
- *
+ *
* @param clazz
* a {@link java.lang.Class} object.
* @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
/**
* Stores a matchStrategy into the preference store.
- *
+ *
* @param matchStrategy
* a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy}
* object.
/**
* Helper method to create the preference property for a match field.
- *
+ *
* @param className
* @param fieldName
* @return
/**
* Returns the default match strategy for a given class.
- *
+ *
* @param clazz
* a {@link java.lang.Class} object.
* @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
* <p>
* getDateFormatPattern
* </p>
- *
+ *
* @return a {@link java.lang.String} object.
*/
public static String getDateFormatPattern() {
* <p>
* addTermToPreferredTerms
* </p>
- *
+ *
* @param term
* a T object.
* @param <T>
/**
* Construct a unique key using the CdmBase object's uuid
- *
+ *
* @param cdmBase
* @return
*/
}
return key;
}
-
+
/**
* Construct a unique key using the CdmBase object's uuid
- *
+ *
* @param cdmBase
* @return
*/
}
return key;
}
-
-
+
+
/**
* Construct a unique key using the CdmBase object's uuid
- *
+ *
* @param cdmBase
* @return
*/
/**
* Retrieves search preferences from the preference store
- *
+ *
* @return an {@link ITaxonServiceConfigurator} to pass to search methods
*/
public static IFindTaxaAndNamesConfigurator getSearchConfigurator() {
/**
* create new preferences, setting all search options to true
- *
+ *
* @return a
* {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
* object.
/**
* Store search preferences
- *
+ *
* @param configurator
* a
* {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
* <p>
* firePreferencesChanged
* </p>
- *
+ *
* @param clazz
* a {@link java.lang.Class} object.
*/
getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS,
true);
getPreferenceStore().setDefault(EDIT_MAP_SERVICE_ACCES_POINT,
- "http://edit.br.fgov.be/edit_wp5/v1/areas.php");
+ "http://edit.africamuseum.be/edit_wp5/v1.2/rest_gen.php");
//FIXME : changed default for SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
getPreferenceStore().setDefault(SHOULD_CONNECT_AT_STARTUP, false);
getPreferenceStore().setDefault(OPENURL_ACCESS_POINT,
* <p>
* getMapServiceAccessPoint
* </p>
- *
+ *
* @return a {@link java.lang.String} object.
*/
public static String getMapServiceAccessPoint() {
* <p>
* shouldConnectAtStartUp
* </p>
- *
+ *
* @return a boolean.
*/
public static boolean shouldConnectAtStartUp() {
- return getPreferenceStore().getBoolean(SHOULD_CONNECT_AT_STARTUP);
+ //FIXME : force SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
+ //return getPreferenceStore().getBoolean(SHOULD_CONNECT_AT_STARTUP);
+ return false;
}
/**
* <p>
* getDefaultFeatureTreeForTextualDescription
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.model.description.FeatureTree} object.
*/
public static FeatureTree getDefaultFeatureTreeForTextualDescription() {
* <p>
* getDefaultFeatureTreeForStructuredDescription
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.model.description.FeatureTree} object.
*/
public static FeatureTree getDefaultFeatureTreeForStructuredDescription() {
* <p>
* setSortRanksHierarchichally
* </p>
- *
+ *
* @param selection
* a boolean.
*/
* <p>
* getSortRanksHierarchichally
* </p>
- *
+ *
* @return a boolean.
*/
public static boolean getSortRanksHierarchichally() {
* <p>
* setEditMarkerTypePreference
* </p>
- *
+ *
* @param input
* a {@link org.eclipse.ui.IEditorInput} object.
* @param markerType
// $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.
*/
* @version 1.0
*/
public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<FeatureNodeContainer> {
-
+
private BrowserElement image;
-
+
/**
* <p>Constructor for FeatureDistributionDetailElement.</p>
*
String mapUriString = getMapUriString(getEntity());
image.setImageUriString(mapUriString);
formElement.getLayoutComposite().layout();
- message = mapUriString;
+ message = mapUriString;
return;
} else {
message = String.format("The service is not available: %s", serviceUriString);
} catch (URISyntaxException e) {
message = String.format("The URI has problems: %s", serviceUriString);
}
-
+
Label label = formFactory.createLabel(getLayoutComposite(), message, SWT.WRAP);
addControl(label);
label.setLayoutData(LayoutConstants.FILL(2, 1));
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
- //
+ //
}
/**
* @return
- * @throws URISyntaxException
+ * @throws URISyntaxException
*/
private String getMapUriString(FeatureNodeContainer container){
String accessPoint = PreferencesUtil.getMapServiceAccessPoint();
Map<PresenceAbsenceTermBase<?>, java.awt.Color> presenceAbsenceTermColors = null;
// FIXME due to a bug in the rest map service we have to ensure that width will always be an even number
- // image.calculateWidth() % 2 == 1 ? image.calculateWidth() + 1 :
+ // image.calculateWidth() % 2 == 1 ? image.calculateWidth() + 1 :
int width = image.calculateWidth();
-
- String bbox = "-180,-90,180,90";
- String backLayer = null;
+
+ String bbox = "-180,-90,180,90";
+ String backLayer = "earth";
List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
-
- String parameter = CdmStore.getGeoService().getDistributionServiceRequestParameterString(getTaxonDescriptions(), presenceAbsenceTermColors, width, 0, bbox, backLayer, languages);
-
+
+ String parameter = CdmStore.getGeoService().getDistributionServiceRequestParameterString(getTaxonDescriptions(),
+ false, false, null, presenceAbsenceTermColors, width, 0, bbox, backLayer, languages);
+
String mapUriString = String.format("%s?%s&ms=1000", accessPoint, parameter);
return mapUriString;
}
-
+
/**
* @return
*/
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.section.key;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
/**
* @author n.hoffmann
- *
+ *
*/
public class PolytomousKeyDetailElement extends
AbstractIdentifiableEntityDetailElement<PolytomousKey> {
+ private NumberWithLabelElement numberStartNumber;
+
public PolytomousKeyDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
toggleable_cache = formFactory.createToggleableTextField(formElement,
"Title Cache", entity.getTitleCache(),
entity.isProtectedTitleCache(), SWT.NULL);
+ numberStartNumber = formFactory.createNumberTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
}
-
+
public String getText() {
return toggleable_cache.getText();
}
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
* .lang.Object)
@Override
public void handleEvent(Object eventSource) {
handleToggleableCacheField();
+ if(eventSource==numberStartNumber){
+ getEntity().setStartNumber(numberStartNumber.getInteger());
+ }
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
}
checkbox_doubtful = formFactory.createCheckbox(formElement,
entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
- checkbox_published = formFactory.createCheckbox(formElement,
- "Taxon is published", ((TaxonBase) entity).isPublish(), style);
-
+ if (entity instanceof Taxon) {
+ checkbox_published = formFactory.createCheckbox(formElement,
+ "Taxon is published", ((Taxon) entity).isPublish(), style);
+ }
}
/** {@inheritDoc} */
} else if (eventSource == checkbox_unplaced) {
((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
} else if (eventSource == checkbox_published) {
- ((Taxon) getEntity()).setPublish(checkbox_published.getSelection());
+ ((Taxon)getEntity()).setPublish(checkbox_published.getSelection());
}
}
}
// $Id$
/**
* Copyright (C) 2009 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.
*/
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<TaxonRelationship> {
private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType;
-
+
private EntitySelectionElement<Taxon> selection_relatedTaxon;
-
+
+ private CheckboxElement checkBoxDoubtful;
+
public TaxonRelationshipDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
protected void createControls(ICdmFormElement formElement,
TaxonRelationship entity, int style) {
combo_taxonRelationshipType = formFactory.createTermComboElement(
- TaxonRelationshipTypeInverseContainer.class,
- formElement, "Relationship Type",
+ TaxonRelationshipTypeInverseContainer.class,
+ formElement, "Relationship Type",
getTaxonRelationshipTypeInverseContainer(), style);
combo_taxonRelationshipType.setEnabled(false);
selection_relatedTaxon = formFactory.createSelectionElement(
- Taxon.class, getConversationHolder(),
- formElement, "Related Taxon", getRelatedTaxon(),
+ Taxon.class, getConversationHolder(),
+ formElement, "Related Taxon", getRelatedTaxon(),
EntitySelectionElement.SELECTABLE, style);
+ checkBoxDoubtful = formFactory.createCheckbox(formElement, "Relation is doubtful", entity.isDoubtful(), style);
}
-
+
private Taxon getRelatedTaxon() {
return TaxonRelationshipTypeInverseContainer.RelatedTaxon(getSourceTaxon(), getEntity());
}
private TaxonRelationshipTypeInverseContainer getTaxonRelationshipTypeInverseContainer(){
return TaxonRelationshipTypeInverseContainer.CreateFromSource(getSourceTaxon(), getEntity());
}
-
+
private Taxon getSourceTaxon(){
IEditorInput editorInput = StoreUtil.getActiveEditorInput();
return (Taxon) editorInput.getAdapter(Taxon.class);
getEntity().setToTaxon(relatedTaxon);
}
}
+ else if(eventSource==checkBoxDoubtful){
+ getEntity().setDoubtful(checkBoxDoubtful.getSelection());
+ }
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
}
// $Id$\r
/**\r
* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
-* \r
+*\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;\r
\r
/**\r
* @author l.morris\r
*\r
*/\r
public class DefinedTermDetailElement<T extends DefinedTermBase> extends AbstractTermBaseDetailElement<T> {\r
- \r
+\r
+ protected TextWithLabelElement textIdInVocabulary;\r
+\r
/**\r
* @param formFactory\r
* @param formElement\r
super(formFactory, formElement);\r
}\r
\r
+ @Override\r
+ protected void createControls(ICdmFormElement formElement, T entity, int style) {\r
+ super.createControls(formElement, entity, style);\r
+ textIdInVocabulary = formFactory.createTextWithLabelElement(formElement, "ID in vocabulary", entity.getIdInVocabulary(), style);\r
+ };\r
+\r
/* (non-Javadoc)\r
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)\r
*/\r
@Override\r
public void handleEvent(Object eventSource) {\r
handleRepresentation(eventSource);\r
+ if(eventSource==textIdInVocabulary){\r
+ getEntity().setIdInVocabulary(textIdInVocabulary.getText());\r
+ }\r
}\r
\r
/* (non-Javadoc)\r
// $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.
*/
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.progress.IProgressConstants;
* @version 1.0
*/
public class UpdateDataSourceHandler extends AbstractDataSourceHandler {
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public boolean specificExecute(ExecutionEvent event) {
final CdmMetaDataAwareDataSourceContainer container = getSelectedDataSourceContainer(event);
-
+
final Display display = Display.getCurrent();
- if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to update the datasource?")){
+ if(! MessageDialog.open(MessageDialog.CONFIRM, HandlerUtil.getActiveShell(event), "Update Datasource", "WARNING!\n\n" +
+ "This will change your data base structure! Be sure you have an up-to-date backup of your data before running the update! \n\n " +
+ "Are you sure you want to update the datasource?", SWT.NONE)){
return false;
}
Job job = new Job("Updating datasource " + container.getDataSource().getName()){
protected IStatus run(IProgressMonitor monitor) {
CdmUpdater updater = new CdmUpdater();
IStatus status = null;
-
+
try{
if(updater.updateToCurrentVersion(container.getDataSource(), CdmProgressMonitorAdapter.CreateMonitor(monitor))){
display.asyncExec(new Runnable(){
@Override
public void run() {
-
+
CdmDataSourceViewPart view = (CdmDataSourceViewPart) StoreUtil.getView(CdmDataSourceViewPart.ID, false);
if(view != null){
view.getViewer().update(new CdmMetaDataAwareDataSourceContainer[]{container}, null);
}
-
+
}
});
status = Status.OK_STATUS;
status = new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, e.getMessage(), e);
StoreUtil.errorDialog("Could not run updater", getClass(), status);
}
-
-
+
+
return status;
}
-
+
};
-
+
job.setPriority(Job.BUILD);
job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
job.schedule();
-
+
return false;
}
}
<!-- <bean id="remoteTermInitializer" class="eu.etaxonomy.cdm.remote.service.RemoteTermInitializer"> \r
</bean> -->\r
\r
+ \r
+\r
+ \r
<import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/>\r
<import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml"/>\r
\r