Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 197697 | Differences between
and this patch

Collapse All | Expand All

(-)projectui/nbproject/project.xml (-1 / +1 lines)
 Lines 141-147    Link Here 
141
                    <build-prerequisite/>
141
                    <build-prerequisite/>
142
                    <compile-dependency/>
142
                    <compile-dependency/>
143
                    <run-dependency>
143
                    <run-dependency>
144
                        <specification-version>7.8</specification-version>
144
                        <specification-version>7.19</specification-version>
145
                    </run-dependency>
145
                    </run-dependency>
146
                </dependency>
146
                </dependency>
147
                <dependency>
147
                <dependency>
(-)projectui/src/org/netbeans/modules/project/ui/ProjectTemplatePanel.java (+9 lines)
 Lines 46-51    Link Here 
46
46
47
import java.awt.Component;
47
import java.awt.Component;
48
import java.awt.Cursor;
48
import java.awt.Cursor;
49
import java.awt.event.ActionEvent;
49
import javax.swing.event.ChangeListener;
50
import javax.swing.event.ChangeListener;
50
import org.openide.ErrorManager;
51
import org.openide.ErrorManager;
51
import org.openide.WizardDescriptor;
52
import org.openide.WizardDescriptor;
 Lines 76-87    Link Here 
76
    private WarmupJob warmUp;
77
    private WarmupJob warmUp;
77
    private boolean warmUpActive;
78
    private boolean warmUpActive;
78
    private boolean needsReselect = false;   // WelcomeScreen hack, XXX Delete after WS is redesigned
79
    private boolean needsReselect = false;   // WelcomeScreen hack, XXX Delete after WS is redesigned
80
    private WizardDescriptor wizard;
79
        
81
        
80
    /** Creates a new instance of ProjectTemplatePanel */
82
    /** Creates a new instance of ProjectTemplatePanel */
81
    public ProjectTemplatePanel() {
83
    public ProjectTemplatePanel() {
82
    }
84
    }
83
    
85
    
84
    public void readSettings(WizardDescriptor settings) {
86
    public void readSettings(WizardDescriptor settings) {
87
        this.wizard = settings;
85
        TemplateWizard wd = (TemplateWizard) settings;
88
        TemplateWizard wd = (TemplateWizard) settings;
86
        wd.putProperty (WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer (0));
89
        wd.putProperty (WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer (0));
87
        wd.putProperty (WizardDescriptor.PROP_CONTENT_DATA, new String[] {
90
        wd.putProperty (WizardDescriptor.PROP_CONTENT_DATA, new String[] {
 Lines 327-331    Link Here 
327
            changeSupport.fireChange();
330
            changeSupport.fireChange();
328
        }
331
        }
329
332
333
        @Override
334
        public void actionPerformed( ActionEvent e ) {
335
            if( null != wizard ) {
336
                wizard.doNextClick();
330
    }
337
    }
331
}
338
}
339
    }
340
}
(-)projectui/src/org/netbeans/modules/project/ui/TemplateChooserPanel.java (-1 / +13 lines)
 Lines 45-50    Link Here 
45
package org.netbeans.modules.project.ui;
45
package org.netbeans.modules.project.ui;
46
46
47
import java.awt.Component;
47
import java.awt.Component;
48
import java.awt.event.ActionEvent;
49
import java.awt.event.ActionListener;
48
import javax.swing.event.ChangeEvent;
50
import javax.swing.event.ChangeEvent;
49
import javax.swing.event.ChangeListener;
51
import javax.swing.event.ChangeListener;
50
import org.netbeans.api.project.Project;
52
import org.netbeans.api.project.Project;
 Lines 73-78    Link Here 
73
75
74
    private Project project;
76
    private Project project;
75
    // private String[] recommendedTypes;
77
    // private String[] recommendedTypes;
78
    private WizardDescriptor wizard;
76
79
77
    TemplateChooserPanel( Project p /*, String recommendedTypes[] */ ) {
80
    TemplateChooserPanel( Project p /*, String recommendedTypes[] */ ) {
78
        this.project = p;
81
        this.project = p;
 Lines 83-89    Link Here 
83
        if (gui == null) {
86
        if (gui == null) {
84
            gui = new TemplateChooserPanelGUI();
87
            gui = new TemplateChooserPanelGUI();
85
            gui.addChangeListener(this);
88
            gui.addChangeListener(this);
89
            gui.setDefaultActionListener(new ActionListener() {
90
91
                @Override
92
                public void actionPerformed( ActionEvent e ) {
93
                    if( null != wizard ) {
94
                        wizard.doNextClick();
86
        }
95
        }
96
                }
97
            });
98
        }
87
        return gui;
99
        return gui;
88
    }
100
    }
89
101
 Lines 105-110    Link Here 
105
    }
117
    }
106
118
107
    public void readSettings(WizardDescriptor settings) {
119
    public void readSettings(WizardDescriptor settings) {
120
        this.wizard = settings;
108
        TemplateChooserPanelGUI panel = (TemplateChooserPanelGUI) this.getComponent();
121
        TemplateChooserPanelGUI panel = (TemplateChooserPanelGUI) this.getComponent();
109
        final FileObject currentTemplate = Templates.getTemplate(settings);
122
        final FileObject currentTemplate = Templates.getTemplate(settings);
110
        FileObject templates = FileUtil.getConfigFile("Templates");    //NOI18N
123
        FileObject templates = FileUtil.getConfigFile("Templates");    //NOI18N
 Lines 169-173    Link Here 
169
        changeSupport.fireChange();
182
        changeSupport.fireChange();
170
        
183
        
171
    }
184
    }
172
173
}    
185
}    
(-)projectui/src/org/netbeans/modules/project/ui/TemplateChooserPanelGUI.form (-2 / +4 lines)
 Lines 1-7    Link Here 
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
5
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
6
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
5
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
7
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
6
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
8
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
7
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
9
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
(-)projectui/src/org/netbeans/modules/project/ui/TemplateChooserPanelGUI.java (+12 lines)
 Lines 79-84    Link Here 
79
 * into new file wizard
79
 * into new file wizard
80
 */
80
 */
81
81
82
83
    // #89393: GTK needs cell renderer to implement UIResource to look "natively"
82
/**
84
/**
83
 * Provides the GUI for the template chooser panel.
85
 * Provides the GUI for the template chooser panel.
84
 * @author Jesse Glick
86
 * @author Jesse Glick
 Lines 102-107    Link Here 
102
    private boolean isWarmUp = true;
104
    private boolean isWarmUp = true;
103
    private ListCellRenderer projectCellRenderer;
105
    private ListCellRenderer projectCellRenderer;
104
    private boolean firstTime = true;
106
    private boolean firstTime = true;
107
    private ActionListener defaultActionListener;
105
    
108
    
106
    public TemplateChooserPanelGUI() {
109
    public TemplateChooserPanelGUI() {
107
        this.builder = new FileChooserBuilder ();
110
        this.builder = new FileChooserBuilder ();
 Lines 168-173    Link Here 
168
        changeSupport.fireChange();
171
        changeSupport.fireChange();
169
    }
172
    }
170
    
173
    
174
    void setDefaultActionListener( ActionListener al ) {
175
        this.defaultActionListener = al;
176
    }
171
    
177
    
172
    public Project getProject() {
178
    public Project getProject() {
173
        boolean wf;
179
        boolean wf;
 Lines 385-391    Link Here 
385
            return NbBundle.getMessage (TemplateChooserPanelGUI.class,"CTL_Files");
391
            return NbBundle.getMessage (TemplateChooserPanelGUI.class,"CTL_Files");
386
        }
392
        }
387
        
393
        
394
        @Override
395
        public void actionPerformed( ActionEvent e ) {
396
            if( null != defaultActionListener ) {
397
                defaultActionListener.actionPerformed( e );
388
    }
398
    }
399
        }
400
    }
389
    
401
    
390
    // #89393: GTK needs cell renderer to implement UIResource to look "natively"
402
    // #89393: GTK needs cell renderer to implement UIResource to look "natively"
391
    private static class ProjectCellRenderer extends JLabel implements ListCellRenderer, UIResource  {
403
    private static class ProjectCellRenderer extends JLabel implements ListCellRenderer, UIResource  {
(-)projectui/src/org/netbeans/modules/project/ui/TemplatesPanelGUI.java (-1 / +10 lines)
 Lines 97-103    Link Here 
97
 */
97
 */
98
public class TemplatesPanelGUI extends javax.swing.JPanel implements PropertyChangeListener {
98
public class TemplatesPanelGUI extends javax.swing.JPanel implements PropertyChangeListener {
99
    
99
    
100
    public static interface Builder {
100
    public static interface Builder extends ActionListener {
101
101
102
        public Children createCategoriesChildren (DataFolder folder);
102
        public Children createCategoriesChildren (DataFolder folder);
103
        
103
        
 Lines 336-341    Link Here 
336
                ((ExplorerProviderPanel)categoriesPanel).setRootNode (root);
336
                ((ExplorerProviderPanel)categoriesPanel).setRootNode (root);
337
            }
337
            }
338
        });
338
        });
339
        ((ExplorerProviderPanel)projectsPanel).addDefaultActionListener( firer );
339
        description.addHyperlinkListener(new ClickHyperlinks());
340
        description.addHyperlinkListener(new ClickHyperlinks());
340
    }
341
    }
341
342
 Lines 555-561    Link Here 
555
            this.add (component);
556
            this.add (component);
556
        }
557
        }
557
        
558
        
559
        void addDefaultActionListener( ActionListener al ) {
560
            //do nothing by default
558
    }
561
    }
562
    }
559
563
560
564
561
    private static class CategoriesBeanTreeView extends BeanTreeView {
565
    private static class CategoriesBeanTreeView extends BeanTreeView {
 Lines 645-651    Link Here 
645
            }
649
            }
646
        }
650
        }
647
        
651
        
652
        @Override
653
        void addDefaultActionListener( ActionListener al ) {
654
            createComponent();
655
            ((TemplatesListView)list).setDefaultProcessor( al );
648
    }
656
    }
657
    }
649
   
658
   
650
    // Variables declaration - do not modify//GEN-BEGIN:variables
659
    // Variables declaration - do not modify//GEN-BEGIN:variables
651
    private javax.swing.JPanel categoriesPanel;
660
    private javax.swing.JPanel categoriesPanel;
(-)projectui/test/unit/src/org/netbeans/modules/project/ui/TemplatesPanelGUITest.java (+6 lines)
 Lines 44-49    Link Here 
44
44
45
import java.awt.Component;
45
import java.awt.Component;
46
import java.awt.Container;
46
import java.awt.Container;
47
import java.awt.event.ActionEvent;
47
import java.lang.ref.WeakReference;
48
import java.lang.ref.WeakReference;
48
import javax.swing.JEditorPane;
49
import javax.swing.JEditorPane;
49
import org.netbeans.junit.NbTestCase;
50
import org.netbeans.junit.NbTestCase;
 Lines 111-114    Link Here 
111
112
112
    public void fireChange() {
113
    public void fireChange() {
113
    }
114
    }
115
116
    @Override
117
    public void actionPerformed( ActionEvent e ) {
118
        throw new UnsupportedOperationException( "Not supported yet." );
114
}
119
}
120
}

Return to bug 197697
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo