Customize properties sheet of a BeanNode in Netbeans

538 Views Asked by At

I have consulted the Node API, and some examples like HERE. My problem is to customize the properties sheet of a BeanNode so that I hide the "Properties" and create my own one.

For that, usuallay I have to override createSheet() method, and this is my code (in fact I want to show only the "Expert" sheet.

 @Override
    protected Sheet createSheet() {
        Sheet sheet = super.createSheet();
       Sheet.Set set = Sheet.createExpertSet();

        TUser user = getLookup().lookup(TUser.class);
        try {
            Property loginProp = new PropertySupport.Reflection(user, String.class, "getLogin", null);

            loginProp.setName("Login");

            set.put(loginProp);

        } catch (NoSuchMethodException ex) {
            ErrorManager.getDefault();
        }

        sheet.remove(Sheet.PROPERTIES);
        sheet.put(set);

        return sheet;
    }

What I got is: Properties sheet

How can I hide Properties sheet and show only the Expert one?

1

There are 1 best solutions below

0
On BEST ANSWER

Abviously, your node must extend AbstractNode not BeanNode