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


Java PlatformUI.isWorkbenchRunning方法代码示例

本文整理汇总了Java中org.eclipse.ui.PlatformUI.isWorkbenchRunning方法的典型用法代码示例。如果您正苦于以下问题:Java PlatformUI.isWorkbenchRunning方法的具体用法?Java PlatformUI.isWorkbenchRunning怎么用?Java PlatformUI.isWorkbenchRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.PlatformUI的用法示例。


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

示例1: stop

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
@Override
public void stop ()
{
    if ( !PlatformUI.isWorkbenchRunning () )
    {
        return;
    }
    final IWorkbench workbench = PlatformUI.getWorkbench ();
    final Display display = workbench.getDisplay ();
    display.syncExec ( new Runnable () {
        @Override
        public void run ()
        {
            if ( !display.isDisposed () )
            {
                workbench.close ();
            }
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:Application.java

示例2: getOutputStream

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
@Override
public OutputStream getOutputStream(final OutputStreamType type, OutputRedirection redirect) {
	if (!PlatformUI.isWorkbenchRunning()) {
		return DEFAULT.getOutputStream(type, redirect);
	}
	final MessageConsole console = consoleSupplier.get();
	boolean silent = redirect == OutputRedirection.SUPPRESS;
	if (!silent) {
		console.activate();
	}
	ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
	final MessageConsoleStream stream = console.newMessageStream();
	getDisplay().asyncExec(() -> {
		stream.setColor(toColor(type));
		showConsoleView(silent);
	});
	return stream;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:ConsoleOutputStreamProvider.java

示例3: unsafeGetWorkbenchPage

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
static private final IWorkbenchPage unsafeGetWorkbenchPage() {
	IWorkbenchPage page = null;
	if (PlatformUI.isWorkbenchRunning()) {
		IWorkbench wb = PlatformUI.getWorkbench();
		IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
		page = win.getActivePage();
	}
	return page;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:EditorsUtil.java

示例4: showConsoleView

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
private void showConsoleView(final boolean silent) {
	if (PlatformUI.isWorkbenchRunning() && !silent) {
		final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		final IViewPart view = window.getActivePage().findView(CONSOLE_VIEW_ID);
		if (null != view) {
			view.setFocus();
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:ConsoleOutputStreamProvider.java

示例5: stopEclipseUI

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
/**
 * Stop Eclipse UI.
 */
private void stopEclipseUI() {
	
	if (PlatformUI.isWorkbenchRunning()==false) return;
	
	final IWorkbench workbench = PlatformUI.getWorkbench();
	final Display display = workbench.getDisplay();
	display.asyncExec(new Runnable() {
		public void run() {
			if (!display.isDisposed()) {
				workbench.close();
			}
		}
	});
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:18,代码来源:PlugInApplication.java

示例6: getActivePage

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
/**
 * Returns active page or <code>null</code>
 * 
 * @return active page or <code>null</code>
 */
public static IWorkbenchPage getActivePage() {
	if (!PlatformUI.isWorkbenchRunning()) {
		return null;
	}
	IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
	if (window == null) {
		return null;
	}
	return window.getActivePage();
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:16,代码来源:EclipseUtil.java

示例7: getWorkbench

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
/**
 * Returns workbench or <code>null</code>
 * 
 * @return workbench or <code>null</code>
 */
private static IWorkbench getWorkbench() {
	if (!PlatformUI.isWorkbenchRunning()) {
		return null;
	}
	IWorkbench workbench = PlatformUI.getWorkbench();
	return workbench;
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:13,代码来源:EclipseUtil.java

示例8: stop

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
public void stop() {
	if (!PlatformUI.isWorkbenchRunning())
		return;
	final IWorkbench workbench = PlatformUI.getWorkbench();
	final Display display = workbench.getDisplay();
	display.syncExec(new Runnable() {
		public void run() {
			if (!display.isDisposed())
				workbench.close();
		}
	});
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:Application.java

示例9: getActivePage

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
/**
 * @return IWorkbenchPage
 */
public static IWorkbenchPage getActivePage() {
	try {
		if (!PlatformUI.isWorkbenchRunning()) return null;
	} catch (Exception | NoClassDefFoundError ne) {
		return null;
	}
	final IWorkbench bench = PlatformUI.getWorkbench();
	if (bench==null) return null;
	final IWorkbenchWindow window = bench.getActiveWorkbenchWindow();
	if (window==null) return null;
	return window.getActivePage();
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:16,代码来源:PageUtil.java

示例10: getDefaultPage

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
/**
 * @return IWorkbenchPage
 */
public static IWorkbenchPage getDefaultPage() {
	try {
		if (!PlatformUI.isWorkbenchRunning()) return null;
	} catch (Exception | NoClassDefFoundError ne) {
		return null;
	}
	final IWorkbench bench = PlatformUI.getWorkbench();
	if (bench==null) return null;
	final IWorkbenchWindow[] windows = bench.getWorkbenchWindows();
	if (windows==null) return null;

	return windows[0].getActivePage();
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:17,代码来源:PageUtil.java

示例11: init

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
private void init() {
	if (PlatformUI.isWorkbenchRunning()) {
		IWorkbench workbench = CodeLensEditorPlugin.getDefault().getWorkbench();
		if (workbench != null) {
			IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
			for (IWorkbenchWindow window : windows) {
				windowOpened(window);
			}
			CodeLensEditorPlugin.getDefault().getWorkbench().addWindowListener(this);
		}
	}
}
 
开发者ID:angelozerr,项目名称:codelens-eclipse,代码行数:13,代码来源:EditorTracker.java

示例12: write

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
public static void write(String msg) {
    if (PlatformUI.isWorkbenchRunning()) {
        if (console == null) {
            console = findConsole();
        }
        console.write(msg);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:ConsoleFactory.java

示例13: init

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
private void init() {
	if (PlatformUI.isWorkbenchRunning()) {
		IWorkbench workbench = EditorConfigPlugin.getDefault().getWorkbench();
		if (workbench != null) {
			IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
			for (IWorkbenchWindow window : windows) {
				windowOpened(window);
			}
			EditorConfigPlugin.getDefault().getWorkbench().addWindowListener(this);
		}
	}
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:13,代码来源:EditorTracker.java

示例14: configureLanguageSpecificURIEditorOpener

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
public void configureLanguageSpecificURIEditorOpener(Binder binder) {
	if (PlatformUI.isWorkbenchRunning()) {
		binder.bind(IURIEditorOpener.class).annotatedWith(LanguageSpecific.class).to(DerivedMemberAwareEditorOpener.class);
		binder.bind(IDerivedMemberAwareEditorOpener.class).to(DerivedMemberAwareEditorOpener.class);
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:7,代码来源:AbstractDSLPoliciesUiModule.java

示例15: isWorkbenchRunning

import org.eclipse.ui.PlatformUI; //导入方法依赖的package包/类
/**
 * Checks if is workbench running.
 * @return true, if is workbench running
 */
public boolean isWorkbenchRunning() {
	return PlatformUI.isWorkbenchRunning();
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:8,代码来源:UiBridge.java


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