eclipse-rcp

How to get the IEclipseContext in an activator

烈酒焚心 提交于 2019-12-01 04:51:24
I got stuck on one problem with an Eclipse 4 RCP application. I need to log some events. I need obtain somehow a reference to the logger. I know, how to do that using IEclipseContext , but I've nowhere found, how to obtain IEclipseContext without the dependency injection, which I cannot use in the activator. Do you anybody know, how to sort it out this problem, please? Thanks a lot You can get a specialized IEclipseContext by calling EclipseContextFactory.getServiceContext(bundleContext) which will allow access to OSGi services. Tomáš K. It seems regretably, that there is no way to obtain

Lazy activation of Eclipse plugins

与世无争的帅哥 提交于 2019-12-01 04:44:37
I would like to know what is "Activate this plug-in when one of its classes is loaded" check-box in Eclipse manifest editor useful for. I thought Eclipse always use "lazy initialization" approach. Does have this option a relation to the BundleActivator class of the plugin? is initialization something different to activation? Here is a similar question, but I don't understand it entirely. Ticking the box causes the following header to be set in the manifest: Bundle-ActivationPolicy: lazy I'll start with how "pure" OSGi deals with this. IF the bundle is started with the START_ACTIVATION_POLICY

How to Add Text and Image Both in a SWT LABEL

孤人 提交于 2019-12-01 04:37:26
Is there any way to add Text and Image in SWT label in a single line. Once I add image, text goes off. No you can't have an image and text simultaneously in a Label (unless you custom draw it). Else use org.eclipse.swt.custom.CLabel : Code: import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class LabelTest { public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell

How do I make a view scrollable in an Eclipse RCP application?

ε祈祈猫儿з 提交于 2019-12-01 04:23:44
What I tried so far: In createPartControl: ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); sc.setLayoutData(new GridData(GridData.FILL_BOTH)); sc.setExpandVertical(true); sc.setExpandHorizontal(true); sc.setSize(ApplicationWorkbenchWindowAdvisor.WIDTH, ApplicationWorkbenchWindowAdvisor.HEIGHT); final TabFolder tabFolder = new TabFolder(sc, SWT.TOP); but this does not work. My problem is that if I resize my program window the scrollbars does not appear in my view. Any ideas? The Javadoc of ScrolledComposite describes the two ways to use it, including example

Using the 64bit XulRunner in Eclipse SWT under Windows

故事扮演 提交于 2019-12-01 04:20:33
问题 Is it possible to use the 64bit XulRunner for Windows (available from here) with the Eclipse browser widget? It works fine under 32bit Windows and the answer to this question explains how this works. But when I try this under 64bit Windows I get the following exception: org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-xulrunner-win32-3834 in java.library.path no swt-xulrunner-win32 in java.library.path Can't load library: C

How to programmatically copy a folder from a plugin to a new project in the work space?

隐身守侯 提交于 2019-12-01 04:04:10
问题 I am developing an Eclipse Plugin creating a new Project Wizard. When creating such new project in the workspace I need it to copy a folder, and its descendent, from the plugin to the just created project in the workspace. The problem is that while the project is an IResource the plugin folder is in the file system. I succeeded in getting an URL for the source plugin folder I need to copy and I have the IProject reference. What I need to know is: How to copy the former into the latter? 回答1:

Use Navigation History in Eclipse RCP

北城以北 提交于 2019-12-01 03:55:32
问题 I like to use the navigation history provided by Eclipse in my RCP Application. Unfortunately this feature isn't well documented. In fact I only found this Wiki entry: http://wiki.eclipse.org/FAQ_How_do_I_hook_my_editor_to_the_Back_and_Forward_buttons%3F It mentions that every editor can be marked in the navigation history, without having to specify a location. This is exactly what I want. Regardless of whether the specific editor has any support for navigation history, markLocation will work

How to auto-start/eager start OSGi services on Eclipse platform

ε祈祈猫儿з 提交于 2019-12-01 03:29:13
I develop an Eclipse RCP application which makes heavy use of OSGi bundles which provide services for later use. The use case requires the bundles to register their services (e.g. import filters) to be used later on in different situations. The OSGi bundles are build with maven-bundle-plugin. How can I tell Equinox to start the OSGi bundles automatically? The normal approach via Activator is not working. Only the lazy mode is working, but I can not touch classes within unknown bundles. I read the OSGi specification and the opposite to lazy load, eager load, is not provided. Is there another

eclipse product invocation causes java.lang.RuntimeException: No application id has been found

廉价感情. 提交于 2019-12-01 02:50:34
I just exported a product that is working nicely if I hit the "Launch an Eclipse application" button. If try to execute the exported product, I get following exception on the startup: !SESSION 2012-03-16 17:28:21.206 ----------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_26 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.osgi 4 0 2012-03-16 17:28:22.184 !MESSAGE Application error !STACK 1 java.lang.RuntimeException: No application id has

How to get the IEclipseContext in an activator

自闭症网瘾萝莉.ら 提交于 2019-12-01 02:25:48
问题 I got stuck on one problem with an Eclipse 4 RCP application. I need to log some events. I need obtain somehow a reference to the logger. I know, how to do that using IEclipseContext , but I've nowhere found, how to obtain IEclipseContext without the dependency injection, which I cannot use in the activator. Do you anybody know, how to sort it out this problem, please? Thanks a lot 回答1: You can get a specialized IEclipseContext by calling EclipseContextFactory.getServiceContext(bundleContext)