This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When using the CardLayout, subcomponents "layout" tab is too simple. You can only insert plain text here. It should be possible to enter any code (like a reference to a constant or a method call) This property should be editable as any other property (Mode = StringEditor, Form Connection...)
The reason why the layout constraints properties are just simple and not "full" form properties is the compatibility of the .form file format - the format is still kept compatible for several NB version and it was originally designed to store only simple layout properties. I'm not sure if the benefit of "full" properties in this case is worth the implementation efforts to solve this problem compatibly (I remember the hacks done for JTabbedPane for the same reason).
*** This issue has been marked as a duplicate of 32367 ***
this leads into a design problem into application. It should at least be possible to add our own source code... Annoying...
The real problem I see here is the duplication of the keys used to refere to the CardLayout elements... I want netbeans to be able to do a layout.addLayoutComponent(A_COMPONENT_NAME, aComponent) instead of layout.addLayoutComponent("a_component_name",aComponent), so I can call layout.show(theParent, A_COMPONENT_NAME) which really better I understand this is not needed by the language, but it is the way to do things the best we can... If netbeans prevents us to do code like this, it can be defined as a limitation. The only workaround here is to let netbeans add its component with a string, and duplicate the key manually in the code in a constant.... Quite a bad way to do things! This leads me to the fix: I'm not sure this is so difficult to patch. Netbeans could generate the code using a constant instead of hardcoding the value into the initComponents() method THIS can easily be implemented without any problem, could solve this issue in a beautifull way and would be entirely compatible with the form (there would be no difference in the form, only in the generated code) Please, don't say this is not feasible, because I'm sure it is!
This would be certainly technically possible, but it is not a correct solution. The card name is a String type property, so you should be able to edit it as a String directly, not as a constant. If the value you write in the property sheet would be generated as constant, then the form editor would have to generate further code for defining the constant, like static final String A_COPMPONENT_NAME = "a_component_name"; and would let the user to edit the constant value additioanally (so you have two things to edit: constant name and constant value). I think it is better to have the card name property full featured property allowing you to enter your custom code if needed. Theoretically, the approach you suggested could be then implemented as special String type property editor (allowing to define String constants; similarly as we have special String property editor allowing to use .properties files). So I think this is the same thing as issue 32367, making it duplicate again. *** This issue has been marked as a duplicate of 32367 ***
> this leads into a design problem into application. It should > at least be possible to add our own source code... Please note I'm not arguing with you this should not be possible or that it is not a problem (it surely is). I've just explained how I think it should be solved and why it is not so easy to implement. It is just normal bug evaluation.
You are totaly right, it is definitely a duplicate of issue 32367, and your last proposed solution is exactly what we asked... Hope to see it corrected soon :)
It was late at night and It was difficult for me to understand that ;) Sorry if we misunderstood ! :)
*** Issue 90077 has been marked as a duplicate of this issue. ***