类org.eclipse.ui.services.IDisposable源码实例Demo

下面列出了怎么用org.eclipse.ui.services.IDisposable的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: gef   文件: AbstractFXView.java
@Override
public void dispose() {
	// deactivate domain
	deactivate();

	// unhook selection forwarder
	unhookViewers();

	// unregister selection provider
	selectionProviderFactory = null;
	if (selectionProvider != null) {
		getSite().setSelectionProvider(null);
		if (selectionProvider instanceof IDisposable) {
			((IDisposable) selectionProvider).dispose();
		}
		selectionProvider = null;
	}

	// XXX: The propertySheetPage does not need to be disposed, as this is
	// already done by the PropertySheet (view) when this view is closed.
	propertySheetPage = null;
	propertySheetPageFactory = null;

	disposeActions();

	domain.dispose();
	domain = null;

	canvasFactory = null;
	if (!canvas.isDisposed()) {
		canvas.dispose();
	}
	canvas = null;

	super.dispose();
}
 
源代码2 项目: dawnsci   文件: PlotImageServiceMock.java
@Override
public IDisposable createPlotDisposable(String plotName) throws Exception {
	
	// We plot to an offscreen plotting system, then take a screen shot of this.
	final PlotDisposable ret = new PlotDisposable();
	IPlottingSystem<?> system = plotName!=null 
	                       ? PlottingFactory.getPlottingSystem(plotName)
	                       : PlottingFactory.getLightWeightPlottingSystem();
	                       
	if (system==null) system = PlottingFactory.getLightWeightPlottingSystem();
	ret.setSystem(system);
			
	if (system.getPlotComposite()==null) {
		Display.getDefault().syncExec(new Runnable() {
			public void run() {
				final Shell   shell   = new Shell(Display.getDefault(), SWT.RESIZE|SWT.NO_TRIM);
				ret.setShell(shell);
				shell.setSize(600, 600);
				
				shell.setLayout(new FillLayout());
				final Composite main = new Composite(shell, SWT.NONE);
				main.setLayout(new GridLayout(1, false));
				
				final Composite plotter = new Composite(main, SWT.NONE);
				plotter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
				
				ret.getSystem().createPlotPart(plotter, "Thumbnail", null, PlotType.XY, null);		
			}
		});
	}
	
	return ret;
}
 
源代码3 项目: birt   文件: CommandUtils.java
public static void disposeParameter( String parameterId, Command command )
		throws NotDefinedException
{
	ParameterType parameterType = command.getParameterType( parameterId );
	Object valueConverter = parameterType.getValueConverter( );
	if ( valueConverter instanceof IDisposable )
		( (IDisposable) valueConverter ).dispose( );
}
 
源代码4 项目: bonita-studio   文件: EmbeddedEditorSite.java
public EmbeddedEditorSite() {
    e4Context = getMWindow().getContext();
    IServiceLocatorCreator slc = (IServiceLocatorCreator) e4Context.get(IServiceLocatorCreator.class.getName());
    IWorkbenchWindow workbenchWindow = getWorkbenchWindow();
    this.serviceLocator = (ServiceLocator) slc.createServiceLocator(workbenchWindow, null, new IDisposable() {

        @Override
        public void dispose() {
            // not sure what to do here
        }
    }, e4Context);
    initializeDefaultServices();
}
 
源代码5 项目: gef   文件: AbstractFXEditor.java
@Override
public void dispose() {
	// deactivate domain
	deactivate();

	// unhook selection forwarder
	unhookViewers();

	// The support class used for handling the dirty state
	if (dirtyStateProvider != null) {
		if (dirtyStateNotifier != null) {
			dirtyStateProvider.dirtyProperty()
					.removeListener(dirtyStateNotifier);
		}
		if (dirtyStateProvider instanceof IDisposable) {
			((IDisposable) dirtyStateProvider).dispose();
		}
		dirtyStateProvider = null;
		dirtyStateNotifier = null;
	}

	// unregister selection provider
	if (selectionProvider != null) {
		getSite().setSelectionProvider(null);
		if (selectionProvider instanceof IDisposable) {
			((IDisposable) selectionProvider).dispose();
		}
	}

	// XXX: The propertySheetPage does not need to be disposed, as this is
	// already done by the PropertySheet (view) when this view is closed.
	propertySheetPage = null;
	propertySheetPageFactory = null;

	disposeActions();

	domain.dispose();
	domain = null;

	canvasFactory = null;
	if (!canvas.isDisposed()) {
		canvas.dispose();
	}
	canvas = null;

	super.dispose();
}
 
源代码6 项目: dawnsci   文件: PlotImageData.java
public IDisposable getDisposable() {
	return disposable;
}
 
源代码7 项目: dawnsci   文件: PlotImageData.java
public void setDisposible(IDisposable disposable) {
	this.disposable = disposable;
}
 
源代码8 项目: dawnsci   文件: IPlotImageService.java
/**
 * Creates an object which may be used to cache the plotting system
 * when looping over a stack and getting many images. For instance when
 * exporting surface or 1D plots. This  IDisposable is then set in the
 * call to PlotImageData to make it more efficient.
 * 
 * THREAD SAFE
 * 
 * @param plotName to use to look up plotting system (can be null)
 * @return
 * @throws Exception
 */
public IDisposable createPlotDisposable(String plotName) throws Exception;
 
 类所在包
 同包方法