Search in sources :

Example 1 with CatalogBranding

use of org.eclipse.epp.internal.mpc.core.model.CatalogBranding in project epp.mpc by eclipse.

the class CatalogBrandingContentHandler method startElement.

@Override
public void startElement(String uri, String localName, Attributes attributes) {
    if (localName.equalsIgnoreCase("wizard")) {
        // $NON-NLS-1$
        model = new CatalogBranding();
        // $NON-NLS-1$
        model.setWizardTitle(attributes.getValue(NS_URI, "title"));
    } else if (localName.equalsIgnoreCase("icon")) {
        // $NON-NLS-1$
        capturingContent = true;
    } else if (localName.equalsIgnoreCase("searchtab")) {
        // $NON-NLS-1$
        // $NON-NLS-1$
        model.setHasSearchTab(toBoolean(attributes.getValue(NS_URI, "enabled")));
        capturingContent = true;
    } else if (localName.equalsIgnoreCase("populartab")) {
        // $NON-NLS-1$
        // $NON-NLS-1$
        model.setHasPopularTab(toBoolean(attributes.getValue(NS_URI, "enabled")));
        capturingContent = true;
    } else if (localName.equalsIgnoreCase("recenttab")) {
        // $NON-NLS-1$
        // $NON-NLS-1$
        model.setHasRecentTab(toBoolean(attributes.getValue(NS_URI, "enabled")));
        capturingContent = true;
    } else if (localName.equalsIgnoreCase("featuredmarkettab")) {
        // $NON-NLS-1$
        // $NON-NLS-1$
        model.setHasFeaturedMarketTab(toBoolean(attributes.getValue(NS_URI, "enabled")));
        capturingContent = true;
    } else if (localName.equalsIgnoreCase("relatedtab") || localName.equalsIgnoreCase("recommendationtab")) {
        // $NON-NLS-1$ //$NON-NLS-2$
        // $NON-NLS-1$
        model.setHasRelatedTab(toBoolean(attributes.getValue(NS_URI, "enabled")));
        capturingContent = true;
    } else if (localName.equalsIgnoreCase("favoritestab")) {
        // $NON-NLS-1$
        // $NON-NLS-1$
        model.setHasFavoritesTab(toBoolean(attributes.getValue(NS_URI, "enabled")));
        // $NON-NLS-1$
        model.setFavoritesServer(attributes.getValue(NS_URI, "apiserver"));
        // $NON-NLS-1$
        model.setFavoritesApiKey(attributes.getValue(NS_URI, "apikey"));
        capturingContent = true;
    }
}
Also used : CatalogBranding(org.eclipse.epp.internal.mpc.core.model.CatalogBranding)

Example 2 with CatalogBranding

use of org.eclipse.epp.internal.mpc.core.model.CatalogBranding in project epp.mpc by eclipse.

the class DefaultCatalogService method registerDynamicFavoritesService.

private void registerDynamicFavoritesService(Catalog catalog) {
    CatalogBranding branding = catalog.getBranding();
    if (branding == null) {
        return;
    }
    if (!branding.hasFavoritesTab()) {
        return;
    }
    String favoritesServer = branding.getFavoritesServer();
    if (favoritesServer != null && !"".equals(favoritesServer.trim())) {
        // $NON-NLS-1$
        registerDynamicFavoritesService(catalog.getUrl(), favoritesServer.trim(), branding.getFavoritesApiKey());
    }
}
Also used : CatalogBranding(org.eclipse.epp.internal.mpc.core.model.CatalogBranding)

Example 3 with CatalogBranding

use of org.eclipse.epp.internal.mpc.core.model.CatalogBranding in project epp.mpc by eclipse.

the class MarketplacePage method getDefaultBranding.

private ICatalogBranding getDefaultBranding() {
    CatalogBranding branding = new CatalogBranding();
    branding.setHasSearchTab(true);
    branding.setHasPopularTab(true);
    branding.setHasRecentTab(true);
    branding.setHasRelatedTab(false);
    branding.setHasFavoritesTab(false);
    branding.setHasFeaturedMarketTab(false);
    branding.setSearchTabName(Messages.MarketplacePage_search);
    branding.setPopularTabName(Messages.MarketplacePage_popular);
    branding.setRecentTabName(Messages.MarketplacePage_recent);
    branding.setRelatedTabName(Messages.MarketplacePage_related);
    branding.setFeaturedMarketTabName(Messages.MarketplacePage_featuredMarket);
    branding.setFavoritesTabName(Messages.MarketplacePage_favorites);
    branding.setWizardTitle(Messages.MarketplacePage_eclipseMarketplaceSolutions);
    branding.setWizardIcon(null);
    return branding;
}
Also used : ICatalogBranding(org.eclipse.epp.mpc.core.model.ICatalogBranding) CatalogBranding(org.eclipse.epp.internal.mpc.core.model.CatalogBranding)

Aggregations

CatalogBranding (org.eclipse.epp.internal.mpc.core.model.CatalogBranding)3 ICatalogBranding (org.eclipse.epp.mpc.core.model.ICatalogBranding)1