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


Java EModelService.find方法代码示例

本文整理汇总了Java中org.eclipse.e4.ui.workbench.modeling.EModelService.find方法的典型用法代码示例。如果您正苦于以下问题:Java EModelService.find方法的具体用法?Java EModelService.find怎么用?Java EModelService.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.e4.ui.workbench.modeling.EModelService的用法示例。


在下文中一共展示了EModelService.find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createControls

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@PostConstruct
public void createControls(
		IEclipseContext context, 
		@Preference(nodePath = TermSuiteUI.PLUGIN_ID, value = TermSuiteUIPreferences.WRAP_TEXT) boolean wrap,
		final Composite parent, 
		MPart part,
		ILoggerProvider loggerProvider,
		EModelService modelService) {
	this.logger = loggerProvider.getClassLogger(this.getClass());

	parent.setLayout(new FillLayout());
	text = new StyledText(parent, getTheStyle(wrap, false));
	
	MToolItem wrapButton = (MToolItem)modelService.find(TOOL_ITEM_WRAP_TEXT, part.getToolbar());
	wrapButton.setSelected(wrap);
	
	text.addLineStyleListener(lineStyleListener);
	text.addLineBackgroundListener(lineBackgroundListener);
	text.setWrapIndent(20);
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:21,代码来源:FileEditorPart.java

示例2: getOpenedEditors

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
public static HashSet<MPart> getOpenedEditors(){
	
	EModelService modelService = CloudscaleContext.getGlobalContext().get(EModelService.class);
	MApplication app = CloudscaleContext.getGlobalContext().get(MApplication.class);

	if(modelService == null){
		throw new IllegalSelectorException();
	}
	if(app == null){
		throw new IllegalSelectorException();
	}
	
	HashSet<MPart> out = new HashSet<MPart>();
	MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", app);
	
	for(MStackElement el : stack.getChildren()){
		if(el instanceof MPart){
			MPart part = (MPart)el;
			if(part.getContext() != null){
				out.add(part);
			}
		}
	}
	return out;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:26,代码来源:ExplorerUtils.java

示例3: ContributionItemsFactory

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
ContributionItemsFactory(final MApplication inApplication,
        final EModelService inModelService,
        final EBindingService inBindingService) {
	items = new ArrayList<StyleContributionItem>();

	final IEclipseContext lContext = inApplication.getContext();
	final CommandManager lCommandManager = lContext
	        .get(CommandManager.class);
	final ISWTResourceUtilities lResourceUtility = (ISWTResourceUtilities) lContext
	        .get(IResourceUtilities.class.getName());
	final EHandlerService lHandlerService = lContext
	        .get(EHandlerService.class);

	final MToolBar lToolbar = (MToolBar) inModelService
	        .find(MUI_ID_STYLING_TOOLBAR, inApplication);
	for (final MToolBarElement lElement : lToolbar.getChildren()) {
		if (lElement instanceof MHandledToolItem) {
			final StyleContributionItem lItem = new StyleContributionItem(
			        (MHandledToolItem) lElement, lResourceUtility,
			        inBindingService, lCommandManager, lHandlerService);
			ContextInjectionFactory.inject(lItem, lContext);
			items.add(lItem);
		}
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:26,代码来源:AbstractEditForm.java

示例4: saveApp

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
/**
 * Save db settings and browser state to preferences.
 *
 * @param inApplication
 *            {@link MApplication}
 */
@SuppressWarnings("unchecked")
@PreDestroy
void saveApp(final MApplication inApplication,
        final EModelService inModelService) {
	// save browser id
	final MElementContainer<MUIElement> lBrowserStack = (MElementContainer<MUIElement>) inModelService
	        .find(RelationsConstants.PART_STACK_BROWSERS, inApplication);
	final MUIElement lBrowser = lBrowserStack.getSelectedElement();
	preferences.put(RelationsConstants.ACTIVE_BROWSER_ID,
	        lBrowser.getElementId());

	// save browser model
	browserManager.saveState(preferences);
	// flush preferences
	try {
		preferences.flush();
	}
	catch (final BackingStoreException exc) {
		log.error(exc, exc.getMessage());
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:28,代码来源:RelationsLifeCycle.java

示例5: activate

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
void activate(final EPartService inPartService,
        final EModelService inModelService, final MApplication inApplication) {
	// get browser stack
	final MPartStack lStack = (MPartStack) inModelService.find(
	        RelationsConstants.PART_STACK_BROWSERS, inApplication);
	final Iterator<MStackElement> lParts = lStack.getChildren().iterator();
	// iterate over children
	while (lParts.hasNext()) {
		final MStackElement lElement = lParts.next();
		if (lElement instanceof MPart) {
			final MPart lPart = (MPart) lElement;
			// activate visible
			if (inPartService.isPartVisible(lPart)) {
				inPartService.activate(lPart, true);
				break;
			}
		}
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:21,代码来源:ActivateViewBrowsers.java

示例6: execute

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
public void execute(MApplication mApplication, EModelService eModelService){
	
	/**
	 * Clears the persisted state for the main toolbar, otherwise the positioning of the
	 * toolbar-elements are in an incorrect order. That means all persisted toolbar-elements are
	 * positioned before the dynamically created elements from
	 * ApplicationActionBarAdvisor#fillCoolBar.
	 * 
	 **/
	MTrimBar mTrimBar =
		(MTrimBar) eModelService.find("org.eclipse.ui.main.toolbar", mApplication);
	if (mTrimBar != null && mTrimBar.getChildren() != null) {
		mTrimBar.getChildren().clear();
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:ElexisProcessor.java

示例7: setActiveTerminology

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
private void setActiveTerminology( EModelService modelService, MApplication application) {
	MPartStack stack = (MPartStack) modelService.find(TermSuiteUI.UI_MAIN_PART_STACK, application);
	MStackElement element = stack.getSelectedElement();
	if(element != null && element instanceof MPart) {
		MPart activePart = (MPart) element;
		if(activePart.getObject() instanceof TerminologyPart)
			updateActiveTerminology((activePart.getContext().get(ETerminology.class)));
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:10,代码来源:StatsPart.java

示例8: execute

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
public void execute(MApplication app, EPartService partService,
    EModelService modelService) {
  MPerspective element = (MPerspective) modelService.find(PART_ID, app);
  if (element != null) {
    partService.switchPerspective(element);
    logger.trace("Switch to " + PART_ID);
  }
}
 
开发者ID:incentivetoken,项目名称:offspring,代码行数:10,代码来源:ShowNXTPerspectiveHandler.java

示例9: execute

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
public void execute(MApplication app, EPartService partService,
    EModelService modelService) {
  MPerspective element = (MPerspective) modelService.find(PART_ID, app);
  partService.switchPerspective(element);
  logger.trace("Switch to " + PART_ID);
}
 
开发者ID:incentivetoken,项目名称:offspring,代码行数:8,代码来源:ShowTraderPerspectiveHandler.java

示例10: startupComplete

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Inject
@Optional
public void startupComplete(@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) MApplication application,
        																			 EModelService modelService){

    MWindow window = (MWindow) modelService.find("eu.cloudscaleproject.env.product.trimmedwindow.0", application);
    window.getContext().set(IWindowCloseHandler.class, new WindowCloseHandler());
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:9,代码来源:LifeCycleManager.java

示例11: getOpenedAlternatives

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
public static HashSet<IEditorInputResource> getOpenedAlternatives(){
	
	EModelService modelService = CloudscaleContext.getGlobalContext().get(EModelService.class);
	MApplication app = CloudscaleContext.getGlobalContext().get(MApplication.class);

	if(modelService == null){
		throw new IllegalSelectorException();
	}
	if(app == null){
		throw new IllegalSelectorException();
	}
	
	HashSet<IEditorInputResource> out = new HashSet<IEditorInputResource>();
	MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", app);
	
	for(MStackElement el : stack.getChildren()){
		if(el instanceof MPart){
			MPart part = (MPart)el;
			if(part.getContext() != null){
				IEditorInputResource alternative = part.getContext().get(IEditorInputResource.class);
				if(alternative != null){
					out.add(alternative);
				}
			}
		}
	}
	return out;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:29,代码来源:ToolchainUtils.java

示例12: execute

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
public void execute(EPartService partService, EModelService modelService, @Named("part_id") String partID) {
	MPart part = partService.findPart(partID);
			
	if(part == null){
		MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", application);
		if(stack != null){
			part = partService.createPart(partID);
			stack.getChildren().add(part);
		}
	}
	
	partService.showPart(part, PartState.ACTIVATE);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:15,代码来源:OpenPartHandler.java

示例13: execute

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
public void execute(EModelService modelService, EPartService partService,
		MWindow window,
		@Named("com.vogella.rcp.jface.translation.commandparameter.perspectiveid") String id) {
	MPerspective activePerspective = modelService
			.getActivePerspective(window);


	MUIElement find = modelService.find(id, window);
	if (find == null || activePerspective.equals(find)) {
		return;
	}

	partService.switchPerspective((MPerspective) find);
}
 
开发者ID:vogellacompany,项目名称:codeexamples-eclipse,代码行数:16,代码来源:SwitchPerspectiveHandler.java

示例14: SwitchToAdvancedPerspectiveHandler

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Inject
public SwitchToAdvancedPerspectiveHandler(MApplication app,
		EModelService modelService){
	
	advancedPerspective = (MPerspective)modelService.find(
			PERSPECTIVE_ID, app);
}
 
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:8,代码来源:SwitchToAdvancedPerspectiveHandler.java

示例15: execute

import org.eclipse.e4.ui.workbench.modeling.EModelService; //导入方法依赖的package包/类
@Execute
public void execute(MApplication application, EPartService partService,
		EModelService modelService){
	
	MPart projectExplorer = (MPart)modelService.find(PART_ID, application);
	
	boolean isVisible = partService.isPartVisible(projectExplorer);
	
	if(isVisible){
		partService.hidePart(projectExplorer);
	}
	else{
		partService.activate(projectExplorer);
	}
}
 
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:16,代码来源:ViewProjectExplorerHandler.java


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