当前位置: 首页>>代码示例>>Java>>正文


Java IDisposable类代码示例

本文整理汇总了Java中org.eclipse.ui.services.IDisposable的典型用法代码示例。如果您正苦于以下问题:Java IDisposable类的具体用法?Java IDisposable怎么用?Java IDisposable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDisposable类属于org.eclipse.ui.services包,在下文中一共展示了IDisposable类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MultiPageToolbarEditorSite

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
/**
 * Creates a site for the given editor nested within the given multi-page editor.
 * 
 * @param multiPageEditor
 *          the multi-page editor
 * @param editor
 *          the nested editor
 */
public MultiPageToolbarEditorSite(MultiPageToolbarEditorPart multiPageEditor, IEditorPart editor) {
	Assert.isNotNull(multiPageEditor);
	Assert.isNotNull(editor);
	this.multiPageEditor = multiPageEditor;
	this.editor = editor;

	final IServiceLocator parentServiceLocator = multiPageEditor.getSite();
	IServiceLocatorCreator slc = (IServiceLocatorCreator) parentServiceLocator.getService(IServiceLocatorCreator.class);
	this.serviceLocator = (ServiceLocator) slc.createServiceLocator(multiPageEditor.getSite(), null, new IDisposable() {
		public void dispose() {
			// Fix for ensuring compilation in E4
			getMultiPageEditor().close();
		}
	});

	initializeDefaultServices();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:MultiPageToolbarEditorSite.java

示例2: dispose

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
public void dispose() {
	pageChangeListeners.clear();
	for (IEditorPart editor : nestedEditors) {
		disposePart(editor);
	}
	nestedEditors.clear();
	if (pageContainerSite instanceof IDisposable) {
		((IDisposable) pageContainerSite).dispose();
		pageContainerSite = null;
	}
	for (IServiceLocator sl : pageSites) {
		if (sl instanceof IDisposable) {
			((IDisposable) sl).dispose();
		}
	}
	pageSites.clear();
	super.dispose();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:MultiPageToolbarEditorPart.java

示例3: deactivate

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
private void deactivate() throws Exception {

		if (controller==null) return;

		Object ui = controller.getUI();
		if (ui instanceof Composite) {
			Composite composite = (Composite)ui;
			GridUtils.setVisible(composite, false);
			composite.dispose();
		}
		if (ui instanceof IDisposable) {
			((IDisposable)ui).dispose();
		}
		controller.dispose();
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:16,代码来源:TypeEditor.java

示例4: doResetProvider

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
protected void doResetProvider() {
	boolean tracking = true;
	Object input = viewer.getInput();
	if (input instanceof FolderPreferenceProvider) {
		((IDisposable) input).dispose();
		tracking = ((FolderPreferenceProvider) input).isTracking();
	}
	setupPreferenceProvider(tracking);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:10,代码来源:FolderViewerPage.java

示例5: dispose

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
@Override
public void dispose() {
	Object input = viewer.getInput();
	if (input instanceof IDisposable) {
		((IDisposable) input).dispose();
	}
	super.dispose();
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:9,代码来源:FolderViewerPage.java

示例6: getPageSite

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
/**
 * Returns the service locator for the given page index. This method can be used to create service locators for pages
 * that are just controls. The page index must be valid.
 * <p>
 * This will return the editor site service locator for an editor, and create one for a page that is just a control.
 * </p>
 * 
 * @param pageIndex
 *          the index of the page
 * @return the editor for the specified page, or <code>null</code> if the specified page was not created with
 *         <code>addPage(IEditorPart,IEditorInput)</code>
 * @since 3.4
 */
protected final IServiceLocator getPageSite(int pageIndex) {
	if (pageIndex == PAGE_CONTAINER_SITE) {
		return getPageContainerSite();
	}

	Item item = getItem(pageIndex);
	if (item != null) {
		Object data = item.getData();
		if (data instanceof IEditorPart) {
			return ((IEditorPart) data).getSite();
		} else if (data instanceof IServiceLocator) {
			return (IServiceLocator) data;
		} else if (data == null) {
			IServiceLocatorCreator slc = (IServiceLocatorCreator) getSite().getService(IServiceLocatorCreator.class);
			IServiceLocator sl = slc.createServiceLocator(getSite(), null, new IDisposable() {
				public void dispose() {
					close();
				}
			});
			item.setData(sl);
			pageSites.add(sl);
			return sl;
		}
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:40,代码来源:MultiPageToolbarEditorPart.java

示例7: getPageContainerSite

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
/**
 * @return A site that can be used with a header.
 * @since 3.4
 * @see #createPageContainer(Composite)
 * @see #PAGE_CONTAINER_SITE
 * @see #getPageSite(int)
 */
private IServiceLocator getPageContainerSite() {
	if (pageContainerSite == null) {
		IServiceLocatorCreator slc = (IServiceLocatorCreator) getSite().getService(IServiceLocatorCreator.class);
		pageContainerSite = slc.createServiceLocator(getSite(), null, new IDisposable() {
			public void dispose() {
				close();
			}
		});
	}
	return pageContainerSite;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:MultiPageToolbarEditorPart.java

示例8: dispose

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
@Override
public void dispose() {
	for (IContributionItem item : menuManager.getItems())
		if (item instanceof ActionContributionItem && ((ActionContributionItem) item).getAction() instanceof IDisposable)
			((IDisposable) ((ActionContributionItem) item).getAction()).dispose();
	menuManager.dispose();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:ExportMenuAction.java

示例9: removeAll

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
public void removeAll() {
	for (IContributionItem it : tbManager.getItems()) {	
		if (it instanceof ActionContributionItem && ((ActionContributionItem) it).getAction() instanceof IDisposable)
			((IDisposable) ((ActionContributionItem) it).getAction()).dispose();
		else if (it instanceof ContributionItem)
			it.dispose();
	}
	tbManager.removeAll();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:ATopToolBarManager.java

示例10: createPlotDisposable

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
@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;
}
 
开发者ID:eclipse,项目名称:dawnsci,代码行数:34,代码来源:PlotImageServiceMock.java

示例11: disposeParameter

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
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( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:CommandUtils.java

示例12: getDisposable

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
public IDisposable getDisposable() {
	return disposable;
}
 
开发者ID:eclipse,项目名称:dawnsci,代码行数:4,代码来源:PlotImageData.java

示例13: setDisposible

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
public void setDisposible(IDisposable disposable) {
	this.disposable = disposable;
}
 
开发者ID:eclipse,项目名称:dawnsci,代码行数:4,代码来源:PlotImageData.java

示例14: createPlotDisposable

import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
/**
 * 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;
 
开发者ID:eclipse,项目名称:dawnsci,代码行数:14,代码来源:IPlotImageService.java


注:本文中的org.eclipse.ui.services.IDisposable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。