eclipse-rcp

Eclipse RCP: Get rid of “reset perspective” message

℡╲_俬逩灬. 提交于 2019-12-25 00:34:50
问题 In an RCP application, we dynamically load plugins and our applicaton can add new plugins. When we create a new plugin, we then load it with: newBundle = Activator.getDefault().getBundleContext().installBundle(location); newBundle.start(); This causes a confirmation dialog appears with the message "Changes to installed plug-ins have affected this perspective. Would you like to reset this perspective to accept these changes?" Is there any way of getting rid of this dialog so that user

Eclipse e4 : IStartup extension not working

99封情书 提交于 2019-12-24 20:46:53
问题 I am trying to extending "org.eclipse.ui.startup" extendion point. but it seems in eclipse e4 ,it does not even getting called. is this extension is broken in eclipse e4(Juno) 回答1: I had the same problem and couldn't find an answer, but in the process I discovered the LifeCycleHandler which is even better for my purpose. It might be a good alternative for you as well. Just as with the startup-extension you can reference a handler from your plugin.xml: <property name="lifeCycleURI" value=

Eclipse e4 export - build.xml: A problem occurred while executing this line:

我怕爱的太早我们不能终老 提交于 2019-12-24 13:38:24
问题 I've recently changed my Eclipse e4 applications project configuration from being based on plug-ins to features. The application runs correctly but when exporting I get errors to do with a build.xml file. Error .metadata/.log - Shortened C:\Users\my.name\Workspace\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\compile.org.eclipse.pde.container.feature.xml:6: The following error occurred while executing this line: C:\Users\my.name\Workspace\project_name\build

Eclipse RCP: How to programmatically get Problems View records

牧云@^-^@ 提交于 2019-12-24 12:42:01
问题 On Eclipse Luna, I need to programmatically build java projects and then retrieve the Problems View's records. I use the following code IWorkspace workspace = ResourcesPlugin.getWorkspace(); IResource resource = workspace.getRoot(); IMarker[] markers = resource.findMarkers(IMarker.MARKER, true, IResource.DEPTH_INFINITE); for (IMarker m : markers) { System.out.println("Id: " + m.getId()); System.out.println("Message: " + m.getAttribute(IMarker.MESSAGE)); System.out.println("Source ID: " + m

How to make my menu contribution appear after a plug-in menu contribution?

拥有回忆 提交于 2019-12-24 11:34:14
问题 I have defined an Exit command to display on my File menu. However another plug-in is contributing a Open File item on the File menu and this is appearing AFTER my Exit command. I want my Exit command to appear last on the File menu. I've tried specifying locationURI menu:file?after=org.eclipse.ui.openLocalFile but then my Exit menu item does not display at all. I think this might be because org.eclipse.ui.openLocalFile has not been loaded yet. I've also tried specifying locationURI menu:file

Adding a custom renderer to different parts

谁说胖子不能爱 提交于 2019-12-24 10:23:53
问题 I would like some parts to use a different renderer. In some cases I would like to remove the Detach option when right clicking and this is a solution according to a comment on my question here. I've been following this tutorial as to how this can be done. I've created two classes. UndetachableStackRenderer and UndetachableStackRendererFactory . If I add UndetachableStackRendererFactory to the plugin.xml it successfully removes the option to detach from ALL part stacks. <property name=

Eclipse RCP: how to get Show View menu instead of a dialog

那年仲夏 提交于 2019-12-24 10:14:24
问题 I've added to my perspective's org.eclipse.ui.menus <command commandId="org.eclipse.ui.views.showView" style="pulldown"> </command> This adds Show View item to main menu, but this item is not a menu (as in the Eclipse Window menu). Instead pressing it shows a dialog where I can select a view. How do I get a menu instead? 回答1: You have to create ContributionItem class like below: public class MyShowViewContributionItem extends org.eclipse.ui.internal.ShowViewMenu { public

Convert from absolute path to IFile

不问归期 提交于 2019-12-24 09:27:17
问题 I am working at an eclipse plugin where the projects which exist in the Project Explorer view have a different workspace name than the actual path of the project. So considering a project located at D:\test when I try to get the project location, it points to D:\test_plugin_specific_suffix . Is there a way to get an IFile from an absolute path (which points to the local path, D:\test\testfile.txt )? I want to create a hyperlink to a specific file for which I have the absolute path. When I

WorkbenchPage.openEditor() does nothing

。_饼干妹妹 提交于 2019-12-24 08:17:19
问题 I'm trying make a toolbar button to open one file with another editor on my RCP aplication ! I have de following code: IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IEditorPart oldEditor = page.getActiveEditor(); IFile file = ((IFileEditorInput) oldEditor.getEditorInput()).getFile(); IConfigurationElement[] editorsElements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.editors"); IEditorInput editorInput = new

How to build a pure e4 RCP Text Editor

不羁岁月 提交于 2019-12-24 07:47:08
问题 I am using the latest Eclipse 4.7 Eclipse. I am trying to build a language sensitive editor for a pure e4 RCP application. I have modeled my editor after the example XML Text Editor template project (generated from File->New->Plug-in project). I have modified it and extended it to support my custom language (loosely based on specialized XML tags/elements/attributes). I can run this plugin on its own from the default product “ org.eclipse.platform.ide ” and it works just fine. But I am trying