/** * @param fragment A plugin interface to merge with */ default void merge( PluginInterface fragment ) { if ( fragment != null ) { Optional.ofNullable( fragment.getClassMap() ).ifPresent( this.getClassMap()::putAll ); Optional.ofNullable( fragment.getImageFile() ).ifPresent( this::setImageFile ); Optional.ofNullable( fragment.getLibraries() ).ifPresent( this.getLibraries()::addAll ); Optional.ofNullable( fragment.getErrorHelpFile() ).ifPresent( this::setErrorHelpFile ); Optional.ofNullable( fragment.getDocumentationUrl() ).ifPresent( this::setDocumentationUrl ); Optional.ofNullable( fragment.getCasesUrl() ).ifPresent( this::setCasesUrl ); Optional.ofNullable( fragment.getForumUrl() ).ifPresent( this::setForumUrl ); Optional.ofNullable( fragment.getClassLoaderGroup() ).ifPresent( this::setClassLoaderGroup ); } } }
private SwingUniversalImage getUniversalImageIcon( PluginInterface plugin ) throws KettleException { try { PluginRegistry registry = PluginRegistry.getInstance(); String filename = plugin.getImageFile(); throw new KettleException( "Unable to find file: " + plugin.getImageFile() + " for plugin: " + plugin ); } catch ( Throwable e ) { throw new KettleException( "Unable to load image from file : '" + plugin.getImageFile() + "' for plugin: " + plugin, e );
private Map<String, SwingUniversalImage> loadEntryImages() { Map<String, SwingUniversalImage> map = new HashMap<>(); for ( PluginInterface plugin : PluginRegistry.getInstance().getPlugins( JobEntryPluginType.class ) ) { try { if ( JobMeta.STRING_SPECIAL.equals( plugin.getIds()[0] ) ) { continue; } SwingUniversalImage image = getUniversalImageIcon( plugin ); if ( image == null ) { throw new KettleException( "Unable to find image file: " + plugin.getImageFile() + " for plugin: " + plugin ); } map.put( plugin.getIds()[0], image ); } catch ( Exception e ) { log.logError( "Unable to load job entry icon image for plugin: " + plugin.getName() + " (id=" + plugin.getIds()[0] + ")", e ); } } return map; }
Image small_image = null; String filename = plugin.getImageFile(); try { ClassLoader classLoader = registry.getClassLoader( plugin );
Image small_image = null; String filename = step.getImageFile(); try { ClassLoader classLoader = registry.getClassLoader( step );
/** * @param pluginType the type of plugin to get information for * @return a row buffer containing plugin information for the given plugin type * @throws KettlePluginException */ public RowBuffer getPluginInformation( Class<? extends PluginTypeInterface> pluginType ) throws KettlePluginException { RowBuffer rowBuffer = new RowBuffer( getPluginInformationRowMeta() ); for ( PluginInterface plugin : getPlugins( pluginType ) ) { Object[] row = new Object[getPluginInformationRowMeta().size()]; int rowIndex = 0; row[rowIndex++] = getPluginType( plugin.getPluginType() ).getName(); row[rowIndex++] = plugin.getIds()[0]; row[rowIndex++] = plugin.getName(); row[rowIndex++] = Const.NVL( plugin.getDescription(), "" ); row[rowIndex++] = Utils.isEmpty( plugin.getLibraries() ) ? "" : plugin.getLibraries().toString(); row[rowIndex++] = Const.NVL( plugin.getImageFile(), "" ); row[rowIndex++] = plugin.getClassMap().values().toString(); row[rowIndex] = Const.NVL( plugin.getCategory(), "" ); rowBuffer.getBuffer().add( row ); } return rowBuffer; }