public void run() { customCommandAvailable(command); } });
public void run() { customExceptionOccurred(exception); } });
/** * Called when an exception occurred. * @param exception The exception. */ public void exceptionOccurredIfUndone(Exception exception) { undone = true; exceptionOccurred(exception); }
public void customResultAvailable(final IComponentManagementService cms) { cms.getExternalAccess(cid).addResultListener(new SwingExceptionDelegationResultListener<IExternalAccess, Boolean>(fut) { public void customResultAvailable(final IExternalAccess exta) { getJCC().getClassLoader(exta.getModel().getResourceIdentifier()) .addResultListener(new SwingExceptionDelegationResultListener<ClassLoader, Boolean>(fut) { public void customResultAvailable(ClassLoader cl) { final Object clid = exta.getModel().getProperty(IAbstractViewerPanel.PROPERTY_VIEWERCLASS, cl); fut.setResult(clid==null? Boolean.FALSE: Boolean.TRUE); // System.out.println("isVis first res: "+viewables.get(cid)); node.refresh(false); } }); } }); } });
public void run() { try { customResultAvailable(result); } catch(Exception e) { // Could happen that overridden customResultAvailable method // first sets result and then throws exception (listener ex are catched). future.setExceptionIfUndone(e); // if(undone) // { // future.setExceptionIfUndone(e); // } // else // { // future.setException(e); // } } } });
/** * Called when the result is available. * @param result The result. */ public void resultAvailableIfUndone(E result) { undone = true; resultAvailable(result); }
public void customResultAvailable(IComponentManagementService cms) { cms.getExternalAccess((IComponentIdentifier)cid) .addResultListener(new SwingExceptionDelegationResultListener<IExternalAccess, IAbstractViewerPanel>(ret) { public void customResultAvailable(IExternalAccess exta) { createComponentPanel(exta).addResultListener(new SwingDelegationResultListener<IAbstractViewerPanel>(ret)); } }); } });
public void customResultAvailable(IComponentManagementService cms) { cms.getExternalAccess((IComponentIdentifier)cid) .addResultListener(new SwingExceptionDelegationResultListener<IExternalAccess, IAbstractViewerPanel>(ret) { public void customResultAvailable(IExternalAccess exta) { createComponentPanel(exta).addResultListener(new SwingDelegationResultListener<IAbstractViewerPanel>(ret)); } }); } });
/** * Called when an exception occurred. * @param exception The exception. */ final public void exceptionOccurred(final Exception exception) { // exception.printStackTrace(); // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) // if(SwingUtilities.isEventDispatchThread()) { customExceptionOccurred(exception); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { customExceptionOccurred(exception); } }); } }
/** * Called when a command is available. */ final public void commandAvailable(final Object command) { // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) // if(SwingUtilities.isEventDispatchThread()) { customCommandAvailable(command); } else { // Thread.dumpStack(); SwingUtilities.invokeLater(new Runnable() { public void run() { customCommandAvailable(command); } }); } }
public void customResultAvailable(IComponentManagementService cms) { // System.out.println("destroying: "+testcase); cms.destroyComponent(testcase) .addResultListener(new SwingExceptionDelegationResultListener<Map<String,Object>, Void>(ret) { public void customResultAvailable(Map<String, Object> result) { // System.out.println("aborted: "+testcase); ret.setResult(null); } }); } });
public void customResultAvailable(IComponentManagementService cms) { // System.out.println("destroying: "+testcase); cms.destroyComponent(testcase) .addResultListener(new SwingExceptionDelegationResultListener<Map<String,Object>, Void>(ret) { public void customResultAvailable(Map<String, Object> result) { // System.out.println("aborted: "+testcase); ret.setResult(null); } }); } });
public void customResultAvailable(IExternalAccess ea) { SRemoteGui.getFileData(ea, ti.getFileName()) .addResultListener(new SwingExceptionDelegationResultListener<FileData, Tuple2<String, Boolean>>(initial) { public void customResultAvailable(FileData file) { initial.setResult(new Tuple2<String, Boolean>(file.getPath(), file.isExists() ? Boolean.TRUE : Boolean.FALSE)); } }); } });
public void customResultAvailable(IExternalAccess ea) { SRemoteGui.getFileData(ea, ti.getFileName()) .addResultListener(new SwingExceptionDelegationResultListener<FileData, Tuple2<String, Boolean>>(initial) { public void customResultAvailable(FileData file) { initial.setResult(new Tuple2<String, Boolean>(file.getPath(), file.isExists() ? Boolean.TRUE : Boolean.FALSE)); } }); } });
public void customResultAvailable(ILibraryService result) { libservice = result; // ClassLoader cl = ((ILibraryService)result).getClassLoader(); // todo: what about dynamic plugin loading? // ClassLoader cl = controlcenter.getJCCAccess().getModel().getClassLoader(); libservice.getClassLoader(controlcenter.getJCCAccess().getModel().getResourceIdentifier()) .addResultListener(new SwingExceptionDelegationResultListener<ClassLoader, Void>(ret) { public void customResultAvailable(ClassLoader cl) { CounterResultListener<IControlCenterPlugin> crl = new CounterResultListener<IControlCenterPlugin>(plugin_classes.length, new SwingDelegationResultListener<Void>(ret)); for(int i=0; i<plugin_classes.length; i++) { addPlugin(plugin_classes[i], cl).addResultListener(crl); } } }); } });
public void customResultAvailable(ILibraryService result) { libservice = result; // ClassLoader cl = ((ILibraryService)result).getClassLoader(); // todo: what about dynamic plugin loading? // ClassLoader cl = controlcenter.getJCCAccess().getModel().getClassLoader(); libservice.getClassLoader(controlcenter.getJCCAccess().getModel().getResourceIdentifier()) .addResultListener(new SwingExceptionDelegationResultListener<ClassLoader, Void>(ret) { public void customResultAvailable(ClassLoader cl) { CounterResultListener<IControlCenterPlugin> crl = new CounterResultListener<IControlCenterPlugin>(plugin_classes.length, new SwingDelegationResultListener<Void>(ret)); for(int i=0; i<plugin_classes.length; i++) { addPlugin(plugin_classes[i], cl).addResultListener(crl); } } }); } });