本文整理汇总了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 ();
}
}
} );
}
示例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;
}
示例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;
}
示例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();
}
}
}
示例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();
}
}
});
}
示例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();
}
示例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;
}
示例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();
}
});
}
示例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();
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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();
}