Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button addClickCommands need to have @SuppressWarnings("unchecked") #89

Open
DanielMartensson opened this issue Feb 14, 2020 · 1 comment

Comments

@DanielMartensson
Copy link

Hi!

Adding a click command to a button, requires a suppress warning.

Example:

@SuppressWarnings("unchecked")
	public void connectToButtonEnableDisableGeometry(Geometry geom) {
		enable3D.addClickCommands(e -> {
			if(enable3D.isPressed() == true && enable3D.getText().contains("Disable") == true) {
				geom.setCullHint(CullHint.Always); // Hide
				enable3D.setText("Enable");
			}else {
				geom.setCullHint(CullHint.Never); // Show
				enable3D.setText("Disable");
			}
		});
	}

Else getters and setters will have problems of the button is a field.

@pspeed42
Copy link
Contributor

pspeed42 commented Jul 2, 2020

I think the only way around this is to create duplicate versions of all of the var-arg methods that take just a single argument. It's an ugly and unfortunate limitation in Java generics that it can't handle arrays properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants