Can I embed my RCP's ViewPart in a Swing Application? - swing

I have an RCP application with a hidden workbench window. I need to reuse the RCP's dialogs and views from a Swing application. The two processes communicate with each other via HTTP.
To display the RCP's SWT dialogs from the Swing Application, on Windows, I pass the window handle of the Swing application's main window to my RCP. It creates a Shell using Shell.win32_new() and uses that to parent the dialog.
Now, I have a ViewPart that I am hoping I can embed in the Swing application. I have tried embedding an SWT widget in my Swing application as described at https://www.eclipsezone.com//eclipse/forums/t60541.html and it works. The problem is in my case, first, its a ViewPart, and second, I need to achieve the embedding across processes. Is this even possible? Is there an approach similar to the window handles that I can employ?

Related

Coded UI - Unable to identify a html controls on a Wpfbrowser

I am new to CodedUI & C#.
I am trying to automate a wpf application which has a WPF Browser.
So basically, It's WPF container with html content inside. I have created a similar sample small application and shared it here. This application opens the amazon.in website within wpfwindow.
WPF Browser application
My problem is Coded UI is not able to identify the Html-Controls/elements like 'Buttons', 'Text input fields' properly.
Below, the top image is from the WPF Browser app [Link which i have shared].
Here you can see a blue square box on the top-left. The coded UI identifies that area has the Search Go button.
Bottom part of the image is of the amazon website in IE browser where coded ui is properly highliting/ identifying the Search Go button.
Does this mean i cannot automate WPFBrowser apps using Coded UI.?
Can someone please tell what to do to identify the buttons properly in coded ui
You need to specify Id attributes for the controls that you want exposed to Coded UI.
To me this looks like CodedUI is getting some control that's similar, rather than the correct one.
You haven't mentioned if you're recording and executing tests or handwriting them in a separate CodedUI solution.
If you're recording them: Be sure that you're recording using your WPF application and interactions inside of them, rather than recording using your browser and then trying to execute tests using the WPF application
If you're writing them by hand: Be sure that you're correctly creating trees of inheritance when writing your tests. For instance, in a traditional CodedUI scenario the absolute top level object that all other controls inherit from is a web browser. In your scenario, that object should be the WPF object. There are probably going to be some other windows or various controls that are children of the WPF application which in turn will finally have the browser as a child.

How to hide a Vaadin 7 UI embedded on a non-Vaadin page?

I'm embedding a Vaadin application within a non-Vaadin web page, using a the "div" technique, as described in https://vaadin.com/book/-/page/advanced.embedding.html
I'd like to completely hide the Vaadin UI in some circumstances and show at other times.
Is this possible from within the Vaadin app and if so, how?
We've looked at:
JavaScript.getCurrent().execute("document.getElementById('my_vaadin_div').style.display = 'none';"); - Works but not pure Java...
GWT's DOM.getElementById("my_vaadin_div").setAttribute("display", "none"); - Doesn't work probably because DOM is client side GWT.
I think your second option is the way to go. You want to hide the div that contains your Vaadin app, so here you have a pure client side manipulation. You can do that with GWT to stay in the realm of Java. Of course, you can't execute the GWT code you proposed directly from the server side. But you can write a component extension which you can use to extend your UI instance. Using a ClientRPC you can switch the div on or off.

Chrome app navigate htmls without creating windows

I'm creating a chrome packaged app, and I need to navigate my htmls without creating a lot of windows, like, if the user click one button, it opens the html in the same window the user are.
Is it even possible? If not, is there a way to make windows modal? So the user can't focus another window without closing the current?
Packaged apps intentionally do not support navigation. Apps are not in a browser, there is no concept of forward, back, or reload. Applications which do require the concept of navigation, or modal dialogs, should use a user interface framework that supports that functionality. In fundamentals, you can navigate by manipulating the DOM or by using CSS to animate and control visibility of components of your app.
The page you want to navigate to can be opened in a new window, then the previous page can be closed.
function navigateToLink (link) {
var current = chrome.app.window.current();
chrome.app.window.create(link);
current.close();
}

Current panel in jqmobi app

I am porting a mobile app from jQueryMobile to jqMobi and am looking for a way to determine the currently viewed panel. In jQuery they had
$.mobile.activePage
Does jqMobi have something similar, or do i need to track it myself?
There is a property called "activeDiv" that you can use - it is the raw DOM node.
$.ui.activeDiv

use air native extension to show a simple native button?

I'm mainly an AS3 coder and I know Java fair enough to be able to build my own ANE files for Vibration, Toast, dialogs and that simple stuff...
using air native extensions are cool but I'm getting a bit disappointed not being able to create a simple button with it.
I know creating a simple native button is a silly thing to do as it is very easy to create buttons in air directly but I'm using it as an example.
So the question is that is it possible to create .ane for calling native Button in android? at all?
it seems like I can't create any .ane files rather than abstract tools like push notifications or popup like windows like progress bars and dialog boxes.
is it right to say that a simple native button cannot be created with air native extensions?
for those who wondering why a simple button cannot be called with extensions, read http://adobe.com/devnet/air/articles/extending-air.html (scroll down to Limitations) where it says: Extensions cannot directly integrate interactive objects, such as native UI controls, with the display list. (Other items, such as native dialog boxes, may work, depending on the platform.)