本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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( );
}
示例12: getDisposable
import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
public IDisposable getDisposable() {
return disposable;
}
示例13: setDisposible
import org.eclipse.ui.services.IDisposable; //导入依赖的package包/类
public void setDisposible(IDisposable disposable) {
this.disposable = disposable;
}
示例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;