import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.jface.viewers.IStructuredSelection;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
public static boolean isSynonymOrTaxonInHomotypicalGroupWithMoreSynonyms(Object selectedElement) {
if (isSynonym(selectedElement) || isAccepted(selectedElement)){
- TaxonBase<?> synonym = (TaxonBase<?>) selectedElement;
+ TaxonBase<?> synonym = HibernateProxyHelper.deproxy(selectedElement, TaxonBase.class);
return synonym.getHomotypicGroup().getTypifiedNames().size()>1;
}
return false;
@Override
public void changed(Object element) {
setDirty(true);
- //firePropertyChange(IEditorPart.PROP_DIRTY);
viewer.update(new TreeNode(element), null);
viewer.refresh();
}
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewer;
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
public static void refreshDetailsViewer(EPartService partService) {
if (getDetailsView(partService) != null) {
- ((AbstractCdmDataViewerE4) getDetailsView(partService).getViewer()).refresh();
+ ((AbstractCdmDataViewer) getDetailsView(partService).getViewer()).refresh();
}
}
public static void reflowDetailsViewer(EPartService partService) {
if (getDetailsView(partService) != null) {
- ((AbstractCdmDataViewerE4) getDetailsView(partService).getViewer()).reflow();
+ ((AbstractCdmDataViewer) getDetailsView(partService).getViewer()).reflow();
}
}
public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_STORE_PARTDESCRIPTOR_OCCURENCESEARCH = "eu.etaxonomy.taxeditor.store.partdescriptor.occurencesearch";
public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_STORE_PARTDESCRIPTOR_SEARCHDIALOG = "eu.etaxonomy.taxeditor.store.partdescriptor.SearchDialog";
public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_STORE_PARTDESCRIPTOR_TERMSEARCH = "eu.etaxonomy.taxeditor.store.partdescriptor.termsearch";
- public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4 = "eu.etaxonomy.taxeditor.view.dataimport.e4.GbifResponseImportViewE4";
- public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4 = "eu.etaxonomy.taxeditor.view.dataimport.e4.SpecimenImportViewE4";
+ public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4 = "eu.etaxonomy.taxeditor.view.dataimport.e4.GbifResponseImportView";
+ public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4 = "eu.etaxonomy.taxeditor.view.dataimport.e4.SpecimenImportView";
public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATASOURCE = "eu.etaxonomy.taxeditor.view.datasource";
public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_E4_DETAILS_DETAILSPARTE4 = "eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4";
public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_E4_SUPPLEMENTALDATA_SUPPLEMENTALDATAPARTE4 = "eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4";
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.StoreUtil;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewer;
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
IEclipseContext context = getFormFactory().getContext().getActiveChild();
DetailsPartE4 detailsView = AbstractUtility.getDetailsView(partService);
if(detailsView!=null){
- AbstractCdmDataViewerE4 viewer = (AbstractCdmDataViewerE4) detailsView.getViewer();
+ AbstractCdmDataViewer viewer = (AbstractCdmDataViewer) detailsView.getViewer();
if(viewer!=null){
viewer.reflow();
}
if(mPartSupplemental!=null){
SupplementalDataPartE4 supplementalPart = (SupplementalDataPartE4)mPartSupplemental.getObject();
if(supplementalPart!=null){
- AbstractCdmDataViewerE4 viewer = (AbstractCdmDataViewerE4) (supplementalPart).getViewer();
+ AbstractCdmDataViewer viewer = (AbstractCdmDataViewer) (supplementalPart).getViewer();
if(viewer!=null){
viewer.refresh();
}
*/
public void chooseViewer(Object input){
this.input = input;
- this.nameViewerMap = CdmViewerUtilE4.getAvailableViewers(input);
+ this.nameViewerMap = CdmViewerUtil.getAvailableViewers(input);
//if only one editor is available then open it
if(nameViewerMap.size()==1){
return;
}
- List<UuidAndTitleCache<? extends ICdmBase>> uuidTypes = CdmViewerUtilE4.transformSelectionToUuidAndTitleCacheList(selectedObject);
+ List<UuidAndTitleCache<? extends ICdmBase>> uuidTypes = CdmViewerUtil.transformSelectionToUuidAndTitleCacheList(selectedObject);
- Map<Command, String> enabledCommands = CdmViewerUtilE4.getAvailableViewers(uuidTypes, commandService, handlerService);
+ Map<Command, String> enabledCommands = CdmViewerUtil.getAvailableViewers(uuidTypes, commandService, handlerService);
//check if only one or multiple viewers/commands are available
if (!enabledCommands.isEmpty()){
* @author pplitzner
* @date Jul 7, 2015
*/
-public class CdmViewerUtilE4 {
+public class CdmViewerUtil {
/**
* Returns a map of available commands to open the given input. Keys are the
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermMediaSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewer;
/**
* The DetailsViewer handles the content of the details view (
* @author pplitzner
* @date 18.07.2017
*/
-public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
+public class DetailsViewerE4 extends AbstractCdmDataViewer {
private ISelection selection;
private boolean detailsEnabled = true;