JflashPlayer in SwingNode - javafx-8

Is there any workaround to use DJNative's JflashPlayer in swingNode of JavaFX 8. I had worked with incorporating JflashPlayer in pureswing containers like JPanel. But when using java's new version- Java8 which has new added feature of embedding swing components in JavaFX using the SwingNode, I can embed JButton and whatever swing components to it, it is working fine. But DJNative's JflashPlayer cannot be embedded in SwingNode or it cannot be found working.
Can any one help me on this.

Related

WebDriver GWT TabPanel Issue

I'm trying to create a WebDriver Test for a GWT application which uses a TabPanel. Clicking on a tab works fine in the IDE (it uses the x-path to find the tab) however I cannot get the tab click working in the JUnit test.
All elements have a debugID including the Tabs (although tab id's do not appear to work even in the IDE) and I'm inheriting com.google.gwt.user.Debug. I've attempted to locate by Xpath which is the IDE default.
genericElement.findElement(By.xpath("//div[#id='gwt-debug-mainTabPanel']/div[2]/div/div[6]/div/div")
I've tried the code outlined in the documentation
genericElement.findElement(By.id("gwt-debug-mainTabPanel-bar-tab6")
I've also attempted a moveToelement(as clickAt is no longer supported) and click but that falls over too(unless I'm misunderstanding it). I'd also like to avoid this as it seems bad practice.
Actions builder = new Actions(driver);
genericElement = driver.findElement(By.id("gwt-debug-mainTabPanel"));
Action action = builder.moveToElement(genericElement,400, 370).click().build();
action.perform();
java.lang.UnsupportedOperationException: Moving to arbitrary X,Y
coordinates not supported.
I know GWT and Webdriver aren't getting along too well - but I feel like this will have a solution. Can anyone offer any help - has anyone implemented a working Webdriver test in which they click a tab in a GWT TabPanel?
EDIT
I've managed to locate the node using Firebug and xpath locators ( you can add /..to move to the parent gwt-TabLayoutPanelTabInner or add /../.. to mover to grandparent gwt-TabLayoutPanelTabInner and it should still work - it does in the IDE)
genericElement = driver.findElement(By.xpath("//div[contains(#class,'gwt-HTML') and contains(text(),'Users')]"));
However not the click doesn't change to the required tab - seems to be a known issue (likely don't need both moveToElement and click(genericElement) - hust giving it a shot)
Actions builder = new Actions(driver);
builder.moveToElement(genericElement).click(genericElement).build().perform();
See section 3 ....This is fun :)

Gwt template file of panel

I am a new GWT developer, just do some coding practice on the MVP framework of GWT, I encounter a interesting problem with the ui template file,
WHen I use HtmlPanel as the root element for widgets in the template, everything show up after module is loaded.
this template works as expected, however if I remove the tag, using an absolutePanel instead nothing shows up,
can anyone tell what could cause the problem, thanks a lot.

SWT needs to much lines of code

I wondering why swt is so inconvenient to use. We as programmers have to produce tons of unnecessary source code. Here an example.
Label label = new Label(parent, SWT.NONE);
label.setText("labelname");
The minimum would be like this:
createLabel(parent, "labelname");
I build up a convenients library and I would like to know if there is something similar or why SWT or JFace don't go this simple way. Is there any drawback in having some more constructors that cover 80% of the programming task.
Have a more detailed look what I have done.
SWT: More Convenients Please
I suggest trying Google Window Builder Pro. It is a plugin for Eclipse that allows for the graphical development of GUI's in SWT, Swing, RCP, JFace and others. GWB writes the code which specifies the GUI layout and all you must do is write code to handle events.
As far as I know there is no such generic library. The one instance which provides some basic factory support for swt control creation is JFace Form Widget. Also have a look at this org.eclipse.ui.forms.widgets.FormToolkit.
From your implementation it appears that you are assuming the GridLayout as the default layouting style. Apart from that a control may have many layout related data like, its indentation (horizontal and vertical), span etc. Which is not easy to cover with factory methods.
If you don't want to put in the extra effort of writing the code for layouting the widgets and all then have a look at the Visual editor at http://www.eclipse.org/archived/.
Also, eclipse itself is moving towards the the Model Driven Generation (http://www.eclipse.org/e4/). It won't be a wonder if we will see a Netbeans like UI designer for SWT (by the way i have written a version for our tool using eclipse modelling framework and GEF).
Still I would suggest you to write the mundane layouting code by hand because it will improve your SWT understanding.
Bytes are very cheap to produce, and I'd debate that SWT "is so inconvenient to use" - well if it's automatically producing it, how is that inconvenient ?
Our computers are so fast that we couldn't even perceive the difference... and time saved is huge.

How to use GWT designer with Eclipse GWT plugin?

Sorry but I see no way to use it at all!
If I create GWT project with sample code, then SDK is generating a page with a HTML table where positions for sample TextBox-es and Button are already marked. So, if I open sample file with GWT designer and move button slightly down-right, I will get errors during run.
If I create GWT project without sample code, then GWT designer appears to be unable to open file with empty GUI.
Is there any way to design GUI from scratch or to see GWT designer usage sample?
Thanks
The problem is when you want GWT to create sample code for you, it puts the container parts of layout hard-coded in your projects html file. The generated sample uses RootPanel.get("someId").add(someWidget); to access these containers. When you open designer and move these widgets around, designer generates RootPanel.get("someId").add(someWidget,left,top); which doesn't work with this method.
On another note, when you want to create a class from scratch and open it with designer, you can simply add a reference to RootPanel to get around "this is not a gui class issue" such as :
public class SimpleClass {
RootPanel r = RootPanel.get();
public SimpleClass() {}
}

SWT in eclipse version 4.1 add additional dialogs

I am very new to swt and im my example I am using the following code for the shell and the display:
final GridLayout layout = new GridLayout(2, false);
parent.setLayout(layout);
I am trying to open a new ,'panel' as it is called in java, I think in swt it is a new display/dialog? when a button is pressed in the opening shell? I have looked everywhere for an example and I tried so much and cannot get it to work.
Any ideas on what I would put into my Listener?
Thanks,
Ann.
The equivalent to JPanel is a Composite in SWT. You should consider to read http://www.eclipse.org/swt/snippets/ for examples.
You may also check out http://www.eclipse.org/recommenders/ which might be of help when learning SWT.