Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Sunday, September 18, 2016

Eclipse Neon (4.6) - RCP Launch Error

Creating even a vanilla RCP using out of the box templates, results in the error

Missing Constraint: Require-Capability: osgi.extender; filter="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"

This can be fixed by the Comment 14 (Dirk Fauth) in this bug -
https://bugs.eclipse.org/bugs/show_bug.cgi?id=481449

 In the Runtime Configuration, required plugins, I had to manually add the plugin to resolve the error -

org.eclipse.equinox.ds_1.4xyzzzz





Sunday, December 19, 2010

Error - 32-bit SWT on 64-bit JVM

This is more of a note to myself for the future and for anyone running into this issue.

Issue
When building an Eclipse RCP application on OSX, you may receive the following error.

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

Resolution
Tested on
  • Macbook Pro
  • OSX Snow Leopard 10.6.5
  • JVM 1.6.0_22
  • Eclipse Helios 3.6.1

1. Open the Run Configuration and switch to the Arguments tab
(Run -> Run Configurations -> RUN_CONFIG_NAME -> Arguments)

2. Add the string '-d32' (a space at the beginning and end, without the quotes) to the arguments text box at the end of the existing value.

3. That should do it. Apply and Run the app

Rationale
My understanding is that if you download the 32-bit Eclipse package like I did, it will load 32-bit SWT by default. However, OSX defaults to 64-bit. Providing the above property forces the JVM to run in a 32-bit mode.

Probably, if you download Eclipse 64-bit for OSX you may not run into this issue - I have not tried that as yet




Saturday, March 22, 2008

Transparent bordered shell in SWT

I've wanted to get a transparent bordered shell in SWT ever since I saw the transparent bordered video shell in Leopard video quickview.

A shell with alpha support is coming in 3.4. However, I have not looked at the 3.4 material as yet and this sample was built on 3.3.

The shell can be used in the same way that the org.eclipse.swt.custom.PopupList class can be used except that you can place any controls you want and not just a List. Lets see how to do this -

In SWT, a Canvas control can have an alpha value. Thus, the base needs to be a canvas. First, create a control that extends the Canvas. Set the layout for this canvas to a FillLayout. This canvas will contain other controls. It is important to set the margin of the layout. This margin will be the width of your transparent border. Now, set an alpha value for the canvas. The alpha determines how transparent the border will be.

Image -
Now create or load a gradiented (is there such a word?) image. In the paintListener for the Canvas, draw this gradiented image. Because of the alpha on the canvas, the image will be semi-transparent. Now add any controls (typically a composite with controls within it) to the canvas and these will be drawn with a transparent border around them.

To get the real transparency, this canvas needs to be placed inside a shell created with the style SWT.NO_TRIM and SWT.ON_TOP. Also, the canvas needs to be created with the style SWT.NO_BACKGROUND. However, due to these styles, the shell cannot be really moved around. Thus, its useful where no movement is necessary - a transparent menu, infopopups, ...

Thus, to summarize,
1. A shell with styles SWT.NO_TRIM and SWT.ON_TOP contains
2. a canvas with style NO_BACKGROUND, a gradiented image, an alpha value, a margin (border width) contains
3. a control (composite) that is displayed within the canvas.

Thursday, July 13, 2006

Displaying Non-Resource Content Using the Common Navigator Framework

Introduction
This post discusses the procedure for displaying non-resource nodes in a CNF Viewer. Examples of non-resource nodes are database tables or servers.

Prerequisites
The article assumes that you have some familiarity with the Common Navigator Framework. If not there are some great articles by Michael Elder.

Define a View and a Viewer
Define a view and a viewer using the common navigator framework.


This definition also adds the content binding for displaying standard resource nodes in the project structure.

Our Content
Our content will consist of the class called Child which represents a non-resource child and a class called NRParent, which will form the parent of all Child classes in the project tree. Note that in a real world the Child class could be something like a database table.





Next a Content provider and a Label provider need to be defined for this content. The content provider is simple - if a parent is of type IProject, it contributes a NRParent instance, if a parent is of type NRParent, it provides some children of type Child and if it is of type Child, it just provides more children.

Here are the relevant code sections from the content provider and the label provider -






The point to note is that when the parent is of type IProject, is when you need to provide first level non-resource nodes to the project structure. Ofcourse you can provide non-resource nodes to a specific folder within a project too or even a file. In that case, check for the parent being of type IFolder or IFile respectively. I can't think of a specific use-case for it right now, but it is something that is possible.


Now add a navigatorContent extension that defines the content provider, the label provider and trigger point. Note the trigger point and the possible children elements.


Finally, add a viewerContentBinding to bind the above navigatorContent to the viewer.



That is it. Execute a Run configuration for the plugin and open the view to see the new non-resource nodes.

As suggested by Michael, the source code has been added as an attachment to bug 143127: [CommonNavigator] Examples

iPhone not connecting to macOS from Xcode

 After trying everything standard (re-pair, restart, reconnects), it turned out that VPN was enabled on my Mac.  Turn Off VPN to let Xcode f...