public static JobDialogPluginType getInstance() { if ( pluginType == null ) { pluginType = new JobDialogPluginType(); } return pluginType; }
@Override protected String extractClassLoaderGroup( Annotation annotation ) { return ( (JobDialogPlugin) annotation ).classLoaderGroup(); } }
private JobDialogPluginType() { super( JobDialogPlugin.class, "JOBDIALOG", "Job dialog" ); populateFolders( "jobdialog" ); }
public JobEntryInterface open() { Shell parent = getParent(); display = parent.getDisplay(); shell = new Shell( parent, props.getJobsDialogStyle() ); props.setLook( shell ); JobDialog.setShellImage( shell, jobEntry ); backupChanged = jobEntry.hasChanged(); createElements(); // Detect [X] or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); getData(); setActive(); BaseStepDialog.setSize( shell ); int width = 750; int height = Const.isWindows() ? 730 : 720; shell.setSize( width, height ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return jobEntry; }
public boolean open() { mainLayout( PKG, "JobExecutionConfigurationDialog", GUIResource.getInstance().getImageJobGraph() ); runConfigurationSectionLayout( PKG, "TransExecutionConfigurationDialog" ); optionsSectionLayout( PKG, "JobExecutionConfigurationDialog" ); parametersSectionLayout( PKG, "JobExecutionConfigurationDialog" ); String docUrl = Const.getDocUrl( BaseMessages.getString( Spoon.class, "Spoon.JobExecutionConfigurationDialog.Help" ) ); String docTitle = BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.docTitle" ); String docHeader = BaseMessages.getString( PKG, "JobExecutionConfigurationDialog.docHeader" ); buttonsSectionLayout( PKG, "JobExecutionConfigurationDialog", docTitle, docUrl, docHeader ); getData(); openDialog(); return retval; }
private void showLogTypeOptions( int index ) { if ( index != previousLogTableIndex ) { getLogInfo( previousLogTableIndex ); // clean the log options composite... // for ( Control control : wLogOptionsComposite.getChildren() ) { control.dispose(); } previousLogTableIndex = index; LogTableInterface logTable = logTables.get( index ); LogTableUserInterface logTableUserInterface = logTableUserInterfaces.get( index ); if ( logTableUserInterface != null ) { logTableUserInterface.showLogTableOptions( wLogOptionsComposite, logTable ); } else { if ( logTable instanceof JobLogTable ) { showJobLogTableOptions( (JobLogTable) logTable ); } else if ( logTable instanceof ChannelLogTable ) { showChannelLogTableOptions( (ChannelLogTable) logTable ); } if ( logTable instanceof JobEntryLogTable ) { showJobEntryLogTableOptions( (JobEntryLogTable) logTable ); } } wLogOptionsComposite.layout( true, true ); wLogComp.layout( true, true ); } }
private void getLogInfo( int previousLogTableIndex ) { if ( previousLogTableIndex < 0 ) { return; } // Remember the that was entered data... // LogTableInterface modifiedLogTable = logTables.get( previousLogTableIndex ); LogTableUserInterface logTableUserInterface = logTableUserInterfaces.get( previousLogTableIndex ); if ( logTableUserInterface != null ) { logTableUserInterface.retrieveLogTableOptions( modifiedLogTable ); } else { if ( modifiedLogTable instanceof JobLogTable ) { getJobLogTableOptions( (JobLogTable) modifiedLogTable ); } else if ( modifiedLogTable instanceof ChannelLogTable ) { getChannelLogTableOptions( (ChannelLogTable) modifiedLogTable ); } else if ( modifiedLogTable instanceof JobEntryLogTable ) { getJobEntryLogTableOptions( (JobEntryLogTable) modifiedLogTable ); } } }
public static boolean editProperties( JobMeta jobMeta, Spoon spoon, Repository rep, boolean allowDirectoryChange ) { if ( jobMeta == null ) { return false; } JobDialog jd = new JobDialog( spoon.getShell(), SWT.NONE, jobMeta, rep ); jd.setDirectoryChangeAllowed( allowDirectoryChange ); JobMeta ji = jd.open(); // In this case, load shared objects // if ( jd.isSharedObjectsFileChanged() ) { try { SharedObjects sharedObjects = rep != null ? rep.readJobMetaSharedObjects( jobMeta ) : jobMeta.readSharedObjects(); spoon.sharedObjectsFileMap.put( sharedObjects.getFilename(), sharedObjects ); } catch ( Exception e ) { new ErrorDialog( spoon.getShell(), BaseMessages.getString( PKG, "Spoon.Dialog.ErrorReadingSharedObjects.Title" ), BaseMessages.getString( PKG, "Spoon.Dialog.ErrorReadingSharedObjects.Message", spoon.delegates.tabs.makeTabName( jobMeta, true ) ), e ); } } // If we added properties, add them to the variables too, so that they appear in the CTRL-SPACE variable completion. // spoon.setParametersAsVariablesInUI( jobMeta, jobMeta ); if ( jd.isSharedObjectsFileChanged() || ji != null ) { spoon.refreshTree(); spoon.delegates.tabs.renameTabs(); // cheap operation, might as will do it anyway } spoon.setShellText(); return ji != null; }
public static final Button setShellImage( Shell shell, JobEntryInterface jobEntryInterface ) { Button helpButton = null; try { final PluginInterface plugin = getPlugin( jobEntryInterface ); if ( plugin.getCategory().equals( BaseMessages.getString( PKGBASE, "JobCategory.Category.Deprecated" ) ) ) { addDeprecation( shell ); } helpButton = HelpUtils.createHelpButton( shell, HelpUtils.getHelpDialogTitle( plugin ), plugin ); shell.setImage( getImage( shell, plugin ) ); } catch ( Throwable e ) { // Ignore unexpected errors, not worth it } return helpButton; }
showJobLogTableOptions( (JobLogTable) logTables.get( 0 ) ); extraTab.getData( jobMeta ); setFlags();
@Override protected String extractID( Annotation annotation ) { return ( (JobDialogPlugin) annotation ).id(); }
@Override protected String extractDesc( Annotation annotation ) { return ( (JobDialogPlugin) annotation ).description(); }
@Override protected String extractName( Annotation annotation ) { return ( (JobDialogPlugin) annotation ).name(); }
@Override protected String extractI18nPackageName( Annotation annotation ) { return ( (JobDialogPlugin) annotation ).i18nPackageName(); }
@VisibleForTesting JobExecutionConfigurationDialog newJobExecutionConfigurationDialog( JobExecutionConfiguration executionConfiguration, JobMeta jobMeta ) { return new JobExecutionConfigurationDialog( spoon.getShell(), executionConfiguration, jobMeta ); } }
private void cancel() { props.setScreen( new WindowProperty( shell ) ); jobMeta = null; dispose(); }
public void widgetSelected( SelectionEvent e ) { DatabaseMeta databaseMeta = new DatabaseMeta(); databaseMeta.shareVariablesWith( jobMeta ); getDatabaseDialog().setDatabaseMeta( databaseMeta ); if ( getDatabaseDialog().open() != null ) { jobMeta.addDatabase( getDatabaseDialog().getDatabaseMeta() ); wLogconnection.add( getDatabaseDialog().getDatabaseMeta().getName() ); wLogconnection.select( wLogconnection.getItemCount() - 1 ); } } } );
public void addRunConfigurationListenerForExpandRemoteOption() { wRunConfiguration.addModifyListener( modifyEvent -> { List<Object> items = Arrays.asList( wRunConfiguration.getText(), false ); try { ExtensionPointHandler.callExtensionPoint( Spoon.getInstance().getLog(), KettleExtensionPoint .RunConfigurationIsRemote.id, items ); } catch ( KettleException ignored ) { // Ignore errors } getConfiguration().setRunConfiguration( wRunConfiguration.getText() ); wExpandRemote.setEnabled( (Boolean) items.get( 1 ) ); wExpandRemote.setSelection( wExpandRemote.isEnabled() && wExpandRemote.getSelection() ); } ); } }
/** * The core plugin types don't know about UI classes. This method adds those in before initialization. * * TODO: create a SpoonLifecycle listener that can notify interested parties of a pre-initialization state so this can * happen in those listeners. */ private static void registerUIPluginObjectTypes() { RepositoryPluginType repositoryPluginType = RepositoryPluginType.getInstance(); repositoryPluginType.addObjectType( RepositoryRevisionBrowserDialogInterface.class, "version-browser-classname" ); repositoryPluginType.addObjectType( RepositoryDialogInterface.class, "dialog-classname" ); PluginRegistry.addPluginType( SpoonPluginType.getInstance() ); SpoonPluginType.getInstance().getPluginFolders().add( new PluginFolder( "plugins/repositories", false, true ) ); LifecyclePluginType.getInstance().getPluginFolders().add( new PluginFolder( "plugins/spoon", false, true ) ); LifecyclePluginType.getInstance().getPluginFolders().add( new PluginFolder( "plugins/repositories", false, true ) ); PluginRegistry.addPluginType( JobDialogPluginType.getInstance() ); PluginRegistry.addPluginType( TransDialogPluginType.getInstance() ); }
public JobEntryInterface open() { Shell parent = getParent(); display = parent.getDisplay(); shell = new Shell( parent, props.getJobsDialogStyle() ); props.setLook( shell ); JobDialog.setShellImage( shell, jobEntry ); backupChanged = jobEntry.hasChanged(); createElements(); // Detect [X] or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); getData(); setActive(); BaseStepDialog.setSize( shell ); int width = 750; int height = Const.isWindows() ? 730 : 718; shell.setSize( width, height ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return jobEntry; }