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);
}
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);
}
Aggregations