public static IStatus convertStatus ( final String pluginId, final Throwable e ) { return convertStatus ( pluginId, ExceptionHelper.getMessage ( e ), e ); }
public static IStatus convertStatus ( final String pluginId, final Throwable e ) { return convertStatus ( pluginId, ExceptionHelper.getMessage ( e ), e ); }
private void invokeCancel ( final Connection connection ) { try { connection.getClass ().getMethod ( "cancelConnection" ).invoke ( connection ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.BLOCK ); } }
private void invokeCancel ( final Connection connection ) { try { connection.getClass ().getMethod ( "cancelConnection" ).invoke ( connection ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.BLOCK ); } }
@Override public void widgetSelected ( final SelectionEvent e ) { try { start (); } catch ( final Exception ex ) { logger.error ( "Failed to start chart", ex ); //$NON-NLS-1$ StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, ex ), StatusManager.BLOCK ); } } } );
public void execute ( final ScriptExecutor scriptExecutor, final Map<String, Object> scriptObjects ) throws Exception { if ( scriptExecutor == null ) { return; } try { scriptExecutor.execute ( this.scriptContext, scriptObjects ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG ); throw new InvocationTargetException ( e ); } }
/** * Trigger the controller to update the data from the registration manager * <p> * This method can be called from any thread and must synchronized to the UI * </p> */ @Override public void triggerDataUpdate () { try { Display.getDefault ().asyncExec ( new Runnable () { @Override public void run () { handleDataUpdate (); }; } ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ) ); } }
public void execute ( final ScriptExecutor scriptExecutor, final Map<String, Object> scriptObjects ) throws Exception { if ( scriptExecutor == null ) { return; } try { scriptExecutor.execute ( this.scriptContext, scriptObjects ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG ); throw new InvocationTargetException ( e ); } }
/** * Trigger the controller to update the data from the registration manager * <p> * This method can be called from any thread and must synchronized to the UI * </p> */ @Override public void triggerDataUpdate () { try { Display.getDefault ().asyncExec ( new Runnable () { @Override public void run () { handleDataUpdate (); }; } ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ) ); } }
private void fireScriptEvent ( final ScriptExecutor script, final Object event, final String eventName ) { this.controller.debugLog ( String.format ( "%s: %s", eventName, event ) ); //$NON-NLS-1$ final Map<String, Object> scriptObjects = new LinkedHashMap<String, Object> ( 1 ); scriptObjects.put ( "event", event ); //$NON-NLS-1$ try { this.controller.execute ( script, scriptObjects ); } catch ( final Exception e ) { this.controller.errorLog ( "Failed to handle event: " + eventName, e ); //$NON-NLS-1$ if ( !Boolean.getBoolean ( "org.eclipse.scada.vi.ui.draw2d.suppressErrors" ) ) //$NON-NLS-1$ { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, "Failed to handle event", e ), StatusManager.SHOW ); } } }
private void fireScriptEvent ( final ScriptExecutor script, final Object event, final String eventName ) { this.controller.debugLog ( String.format ( "%s: %s", eventName, event ) ); //$NON-NLS-1$ final Map<String, Object> scriptObjects = new LinkedHashMap<String, Object> ( 1 ); scriptObjects.put ( "event", event ); //$NON-NLS-1$ try { this.controller.execute ( script, scriptObjects ); } catch ( final Exception e ) { this.controller.errorLog ( "Failed to handle event: " + eventName, e ); //$NON-NLS-1$ if ( !Boolean.getBoolean ( "org.eclipse.scada.vi.ui.draw2d.suppressErrors" ) ) //$NON-NLS-1$ { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, "Failed to handle event", e ), StatusManager.SHOW ); } } }
@Override public void doubleClick ( final DoubleClickEvent event ) { try { final IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench ().getService ( IHandlerService.class ); handlerService.executeCommand ( COMMAND_ID, null ); } catch ( final Exception e ) { logger.warn ( "Failed to execute command", e ); StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.BLOCK ); } }
private void runUpdate ( final boolean ignoreParents ) { logger.debug ( "Running update: {}", this.nameHierarchy ); try { if ( this.onUpdate != null ) { this.onUpdate.execute ( this.scriptContext ); } } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG ); errorLog ( "Failed to run update", e ); } notifySummaryListeners (); // propagate update if ( !ignoreParents && this.parentController != null ) { this.parentController.runUpdate ( false ); } }
private void runUpdate ( final boolean ignoreParents ) { logger.debug ( "Running update: {}", this.nameHierarchy ); try { if ( this.onUpdate != null ) { this.onUpdate.execute ( this.scriptContext ); } } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG ); errorLog ( "Failed to run update", e ); } notifySummaryListeners (); // propagate update if ( !ignoreParents && this.parentController != null ) { this.parentController.runUpdate ( false ); } }
plugin.getLog ().log ( StatusHelper.convertStatus ( PLUGIN_ID, e ) ); return null;
@SuppressWarnings ( "unchecked" ) @Override public Object execute ( final ExecutionEvent event ) throws ExecutionException { final String detailViewId = event.getParameter ( "org.eclipse.scada.vi.details.showDetailDialog.id" ); final Map<String, String> parameters = (Map<String, String>)event.getObjectParameterForExecution ( "org.eclipse.scada.vi.details.showDetailDialog.parameters" ); try { if ( this.useWaitShell ) { openWithWaitShell ( getShell (), detailViewId, parameters ); } else { open ( getShell (), detailViewId, parameters ); } } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, "Failed to open detail view", e ), StatusManager.SHOW ); } return null; }
StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.BLOCK );
StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.BLOCK );
protected void create ( final SymbolLoader symbolLoader ) { try { final Map<String, String> properties = new HashMap<String, String> ( this.symbol.getProperties ().size () ); for ( final Map.Entry<String, String> entry : this.symbol.getProperties ().entrySet () ) { properties.put ( entry.getKey (), entry.getValue () ); } properties.putAll ( this.initialProperties ); this.controller = new SymbolController ( getShell (), symbolLoader, properties, this.scriptObjects, this.factoryContext ); final Controller controller = create ( this.symbol.getRoot () ); this.controller.init (); this.layer.add ( this.figure = controller.getFigure () ); this.factory.createConnections ( this.connectionLayer, this.controller, this.symbol.getConnections () ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG ); this.layer.add ( this.figure = Helper.createErrorFigure ( e ) ); } this.canvas.setContents ( this.pane ); }
protected void create ( final SymbolLoader symbolLoader ) { try { final Map<String, String> properties = new HashMap<String, String> ( this.symbol.getProperties ().size () ); for ( final Map.Entry<String, String> entry : this.symbol.getProperties ().entrySet () ) { properties.put ( entry.getKey (), entry.getValue () ); } properties.putAll ( this.initialProperties ); this.controller = new SymbolController ( getShell (), symbolLoader, properties, this.scriptObjects, this.factoryContext ); final Controller controller = create ( this.symbol.getRoot () ); this.controller.init (); this.layer.add ( this.figure = controller.getFigure () ); this.factory.createConnections ( this.connectionLayer, this.controller, this.symbol.getConnections () ); } catch ( final Exception e ) { StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG ); this.layer.add ( this.figure = Helper.createErrorFigure ( e ) ); } this.canvas.setContents ( this.pane ); }