@Nonnull public String getTaxonomyDisplayName() { return taxonomyPreferences.getTaxonomy().as(Displayable.class).getDisplayName(); }
tvName.setText(taxonomy.as(Displayable.class).getDisplayName()); x(tvDescription, "", taxonomy.as(Document.class), DublinCoreVocabulary.DC_DESCRIPTION); x2(tvLanguages, "Common names in: ", taxonomy.as(Document.class), KEY_LANGUAGE, _); x(tvLanguages, "Common names in: ", taxonomy.as(Document.class), KEY_LANGUAGE, _); x(tvPublisher, "Publisher: ", taxonomy.as(Document.class), DublinCoreVocabulary.DC_PUBLISHER); x(tvDate, "Publishing date: ", taxonomy.as(Document.class), KEY_DATE); x(tvAuthors, "Authors: ", taxonomy.as(Document.class), DublinCoreVocabulary.DC_CREATOR); x(tvLicense, "License: ", taxonomy.as(Document.class), DublinCoreVocabulary.DC_RIGHTS);
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Override public void setTaxonomy (final @Nonnull Taxonomy taxonomy) { logger.info("setTaxonomy(%s)", taxonomy); final Id taxonomyId = taxonomy.as(Identifiable.class).getId(); if (!taxonomyId.stringValue().equals(preferences.getString(TaxonomyPreferencesSupport.PREF_TAXONOMY, ""))) { final Editor editor = preferences.edit(); editor.putString(TaxonomyPreferencesSupport.PREF_TAXONOMY, taxonomyId.stringValue()); editor.commit(); } }
final String taxonomyName = taxonomyPreferences.get().getTaxonomy().as(Displayable.class).getDisplayName(); latestSortLocale = taxonomyPreferences.get().getTaxonomyLocales().get(0);
/******************************************************************************************************************* * * {@inheritDoc} * Eventually loads the data - remember that this is called both after the Activity creation and after a real * resume. While the activity was suspended, the user might have changed the Taxonomy or the sort order. which would * need some care be taken of. * ******************************************************************************************************************/ @Override protected void onResume() { logger.info("onResume()"); super.onResume(); final Taxonomy taxonomy = taxonomyPreferences.get().getTaxonomy(); final String newTaxonomyName = taxonomy.as(Displayable.class).getDisplayName(); logger.info(">>>> current taxonomy: %s new taxonomy: %s", currentTaxonomyName, newTaxonomyName); if ((currentTaxonomyName == null) || !currentTaxonomyName.equals(newTaxonomyName)) { currentTaxonomyName = newTaxonomyName; new LoadTaxonomyTask().execute(); } if ((controller != null) && controller.needsResorting()) { new EnsureTaxaSortedTask().execute(); } }