Search in sources :

Example 1 with MTGCardsProvider

use of org.magic.api.interfaces.MTGCardsProvider in project MtgDesktopCompanion by nicho92.

the class SpeedConfigurator method save.

protected void save() {
    for (MTGCardsProvider prov : MTGControler.getInstance().getListProviders()) {
        prov.enable(false);
        if (prov.getName().equals(cboProvider.getSelectedItem().toString()))
            prov.enable(true);
        MTGControler.getInstance().setProperty(prov, prov.isEnable());
    }
    for (MTGDao prov : MTGControler.getInstance().getDaoProviders()) {
        prov.enable(false);
        if (prov.getName().equals(cboDAOs.getSelectedItem().toString()))
            prov.enable(true);
        MTGControler.getInstance().setProperty(prov, prov.isEnable());
    }
    for (MTGPictureProvider prov : MTGControler.getInstance().getPicturesProviders()) {
        prov.enable(false);
        if (prov.getName().equals(cboPictures.getSelectedItem().toString()))
            prov.enable(true);
        MTGControler.getInstance().setProperty(prov, prov.isEnable());
    }
    for (MTGPicturesCache prov : MTGControler.getInstance().getListCaches()) {
        prov.enable(false);
        if (prov.getName().equals(cboCaches.getSelectedItem().toString()))
            prov.enable(true);
        MTGControler.getInstance().setProperty(prov, prov.isEnable());
    }
    for (MTGDashBoard prov : MTGControler.getInstance().getDashBoards()) {
        prov.enable(false);
        if (prov.getName().equals(cboDashboard.getSelectedItem().toString()))
            prov.enable(true);
        MTGControler.getInstance().setProperty(prov, prov.isEnable());
    }
    System.exit(0);
}
Also used : MTGPictureProvider(org.magic.api.interfaces.MTGPictureProvider) MTGDao(org.magic.api.interfaces.MTGDao) MTGDashBoard(org.magic.api.interfaces.MTGDashBoard) MTGPicturesCache(org.magic.api.interfaces.MTGPicturesCache) MTGCardsProvider(org.magic.api.interfaces.MTGCardsProvider)

Aggregations

MTGCardsProvider (org.magic.api.interfaces.MTGCardsProvider)1 MTGDao (org.magic.api.interfaces.MTGDao)1 MTGDashBoard (org.magic.api.interfaces.MTGDashBoard)1 MTGPictureProvider (org.magic.api.interfaces.MTGPictureProvider)1 MTGPicturesCache (org.magic.api.interfaces.MTGPicturesCache)1