Eclipse RAP/RWT not containing a Transform class - eclipse

I am using Eclipse RWT to port applications written using Eclipse SWT to the web. But unfortunately there is no equivalent class for transformations under org.eclipse.swt.graphics.
You can compare the Eclipse Platform API and the corresponding RAP/RWT API to see what else is missing. Concerning single sourcing the transformation operations are quite important and yet I couldn’t figure out why these are missing. And before opening a feature request ticket it is probably better to ask if someone already has a solution to this problem.

The reason why the GC API in is not completely implemented in RAP is that some features are hard or impossible to implement in all browsers. For example, in IE7 and IE8, the webclient has to resort to VML to draw, which is very limited. But also the HTML5 Canvas API does not cover all features of the GC API. I guess that transformations are only possible with SVG, which has already been considered as an alternative to HTML Canvas.
I'd suggest that you open an enhancement request for your requirements.

Please open an enhancement request here [1]. I'm not sure if all the Transform API could be implemented against HTML canvas in all supported by RAP browsers.
[1] http://eclipse.org/rap/bugs/

Related

How to reverse engineer a progressive web app ?

I found this free PWA https://www.the-qrcode-generator.com and now wonder how I could do one such myself.
Since I couldn't find any access to its source code I wondered if it'd be difficult to reverse engineer.
I'm interested in building a PWA with QRCode functionality.
This one was created with AngularJS v1.3.20. You can find the source in your console windows under Sources tab. You can easily beautify the code inside the window to make it readable.
If you want to know how they organized their rest API, the browser network tab will help a lot, just filter by XHR and examine all the call from the front end to be.
The front end is very hard to revers engineer, because most sites are served as minified bundles, so you can't see the original code.
You can however find some other information about what they used to build it, for example in the html source you can see some ng-* tags, which indicates that this is angular, you can also see that body has attribute data-ng-app meaning this is angularjs and so on.
For the QR logic you can see that there are no back end calls, meaning that it is written entirely in the client. I would search for already available solutions for that.

Cannot get JxBrowser to render in eclipse rcp JavaFx environment

I am currently evaluating JxBrowser 6.17 as an alternative browser technology for a eclipse RCP based data maintenance application, since the SWT Browser does not suit our needs.
What are our special needs anyways? Well, we need to embed an older solution into our new application, since we would not be able to add all required features into the new application in time. Since we have the required features in an older JSP based web application we need to embed it to make the functionality available to our customers. This comes with a lot of issues, but for most of them we already generated answers. The biggest issue we are currently facing is that the SWT Browser component does not support instance based Cookies which we need, since our web application has Cookie based session management.
I have also tried using the Mozilla implementation using different profiles, which unfortunately is not possible, since the profile management is just as static as the Cookie management.
Next step is to evaluate commercial frameworks with which I am currently facing some issues.
I requested an evaluation license for JxBrowser and tried to embed it into our eclipse 4 RCP application. I would like to embed it using JavaFX, since we already use JavaFX and would like to avoid AWT.
Using the following code will instantiate a JxBrowser and load the given URL. Actually the request does get fired, but the Browser does not render any content at all.
FXCanvas canvas = new FXCanvas(parent, SWT.NONE);
Browser browser = new Browser();
BrowserView browserView = new BrowserView(browser);
browser.loadURL("http://www.google.com");
canvas.setScene(new Scene(browserView));
Even when loading specific HTML it will not render any content.
There are no observable Exceptions or errors.
Does anybody have an idea on whats the issue in my case?
In a different scenario we use the JavaFX WebView embedding the CKEditor into our application and everything works (more or less) flawlessly, but I am not able to get the JxBrowser to render its contents.
I am sure, that I am doing something wrong (probably something pretty basic :))
What could I be missing?
Any idea or tip could do the trick ;)

GWT Image Cropping

I'm building a website using GWT and would like to add Image Cropping capability so users can upload their profile image and then crop it as they need to. I'm looking for something similar to Jcrop but in GWT.
I found THIS and THIS code samples how to crop an image on the client side but there is no UI part where user can select part of their image that needs to be cropped.
There were also couple of similar questions on SO (for example and this GWT with Jcrop) but nobody gave an example of the selection part of the image that uses pure GWT.
If you have an idea how to do it please share and I'm sure other people will leverage from this in the future.
Here is the example of what I'm looking for:
I recommend that you take route #1. I've been working full time in GWT for awhile and spend a lot of time looking for libraries, and this is one that I just don't think exists yet.
Here are your options:
Wrap Jcrop using a JSNI interface.
Pros: You have to include JQuery and JCrop, which are small and robust
Cons: Learning how to build your first JSNI wrapper can be a pain
Build your own from GWT Drag and Drop
Pros: "Pure GWT"
Cons: You probably won't handle all the edge cases that JCrop has figured out over time, nor be as featureful.
Port JCrop to GQuery
Pros: JCrop is open source and only around ~1600 lines of code
Cons: It's ~1600 lines of code, which is likely to be much bigger when ported to Java
If you decide to do any of the above, please open source it! I'd be happy to contribute, and it looks like something that I could use in my GWT projects as well.
GWT Cropper is a widget that allows cropping an image.
https://code.google.com/p/gwt-cropper/
Edited in 2015: as long as Google Code is about to be closed, the project has been moved to GitHub. The new address is https://github.com/w32blaster/gwt-cropper

Accurate browser detection/redirect possible using JavaScript?

Please forgive me if this answer is somewhere else on this site or online. If it is, I sure haven't found it in the past several days of searching.
What I am hoping to find is an "accurate" method of detecting a browser and redirecting to a simple, static page if not a recent browser.
The samples I have found until now often have not provided an accurate representation of the actual browser being used. For instance:
When testing with Navigator 9, I'll get a message that I'm using Firefox 2
When testing with Maxthon 3, it reports I'm using IE 9.
My site displays correctly in all the current browsers I've been testing it with. But I wish I could have a basic static page for those .01% who still are using an old browser for whatever reason. They could still get some basic information from my site, as well as encouraged to update to a more current browser.
If anyone has any useful suggestions, I'd greatly appreciate them.
Thanks so much.
Cheers,
David
Browser detection is never perfect, for a variery of reasons. If you are using jQuery, you should look into jQuery.browser.
I'd try to detect the browser on the server side and do an HTTP redirect if the browser is something non-standard. Most decent frameworks have functionality to detect the browser from the user agent string. Again, this is not perfect, mainly because of the data browsers report. Also, if Maxthon reports it's IE, that's because it is based on IE and therefore the layout engine should be the same.
So you either
support a small number of browsers and cater for their quirks, sending all other browsers to a basic page (this sucks for future versions of browsers because they might be standards-compliant but they will still display your very basic page), or
you have a standards-compliant page for all browsers and then you define alternatives for the ones that give you problems.
I'd go for the second option. It usually all boils down to one version for all browsers, and a number of hacks for various versions of IE. Also, remember to avoid padding in your CSS and use margins instead.
In the end, you probably shouldn't be testing for browsers and version numbers, but supported features. Try using Modernizr.
The $.browser property is deprecated in jQuery 1.3. On jQuery support site, they strongly recommend to use the detection feature (JQuery.support) instead of the jQuery.browser property.
Actually, this has been answered already in another question, please check here How can you detect the version of a browser?

Has anybody tried the new MVC HTML5 Toolkit from Codeplex?

I saw a tweet today referring to the MVCHTML5 helpers on Codeplex. I'm wondering if
Anybody has tried this out yet?
Does it add any real significant benefit over the default HTML helpers?
What are the actual HTML5 aspects of this library?
I would definitely recommend checking it (I am a little biased as I wrote it!).
But it's just a simple DLL that you include in your MVC project and it will give you all the benefits of HTML5 input types. If the browser doesn't support it - it will just fall back to a normal textbox.
To answer your questions though, it only adds a benefit if you are looking to add HTML5 functionality to your application or website. It uses the exact same syntax and the normal HTML helpers that ASP.net MVC comes with, but this just makes life easier if you are looking to add HTML5 functionality to your site.
Here is another link regarding HTML5 and the input types: http://diveintohtml5.ep.io/
I've just been trying it out, it doesn't seem to support the Required DataAnnotations for unobtrusive client side validation