Apache NetBeans
Apache NetBeans
Latest release

Apache NetBeans 24

Download

How do I add a readonly property?

You can customize your properties by using the setValue method.

Example:

PropertySupport.ReadOnly<String> javaVersionProperty = new PropertySupport.ReadOnly<String>(RuntimeProxyBean.PROP_VMVERSION, String.class, "JVM version", "Java VM version") {

            @Override
            public String getValue() throws IllegalAccessException, InvocationTargetException {
                return runtimeProxyBean.getVmVersion();
            }
        };

javaVersionProperty.setValue("suppressCustomEditor", true);

Taken from mailing list, contributed by Jean-Marc Borer