Merge branch 'develop' of https://dev.e-taxonomy.eu/git/taxeditor into actualBranch
authorU-BGBM\k.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Wed, 2 Sep 2015 09:34:32 +0000 (11:34 +0200)
committerU-BGBM\k.luther <k.luther@BGBM11732.bgbm.fu-berlin.de>
Wed, 2 Sep 2015 09:34:32 +0000 (11:34 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index c9350145261000221c842ae1127f8c5d96779a32..e87142c40ea62fbe582d74221d87aa1d5b932a1a 100644 (file)
@@ -168,7 +168,9 @@ public class EditorUtil extends AbstractUtility {
         }
                TaxonEditorInput input = TaxonEditorInput
                                .NewInstanceFromTaxonBase(taxonBaseUuid);
-               open(input);
+               if(input!=null){
+                   open(input);
+               }
        }
 
        /**
index 86609245a3571b0d1283dfd2b75e6977e441a567..9d828fb455d36b9a94c4fbefd695a12d73f2c5d5 100644 (file)
                   commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
                   label="%command.label.2"
                   style="push">
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="selection">
+                     <count
+                           value="+">
+                     </count>
+                  </with>
+               </visibleWhen>
             </command>
             <separator
                   name="eu.etaxonomy.navigation.menu.new.separator1"
                            definitionId="isSynonymNode">
                      </reference>
                   </not>
+                  <with
+                        variable="selection">
+                     <count
+                           value="+">
+                     </count>
+                  </with>
                </and>
             </visibleWhen>
          </command>
index 51409eb7ab32f33627d760f932108590391f33eb..1241f571fe803e28d4d546f5c2394032b890f7a1 100644 (file)
@@ -1,21 +1,21 @@
-CdmDataSourceViewPart_1=Datenquelle wird geladen\r
-CdmDataSourceViewPart_10=Server\r
-CdmDataSourceViewPart_11=Name\r
-CdmDataSourceViewPart_12=Verbunden\r
-CdmDataSourceViewPart_2=Notizen\r
-CdmDataSourceViewPart_3=Kompatibel\r
-CdmDataSourceViewPart_4=CDM Version\r
-CdmDataSourceViewPart_5=Erstellt\r
-CdmDataSourceViewPart_6=Nomenklaturcode\r
-CdmDataSourceViewPart_7=Datenquelle\r
-CdmDataSourceViewPart_8=Typ\r
-CdmDataSourceViewPart_9=Verf\u00FCgbar\r
-LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte wählen Sie die Standardsprache für den Taxonomischen Editor aus.\r
-LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten?\r
-LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten\r
-LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.\r
-OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.\r
-UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\!\r
-UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnt nicht geöffnet werden. URL is ung\u00FCtlig.\r
-UriWithLabelElement_INVALID_URL=Ung\u00FCltiger URL\r
+CdmDataSourceViewPart_1=Datenquelle wird geladen
+CdmDataSourceViewPart_10=Server
+CdmDataSourceViewPart_11=Name
+CdmDataSourceViewPart_12=Verbunden
+CdmDataSourceViewPart_2=Notizen
+CdmDataSourceViewPart_3=Kompatibel
+CdmDataSourceViewPart_4=CDM Version
+CdmDataSourceViewPart_5=Erstellt
+CdmDataSourceViewPart_6=Nomenklaturcode
+CdmDataSourceViewPart_7=Datenquelle
+CdmDataSourceViewPart_8=Typ
+CdmDataSourceViewPart_9=Verf\u00FCgbar
+LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte wählen Sie die Standardsprache für den Taxonomischen Editor aus.
+LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten?
+LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten
+LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.
+OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.
+UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\! 
+UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnt nicht geöffnet werden. URL is ung\u00FCtlig.
+UriWithLabelElement_INVALID_URL=Ung\u00FCltiger URL
 UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen 
\ No newline at end of file
index d913442dbe169b9969b31c31ad15e9a16dbd782f..1213418a592094bbbe9977831a7c19553513e8a0 100644 (file)
@@ -26,10 +26,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 
 /**
- * <p>
- * NonViralNameDetailElement class.
- * </p>
- *
  * @author n.hoffmann
  * @created May 20, 2010
  * @version 1.0
@@ -42,67 +38,40 @@ public class NonViralNameDetailElement extends
        private EnumComboElement<NomenclaturalCode> combo_nomenclaturalCode;
        private HybridDetailSection section_hybrid;
 
-       /**
-        * <p>
-        * Constructor for NonViralNameDetailElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        */
        public NonViralNameDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-        * (eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement,
-        * eu.etaxonomy.cdm.model.common.AnnotatableEntity, int)
-        */
        /** {@inheritDoc} */
        @Override
     protected void createControls(ICdmFormElement formElement, final NonViralName entity, int style) {
-           //name can be null in rare cases. Temporary solution for #4221. May be obsolete when
-           //#4393 (Make changing name of a taxon possible in details view) is implemented.
-           if(entity==null){
-               formFactory.createEmptyElement(formElement, "No name associated with this taxon.");
+           toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
+
+           combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+           combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+
+           //TODO RL
+           if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               toggleable_cache.setVisible(false);
+               combo_nomenclaturalCode.setVisible(false);
            }
-           else {
-               toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
-
-               combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
-               combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
-               //TODO RL
-               if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
-                   toggleable_cache.setVisible(false);
-                   combo_nomenclaturalCode.setVisible(false);
-               }
-
-               section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-               section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_name);
-               addElement(section_name);
-               section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-               section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_author);
-               addElement(section_author);
-
-               //TODO RL
-               if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
-                   section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
-                   section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-                   addControl(section_hybrid);
-                   addElement(section_hybrid);
-               }
+
+           section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           addControl(section_name);
+           addElement(section_name);
+           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           addControl(section_author);
+           addElement(section_author);
+
+           //TODO RL
+           if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+               section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+               addControl(section_hybrid);
+               addElement(section_hybrid);
            }
     }
 
@@ -156,13 +125,6 @@ public class NonViralNameDetailElement extends
                }
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-        * .lang.Object)
-        */
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
index 04bb9207f815a4499f01a543ce4c244d61ee157c..4856e3ff7f3ef99b55c64f1914f782c6273d5368 100644 (file)
@@ -204,7 +204,12 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         destroySections();
         if (input instanceof TaxonBase) {
-            createTaxonSections(rootElement);
+            if(((TaxonBase) input).getName()==null){
+                createEmptySection(rootElement);
+            }
+            else{
+                createTaxonSections(rootElement);
+            }
 
         } else if (input instanceof NonViralName) {
             createNameSections(rootElement);