Search in sources :

Example 1 with SubjectDataBrowserDialog

use of org.pentaho.di.ui.core.dialog.SubjectDataBrowserDialog in project pentaho-kettle by pentaho.

the class Spoon method showPluginInfo.

/**
 * Show a plugin browser
 */
public void showPluginInfo() {
    try {
        // First we collect information concerning all the plugin types...
        // 
        Map<String, RowMetaInterface> metaMap = new HashMap<>();
        Map<String, List<Object[]>> dataMap = new HashMap<>();
        PluginRegistry registry = PluginRegistry.getInstance();
        List<Class<? extends PluginTypeInterface>> pluginTypeClasses = registry.getPluginTypes();
        for (Class<? extends PluginTypeInterface> pluginTypeClass : pluginTypeClasses) {
            PluginTypeInterface pluginTypeInterface = registry.getPluginType(pluginTypeClass);
            if (pluginTypeInterface.isFragment()) {
                continue;
            }
            String subject = pluginTypeInterface.getName();
            RowBuffer pluginInformation = registry.getPluginInformation(pluginTypeClass);
            metaMap.put(subject, pluginInformation.getRowMeta());
            dataMap.put(subject, pluginInformation.getBuffer());
        }
        // Now push it all to a subject data browser...
        // 
        SubjectDataBrowserDialog dialog = new SubjectDataBrowserDialog(shell, metaMap, dataMap, "Plugin browser", "Plugin type");
        dialog.open();
    } catch (Exception e) {
        new ErrorDialog(shell, "Error", "Error listing plugins", e);
    }
}
Also used : PluginTypeInterface(org.pentaho.di.core.plugins.PluginTypeInterface) HashMap(java.util.HashMap) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowBuffer(org.pentaho.di.core.row.RowBuffer) SWTException(org.eclipse.swt.SWTException) KettleRowException(org.pentaho.di.core.exception.KettleRowException) FileSystemException(org.apache.commons.vfs2.FileSystemException) MetaStoreException(org.pentaho.metastore.api.exceptions.MetaStoreException) KettleValueException(org.pentaho.di.core.exception.KettleValueException) KettleAuthException(org.pentaho.di.core.exception.KettleAuthException) KettleRepositoryLostException(org.pentaho.di.repository.KettleRepositoryLostException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) LifecycleException(org.pentaho.di.core.lifecycle.LifecycleException) KettleMissingPluginsException(org.pentaho.di.core.exception.KettleMissingPluginsException) KettleFileException(org.pentaho.di.core.exception.KettleFileException) KettleException(org.pentaho.di.core.exception.KettleException) MalformedURLException(java.net.MalformedURLException) SubjectDataBrowserDialog(org.pentaho.di.ui.core.dialog.SubjectDataBrowserDialog) PluginRegistry(org.pentaho.di.core.plugins.PluginRegistry) ArrayList(java.util.ArrayList) List(java.util.List) RepositoryObject(org.pentaho.di.repository.RepositoryObject) SimpleLoggingObject(org.pentaho.di.core.logging.SimpleLoggingObject) FileObject(org.apache.commons.vfs2.FileObject)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 FileObject (org.apache.commons.vfs2.FileObject)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 SWTException (org.eclipse.swt.SWTException)1 KettleAuthException (org.pentaho.di.core.exception.KettleAuthException)1 KettleException (org.pentaho.di.core.exception.KettleException)1 KettleFileException (org.pentaho.di.core.exception.KettleFileException)1 KettleMissingPluginsException (org.pentaho.di.core.exception.KettleMissingPluginsException)1 KettleRowException (org.pentaho.di.core.exception.KettleRowException)1 KettleValueException (org.pentaho.di.core.exception.KettleValueException)1 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)1 LifecycleException (org.pentaho.di.core.lifecycle.LifecycleException)1 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)1 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)1 PluginTypeInterface (org.pentaho.di.core.plugins.PluginTypeInterface)1 RowBuffer (org.pentaho.di.core.row.RowBuffer)1 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)1