/** * {@inheritDoc} */ @Override public void reset() { this.runAnalysisAction.restore(); }
/** * {@inheritDoc} */ @Override protected void setControlsEnabled( final boolean aEnabled ) { this.runAction.setEnabled( aEnabled ); }
/** * Creates a new RunAnalysisAction instance. */ public RunAnalysisAction( final ToolDialog aToolDialog ) { super( "Analyze" ); restore(); this.toolDialog = aToolDialog; }
/** * {@inheritDoc} */ public void exportToFile( final File aOutputFile, final ExportFormat aFormat ) throws IOException { if ( ExportFormat.HTML.equals( aFormat ) ) { storeToHtmlFile( aOutputFile, getLastResult() ); } else if ( ExportFormat.CSV.equals( aFormat ) ) { storeToCsvFile( aOutputFile, getLastResult() ); } }
/** * {@inheritDoc} */ @Override public final void close() { this.taskExecutionService.close(); this.annotationListener.close(); this.toolProgressListener.close(); try { this.serviceReg.unregister(); this.serviceReg = null; } catch ( IllegalStateException exception ) { // Ignore; we're closing anyway... } onBeforeCloseDialog(); setVisible( false ); dispose(); }
/** * {@inheritDoc} */ @Override public final void showDialog() { this.serviceReg = this.bundleContext.registerService( TaskStatusListener.class.getName(), this, null ); this.taskExecutionService.open(); this.annotationListener.open(); this.toolProgressListener.open(); onBeforeShowDialog(); setVisible( true ); }
/** * Creates a new {@link BaseToolDialog} instance that is document modal. * * @param aOwner * the owning window of this dialog; * @param aTitle * the title of this dialog; * @param aContext * the tool context to use in this dialog. */ protected BaseToolDialog( final Window aOwner, final ToolContext aContext, final BundleContext aBundleContext, final Tool<RESULT_TYPE> aTool ) { super( aTool.getName() ); this.context = aContext; this.bundleContext = aBundleContext; this.tool = aTool; setModalExclusionType( ModalExclusionType.NO_EXCLUDE ); this.taskExecutionService = new TaskExecutionServiceTracker( aBundleContext ); this.annotationListener = new AnnotationListenerServiceTracker( aBundleContext ); this.toolProgressListener = new ToolProgressListenerServiceTracker( aBundleContext ); }
@Override public void run() { setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) ); setControlsEnabled( true ); onToolFailed( aException ); } } );
@Override public void run() { setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) ); setControlsEnabled( false ); onToolStarted(); } } );
@Override public void run() { setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) ); setControlsEnabled( true ); onToolEnded( BaseToolDialog.this.lastResult ); } } );
/** * Called when the tool is failed. * <p> * By default, shows a error dialog with the details of the failure. * </p> * <p> * <b>THIS METHOD WILL BE INVOKED ON THE EVENT-DISPATCH THREAD (EDT)!</b> * </p> * * @param aException * the exception with the failure, can be <code>null</code>. */ protected void onToolFailed( final Exception aException ) { ToolUtils.showErrorMessage( getOwner(), "Tool failed!\nDetails: " + aException.getMessage() ); }
/** * Creates new ExportAction instance. */ public ExportAction( final ExportAware<?> aToolDialog ) { super( "Export" ); this.toolDialog = aToolDialog; putValue( SHORT_DESCRIPTION, "Exports the analysis results to file" ); putValue( ACCELERATOR_KEY, SwingComponentUtils.createMenuKeyMask( KeyEvent.VK_E ) ); setEnabled( false ); }
/** * Cancels the current running tool worker. */ protected boolean cancelToolTask() { try { this.toolDialog.cancelTool(); return true; } catch ( IllegalStateException exception ) { return false; } }
/** * @return */ protected boolean startToolTask() { try { return this.toolDialog.invokeTool(); } catch ( IllegalStateException exception ) { return false; } } }
/** * {@inheritDoc} */ @Override public boolean isEnabled() { return super.isEnabled() && ( this.toolDialog.getLastResult() != null ); } }
/** * {@inheritDoc} */ @Override public void exportToFile( final File aOutputFile, final ExportFormat aFormat ) throws IOException { if ( ExportFormat.CSV.equals( aFormat ) ) { storeToCsvFile( aOutputFile, getLastResult() ); } else if ( ExportFormat.HTML.equals( aFormat ) ) { storeToHtmlFile( aOutputFile, getLastResult() ); } }
/** * @see nl.lxtreme.ols.tool.base.BaseAsyncToolDialog#reset() */ @Override public void reset() { this.runAction.restore(); }
/** * {@inheritDoc} */ @Override public void exportToFile( final File aOutputFile, final ExportFormat aFormat ) throws IOException { if ( ExportFormat.CSV.equals( aFormat ) ) { storeToCsvFile( aOutputFile, getLastResult() ); } else if ( ExportFormat.HTML.equals( aFormat ) ) { storeToHtmlFile( aOutputFile, getLastResult() ); } }
/** * {@inheritDoc} */ @Override public void exportToFile( final File aOutputFile, final ExportFormat aFormat ) throws IOException { if ( ExportFormat.HTML.equals( aFormat ) ) { storeToHtmlFile( aOutputFile, getLastResult() ); } else if ( ExportFormat.CSV.equals( aFormat ) ) { storeToCsvFile( aOutputFile, getLastResult() ); } }