Search in sources :

Example 1 with ConfigurationGUISetup

use of net.viperfish.journal.framework.provider.ConfigurationGUISetup in project vsDiaryWriter by shilongdai.

the class ViperfishEncryptionProvider method registerConfig.

@Override
public void registerConfig() {
    ConfigurationGUISetup setup = new ConfigurationGUISetup() {

        @Override
        public void proccess(PreferenceManager mger) {
            PreferenceNode encryption = new PreferenceNode("compressMac", "Encryption", null, CompressMacPreference.class.getCanonicalName());
            PreferenceNode blockCipher = new PreferenceNode("blockcipher", "Block Cipher", null, BlockCipherPreferencePage.class.getCanonicalName());
            PreferenceNode streamCipher = new PreferenceNode("streamcipher", "Stream Cipher", null, StreamCipherPreferencePage.class.getCanonicalName());
            encryption.add(blockCipher);
            encryption.add(streamCipher);
            mger.addToRoot(encryption);
        }
    };
    PreferenceGUIManager.add(setup);
}
Also used : ConfigurationGUISetup(net.viperfish.journal.framework.provider.ConfigurationGUISetup) PreferenceNode(org.eclipse.jface.preference.PreferenceNode) PreferenceManager(org.eclipse.jface.preference.PreferenceManager)

Example 2 with ConfigurationGUISetup

use of net.viperfish.journal.framework.provider.ConfigurationGUISetup in project vsDiaryWriter by shilongdai.

the class JournalApplication method initModules.

/**
 * load all providers.
 *
 * This method loads all provider available.
 */
public static void initModules() {
    // prepare to load modules
    modules = new File("modules");
    CommonFunctions.initDir(modules);
    m = new PF4JModuleLoader();
    // put system configuration first
    ConfigurationGUISetup setup = new ConfigurationGUISetup() {

        @Override
        public void proccess(PreferenceManager mger) {
            PreferenceNode system = new PreferenceNode("system", "System", null, SystemPreferencePage.class.getCanonicalName());
            mger.addToRoot(system);
        }
    };
    PreferenceGUIManager.add(setup);
    // register the providers
    AuthManagers.INSTANCE.registerAuthProvider(new ViperfishAuthProvider());
    EntryDatabases.INSTANCE.registerEntryDatabaseProvider(new ViperfishEntryDatabaseProvider());
    Indexers.INSTANCE.registerIndexerProvider(new ViperfishIndexerProvider());
    JournalTransformers.INSTANCE.registerTransformerProvider(new ViperfishEncryptionProvider());
    // load third party
    m.loadModules(modules);
}
Also used : ConfigurationGUISetup(net.viperfish.journal.framework.provider.ConfigurationGUISetup) ViperfishEntryDatabaseProvider(net.viperfish.journal.dbProvider.ViperfishEntryDatabaseProvider) PreferenceNode(org.eclipse.jface.preference.PreferenceNode) ViperfishIndexerProvider(net.viperfish.journal.indexProvider.ViperfishIndexerProvider) ViperfishEncryptionProvider(net.viperfish.journal.secureProvider.ViperfishEncryptionProvider) ViperfishAuthProvider(net.viperfish.journal.authProvider.ViperfishAuthProvider) File(java.io.File) PreferenceManager(org.eclipse.jface.preference.PreferenceManager)

Aggregations

ConfigurationGUISetup (net.viperfish.journal.framework.provider.ConfigurationGUISetup)2 PreferenceManager (org.eclipse.jface.preference.PreferenceManager)2 PreferenceNode (org.eclipse.jface.preference.PreferenceNode)2 File (java.io.File)1 ViperfishAuthProvider (net.viperfish.journal.authProvider.ViperfishAuthProvider)1 ViperfishEntryDatabaseProvider (net.viperfish.journal.dbProvider.ViperfishEntryDatabaseProvider)1 ViperfishIndexerProvider (net.viperfish.journal.indexProvider.ViperfishIndexerProvider)1 ViperfishEncryptionProvider (net.viperfish.journal.secureProvider.ViperfishEncryptionProvider)1