• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IPage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.ui.part.IPage的典型用法代码示例。如果您正苦于以下问题:Java IPage类的具体用法?Java IPage怎么用?Java IPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IPage类属于org.eclipse.ui.part包,在下文中一共展示了IPage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAdapter

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
@Override
public Object getAdapter(Class key) {
	if (key.equals(IContextProvider.class)) {
		return new ContextProvider(ID);
	}

	if (key.equals(TreeViewer.class)) {
		IPage page = this.getCurrentPage();
		if (page instanceof PlanAdvisorPage) {
			PlanAdvisorPage planAdvisorPage = (PlanAdvisorPage) page;
			return planAdvisorPage.getPlanAdvisorTreeViewer();
		}

		else {
			return null;
		}
	}
	return super.getAdapter(key);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:PlanAdvisorView.java


示例2: getConsole

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
public static IConsole getConsole(IWorkbenchPart part) {
      if(!(part instanceof IViewPart)){
          return null;
      }

      IViewPart vp =(IViewPart) part;
      if (vp instanceof PageBookView) {
          IPage page = ((PageBookView) vp).getCurrentPage();
          ITextViewer viewer = getViewer(page);
          if (viewer == null || viewer.getDocument() == null)
          	return null;
      }

      IConsole con = null;
  	try {
  		con = ((IConsoleView)part).getConsole();
  	} catch (Exception e) {

}

return con;
  }
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:23,代码来源:ResourceUtils.java


示例3: getViewer

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
public static ITextViewer getViewer(IPage page) {
    if(page == null){
        return null;
    }
    if(page instanceof TextConsolePage) {
        return ((TextConsolePage)page).getViewer();
    }
    if(page.getClass().equals(MessagePage.class)){
        // empty page placeholder
        return null;
    }
    try {
        /*
         * org.eclipse.cdt.internal.ui.buildconsole.BuildConsolePage does not
         * extend TextConsolePage, so we get access to the viewer with dirty tricks
         */
        Method method = page.getClass().getDeclaredMethod("getViewer", (Class<?>[])null);
        method.setAccessible(true);
        return (ITextViewer) method.invoke(page, (Object[])null);
    } catch (Exception e) {
        // AnyEditToolsPlugin.logError("Can't get page viewer from the console page", e);
    }
    return null;
}
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:25,代码来源:ResourceUtils.java


示例4: execute

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
	// assumes to expand to level 1 if not specified
	int level = 1;
	String levelStr = event.getParameter(LEVEL);
	if (levelStr != null)
	{
		level = Integer.parseInt(levelStr);
	}

	IWorkbenchPart part = HandlerUtil.getActivePart(event);
	if (part instanceof ContentOutline)
	{
		IPage page = ((ContentOutline) part).getCurrentPage();
		if (page instanceof CommonOutlinePage)
		{
			CommonOutlinePage outlinePage = (CommonOutlinePage) page;
			// we want to expand to the specified level and collapse everything below
			outlinePage.collapseAll();
			outlinePage.expandToLevel(level);
		}
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:25,代码来源:ExpandLevelHandler.java


示例5: pageActivated

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
@Override
protected void pageActivated(IPage page) {
    if (page instanceof ConstraintsPage) {
    	ConstraintsPage constraintsPage = (ConstraintsPage)page;
    	final EPlan plan = constraintsPage.getPlan();
		WidgetUtils.runInDisplayThread(page.getControl(), new Runnable() {
			@Override
			public void run() {
				String planName = plan.getName();
				if(planName == null) {
					planName = "";
				}
				setContentDescription(planName);
			}
		});
    } else {
		setContentDescription("");
	}
   }
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:ConstraintsView.java


示例6: isSaveOnCloseNeeded

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean isSaveOnCloseNeeded() {
	// workaround for SPF-6678 "Dirty bit is only set when focus is removed from field in Template View, Details View "
	IWorkbenchPartSite site = getSite();
	if (site != null) {
		IWorkbenchPage page = site.getPage();
		IViewReference[] viewReferences = page.getViewReferences();
		for (IViewReference iViewReference : viewReferences) {
			IViewPart viewPart = iViewReference.getView(false);
			if(viewPart != null) {
				Object adapter = viewPart.getAdapter(IPage.class);
				if(adapter instanceof DetailPage) {
					DetailPage detailPage = (DetailPage) adapter;
					if(detailPage.hasSheet()) {
						this.setFocus();
						break;
					}
				}
			}	
		}			
	}
	// end workaround
	return super.isSaveOnCloseNeeded();
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:28,代码来源:MultiPagePlanEditor.java


示例7: getSelection

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
private ISelection getSelection(IWorkbenchPart part, ISelection selection) {
	// for some reason, selection is empty when we select a revision from the P4 history view
	if (!(part instanceof PageBookView)) {
		return selection;
	}
	IPage page = ((PageBookView)part).getCurrentPage();
	if (!(page instanceof P4HistoryPage)) {
		return selection;
	}
	return getSelection((P4HistoryPage)page);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:12,代码来源:P4RevisionBookmarkPropertiesProvider.java


示例8: createDefaultPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
@Override
protected IPage createDefaultPage(PageBook book)
{
	MessagePage defaultPage = new MessagePage();
	initPage(defaultPage);
	defaultPage.setMessage(m_defaultMsg);
	defaultPage.createControl(book);
	setPartName(m_defaultTitle);
	return defaultPage;
}
 
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:11,代码来源:ProcedurePageView.java


示例9: createDefaultPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
@Override
protected IPage createDefaultPage(PageBook book) {
	ReportStatePage page = new ReportStatePage(null);
	initPage(page);
	page.createControl(book);
	return page;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:ReportStateView.java


示例10: hijackConsole

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
protected void hijackConsole(IViewPart view)
{
	if (view instanceof ConsoleView)
	{
		IPage currentPage = ((ConsoleView) view).getCurrentPage();
		if (currentPage != null)
		{
			hookTheme(currentPage.getControl(), false);
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:12,代码来源:InvasiveThemeHijacker.java


示例11: execute

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
	IWorkbenchPart part = HandlerUtil.getActivePart(event);
	if (part instanceof ContentOutline)
	{
		IPage page = ((ContentOutline) part).getCurrentPage();
		if (page instanceof CommonOutlinePage)
		{
			((CommonOutlinePage) page).collapseAll();
		}
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:CollapseAllHandler.java


示例12: execute

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
	IWorkbenchPart part = HandlerUtil.getActivePart(event);
	if (part instanceof ContentOutline)
	{
		IPage page = ((ContentOutline) part).getCurrentPage();
		if (page instanceof CommonOutlinePage)
		{
			((CommonOutlinePage) page).expandAll();
		}
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:ExpandAllHandler.java


示例13: pageActivated

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
@Override
protected void pageActivated(IPage page) {
	if (page instanceof PlanAdvisorPage) {
		PlanAdvisorPage planAdvisorPage = (PlanAdvisorPage) page;
		EPlan plan = planAdvisorPage.getPlan();
		PlanAdvisorMember planAdvisorMember = PlanAdvisorMember.get(plan);
		viewIconListener.setPlanAdvisorMember(planAdvisorMember);
	} else {
		viewIconListener.setPlanAdvisorMember(null);
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:PlanAdvisorView.java


示例14: createDefaultPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected IPage createDefaultPage(PageBook book) {
	MessagePage page = new MessagePage();
	initPage(page);
	page.createControl(book);
	page.setMessage("default page");
	return page;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:DefaultPageBookView.java


示例15: getCurrentDetailPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
private DetailPage getCurrentDetailPage(IWorkbenchPage page) {
	DetailView detailView = DetailView.getDetailView(page);
	if (detailView != null) {
		IPage currentPage = detailView.getCurrentPage();
		if (currentPage instanceof DetailPage)
			return (DetailPage)currentPage;
	}
	return null;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:10,代码来源:DetailPage.java


示例16: createDefaultPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
@Override
protected IPage createDefaultPage(PageBook book) {
       IPage page = super.createDefaultPage(book);
       if (page instanceof MessagePage) {
           ((MessagePage)page).setMessage("Nothing currently selected.");
       }
       return page;
   }
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:DetailView.java


示例17: getCurrentPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
private SPIFeTemplatePlanPage getCurrentPage() {
	IPage currentPage = templatePlanView.getCurrentPage();
	if (currentPage instanceof SPIFeTemplatePlanPage) {
		return (SPIFeTemplatePlanPage)currentPage;
	}
	return null;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:8,代码来源:SPIFeTemplatePlanViewAddNewItemAction.java


示例18: createDefaultPage

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
/**
 * Creates, initializes and returns the default page for this view, giving it the default
 * message. Implements the abstract method from Eclipse class PageBookView.
 * @param book the PageBook control that will become the parent of the new page
 * @return the newly-created page
 */
@Override
protected IPage createDefaultPage(PageBook book) {
   	MessagePage page = new MessagePage();
	initPage(page);
	page.createControl(book);
	page.setMessage(defaultMessage);
       return page;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:15,代码来源:PlanPageBookView.java


示例19: showPageRec

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
/**
 * If the argument is not null, prefix the call to the superclass by performing the
 * pre-open operation. This operation can be supplied by the concrete subclass.
 * @param pageRec the page being opened
 */
@Override
protected void showPageRec(PageRec pageRec) {
	if (pageRec != null) {
		IPage page = pageRec.page;
		pageActivated(page);
	}
	super.showPageRec(pageRec);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:14,代码来源:PlanPageBookView.java


示例20: getCurrentTemplatePlan

import org.eclipse.ui.part.IPage; //导入依赖的package包/类
/**
 * Return the current page's plan.
 * @return the page's plan; may be null if the current page is not a TemplatePlanPage or
 * if the page has no plan
 */
public EPlan getCurrentTemplatePlan() {
	IPage currentPage = getCurrentPage();
	EPlan plan = null;
	if(currentPage instanceof TemplatePlanPage) {
		TemplatePlanPage templatePlanPage = (TemplatePlanPage)currentPage;
		plan = templatePlanPage.getTemplatePlan();
	}
	
	return plan;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:16,代码来源:TemplatePlanView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Resource类代码示例发布时间:2022-05-21
下一篇:
Java BoundKind类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap