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 122199 | Differences between
and this patch

Collapse All | Expand All

(-)projects/src/org/netbeans/modules/ruby/rubyproject/gems/GemPanel.java (-18 / +54 lines)
 Lines 55-60    Link Here 
55
import javax.swing.JTextField;
55
import javax.swing.JTextField;
56
import javax.swing.JTextPane;
56
import javax.swing.JTextPane;
57
import javax.swing.ListSelectionModel;
57
import javax.swing.ListSelectionModel;
58
import javax.swing.SwingUtilities;
58
import javax.swing.event.ListSelectionEvent;
59
import javax.swing.event.ListSelectionEvent;
59
import javax.swing.event.ListSelectionListener;
60
import javax.swing.event.ListSelectionListener;
60
import org.netbeans.api.options.OptionsDisplayer;
61
import org.netbeans.api.options.OptionsDisplayer;
 Lines 134-143    Link Here 
134
    
135
    
135
    public void run() {
136
    public void run() {
136
        // This will also update the New and Installed lists because Update depends on these
137
        // This will also update the New and Installed lists because Update depends on these
137
        refreshUpdated();
138
        SwingUtilities.invokeLater(new Runnable() {
139
            public void run() {
140
                refreshUpdated();
141
            }
142
        });
138
    }
143
    }
139
    
144
    
140
    private void updateGemDescription(JTextPane pane, Gem gem) {
145
    private void updateGemDescription(JTextPane pane, Gem gem) {
146
        assert SwingUtilities.isEventDispatchThread();
147
141
        if (gem == null) {
148
        if (gem == null) {
142
            pane.setText("");
149
            pane.setText("");
143
            return;
150
            return;
 Lines 196-201    Link Here 
196
     * @return True iff we're done with the updates
203
     * @return True iff we're done with the updates
197
     */
204
     */
198
    private synchronized boolean updateGems() {
205
    private synchronized boolean updateGems() {
206
        assert SwingUtilities.isEventDispatchThread();
207
199
        if (!(fetchingRemote || fetchingLocal)) {
208
        if (!(fetchingRemote || fetchingLocal)) {
200
            updatedProgress.setVisible(false);
209
            updatedProgress.setVisible(false);
201
            updatedProgressLabel.setVisible(false);
210
            updatedProgressLabel.setVisible(false);
 Lines 250-255    Link Here 
250
    }
259
    }
251
    
260
    
252
    private void updateList(int tab, boolean showCount) {
261
    private void updateList(int tab, boolean showCount) {
262
        assert SwingUtilities.isEventDispatchThread();
263
253
        Pattern pattern = null;
264
        Pattern pattern = null;
254
        String filter = getGemFilter(tab);
265
        String filter = getGemFilter(tab);
255
        String lcFilter = null;
266
        String lcFilter = null;
 Lines 351-356    Link Here 
351
    }
362
    }
352
363
353
    private synchronized void refreshInstalled(boolean fetch) {
364
    private synchronized void refreshInstalled(boolean fetch) {
365
        assert SwingUtilities.isEventDispatchThread();
366
354
        if (installedList.getSelectedIndex() != -1) {
367
        if (installedList.getSelectedIndex() != -1) {
355
            updateGemDescription(installedDesc, null);
368
            updateGemDescription(installedDesc, null);
356
        }
369
        }
 Lines 364-369    Link Here 
364
    }
377
    }
365
    
378
    
366
    private synchronized void refreshNew(boolean fetch) {
379
    private synchronized void refreshNew(boolean fetch) {
380
        assert SwingUtilities.isEventDispatchThread();
381
367
        if (newList.getSelectedIndex() != -1) {
382
        if (newList.getSelectedIndex() != -1) {
368
            updateGemDescription(newDesc, null);
383
            updateGemDescription(newDesc, null);
369
        }
384
        }
 Lines 376-381    Link Here 
376
    }
391
    }
377
392
378
    private void refreshUpdated() {
393
    private void refreshUpdated() {
394
        assert SwingUtilities.isEventDispatchThread();
395
379
        if (updatedList.getSelectedIndex() != -1) {
396
        if (updatedList.getSelectedIndex() != -1) {
380
            updateGemDescription(updatedDesc, null);
397
            updateGemDescription(updatedDesc, null);
381
        }
398
        }
 Lines 790-795    Link Here 
790
    }//GEN-LAST:event_reloadReposButtonActionPerformed
807
    }//GEN-LAST:event_reloadReposButtonActionPerformed
791
808
792
    private void installButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installButtonActionPerformed
809
    private void installButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installButtonActionPerformed
810
        assert SwingUtilities.isEventDispatchThread();
811
793
        int[] indices = newList.getSelectedIndices();
812
        int[] indices = newList.getSelectedIndices();
794
        List<Gem> gems = new ArrayList<Gem>();
813
        List<Gem> gems = new ArrayList<Gem>();
795
        for (int index : indices) {
814
        for (int index : indices) {
 Lines 836-841    Link Here 
836
    }//GEN-LAST:event_updateAllButtonActionPerformed
855
    }//GEN-LAST:event_updateAllButtonActionPerformed
837
856
838
    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
857
    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
858
        assert SwingUtilities.isEventDispatchThread();
859
839
        int[] indices = updatedList.getSelectedIndices();
860
        int[] indices = updatedList.getSelectedIndices();
840
        List<Gem> gems = new ArrayList<Gem>();
861
        List<Gem> gems = new ArrayList<Gem>();
841
        if (indices != null) {
862
        if (indices != null) {
 Lines 856-861    Link Here 
856
    }//GEN-LAST:event_updateButtonActionPerformed
877
    }//GEN-LAST:event_updateButtonActionPerformed
857
878
858
    private void uninstallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uninstallButtonActionPerformed
879
    private void uninstallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uninstallButtonActionPerformed
880
        assert SwingUtilities.isEventDispatchThread();
881
859
        int[] indices = installedList.getSelectedIndices();
882
        int[] indices = installedList.getSelectedIndices();
860
        List<Gem> gems = new ArrayList<Gem>();
883
        List<Gem> gems = new ArrayList<Gem>();
861
        if (indices != null) {
884
        if (indices != null) {
 Lines 884-889    Link Here 
884
        Runnable runner = new Runnable() {
907
        Runnable runner = new Runnable() {
885
            public void run() {
908
            public void run() {
886
                synchronized(this) {
909
                synchronized(this) {
910
                    assert !SwingUtilities.isEventDispatchThread();
887
                    List<String> lines = new ArrayList<String>(500);
911
                    List<String> lines = new ArrayList<String>(500);
888
                    if (tab == INSTALLED_TAB_INDEX) {
912
                    if (tab == INSTALLED_TAB_INDEX) {
889
                        installedGems = gemManager.reloadInstalledGems(lines);
913
                        installedGems = gemManager.reloadInstalledGems(lines);
 Lines 897-911    Link Here 
897
                        fetchingRemote = false;
921
                        fetchingRemote = false;
898
                    }
922
                    }
899
                    
923
                    
900
                    // Recompute lists
924
                    // Update UI
901
                    boolean done = updateGems();
925
                    SwingUtilities.invokeLater(new Runnable() {
902
                    
926
                        public void run() {
903
                    if (!done) {
927
                            boolean done = updateGems();
904
                        // Just filter
928
905
                        updateList(tab, false);
929
                            if (!done) {
906
                    } else if (tab == INSTALLED_TAB_INDEX) {
930
                                // Just filter
907
                        updateList(tab, true);
931
                                updateList(tab, false);
908
                    }
932
                            } else if (tab == INSTALLED_TAB_INDEX) {
933
                                updateList(tab, true);
934
                            }
935
                        }
936
                    });
909
                }
937
                }
910
            }
938
            }
911
        };
939
        };
 Lines 917-922    Link Here 
917
        Runnable runner = new Runnable() {
945
        Runnable runner = new Runnable() {
918
            public void run() {
946
            public void run() {
919
                synchronized(this) {
947
                synchronized(this) {
948
                    assert !SwingUtilities.isEventDispatchThread();
949
920
                    List<String> lines = Collections.emptyList();
950
                    List<String> lines = Collections.emptyList();
921
                    remoteFailure = null;
951
                    remoteFailure = null;
922
                    if (!useCached) {
952
                    if (!useCached) {
 Lines 932-945    Link Here 
932
                        remoteFailure = lines;
962
                        remoteFailure = lines;
933
                    }
963
                    }
934
                    
964
                    
935
                    // Recompute lists
965
                    // Update UI
936
                    updateGems();
966
                    SwingUtilities.invokeLater(new Runnable() {
937
                    updateList(INSTALLED_TAB_INDEX, true);
967
                        public void run() {
938
                    
968
                            updateGems();
939
                    if (remoteFailure != null && !fetchingLocal) {
969
                            updateList(INSTALLED_TAB_INDEX, true);
940
                        // Update the local list which shouldn't have any errors
970
941
                        refreshInstalled(true);
971
                            if (remoteFailure != null && !fetchingLocal) {
942
                    }
972
                                // Update the local list which shouldn't have any errors
973
                                refreshInstalled(true);
974
                            }
975
                        }
976
                    });
943
                }
977
                }
944
            }
978
            }
945
        };
979
        };
 Lines 948-953    Link Here 
948
    }
982
    }
949
    
983
    
950
    private String getGemFilter(int tab) {
984
    private String getGemFilter(int tab) {
985
        assert SwingUtilities.isEventDispatchThread();
986
951
        String filter = null;
987
        String filter = null;
952
        JTextField tf;
988
        JTextField tf;
953
        if (tab == INSTALLED_TAB_INDEX) {
989
        if (tab == INSTALLED_TAB_INDEX) {
(-)railsprojects/src/org/netbeans/modules/ruby/railsprojects/plugins/PluginPanel.java (-29 / +76 lines)
 Lines 52-57    Link Here 
52
import javax.swing.JList;
52
import javax.swing.JList;
53
import javax.swing.JTextField;
53
import javax.swing.JTextField;
54
import javax.swing.ListSelectionModel;
54
import javax.swing.ListSelectionModel;
55
import javax.swing.SwingUtilities;
55
import javax.swing.event.ListSelectionEvent;
56
import javax.swing.event.ListSelectionEvent;
56
import javax.swing.event.ListSelectionListener;
57
import javax.swing.event.ListSelectionListener;
57
import org.netbeans.api.options.OptionsDisplayer;
58
import org.netbeans.api.options.OptionsDisplayer;
 Lines 474-479    Link Here 
474
    }//GEN-LAST:event_reloadNewButtonActionPerformed
475
    }//GEN-LAST:event_reloadNewButtonActionPerformed
475
476
476
    private void addUrlButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addUrlButtonActionPerformed
477
    private void addUrlButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addUrlButtonActionPerformed
478
        assert SwingUtilities.isEventDispatchThread();
479
477
        NewUrlPanel panel = new NewUrlPanel();
480
        NewUrlPanel panel = new NewUrlPanel();
478
481
479
        DialogDescriptor descriptor = new DialogDescriptor(panel, NbBundle.getMessage(PluginPanel.class,
482
        DialogDescriptor descriptor = new DialogDescriptor(panel, NbBundle.getMessage(PluginPanel.class,
 Lines 503-508    Link Here 
503
    }//GEN-LAST:event_proxyButtonActionPerformed
506
    }//GEN-LAST:event_proxyButtonActionPerformed
504
507
505
    private void discoverButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_discoverButtonActionPerformed
508
    private void discoverButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_discoverButtonActionPerformed
509
        assert SwingUtilities.isEventDispatchThread();
510
506
        // Bring up a selection list
511
        // Bring up a selection list
507
        String wait = getWaitMsg();
512
        String wait = getWaitMsg();
508
        RepositorySelectionPanel panel = new RepositorySelectionPanel();
513
        RepositorySelectionPanel panel = new RepositorySelectionPanel();
 Lines 557-562    Link Here 
557
    }//GEN-LAST:event_reloadReposButtonActionPerformed
562
    }//GEN-LAST:event_reloadReposButtonActionPerformed
558
563
559
    private void unregisterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unregisterButtonActionPerformed
564
    private void unregisterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unregisterButtonActionPerformed
565
        assert SwingUtilities.isEventDispatchThread();
566
560
        int[] indices = repositoryList.getSelectedIndices();
567
        int[] indices = repositoryList.getSelectedIndices();
561
        List<String> repositories = new ArrayList<String>();
568
        List<String> repositories = new ArrayList<String>();
562
        if (indices != null) {
569
        if (indices != null) {
 Lines 580-585    Link Here 
580
    }//GEN-LAST:event_unregisterButtonActionPerformed
587
    }//GEN-LAST:event_unregisterButtonActionPerformed
581
588
582
    private void repositoryPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_repositoryPanelComponentShown
589
    private void repositoryPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_repositoryPanelComponentShown
590
        assert SwingUtilities.isEventDispatchThread();
591
583
        // Make sure the list is shown
592
        // Make sure the list is shown
584
        if (!repositoriesInitialized) {
593
        if (!repositoriesInitialized) {
585
            repositoriesInitialized = true;
594
            repositoriesInitialized = true;
 Lines 603-608    Link Here 
603
    }//GEN-LAST:event_repositoryPanelComponentShown
612
    }//GEN-LAST:event_repositoryPanelComponentShown
604
613
605
    private void newPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_newPanelComponentShown
614
    private void newPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_newPanelComponentShown
615
        assert SwingUtilities.isEventDispatchThread();
616
606
        // Make sure the list is shown
617
        // Make sure the list is shown
607
        if (!newInitialized) {
618
        if (!newInitialized) {
608
            newInitialized = true;
619
            newInitialized = true;
 Lines 617-622    Link Here 
617
    }//GEN-LAST:event_newPanelComponentShown
628
    }//GEN-LAST:event_newPanelComponentShown
618
629
619
    private void installButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installButtonActionPerformed
630
    private void installButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installButtonActionPerformed
631
        assert SwingUtilities.isEventDispatchThread();
632
620
        int[] indices = newList.getSelectedIndices();
633
        int[] indices = newList.getSelectedIndices();
621
        List<Plugin> plugins = new ArrayList<Plugin>();
634
        List<Plugin> plugins = new ArrayList<Plugin>();
622
        for (int index : indices) {
635
        for (int index : indices) {
 Lines 639-645    Link Here 
639
                if (result.equals(NotifyDescriptor.OK_OPTION)) {
652
                if (result.equals(NotifyDescriptor.OK_OPTION)) {
640
                    Plugin plugin = new Plugin(panel.getPluginName(), null);
653
                    Plugin plugin = new Plugin(panel.getPluginName(), null);
641
                    // XXX Do I really need to refresh it right way?
654
                    // XXX Do I really need to refresh it right way?
642
                    PluginListRefresher completionTask = new PluginListRefresher(newList, true);
655
                    PluginListRefresher completionTask = new PluginListRefresher(newList, false);
643
                    boolean changed = pluginManager.install(new Plugin[] { plugin }, this, null, panel.isSvnExternals(), panel.isSvnCheckout(), panel.getRevision(), 
656
                    boolean changed = pluginManager.install(new Plugin[] { plugin }, this, null, panel.isSvnExternals(), panel.isSvnCheckout(), panel.getRevision(), 
644
                            true, completionTask);
657
                            true, completionTask);
645
                    installedModified = installedModified || changed;
658
                    installedModified = installedModified || changed;
 Lines 660-665    Link Here 
660
    }//GEN-LAST:event_updateAllButtonActionPerformed
673
    }//GEN-LAST:event_updateAllButtonActionPerformed
661
674
662
    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
675
    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
676
        assert SwingUtilities.isEventDispatchThread();
677
663
        int[] indices = installedList.getSelectedIndices();
678
        int[] indices = installedList.getSelectedIndices();
664
        List<Plugin> plugins = new ArrayList<Plugin>();
679
        List<Plugin> plugins = new ArrayList<Plugin>();
665
        if (indices != null) {
680
        if (indices != null) {
 Lines 680-685    Link Here 
680
    }//GEN-LAST:event_updateButtonActionPerformed
695
    }//GEN-LAST:event_updateButtonActionPerformed
681
696
682
    private void uninstallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uninstallButtonActionPerformed
697
    private void uninstallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uninstallButtonActionPerformed
698
        assert SwingUtilities.isEventDispatchThread();
699
683
        int[] indices = installedList.getSelectedIndices();
700
        int[] indices = installedList.getSelectedIndices();
684
        List<Plugin> plugins = new ArrayList<Plugin>();
701
        List<Plugin> plugins = new ArrayList<Plugin>();
685
        if (indices != null) {
702
        if (indices != null) {
 Lines 704-709    Link Here 
704
    }//GEN-LAST:event_reloadInstalledButtonActionPerformed
721
    }//GEN-LAST:event_reloadInstalledButtonActionPerformed
705
722
706
    private void installedPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_installedPanelComponentShown
723
    private void installedPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_installedPanelComponentShown
724
        assert SwingUtilities.isEventDispatchThread();
725
707
        // Make sure the list is shown
726
        // Make sure the list is shown
708
        if (!installedInitialized) {
727
        if (!installedInitialized) {
709
            installedInitialized = true;
728
            installedInitialized = true;
 Lines 724-729    Link Here 
724
743
725
    /** Refresh the list of displayed plugins. If refresh is true, refresh the list from the plugin manager, otherwise just refilter list */
744
    /** Refresh the list of displayed plugins. If refresh is true, refresh the list from the plugin manager, otherwise just refilter list */
726
    private void refreshPluginList(final String filter, final boolean refresh, final JList list, final boolean local) {        
745
    private void refreshPluginList(final String filter, final boolean refresh, final JList list, final boolean local) {        
746
        assert SwingUtilities.isEventDispatchThread();
747
727
        boolean showRefreshMessage = true;
748
        boolean showRefreshMessage = true;
728
        //        if (!pluginManager.hasUptodateAvailableList()) {
749
        //        if (!pluginManager.hasUptodateAvailableList()) {
729
        //            // No need to ask for cached version if the full version will be displayed shortly
750
        //            // No need to ask for cached version if the full version will be displayed shortly
 Lines 744-750    Link Here 
744
        Runnable runner = new Runnable() {
765
        Runnable runner = new Runnable() {
745
            public void run() {
766
            public void run() {
746
                synchronized(this) {
767
                synchronized(this) {
747
                    DefaultListModel model = new DefaultListModel();
768
                    final DefaultListModel model = new DefaultListModel();
748
                    List<String> lines = new ArrayList<String>(500);
769
                    List<String> lines = new ArrayList<String>(500);
749
                    List<Plugin> plugins;
770
                    List<Plugin> plugins;
750
                    if (local) {
771
                    if (local) {
 Lines 800-824    Link Here 
800
                            model.addElement("<html><span color=\"red\">" + line + "</span></html>"); // NOI18N
821
                            model.addElement("<html><span color=\"red\">" + line + "</span></html>"); // NOI18N
801
                        }
822
                        }
802
                    }
823
                    }
803
                    list.clearSelection();
824
                    
804
                    list.setModel(model);
825
                    final int pluginsCount = plugins.size();
805
                    list.invalidate();
806
                    list.repaint();
807
                    if (plugins.size() > 0) {
808
                        list.setSelectedIndex(0);
809
                    }
810
826
811
                    int tabIndex = local ? 0 : 1;
827
                    SwingUtilities.invokeLater(new Runnable() {
812
                    String tabTitle = pluginsTab.getTitleAt(tabIndex);
828
                        public void run() {
813
                    String originalTabTitle = tabTitle;
829
                            list.clearSelection();
814
                    int index = tabTitle.lastIndexOf('(');
830
                            list.setModel(model);
815
                    if (index != -1) {
831
                            list.invalidate();
816
                        tabTitle = tabTitle.substring(0, index);
832
                            list.repaint();
817
                    }
833
                            if (pluginsCount > 0) {
818
                    tabTitle = tabTitle + "(" + plugins.size() + ")";
834
                                list.setSelectedIndex(0);
819
                    if (!tabTitle.equals(originalTabTitle)) {
835
                            }
820
                        pluginsTab.setTitleAt(tabIndex, tabTitle);
836
821
                    }
837
                            int tabIndex = local ? 0 : 1;
838
                            String tabTitle = pluginsTab.getTitleAt(tabIndex);
839
                            String originalTabTitle = tabTitle;
840
                            int index = tabTitle.lastIndexOf('(');
841
                            if (index != -1) {
842
                                tabTitle = tabTitle.substring(0, index);
843
                            }
844
                            tabTitle = tabTitle + "(" + pluginsCount + ")";
845
                            if (!tabTitle.equals(originalTabTitle)) {
846
                                pluginsTab.setTitleAt(tabIndex, tabTitle);
847
                            }
848
                        }
849
                    });
822
                }
850
                }
823
            }
851
            }
824
        };
852
        };
 Lines 838-847    Link Here 
838
866
839
    /** Refresh the list of displayed plugins. If refresh is true, refresh the list from the plugin manager, otherwise just refilter list */
867
    /** Refresh the list of displayed plugins. If refresh is true, refresh the list from the plugin manager, otherwise just refilter list */
840
    private void refreshRepositoryList(final String filter, final boolean refresh, final JList list, final boolean local) {        
868
    private void refreshRepositoryList(final String filter, final boolean refresh, final JList list, final boolean local) {        
869
        assert SwingUtilities.isEventDispatchThread();
870
841
        Runnable runner = new Runnable() {
871
        Runnable runner = new Runnable() {
842
            public void run() {
872
            public void run() {
843
                synchronized(this) {
873
                synchronized(this) {
844
                    DefaultListModel model = new DefaultListModel();
874
                    final DefaultListModel model = new DefaultListModel();
845
                    List<String> lines = new ArrayList<String>(500);
875
                    List<String> lines = new ArrayList<String>(500);
846
                    List<String> repositories;
876
                    List<String> repositories;
847
                    if (local) {
877
                    if (local) {
 Lines 888-900    Link Here 
888
                            model.addElement("<html><span color=\"red\">" + line + "</span></html>"); // NOI18N
918
                            model.addElement("<html><span color=\"red\">" + line + "</span></html>"); // NOI18N
889
                        }
919
                        }
890
                    }
920
                    }
891
                    list.clearSelection();
921
                    final int repositoryCount = repositories.size();
892
                    list.setModel(model);
922
                    
893
                    list.invalidate();
923
                    SwingUtilities.invokeLater(new Runnable() {
894
                    list.repaint();
924
                        public void run() {
895
                    if (repositories.size() > 0) {
925
                            list.clearSelection();
896
                        list.setSelectedIndex(0);
926
                            list.setModel(model);
897
                    }
927
                            list.invalidate();
928
                            list.repaint();
929
                            if (repositoryCount > 0) {
930
                                list.setSelectedIndex(0);
931
                            }
932
                        }
933
                    });
898
                }
934
                }
899
            }
935
            }
900
        };
936
        };
 Lines 910-917    Link Here 
910
        }
946
        }
911
    }
947
    }
912
    
948
    
913
    
914
    private String getRepositoryFilter(boolean local) {
949
    private String getRepositoryFilter(boolean local) {
950
        assert SwingUtilities.isEventDispatchThread();
951
915
        String filter = null;
952
        String filter = null;
916
        if (local) {
953
        if (local) {
917
            filter = searchReposText.getText().trim();
954
            filter = searchReposText.getText().trim();
 Lines 924-929    Link Here 
924
    }
961
    }
925
962
926
    private String getPluginFilter(boolean local) {
963
    private String getPluginFilter(boolean local) {
964
        assert SwingUtilities.isEventDispatchThread();
965
927
        String filter = null;
966
        String filter = null;
928
        JTextField tf = local ? instSearchText : searchNewText;
967
        JTextField tf = local ? instSearchText : searchNewText;
929
        filter = tf.getText().trim();
968
        filter = tf.getText().trim();
 Lines 944-949    Link Here 
944
        }
983
        }
945
984
946
        public void run() {
985
        public void run() {
986
            if (!SwingUtilities.isEventDispatchThread()) {
987
                SwingUtilities.invokeLater(this);
988
                return;
989
            }
947
            refreshPluginList(getPluginFilter(local), true, list, local);
990
            refreshPluginList(getPluginFilter(local), true, list, local);
948
            if (list == newList) {
991
            if (list == newList) {
949
                newModified = false;
992
                newModified = false;
 Lines 964-969    Link Here 
964
        }
1007
        }
965
1008
966
        public void run() {
1009
        public void run() {
1010
            if (!SwingUtilities.isEventDispatchThread()) {
1011
                SwingUtilities.invokeLater(this);
1012
                return;
1013
            }
967
            refreshRepositoryList(getRepositoryFilter(local), true, list, local);
1014
            refreshRepositoryList(getRepositoryFilter(local), true, list, local);
968
            if (list == repositoryList) {
1015
            if (list == repositoryList) {
969
                repositoriesModified = false;
1016
                repositoriesModified = false;

Return to bug 122199
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