Search in sources :

Example 1 with GUIOption

use of org.pentaho.di.core.gui.GUIOption in project pentaho-kettle by pentaho.

the class PropsUI method init.

@SuppressWarnings("unchecked")
protected synchronized void init() {
    super.createLogChannel();
    properties = new Properties();
    pluginHistory = new ArrayList<ObjectUsageCount>();
    setDefault();
    loadProps();
    addDefaultEntries();
    loadPluginHistory();
    loadScreens();
    loadLastUsedFiles();
    loadLastUsedRepoFiles();
    loadOpenTabFiles();
    resetRecentSearches();
    PluginRegistry registry = PluginRegistry.getInstance();
    List<PluginInterface> plugins = registry.getPlugins(LifecyclePluginType.class);
    List<GUIOption<Object>> leditables = new ArrayList<GUIOption<Object>>();
    for (PluginInterface plugin : plugins) {
        if (!plugin.getClassMap().keySet().contains(GUIOption.class)) {
            continue;
        }
        try {
            GUIOption<Object> loaded = registry.loadClass(plugin, GUIOption.class);
            if (loaded != null) {
                leditables.add(loaded);
            }
        } catch (ClassCastException cce) {
            // Not all Lifecycle plugins implement GUIOption, keep calm and carry on
            LogChannel.GENERAL.logDebug("Plugin " + plugin.getIds()[0] + " does not implement GUIOption, it will not be editable");
        } catch (Exception e) {
            LogChannel.GENERAL.logError("Unexpected error loading class for plugin " + plugin.getName(), e);
        }
    }
    editables = Collections.unmodifiableList(leditables);
}
Also used : ObjectUsageCount(org.pentaho.di.core.ObjectUsageCount) GUIOption(org.pentaho.di.core.gui.GUIOption) PluginInterface(org.pentaho.di.core.plugins.PluginInterface) ArrayList(java.util.ArrayList) Properties(java.util.Properties) ParseException(java.text.ParseException) PluginRegistry(org.pentaho.di.core.plugins.PluginRegistry)

Aggregations

ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 ObjectUsageCount (org.pentaho.di.core.ObjectUsageCount)1 GUIOption (org.pentaho.di.core.gui.GUIOption)1 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)1 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)1