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


Java IPage类代码示例

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


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


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