History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-1916
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Jemerov
Reporter: Maxim Shafirov
Votes: 0
Watchers: 1
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

Initialize GUI fields inline

Created: 07 Feb 05 20:01   Updated: 30 Jan 06 15:46
Component/s: GUI Designer
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
http://www.intellij.net/tracker/idea/viewSCR?publicId=35777
So instead of:

[code] private JPanel mainPanel;
private JTextField xyzField;

{ // GUI initializer generated by IntelliJ IDEA GUI Designer // >>> IMPORTANT!! <<< // DO NOT EDIT OR ADD ANY CODE HERE! $$$setupUI$$$(); }

/**

  • Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT
  • edit this method OR call it in your code!
    */
    private void $$$setupUI$$$() {
    mainPanel = new JPanel();
    mainPanel.setLayout(
    new com.intellij.uiDesigner.core.GridLayoutManager(8, 2,
    new Insets(10, 10, 10, 10),
    -1, -1));
    xyzField = new JTextField();
    xyzField.setText("");
    xyzField.setEditable(false);
    mainPanel.add(xyzField,
    new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1,
    com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST,
    com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL,
    com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW,
    com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED,
    null,
    new Dimension(250, -1),
    null));[/code]

we have:

[code] private final JPanel mainPanel = new JPanel();

{ mainPanel.setLayout( new com.intellij.uiDesigner.core.GridLayoutManager(8, 2, new Insets(10, 10, 10, 10), -1, -1)); }

private final JTextField xyzField = new JTextField();
{ xyzField.setText(""); xyzField.setEditable(false); mainPanel.add(xyzField, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(250, -1), null)); }[/code]

This will eliminate the problems of having the call to $$$setupUI$$$ after references to the GUI fields in other initializers. See http://www.intellij.net/tracker/idea/viewSCR?publicId=26558. The GUI fields can now be made final. It also produces neater code.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.