FAQ Database Discussion Community


Eclipse plugin dev: make bundle to explode inside `plugins` folder

eclipse,eclipse-plugin,eclipse-rcp,nodeclipse
There is old Eclipse Image Viewer plugin https://github.com/persal/quickimage that I want to update. After adding maven/tycho build and building against Kepler. It works in new Eclipse instance (project -> run as Eclipse application), but when installing here is an issue #6 org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: file:\D:\Progs\Eclipses\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\nu.psnet.quickimage.plugin_1.1.0.201503030326.jar!\icons\previous.gif (The filename, directory name,...

Migrating to E4 - equivalent of PlatformUI.isWorkbenchRunning

eclipse,eclipse-rcp,rcp,e4
In our Eclipse RCP 3.7 application we have quite a few calls to PlatformUI.isWorkbenchRunning(). For example most of the calls are guards around Workbench API calls, along the lines of ` if (PlatformUI.isWorkbenchRunning()) { display = PlatformUI.getWorkbench().getDisplay(); } else { display = Display.getDefault(); } We're migrating now to Eclipse RCP...

Add a new sub menu to compare with menu in Package explorer and project explorer

eclipse,eclipse-plugin,eclipse-rcp
I am trying to add a new command to "compare with" menu present in context menu of Package Explorer and Project Explorer. Command is getting displayed only in Package Explorer. I am not getting any command in Project Explorer. I want the command to be present only in these two...

Running Server Edge SDK with OSGI Framework in Eclipse RCP

java,osgi,eclipse-rcp
I followed the instructions here about setting up a development environment in order to either develop a custom Rifidi Edge Server(RFID Middleware) application, or modify an existing Edge Server bundle. every thing was ok but when i clicked on run button,instead of 'OSGi:' i saw this Error: Error: Could not...

How to use an IResourceChangeListener to detect a file rename and set the EditorPart name dynamically?

eclipse,user-interface,eclipse-plugin,eclipse-rcp
IResourceChangeListener listens to changes in project workspace for example if the editor part file name has changed. I want to know how to access that particular EditorPart and change its title name accordingly (e.g. with .setPartName), or maybe the refresh the editor so that it shows the new name automatically....

Eclipse RCP: How and when to correctly unsubscribe a Composite from EventBroker?

java,swt,eclipse-rcp
In the constructor of my custom composite (inherited from SWT Composite), I register myself as an EventHandler to the Eclipse IEventBroker. To unsubscribe upon disposal, I had overridden the dispose method where I unsubscribe myself. But I now noticed that this unsubscription is not happening, indeed the dispose method is...

Eclipse RCP: How to listen to CheckboxTableViewer selection in other view

java,swt,eclipse-rcp,jface
I have an Eclipse RCP with a view whose Control is a CheckboxTableViewer. I'd like to use the WorkbenchPage's SelectionService (for reasons of loose coupling) to react to check/uncheck actions within the view in an editor. So I do getSite().setSelectionProvider(myTableViewer); in the view's createPartControl() method. Also, I create a listener...

How to position a Handled Tool Item to the right

java,eclipse-rcp,rcp,e4
I've an application built on eclipse e4 framework. I want to position a Handled Tool Item to the far right end. How can I achieve it? ...

IInputSelectionProvider not considered by listeners of RCP SelectionService

eclipse-rcp
I have a RCP application with different views. The views should interact with each other through the Eclipse SelectionService. In view 1 I have added a SelectionListener with getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this.listener); In view 2 I have added a SelectionProvider with getSite().setSelectionProvider(this); To get this working, I implemented the methods from the IInputSelectionProvider...

Always show the file path in FilteredResourcesSelectionDialog

eclipse,eclipse-plugin,swt,eclipse-rcp,jface
In the FilteredResourcesSelectionDialog, some items show the file path beside them in grey color while others don"t show the path. Why does this happen and how do I make sure that the file paths are always shown?...

Add a progress bar to a Job in RCP

java,eclipse-plugin,eclipse-rcp,rcp,jobs
I have a time consuming job in my RCp application in which I read out a big database and save it in a file. I am running this job in a separate thread so that the UI of my app is not blocked but I dont know how to add...

Enable plugin only on certain folder (Eclipse RCP)

eclipse-plugin,eclipse-rcp,plugin.xml
I created a simple Eclipse plugin, to launch a wizard and create some files, everything is working, I also added an option lo launch the wizard from the New > Mi Wizard menu, but now I want to display this option only when I right click an specific folder in...

Elapsed time column - how to refresh only one part of StructuredViewer

swt,eclipse-rcp,jface
I have a StructuredViewer (in this example a TreeViewer with columns) that refreshes its interior through some callbacks I don't want to get into, by calling setInput() and refresh() on it when the callbacks occur. I need to introduce a Time Elapsed cell that will need to refresh every second,...

Tycho build error: “… requires bundle … but it could not be found”

eclipse,plugins,eclipse-rcp,tycho
We have an eclipse Luna plugin application which we're trying to build with Tycho. When we try to do a mvn clean verify, we're getting this type of message: [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: our.app 1.0.0.qualifier [ERROR] Missing requirement: our.app 1.0.0.qualifier requires 'bundle org.eclipse.core.runtime 3.7.0' but...

Invalid Thread Access

java,eclipse,multithreading,swt,eclipse-rcp
The create View Control Class public void createPartControl(Composite parent) { //viewer = new TableViewer(parent, SWT.MULTI| SWT.V_SCROLL); //viewer.setContentProvider(new ViewContentProvider()); //viewer.setLabelProvider(new ViewLabelProvider()); // Provide the input to the ContentProvider //viewer.setInput(new String[] {"One", "Two", "Three"}); //Display display=new Display(); parent.getShell().setText("A dialog box with no buttons at all press 'ESC' to close"); final Shell shell...

What is the difference between jface treeviewer setComparer method and setSorter method?

java,eclipse-plugin,eclipse-rcp,jface
Could anyone explain me conceptually(inner working), what is the difference between jface treeviewer setComparer method and setSorter method.

Missing jar files in Eclipse RCP 4.4.2 (Luna SR2) SDK, delta pack and language pack

jar,eclipse-plugin,eclipse-rcp,java-8,eclipse-luna
We have an Eclipse RCP based GUI application based on Eclipse SDK 3.7.2 and compiled using Java 7. We are migrating the code base to Java8. We are also migrating Eclipse version to 4.4.2 (Luna SR2) as Eclipse supports Java8 starting 4.4. I have downloaded eclipse-4.4.2-delta-pack.zip and eclipse-SDK-4.4.2-win32.zip and built...

How to add a Menu Action to my view?

java,eclipse-rcp
I want to add a menu action to my view, like this one from the Eclipse Console: I managed to do something quite similar.. From the two actions that I want on the menu, one of them has a MenuCreator associated, but doing it this way sets this action to...

RCP or SWT to build eclipse plugin

java,eclipse,eclipse-plugin,swt,eclipse-rcp
I am new to eclipse plugin development. I want to develop a plugin which will generate XML files from the classes present in the workspace. It will have 2-3 UI forms which will take information from user while generating XMLs. From what I have read till now, I think there...

Is it possible to use a target platform eclipse 4 with an app coded in eclipse 3?

java,eclipse-rcp
As the title says, I want know if it is possible to run an application coded in Eclipse RCP 3.X above an Eclipse 4.X target platform without making structural changes (such as migrating the application code to eclipse 4.X). If so, how can I do that?

Save the selections in JFace Dialog (Java)

java,eclipse-plugin,dialog,eclipse-rcp
I have a dialog which consists of multiple checkboxes. when a user click on a button the dialog opens and all the checkboxes are selected by default. the user can uncheck some checkboxes. Second time the user click on the button I want the dialog to be loaded with the...

Use existing perspective from a different plugin in RCP application

eclipse,eclipse-plugin,eclipse-rcp
This is what we have: a Plugin with an IPerspectiveFactory implementation and an extension to org.eclipse.ui.perspectives. This works fine if we open the perspective in the Eclipse window that is tarted from this plugin's MANIFEST.MF. An Eclipse 4 Application Project (in a different Eclipse project) I tried to use the...

RCP Editor and JPA merge

eclipse,jpa,eclipse-rcp,eclipselink,jpa-2.1
I am updating an RCP based application to use JPA 2.1 (EclipseLink's implementation) from Hibernate 3.x. The JPA merge behavior is causing me problems. The issue I am seeing is when I assign the returned value to the model object in the RCP editor (inherited from FormEditor) it is a...

Nebula Nattable - Change columns dynamically

java,eclipse-rcp,nebula,nattable
I am using a Nattable inside a eclipse ViewPart. My RCP application is such that, each time I open the view, the table can have different columns based on the datamodel(represented by a different POJO) I wish to display.In short, can I do something like the below? : ` IWorkBenchPage...

A handler conflict occurred. This may disable some commands

eclipse-plugin,eclipse-rcp,eclipse-pde
I want to be able to control when a particular command can be enabled in a toolbar. Currently this is in my plugin.xml file: <extension point="org.eclipse.ui.commands"> <command defaultHandler="my.plugin.handler.Terminate" description="Terminate session" id="my.plugin.terminate" name="Terminate"> </command> </extension> <extension point="org.eclipse.ui.commandImages"> <image commandId="my.plugin.terminate" icon="icons/terminate.gif"> </image> </extension> <extension...

org.eclipse.ui.part.MultiPageEditorSite cannot be cast to org.eclipse.ui.internal.PartSite

eclipse-rcp,rcp
I am porting eclipse 3 RCP on Eclipse 4. I am getting runtime exception java.lang.ClassCastException Here is the code snippet public FamilyEditorSite(MultiPageEditorPart multiPageEditor, IEditorPart editor) { Assert.isNotNull (multiPageEditor); Assert.isNotNull (editor); this.multiPageEditor = multiPageEditor; this.editor = editor; // Point for runtime exception PartSite site = (PartSite) this.multiPageEditor.getSite(); //IWorkbenchPartSite site = multiPageEditor.getSite...

IWorkspace search for file type

eclipse,user-interface,eclipse-plugin,eclipse-rcp
I need to search my project workspace and find a certain type of files (e.g. .txt) and store them in a list for example. I can access the workspace by: IWorkspace workspace = ResourcesPlugin.getWorkspace(); But how to search through the different folders and get the type of files that I...

Eclipse RCP and RAP customizable table control

java,eclipse,eclipse-rcp,eclipse-rap
I am looking for a table control that is customizable and works both on RCP and RAP, single source. By customizable I mean this: a cell from this table can also be splitted again in rows and columns. Or should be possible for the cell renderer to draw this cell...

Eclipse RCP periodic workspace save

eclipse-rcp
I am developing an RCP application in Eclipse 4.2. I am getting an error of "Periodic workspace has encountered a problem". My question is how to disable periodic workspace save in my RCP application. Thanks!...

How to pass an object from one part to another part in Eclispe e4 RCP?

eclipse,eclipse-rcp,e4
I am building an application with eclipse e4 RCP. I have a navigator (similar to Navigator in eclipse IDE) and I would like to link it to an editor (similar to how a file in Navigator in eclipse IDE is linked to an editor). Currently I am using EPartService to...

Update Eclipse menu radio state from code

eclipse,eclipse-plugin,eclipse-rcp
In the command handler for a radio state menu item, I prompt the user if they want to continue. If they choose no, I need to reset the selected menu item back to the previous value. I am using HandlerUtil.updateRadioState(event.getCommand(), oldScope) but the menu stays with the new value. Any...

Export an Eclipse RCP product

eclipse,eclipse-rcp,rcp
When I try to export my own RCP product I receive this error: In plugin com.nex.editor, the value for property source.lib/commons-beanutils.jar is not set. Any help or idea how to resolve this problem?...

Eclipse RCP - JFace dialog doesn't show buttons

java,swt,eclipse-rcp,jface
I'm trying to create a custom dialog with a TableViewer inside it. It looks good as Test/Preview but when I actually run my app the buttons at the bottom disappear. Test/preview when running from inside WindowBuilder looks like this (at the bottom): When running in the app it looks like...

Dynamically update TreeViewer from eclipse plugin

java,eclipse-plugin,eclipse-rcp,jface
I am creating a eclipse plugin which requires TreeViewer to be dynamically updated when domain object changes. I have found one article from eclipse site http://www.eclipse.org/articles/Article-TreeViewer/TreeViewerArticle.htm?PHPSESSID=4d48764999a9cb66a7fd58a954ef2131 This article mentions below code to register for domain object changes /** Because the domain model does not have a richer * listener model,...

Creating anonymous view actions in Eclipse e4

eclipse,eclipse-rcp,e4
I am trying to create a new view using Eclipse e4 (my product is RCP 3.x based, but now updated to use the Legacye4.xmi). In the past when I wanted to create a toolbar action to interact with internal view state I would do something like this; private TableViewer viewer;...

Eclipse PDE: Exclude test fragments from required plugins

eclipse,eclipse-plugin,eclipse-rcp,eclipse-pde
I have an Eclipse RCP application with plugins and associated test fragments. When using the "Add required plugins" functionality in the launch or product configuration, the test fragments get added as well. Can I avoid this? My plugins don't depend on their fragments, and I'd like to select only the...

Disable “Detached”-Action in SWT - “Wrong parent”-Exception

java,swt,eclipse-rcp
Im working in a project, with a Eclipse SWT-Application. On the tabs of all views there are the default-actions, for example the "Detached"-Action that takes the tab and creates a detached window for it. In our case, this leads to the following exception: Widget has the wrong parent java.lang.IllegalArgumentException: Widget...

How to Inject a context from a test

dependency-injection,eclipse-rcp,integration-testing,e4
I'm testing an (Eclipse 4) application (I'm not talking about unit test but more integration and system-test). I've a recurrent problem I need to solve. I have to "inject" (@Inject) a context from the test into the class(es) under test. In other words I need the test does what the...

Implementing a Launcher Framework - disabled Apply button on dialog

eclipse-plugin,eclipse-rcp
I am working on a eclipse plugin and implementing a custom launcher as per the link https://eclipse.org/articles/Article-Launch-Framework/launch.html . I have implemented a class BrowsersTab which extends AbstractLaunchConfigurationTab and implemented all the methods. The problem is that when I call the updateLaunchConfigurationDialog(); on the selection event , the 'Apply' Button remains...

Mouse Events on Application Window

java,eclipse-plugin,swt,eclipse-rcp,e4
I've an eclipse e4 application. I'm trying to run some code say xyz() when the window is resized. The issue is that while resizing the resize listener is called multiple times and I want to call xyz() only once after the user has done resizing. The only way that I...

Maven Tycho: use multiple environments (win32, linux) during test, but only build win32 artifact

maven,jenkins,eclipse-rcp,tycho
I have a Maven Tycho project, where unit tests are run with tycho-surefire-plugin. These unit tests use the SWT library, and because I want to be able to build the project locally (win32) and on the Jenkins continous integration server (linux), I specified multiple enviroments, so that the libraries were...

Can SWTBot recognize Action Buttons?

java,junit,swt,eclipse-rcp,swtbot
I have an RCP Application with a ViewPart that has a toolbar with some Actions on it. These Actions are put on the toolbar by the system as simple Buttons with an icon and a tooltip. The Action looks like this: public class MyAction extends Action { public static final...

How can I build BIRT 4 designer RCP?

build,eclipse-rcp,birt
I am new to Eclipse development and I have been trying to build the BIRT designer RCP without success. My goal is to customize the BIRT designer, e.g. removing some views and menus, setting fixed data sources and templates, restricting some actions, etc, and then embed it in my own...

PDE Tools (Create Ant build file) not generating ant script(build.xml)

apache,ant,eclipse-plugin,eclipse-rcp
I have created one plugin project "com.example.first" and one plugin feature project "com.example.first.feature" for the plugin. I am able to generate build.xml(ant build file) for "com.exilant.first" by following below steps: right click on build.properties---->Plug-in-tools--->Create Ant build file. I am following same steps to create build.xml for "com.exilant.first.feature" (feature project) but...

EMF: How can i reload an Emf model resource when the xml file is editied manually and saved

editor,eclipse-rcp,eclipse-emf,emf,eclipse-emf-ecore
I have an Emf editor linked with spring.xml. When the editor is opened the spring model is created and stores in the editing domain. Every time a user manually edits and adds content into spring.xml. How can i load the updated spring model into the Editing Domain Resource.

Close an open IFile in editor if it is deleted in Project Explorer

eclipse-plugin,eclipse-rcp
I have a requirement to close an open IFile in editor if it is deleted in Project Explorer. As I understand IResourceChangeListener can be used to listens to changes in project workspace but how can I get the perticular file which has been deleted. as event.getResource() returns a IProject being...

In Eclipse RCP, how to prevent a PartStack from being destroyed when it becomes empty

eclipse-rcp,e4
I have a Sash containing two PartStacks. Each PartStack contains a Part. When moving a Part from the first PartStack to the second PartStack, the first PartStack becomes empty. It is then destroyed from the Model. (I checked this using the LiveEditor plugin.) What I would expect is the PartStack...

Rename resource file does not change editor part title

eclipse,user-interface,eclipse-plugin,eclipse-rcp
In my plugin project, I have a project explorer view where I can rename a config file which in shown in another editor part. The file can be renamed in the explorer with the rename resource dialog but the corresponding the editor tab title does not change. The same problem...

JFace - Change font color in ToolBarManager

java,swt,eclipse-rcp,jface
I have an application using a ToolBarManager and I need to change the font color of a button. ICoolBarManager coolBar = ... IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle()); MyAction myAction = new MyAction(); myAction.setText("I need this text in other color"); //this is my button's description at the toolbar toolBar.add(myAction); coolBar.add(new ToolBarContributionItem(toolBar,...

Test Eclipse 4 RCP Application. Provide necessary Objects

java,eclipse,eclipse-rcp
I´m developing an Eclipse 4 RCP Application and I want to test some functions of my Parts. I have a Test Class like this: @BeforeClass public static void initUI() { display = new Display(); shell = new Shell(display); configPart = new ConfigPart(); configPart.postConstruct(shell); } @Test public void testConfigPart() { String...

How to log starting of Eclipse plug-ins / OSGi bundles?

eclipse,eclipse-plugin,osgi,eclipse-rcp,osgi-bundle
In an Eclipse RCP application, how can I automatically log each plug-in as it is being started? I know about these, but am looking for something more akin to Java's -verbose:class: OSGi console's ability to query the current set of plug-ins. Handcoding a logging call in each plug-in's activator. This...

Is it possible to “extend”, or re-use, an Eclipse extension point?

eclipse,eclipse-plugin,osgi,eclipse-rcp
I'm developing an Eclipse RCP application (3.x), which also provides extension points. Up to now, I've simply created a new schema for the extension points, since they are linked to specific application functionalities. Now, however, I'd like to provide an extension point for new editors. I'd like to use the...

Root directory of eclipse plugin project

java,eclipse-plugin,eclipse-rcp
I have an RCP application based on eclipse plugins. I have a file and I want to put it inside the root directory of my plugin and access it from there, so it is available on any platform (windows or linux). For example, my plugin name is Test and I...

Does PlatformUI.createDisplay() ensure creation of Display object through UI thread?

java,user-interface,thread-safety,swt,eclipse-rcp
How should I ensure creation of Display object through UI Thread only? Does PlatformUI.createDisplay() ensure creation of Display object through UI thread?...

What is the difference between application context and workbench context in eclipse e4?

eclipse,eclipse-rcp,e4
I have read in different tutorials/articles these terms are used alternatively 'Application Context' and 'Workbench Context'. Are they the same? If not, what is the difference between the two? and whats the relationship between them?...

Re-set Editor Input of AbstractConfigurationEditor

eclipse,eclipse-plugin,eclipse-rcp
I have a MultiPageEditorPart which contains two AbstractConfigurationEditor which I added via the addPage() method. I have a rename file listener and reset the main editor input via setInput() and rename title setPartName(). However I still need to change the editor input of two AbstractConfigurationEditor. But their setInput() method is...

Do not save workbench state in a eclipse RCP app

java,eclipse,eclipse-rcp
I am devoloping an application with eclipse RCP. This application should alwaysshow a certain perspective when started. But the application saves it workbench state and when restarted it shows the same perspective it had when it was closed. I tried to add public void initialize(IWorkbenchConfigurer configurer){ configurer.setSaveAndRestore(false); } to my...

Programatically trigger DataBinding execution on Slider Selection

java,swt,eclipse-rcp,jface,e4
I have a Databinding between a Widget (Slider) and a Model (int value) in my E4 Application. If I start the Application and move the Slider, the Model value gets updated properly, so the Databinding works. But if I set the Slider Selection via the setSelection method, the Databinding isn´t...

Eclipse PDE: Programmatically detect opened dialog and close it

eclipse,swt,eclipse-rcp,jface,eclipse-pde
On Eclipse Luna, I select a server and click the Start button on Servers view, then the server (for example Tomcat8) will get started. If something is wrong during the start-up process, a dialog will be populated to display the error messages (for example time-out). The dialog is modeless in...

RCP TT cannot record for my application

java,eclipse-plugin,eclipse-rcp,rcp
I am trying to use the record feature in RCP TT but it keeps failing to start with this error: org.eclipse.core.runtime.CoreException: Java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.rcptt.tesla.internal.ui.SWTUIPlayer The application i am running is a RCP app and RCPTT can run it fine but when i try to use the record...

Cyclic Dependencies detected while creating exe from rcp plugin

java,eclipse-plugin,eclipse-rcp,rcp
I have a bunch of eclipse plugins projects. Everything works fine when I run them from eclipse but when I try to create exe from the plugins I get the following error A cycle was detected when generating the classpath Plugin A, Plugin B, Plugin C, Plugin D, Plugin B...

How to set custom style to some columns in a nattable?

java,eclipse-rcp,nattable
I need to set a custom style not for all, but some columns in a nattable. I can't set the configuration like this: natTable.addConfiguration(new DefaultNatTableStyleConfiguration()); because this sets the configuration to the whole table. I have to override the configuration only to specific columns. In my case the columns should...

Is there any event to know if a view is moved below some other view?

java,eclipse-plugin,eclipse-rcp
I have a stack of views shown on top of each other. So at a time only 1 view is shown and others are below the active view. I want to know whether a particular view is active or moved below some other view inside the ViewPart code. Is there...