public static boolean isPluginDocumented( PluginInterface plugin ) { if ( plugin == null ) { return false; } return !StringUtil.isEmpty( plugin.getDocumentationUrl() ); }
/** * @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 void setShellImage( Shell shell ) { PluginInterface plugin = PluginRegistry.getInstance().getPlugin( PartitionerPluginType.class, partitioner.getId() ); if ( !Utils.isEmpty( plugin.getDocumentationUrl() ) ) { createHelpButton( shell, stepMeta, plugin ); } shell.setImage( GUIResource.getInstance().getImageSpoon() ); } }
public static ShowHelpDialog openHelpDialog( Shell shell, PluginInterface plugin ) { if ( shell == null || plugin == null ) { return null; } if ( isPluginDocumented( plugin ) ) { return openHelpDialog( shell, getHelpDialogTitle( plugin ), plugin.getDocumentationUrl(), plugin.getName() ); } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); String msgKey = ""; // TODO currently support only Step and JobEntry - extend if required. if ( plugin.getPluginType().equals( StepPluginType.class ) ) { msgKey = "System.ShowHelpDialog.Step.HelpIsNotAvailable"; } else { msgKey = "System.ShowHelpDialog.JobEntry.HelpIsNotAvailable"; } mb.setMessage( BaseMessages.getString( PKG, msgKey, plugin.getName() ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } return null; }