eclipse-rcp

Programmatically showing a View from an Eclipse Plug-in

家住魔仙堡 提交于 2019-11-27 01:02:17
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu. I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere. You are probably looking for this: PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId"); If called from handler of a command HandlerUtil

How to communicate between views in Eclipse RCP?

半腔热情 提交于 2019-11-27 00:47:46
问题 In Eclipse RCP, I am creating views for the Perspective using IPageLayout.addView(...) But this way I don't have a reference to the view. Therefore I don't know how I can tell ViewA to update ViewB. What's the best pattern to use here? 回答1: Besides what VonC has mentioned above, you can also use ISourceProviderListener if the changes you need are not triggered by selection. Have ViewB implements ISourceProviderListener Create an implementation of ISourceProvider and register it in the

Save an Eclipse editor programmatically

﹥>﹥吖頭↗ 提交于 2019-11-26 22:08:08
问题 I am developing a plug-in. On clicking a button, I'd like to call the save method of Eclipse or call the save button on Eclipse toolbar. What is the way to do it? 回答1: org.eclipse.ui.PlatformUI.getWorkbench().saveAll(..) should do the trick. If you want to save the active editor, please try IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IEditorPart editor = page.getActiveEditor(); page.saveEditor(editor, true /* confirm */); Note that the elements

Programmatically showing a View from an Eclipse Plug-in

风格不统一 提交于 2019-11-26 17:28:19
问题 I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu. I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere. 回答1: You are probably looking for this: PlatformUI.getWorkbench()

How remove pop-up menu contributions in eclipse RCP

房东的猫 提交于 2019-11-26 17:05:33
问题 I'm working in a RCP application and I have a view which data model are instances of IResources. When popup menu is visible I find commands contributed by others plugins I would like to remove. Sample of code: 1 MenuManager menuManager = new MenuManager(); 2 mm.setRemoveAllWhenShown(true); 3 Menu menu = menuManager.createContextMenu(this.treeViewer.getControl()); 4 this.treeViewer.getControl().setMenu(menu); 5 getSite().registerContextMenu(menuManager, this.treeViewer); If I comment line 5

View classes dependency graph plugin? [closed]

泄露秘密 提交于 2019-11-26 15:58:11
问题 Is there any plugins I can use for Eclipse that will show graphical view of classes dependencies? 回答1: Classycle can be a good start (for static dependencies between classes at least) (I find their graph a bit complicated to follow though : CDA - Class Dependency Analyzer is an external tool, but produce much more readable dependency graphs) 回答2: stan4j: Free for private use For commercial use requires license Video on homepage does a good job of demoing features 回答3: For a more in-depth