eclipse-pde

How do I get the workbench window to open a modal dialog in an Eclipse based project?

爱⌒轻易说出口 提交于 2019-12-04 16:55:01
问题 In order to open a modal dialog, you need to pass a parent window, and pass the necessary flags for the dialog to be modal of course. Depending on where you are in the eclipse infrastructure, finding this parent window is not always easy. How can the parent window be accessed? 回答1: The piece of code from the previous answer will work. However, keep in mind you can only open your dialog from the UI thread. If you are opening the dialog from a different thread, e.g. a background process, you

Eclipse Plugin: Creating a dynamic menu and corresponding handler?

好久不见. 提交于 2019-12-04 14:46:51
I am trying to write what I think is a very simple Eclipse plugin, but I am really struggling to find my way around as I have never worked with the PDE before. Basically what I am trying to do is add a sub-menu to the Java Project context menu that will list a bunch of available files in the project's root directory. Then upon selecting one of these sub-menu items I want the handler to be called and passed the name of the file that was selected. So far I have managed to get the menu to appear correctly by adding a dynamic menuContribution to the org.eclipse.ui.menus extension point. I have

How do you communicate between eclipse declarative services and Views (ContentProviders)

别来无恙 提交于 2019-12-04 13:37:25
问题 Say you have an eclipse plugin with various views, these views should display data from some OSGi bundle that pushes data to the Views. Rather than have every view communicate with the OSGi bundle, I have an intermediate Facade class that acts as a blackboard for the views and manages communications between the views and the other OSGi bundle--well, that's the theory. The problem comes about because the ui bundle (with the Views and the Facade) communicate with the other bundle (call it the

How do I use “org.eclipse.debug.ui.launchShortcuts”?

蹲街弑〆低调 提交于 2019-12-04 10:55:36
I have written a custom launcher in Eclipse which I can access via the "Run As" and "Debug As" menu options on the toolbar. I also want to be able to launch via the package explorer and via right clicking on the editor of a file to be launched. I followed the tutorial here to add the shortcut but nothing happens, it does not enter my handling code, nor does it complain regarding the configuration of the extension point. Here is a snippet from my plugin.xml <extension point="org.eclipse.debug.ui.launchShortcuts"> <shortcut id = "org.mylauncher.launchCalcShortcut" class = "org.mylauncher

How do I get notified whenever a new editor is opened in Eclipse?

拟墨画扇 提交于 2019-12-04 09:39:59
问题 I have a view which would like to be notified about all the currently opened editors. Where can I add a listener to achieve this? I was expecting WorkbenchPage or EditorManager to have some appropriate listener registry, but I couldn't find it. 回答1: Does your view uses a org.eclipse.ui.IPartListener2 ? That is what is using this EditorListener, whose job is to react, for a given view, to Editor events (including open and close) public class EditorListener implements ISelectionListener,

Unable locate installable unit in target definition

白昼怎懂夜的黑 提交于 2019-12-04 03:59:30
I created my own target definition. It worked perfectly until now. Today I opened this target definition and got following error for all software sites I have there: Unable to locate installable unit <unit name> The target definition file looks like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde version="3.6"?> <target name="indigo" sequenceNumber="20"> <locations> <location includeAllPlatforms="false" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.zest.feature.group" version="1.3.0.v20110425-2050-67A18yF6F18CBD5A7N54242"/> <unit id

What's 'API Baseline' in Eclipse PDT

社会主义新天地 提交于 2019-12-03 23:25:47
Since upgrading to Eclipse 3.7, the Eclipse PDE plugin wants me to specify an 'API Baseline' for all my Eclipse Plugin projects. However there seems to be no documentation which actually explains what 'API Baseline' stands for here, and what is it used for. Could somebody please explain? From the PDE API Tools User Guide : An API baseline defines the state you want to compare your development workspace bundles against for the purposes of binary compatibility, bundle version numbers, and @since tags. For example, if you are developing bundles for Eclipse 3.4, you will use Eclipse 3.3 as your

Enumerating all my Eclipse editors?

怎甘沉沦 提交于 2019-12-03 16:29:22
I have built a simple Eclipse plugin where a user may use a TableViewer of database resources to open an editor on any of those resources. Users may therefore have zero upwards instances of the editor running. Is there an API available to get a list of those editor instances? You can get references to all open editors with: PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage().getEditorReferences(); And then check these to select the ones that reference instances of your editor type. According to the javadoc for the API a workbench can have several windows, and a window can

How do I get the workbench window to open a modal dialog in an Eclipse based project?

醉酒当歌 提交于 2019-12-03 10:51:57
In order to open a modal dialog, you need to pass a parent window, and pass the necessary flags for the dialog to be modal of course. Depending on where you are in the eclipse infrastructure, finding this parent window is not always easy. How can the parent window be accessed? zvikico The piece of code from the previous answer will work. However, keep in mind you can only open your dialog from the UI thread. If you are opening the dialog from a different thread, e.g. a background process, you need to do something like this: PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {

How do you communicate between eclipse declarative services and Views (ContentProviders)

[亡魂溺海] 提交于 2019-12-03 08:29:00
Say you have an eclipse plugin with various views, these views should display data from some OSGi bundle that pushes data to the Views. Rather than have every view communicate with the OSGi bundle, I have an intermediate Facade class that acts as a blackboard for the views and manages communications between the views and the other OSGi bundle--well, that's the theory. The problem comes about because the ui bundle (with the Views and the Facade) communicate with the other bundle (call it the DataStore) using Declarative Services. Since the Data Store receives asynchronous data updates from yet