eclipse-windowbuilder / windowbuilder

Eclipse Windowbuilder
https://projects.eclipse.org/projects/tools.windowbuilder
Eclipse Public License 1.0
79 stars 30 forks source link

Context menu not showing up on UI Elements #758

Open purohitanuj opened 5 months ago

purohitanuj commented 5 months ago

Hi, In earlier versions of WindowBuilder, I was able to do various tasks on right click on UI Element. For example, I could have placed a button and then right click on it to selection the action of the button, which would open the code editor with that block of new code in place. Another example would be right click on window to assign the "Window Closing" / " Window Closed" event to write a code for that. Now only two options are available. Please fix it or let me know how I can fix it. Context Menu Issue

See above. Earlier, there were many options were shown if I had right clicked the Button.

IDE Version WindowBuilderInfo

purohitanuj commented 5 months ago

This is an example of context menu on button on an older version of Eclipse and WindowBuilder.

OldMenu

ptziegler commented 5 months ago

From a fresh Eclipse IDE 4.31 + WindowBuilder 1.15.0

image

Perhaps an internal error is thrown somewhere... Can you go to the error view and check if anything is logged there?

purohitanuj commented 5 months ago

This is the error which popsup. I have discovered that if I use direct class provided by the GUI framework, example JDialog, the menu items appear. However in my project, these classes are extended to new classes and these are drawn correctly but context menu is not displayed.

Example of my project extension:

1.public abstract class MSJInternalFrame extends JInternalFrame 2.public abstract class MSPrintableInternalFrame extends MSJInternalFrame 3.public abstract class MSPrintableInternalFrameToIMSLayeredPane extends MSPrintableInternalFrame 4.public class PasswordOptions extends MSPrintableInternalFrameToIMSLayeredPane

This class PasswordOptions has the GUI Element image

image

Error which comes in the background Screenshot 2024-05-05 084956

ptziegler commented 5 months ago

The context menu with the classes you have described.

image

Are you by any chance using Java 8? Because this is the only way I can reproduce this problem.

image

purohitanuj commented 5 months ago

Yes. I can confirm that I am using Java8 and on changing to the latest version of Java, I can see the context menus. But my application runs over embedded system which is compliant for Java8; hence I cannot switch over to newer version. Any idea if this is going to be fixed or should I revert to older version of Eclipse?

ptziegler commented 5 months ago

Yes. I can confirm that I am using Java8 and on changing to the latest version of Java, I can see the context menus. But my application runs over embedded system which is compliant for Java8; hence I cannot switch over to newer version. Any idea if this is going to be fixed or should I revert to older version of Eclipse?

I had a look at it in the past and for some reason, the Eclipse compiler behaves differently when an actual Java 8 JRE is used. Any changes would have to be done there. But given that Java 8 is well beyond the end-of-life (for several years by now), it's unlikely that this will ever be fixed.

If you need to build against Java 8, then my suggestion is to use a modern Java version and instead simply adjust the compiler compliance.

image

purohitanuj commented 5 months ago

Thanks. Will check the build on my embedded platform (which is a Linux ARM 32 Hard Float ABI SOC). Cheers!

gss0 commented 1 month ago

I also encountered this problem with Java 8. Even after a clean install of eclipse and the plugin, I did not get the results I was hoping for.

I managed to identify the culprit but I do not know how to solve it. Apparently the problem is due to GridBagLayout.

This bug greatly limits productivity and makes it almost impossible to program easily... please fix it as soon as possible or at least make public directives to mitigate the problem.

Thanks

Screenshot 2024-09-23 174302 Screenshot 2024-09-23 174319 Screenshot 2024-09-23 174331 Screenshot 2024-09-23 174434 Screenshot 2024-09-23 175158

ptziegler commented 1 month ago

See https://github.com/eclipse-windowbuilder/windowbuilder/issues/758#issuecomment-2094801253