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

Custom component shows additional properties in Custom section #698

Open
heySourabh opened this issue Aug 11, 2024 · 1 comment
Open

Custom component shows additional properties in Custom section #698

heySourabh opened this issue Aug 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@heySourabh
Copy link

The custom component shows the "Focus Visible", "Focus Within", "View Order" and other undefined properties under Custom section. This creates unnecessary clutter when working with custom components.

Expected Behavior

The Custom section must only show properties relevant to the Custom component.

Current Behavior

Additional properties from parent component are shown ( see screenshots below ).

Steps to Reproduce

Here is a very simple wireframe of custom component for testing:

import javafx.beans.property.StringProperty;
import javafx.beans.property.StringPropertyBase;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;

public class Card extends VBox {

    public Card() {
        getChildren().add(new Label("Card Test"));
    }

    private StringProperty title;

    public void setTitle(String title) {
        titleProperty().set(title);
    }

    public String getTitle() {
        return title == null ? "Title" : title.get();
    }

    public StringProperty titleProperty() {
        if(title == null) {
            title = new StringPropertyBase("Title") {
                @Override
                public Object getBean() {
                    return Card.this;
                }

                @Override
                public String getName() {
                    return "title";
                }
            };
        }
        return title;
    }
}

Compiling and loading this class file shows the attached properties panel, with additional properties from the parent classes. The only property which must be shown here is Title.
scene-builder-properties

The striked-out properties must not be shown for this test custom component.
scene-builder-properties (bug)

Your Environment (taken from About Scene Builder menu)

Product Version
JavaFX Scene Builder 22.0.0

Build Information
Version 22.0.0
Date: 2024-03-22 16:11:53
JavaFX Version: 22
Java Version: 22, OpenJDK Runtime Environment

Operating System
Linux, amd64, 5.4.0-192-generic

Screenshots

Attached above.

@heySourabh heySourabh added the bug Something isn't working label Aug 11, 2024
@Oliver-Loeffler
Copy link
Collaborator

This might be related to #701 and #702.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants