當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。