本文整理匯總了Java中org.eclipse.ui.IWorkbench.getWorkbenchWindows方法的典型用法代碼示例。如果您正苦於以下問題:Java IWorkbench.getWorkbenchWindows方法的具體用法?Java IWorkbench.getWorkbenchWindows怎麽用?Java IWorkbench.getWorkbenchWindows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.IWorkbench
的用法示例。
在下文中一共展示了IWorkbench.getWorkbenchWindows方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDefaultPage
import org.eclipse.ui.IWorkbench; //導入方法依賴的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();
}
示例2: getDefaultPage
import org.eclipse.ui.IWorkbench; //導入方法依賴的package包/類
/**
* @return IWorkbenchPage
*/
public static IWorkbenchPage getDefaultPage() {
final IWorkbench bench = PlatformUI.getWorkbench();
if (bench==null) return null;
final IWorkbenchWindow[] windows = bench.getWorkbenchWindows();
if (windows==null) return null;
return windows[0].getActivePage();
}
示例3: init
import org.eclipse.ui.IWorkbench; //導入方法依賴的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);
}
}
}
示例4: init
import org.eclipse.ui.IWorkbench; //導入方法依賴的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);
}
}
}