本文整理汇总了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);
}
示例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;
}
示例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);
}
}
}
示例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());
}
}
示例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;
}
}
}
}
示例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();
}
}
示例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)));
}
}
示例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);
}
}
示例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);
}
示例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());
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}