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.
Summary: | Form editor inspires hard-coding | ||
---|---|---|---|
Product: | guibuilder | Reporter: | randahl <randahl> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
randahl
2005-07-12 10:19:51 UTC
Thanks for spending time summarizing the issue of the initial (pre-set) property values. I can agree with you in point 1, point 2 is rather minor I'd say, point 3 seems to be a bit extreme - I don't think form editor inspires hard-coding (everybody notice this once need non-static data; for prototyping it is ok). Also not all components with pre-set property values make a problem. Right now it seems to me there are just 4 component types that are problematic: JTextField, JList, JComboBox, JTable. OTOH an initial value is IMO desirable e.g. for buttons. And quite necessary for labels. So we can't just turn this off. It is interesting that some pre-set values come from the components directly - e.g. JTree or JSplitPane. I would not underrate the importance of visually distinguishable components. Tooltips are not enough. Seeing immediately that a component is a JList and not JTextArea or JTable is much better. But I agree with you that we should probably achieve this a different way than pre-setting property values (that propagate to generated code). Other reasons for the pre-set values are that they give the component reasonable preferred size; and also indicate the users (who wouldn't know) what property is responsible for the content of the component. These are also points to consider. So we will consider this for the future. I think we can eliminate the text in textfields easily. Not sure about the rest right now. I suggest to make this RFE. Thank you for getting back to me. First, I completely agree that Problem 2 is a minor one; however, my example illustrates what is bad about mixing UI design with model data. It is the *principle* of your design that seems problematic to me - ideally an IDE should be a good example of the right way to do things. Second, you mention prototype development as an argument for allowing field values to be set in the form editor, and I agree these kinds of projects need such features. Still, though prototyping is popular, I do not think that the majority of the projects being developed with NetBeans involve developing a prototype in which you hard-code values into GUI components like JTextField. This is why I think the hard-coding is a questionable default behavior. So all in all (and in a completely abstract sence) what I would like, ideally, is for NetBeans to show GUI components in a so called "design mode" in the form editor. - A mode in which the IDE is allowed to add data for illustrative purposes and spice up the components in any way imagineable. Still, this mode is to be *completely* seperated from the "runtime mode" my components are in once the application is run - in this mode every component should be completely free of the illustrative data. I am happy to hear you will look into this - if you do not plan to rewrite much of the form editor code for 4.2, it would be really great if, as mentioned, you could save everyone a lot of time by at least modifying the code which keep adding the "jTextField1" text to each and every text field we create. Randahl JCheckBox seems very similar to JTextField in the sence that it too creates a default string, which developers then need to remove - and maybe it is similarly easy to fix. R. |