[hg] main-silver: housekeeping

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: housekeeping
  • Date: Fri, 21 Jun 2013 04:47:04 -0700

changeset 685d69b7edc5 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/685d69b7edc5
description:
        housekeeping

diffstat:

 
bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/KenaiHandler.java
 |    2 +-
 
odcs.tasks.bridge/src/org/netbeans/modules/odcs/tasks/bridge/ODCSHandler.java 
 |    2 +-
 team.ui/src/org/netbeans/modules/team/ui/common/DefaultDashboard.java        
  |    9 +-
 team.ui/src/org/netbeans/modules/team/ui/common/OneProjectDashboard.java     
  |  243 ++-------
 4 files changed, 69 insertions(+), 187 deletions(-)

diffs (613 lines):

diff --git 
a/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/KenaiHandler.java
 
b/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/KenaiHandler.java
--- 
a/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/KenaiHandler.java
+++ 
b/bugtracking.kenai/src/org/netbeans/modules/bugtracking/kenai/KenaiHandler.java
@@ -125,7 +125,7 @@
         KenaiUIUtils.addDashboardListener(kenai, new 
PropertyChangeListener() {
             @Override
             public void propertyChange(PropertyChangeEvent evt) {
-                
if(evt.getPropertyName().equals(DashboardSupport.PROP_REFRESH_REQUEST) && 
evt.getSource() instanceof DashboardSupport) {
+                
if(evt.getPropertyName().equals(DashboardSupport.PROP_REFRESH_REQUEST)) {
                     
if(KenaiHandler.this.kenai.getUrl().equals(((DashboardSupport)evt.getSource()).getServer().getUrl()))
 {
                         clear();
                     }
diff --git 
a/odcs.tasks.bridge/src/org/netbeans/modules/odcs/tasks/bridge/ODCSHandler.java
 
b/odcs.tasks.bridge/src/org/netbeans/modules/odcs/tasks/bridge/ODCSHandler.java
--- 
a/odcs.tasks.bridge/src/org/netbeans/modules/odcs/tasks/bridge/ODCSHandler.java
+++ 
b/odcs.tasks.bridge/src/org/netbeans/modules/odcs/tasks/bridge/ODCSHandler.java
@@ -116,7 +116,7 @@
         list = new PropertyChangeListener() {
             @Override
             public void propertyChange (PropertyChangeEvent evt) {
-                if 
(evt.getPropertyName().equals(DashboardSupport.PROP_REFRESH_REQUEST) && 
evt.getSource() instanceof DashboardSupport) {
+                if 
(evt.getPropertyName().equals(DashboardSupport.PROP_REFRESH_REQUEST)) {
                     if 
(ODCSHandler.this.server.getUrl().equals(((DashboardSupport) 
evt.getSource()).getServer().getUrl())) {
                         clear();
                     }
diff --git 
a/team.ui/src/org/netbeans/modules/team/ui/common/DefaultDashboard.java 
b/team.ui/src/org/netbeans/modules/team/ui/common/DefaultDashboard.java
--- a/team.ui/src/org/netbeans/modules/team/ui/common/DefaultDashboard.java
+++ b/team.ui/src/org/netbeans/modules/team/ui/common/DefaultDashboard.java
@@ -100,7 +100,6 @@
     private final TreeList treeList = new TreeList(model);
     private final ArrayList<ProjectHandle> memberProjects = new 
ArrayList<>(50);
     private final ArrayList<ProjectHandle> openProjects = new 
ArrayList<>(50);
-    //TODO: this should not be public
     private final JScrollPane dashboardComponent;
     private final PropertyChangeListener userListener;
     private boolean opened = false;
@@ -236,7 +235,7 @@
         changeSupport.removePropertyChangeListener(listener);
     }
 
-    public boolean isMemberProject(ProjectHandle m) {
+    private boolean isMemberProject(ProjectHandle m) {
         return memberProjects.contains(m);
     }
 
@@ -441,11 +440,11 @@
         };
     }
 
-    boolean isOpened() {
+    private boolean isOpened() {
         return opened;
     }
 
-    void refreshProjects() {
+    private void refreshProjects() {
         myProjectLoadingStarted();
         projectLoadingStarted();
         
changeSupport.firePropertyChange(DashboardSupport.PROP_REFRESH_REQUEST, null, 
null);
@@ -463,7 +462,7 @@
         }
     }
 
-    public void refreshNonMemberProjects() {
+    private void refreshNonMemberProjects() {
         synchronized( LOCK ) {
             removeProjectsFromModel(openProjects);
             openProjects.clear();
diff --git 
a/team.ui/src/org/netbeans/modules/team/ui/common/OneProjectDashboard.java 
b/team.ui/src/org/netbeans/modules/team/ui/common/OneProjectDashboard.java
--- a/team.ui/src/org/netbeans/modules/team/ui/common/OneProjectDashboard.java
+++ b/team.ui/src/org/netbeans/modules/team/ui/common/OneProjectDashboard.java
@@ -94,15 +94,8 @@
  */
 final class OneProjectDashboard<P> implements 
DashboardSupport.DashboardImpl<P> {
 
-    /**
-     * fired when user clicks refresh
-     */
-    public static final String PROP_REFRESH_REQUEST = "refreshRequest";// 
NOI18N
+    private LoginHandle login;
     
-    public static final String PREF_ALL_PROJECTS = "allProjects"; //NOI18N
-    public static final String PREF_COUNT = "count"; //NOI18N
-    public static final String PREF_ID = "id"; //NOI18N
-    private LoginHandle login;
     private final TreeListModel model = new TreeListModel();
     private static final ListModel EMPTY_MODEL = new AbstractListModel() {
         @Override
@@ -117,11 +110,8 @@
     private final RequestProcessor requestProcessor = new 
RequestProcessor("Team Dashboard"); // NOI18N
     private final TreeList treeList = new TreeList(model);
                 
-    private final ArrayList<ProjectHandle<P>> memberProjects = new 
ArrayList<>(50);
-    private final ArrayList<ProjectHandle<P>> openProjects = new 
ArrayList<>(50);
-    //TODO: this should not be public
-    public final JScrollPane dashboardComponent;
-    public final JPanel dashboardPanel;
+    private final JScrollPane dashboardComponent;
+    private final JPanel dashboardPanel;
     private final PropertyChangeListener userListener;
     private boolean opened = false;
     private boolean memberProjectsLoaded = false;
@@ -139,11 +129,15 @@
 
     private final Object LOCK = new Object();
 
+    private final TeamServer server;
+    private PropertyChangeListener serverListener;
+    private final DashboardProvider<P> dashboardProvider;
     private final PropertyChangeSupport changeSupport = new 
PropertyChangeSupport(this);
-    private PropertyChangeListener serverListener;
-    private TeamServer server;
-    private final DashboardProvider<P> dashboardProvider;
+
     private final Map<String, MyProjectNode> projectNodes = 
Collections.synchronizedMap(new HashMap<String, MyProjectNode>());
+    private final Map<String, List<TreeListNode>> projectChildren = new 
HashMap<>(3);
+    private final ArrayList<ProjectHandle<P>> memberProjects = new 
ArrayList<>(50);
+    private final ArrayList<ProjectHandle<P>> otherProjects = new 
ArrayList<>(50);
 
     public OneProjectDashboard(TeamServer server, DashboardProvider<P> 
dashboardProvider) {
         this.dashboardProvider = dashboardProvider;
@@ -189,33 +183,6 @@
             }
         };
 
-//        userNode = new UserNode(
-//                new AbstractAction() {  // refresh
-//                    @Override
-//                    public void actionPerformed(ActionEvent e) {
-//                        refreshProjects();
-//                    }
-//                },
-//                dashboardProvider.createLoginAction(),    // login    
-//                dashboardProvider.createLogoutAction(),
-//                
dashboardProvider.getProjectAccessor().getNewTeamProjectAction(),
-//                
dashboardProvider.getProjectAccessor().getOpenNonMemberProjectAction());
-//        model.addRoot(-1, userNode);
-//        openProjectsNode = new 
CategoryNode(org.openide.util.NbBundle.getMessage(DefaultDashboard.class, 
"LBL_OpenProjects"), null); // NOI18N
-//        model.addRoot(-1, openProjectsNode);
-//        model.addRoot(-1, noOpenProjects);
-
-//        myProjectsNode = new 
CategoryNode(org.openide.util.NbBundle.getMessage(DefaultDashboard.class, 
"LBL_MyProjects"), // NOI18N
-//                
ImageUtilities.loadImageIcon("org/netbeans/modules/team/ui/resources/bookmark.png",
 true)); // NOI18N
-//        if (login!=null) {
-//            if (!model.getRootNodes().contains(myProjectsNode)) {
-//                model.addRoot(-1, myProjectsNode);
-//            }
-//            if (!model.getRootNodes().contains(noMyProjects)) {
-//                model.addRoot(-1, noMyProjects);
-//            }
-//        }
-
         memberProjectsError = new 
ErrorNode(NbBundle.getMessage(DashboardSupport.class, 
"ERR_OpenMemberProjects"), new AbstractAction() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -251,10 +218,8 @@
     @Override
     public ProjectHandle<P>[] getProjects(boolean onlyOpened) {
         TreeSet<ProjectHandle> s = new TreeSet();
-        s.addAll(openProjects);
-//        if(!onlyOpened) { // XXX lets consider all projects as open - they 
are listed in the mega menu anyway
+        s.addAll(otherProjects);
             s.addAll(memberProjects);
-//        }
         return s.toArray(new ProjectHandle[s.size()]);
     }
 
@@ -268,16 +233,13 @@
         changeSupport.removePropertyChangeListener(listener);
     }
 
-    public boolean isMemberProject(ProjectHandle m) {
+    private boolean isMemberProject(ProjectHandle m) {
         return memberProjects.contains(m);
     }
 
     private void initServer() {
 
         refreshNonMemberProjects();
-        if (server==null) {
-            return;
-        }
 
         serverListener = new PropertyChangeListener() {
             @Override
@@ -290,7 +252,6 @@
                             public void run () {
                                 if (newValue == null) {
                                     handleLogin(null);
-                                    setNoProject();
                                 } else {
                                     handleLogin(new 
LoginHandleImpl(newValue.getUserName()));
                                 }
@@ -318,20 +279,11 @@
         
         final PasswordAuthentication pa = server.getPasswordAuthentication();
         this.login = pa==null ? null : new LoginHandleImpl(pa.getUserName());
-//        userNode.set(login, false);
     }
     
     @Override
     public void selectAndExpand(ProjectHandle project) {
-        // XXX does not work - there are no Project nodes in the model
-        for (TreeListNode n:model.getRootNodes()) {
-            if (n instanceof MyProjectNode) {
-                if 
(((MyProjectNode)n).getProject().getId().equals(project.getId())) {
-                    treeList.setSelectedValue(n, true);
-                    n.setExpanded(true);
-                }
-            }
-        }
+        switchProject(project);
     }
 
     /**
@@ -349,49 +301,36 @@
             
             if (login==null) {
 
-                //
                 //remove private project from dashboard
                 //private projects are visible only for
                 //authenticated user who is member of this project
-                Iterator<ProjectHandle<P>> ph = openProjects.iterator();
+                Iterator<ProjectHandle<P>> ph = otherProjects.iterator();
                 while (ph.hasNext()) {
                     final ProjectHandle<P> next = ph.next();
                     if (next.isPrivate()) {
                         removeProjectNodes(Collections.singletonList(next));
                         ph.remove();
                     }
-                    //storeAllProjects();
+                    storeAllProjects();
                 }
-//                removeMemberProjectsFromModel(memberProjects);
+                otherProjects.clear();
                 memberProjects.clear();
+                setNoProject();
+            } 
 
-//                model.removeRoot(myProjectsNode);
-//                model.removeRoot(noMyProjects);
-            } else {
-//                if (!model.getRootNodes().contains(myProjectsNode)) {
-//                    model.addRoot(-1, myProjectsNode);
-//                }
-//                if (!model.getRootNodes().contains(noMyProjects)) {
-//                    model.addRoot(-1, noMyProjects);
-//                }
-                }
-//            removeMemberProjectsFromModel(memberProjects);
             memberProjectsLoaded = false;
-//            userNode.set(login, !openProjects.isEmpty());
-            if( isOpened() ) {
-                if( null != login ) {
+            if( isOpened() && null != login ) {
                     requestProcessor.post(new Runnable() {
                         @Override
                         public void run() {
                             startLoadingMemberProjects(false);
                             if (!otherProjectsLoaded) {
-                                startLoadingAllProjects(false);
+                            startLoadingOtherProjects(false);
                             }
                             switchContent();
                         }    
                     });
                 }
-            }
             if( null != this.login ) {
                 this.login.addPropertyChangeListener(userListener);
             }
@@ -416,7 +355,7 @@
                             selectAndExpand(project);
                         }
                     };
-                    if (openProjects.contains(project)) {
+                    if (otherProjects.contains(project)) {
                         if (select) {
                             SwingUtilities.invokeLater(selectAndExpand);
                         }
@@ -427,10 +366,9 @@
                         memberProjects.add(project);
                         setMemberProjects(new ArrayList<>(memberProjects));
                     }
-                    openProjects.add(project);
+                    otherProjects.add(project);
                     storeAllProjects();
-                    setOtherProjects(new ArrayList<>(openProjects));
-//                    userNode.set(login, !openProjects.isEmpty());
+                    setOtherProjects(new ArrayList<>(otherProjects));
                     switchMemberProjects();
                     switchProject(project, createProjectNode(project));
                     if (isOpened()) {
@@ -448,10 +386,10 @@
     @Override
     public void removeProject( ProjectHandle<P> project ) {
         synchronized( LOCK ) {
-            if( !openProjects.contains(project) ) {
+            if( !otherProjects.contains(project) ) {
                 return;
             }
-            openProjects.remove(project);
+            otherProjects.remove(project);
             removeProjectNodes( Collections.singleton(project) );
             
             storeAllProjects();
@@ -480,29 +418,27 @@
         };
     }
 
-    boolean isOpened() {
+    private boolean isOpened() {
         return opened;
     }
 
-    void refreshProjects() {
+    private void refreshProjects() {
         myProjectLoadingStarted();
         projectLoadingStarted();
-        changeSupport.firePropertyChange(PROP_REFRESH_REQUEST, null, null);
+        
changeSupport.firePropertyChange(DashboardSupport.PROP_REFRESH_REQUEST, null, 
null);
         synchronized( LOCK ) {
             memberProjectsLoaded = false;
             otherProjectsLoaded = false;
-//            if( isOpened() ) {
-                startLoadingAllProjects(true);
+            startLoadingOtherProjects(true);
                 startLoadingMemberProjects(true);
-//            }
         }
     }
 
-    public void refreshNonMemberProjects() {
+    private void refreshNonMemberProjects() {
         synchronized( LOCK ) {
             otherProjectsLoaded = false;
             if( isOpened() ) {
-                startLoadingAllProjects(false);
+                startLoadingOtherProjects(false);
             }
         }
     }
@@ -540,7 +476,7 @@
                                 startLoadingMemberProjects(false);
                             }
                             if (!otherProjectsLoaded) {
-                                startLoadingAllProjects(false);
+                                startLoadingOtherProjects(false);
                             }
                         }
                     }
@@ -552,23 +488,6 @@
         return dashboardPanel;
     }
 
-    private void fillModel() {
-//        synchronized( LOCK ) {
-//            if( !model.getRootNodes().contains(userNode) ) {
-//                model.addRoot(0, userNode);
-//                model.addRoot(1, openProjectsNode);
-//                if (login!=null&& 
!model.getRootNodes().contains(myProjectsNode)) {
-//                    model.addRoot(-1, myProjectsNode);
-//                }
-//                }
-//            if(login!=null?model.getSize() > 3:model.getSize()>2 ) {
-//                return;
-//            }
-//            addProjectsToModel(-1, openProjects);
-//            addMemberProjectsToModel(-1, memberProjects);
-//        }
-    }
-
     private void switchContent() {
         Runnable r = new Runnable() {
             @Override
@@ -588,7 +507,6 @@
                         dashboardComponent.repaint();
                     }
                 } else {
-                    fillModel();
                     treeList.setModel(model);
                     switchMemberProjects();
                     if( !isTreeListShowing ) {
@@ -622,11 +540,6 @@
         lbl.setHorizontalAlignment(JLabel.CENTER);
         LinkButton btnWhatIs = new 
LinkButton(NbBundle.getMessage(DashboardSupport.class, "LBL_WhatIsTeam"), 
createWhatIsTeamAction() ); //NOI18N
 
-//        model.removeRoot(userNode);
-////        model.removeRoot(myProjectsNode);
-////        model.removeRoot(openProjectsNode);
-//        userNode.set(null, false);
-//        res.add( 
userNode.getComponent(UIManager.getColor("List.foreground"), 
ColorManager.getDefault().getDefaultBackground(), false, false, 200), new 
GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, 
GridBagConstraints.HORIZONTAL, new Insets(3, 4, 3, 4), 0, 0) ); //NOI18N
         res.add( new JLabel(), new GridBagConstraints(0, 1, 3, 1, 0.0, 1.0, 
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 
0), 0, 0) );
         res.add( lbl, new GridBagConstraints(0, 2, 3, 1, 1.0, 0.0, 
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 4, 
0), 0, 0) );
         res.add( btnWhatIs, new GridBagConstraints(0, 3, 3, 1, 1.0, 0.0, 
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 
0), 0, 0) );
@@ -634,20 +547,20 @@
         return res;
     }
 
-    private void startLoadingAllProjects(boolean forceRefresh) {
+    private void startLoadingOtherProjects(boolean forceRefresh) {
         if (server==null) {
             return;
         }
         String teamName = server.getUrl().getHost();
-        Preferences prefs = 
NbPreferences.forModule(DashboardSupport.class).node(PREF_ALL_PROJECTS + 
("kenai.com".equals(teamName)?"":"-"+teamName)); //NOI18N
-        int count = prefs.getInt(PREF_COUNT, 0); //NOI18N
+        Preferences prefs = 
NbPreferences.forModule(DashboardSupport.class).node(DashboardSupport.PREF_ALL_PROJECTS
 + ("kenai.com".equals(teamName)?"":"-"+teamName)); //NOI18N
+        int count = prefs.getInt(DashboardSupport.PREF_COUNT, 0); //NOI18N
         if( 0 == count ) {
             projectLoadingFinished();
             return; //nothing to load
         }
         ArrayList<String> ids = new ArrayList<>(count);
         for( int i=0; i<count; i++ ) {
-            String id = prefs.get(PREF_ID+i, null); //NOI18N
+            String id = prefs.get(DashboardSupport.PREF_ID+i, null); //NOI18N
             if( null != id && id.trim().length() > 0 ) {
                 ids.add( id.trim() );
             }
@@ -662,45 +575,42 @@
             }
             otherProjectsLoader = new OtherProjectsLoader(ids, forceRefresh);
             otherProjectsLoader.run();
-//            requestProcessor.post(otherProjectsLoader).waitFinished();
         }
     }
 
     private void storeAllProjects() {
         String serverName = server.getUrl().getHost();
-        Preferences prefs = 
NbPreferences.forModule(DashboardSupport.class).node(PREF_ALL_PROJECTS + 
("kenai.com".equals(serverName)?"":"-"+serverName)); //NOI18N
+        Preferences prefs = 
NbPreferences.forModule(DashboardSupport.class).node(DashboardSupport.PREF_ALL_PROJECTS
 + ("kenai.com".equals(serverName)?"":"-"+serverName)); //NOI18N
         int index = 0;
-        for( ProjectHandle project : openProjects ) {
+        for( ProjectHandle project : otherProjects ) {
             //do not store private projects
 //            if (!project.isPrivate()) {
-                prefs.put(PREF_ID+index++, project.getId()); //NOI18N
+                prefs.put(DashboardSupport.PREF_ID+index++, 
project.getId()); //NOI18N
 //            }
         }
         //store size
-        prefs.putInt(PREF_COUNT, index); //NOI18N
+        prefs.putInt(DashboardSupport.PREF_COUNT, index); //NOI18N
     }
 
     private void setOtherProjects(ArrayList<ProjectHandle<P>> projects) {
         synchronized( LOCK ) {
             
-            ArrayList<ProjectHandle<P>> toRemove = new 
ArrayList<>(openProjects);
+            ArrayList<ProjectHandle<P>> toRemove = new 
ArrayList<>(otherProjects);
             
-            openProjects.clear();
+            otherProjects.clear();
             for( ProjectHandle p : projects ) {
-                if( !openProjects.contains( p ) ) {
-                    openProjects.add( p );
+                if( !otherProjects.contains( p ) ) {
+                    otherProjects.add( p );
                     toRemove.remove(p);
                 }
             }
-            Collections.sort(openProjects);
+            Collections.sort(otherProjects);
             
-            toRemove.removeAll(openProjects);
+            toRemove.removeAll(otherProjects);
             toRemove.removeAll(memberProjects);
             removeProjectNodes( toRemove );
             
             otherProjectsLoaded = true;
-//            addProjectsToModel( -1, openProjects );
-//            userNode.set(login, !openProjects.isEmpty());
             storeAllProjects();
 
             switchMemberProjects();
@@ -770,58 +680,34 @@
     }
     
     @Override
-    public void deletingStarted() {
-//        
userNode.loadingStarted(NbBundle.getMessage(DashboardSupport.class, 
"LBL_Deleting"));
-    }
+    public void deletingStarted() { }
 
     @Override
-    public void deletingFinished() {
-//        userNode.loadingFinished();
-    }
+    public void deletingFinished() { }
 
-    public void loggingStarted() {
-//        
userNode.loadingStarted(NbBundle.getMessage(DashboardSupport.class, 
"LBL_Authenticating"));
-    }
+    public void loggingStarted() { }
 
-    public void loggingFinished() {
-//        userNode.loadingFinished();
-    }
+    public void loggingFinished() { }
 
     @Override
-    public void xmppStarted() {
-//        
userNode.loadingStarted(NbBundle.getMessage(DashboardSupport.class, 
"LBL_ConnectingXMPP"));
-    }
+    public void xmppStarted() { }
 
     @Override
-    public void xmppFinsihed() {
-//        userNode.loadingFinished();
-    }
+    public void xmppFinsihed() { }
 
-    private void projectLoadingStarted() {
-//        noOpenProjects.loadingStarted();
-    }
+    private void projectLoadingStarted() { }
 
-    private void projectLoadingFinished() {
-//        noOpenProjects.loadingFinished();
-    }
+    private void projectLoadingFinished() { }
 
-    private void myProjectLoadingStarted() {
-//        noMyProjects.loadingStarted();
-    }
+    private void myProjectLoadingStarted() { }
 
-    private void myProjectLoadingFinished() {
-//        noMyProjects.loadingFinished();
-    }
+    private void myProjectLoadingFinished() { }
 
     @Override
-    public void myProjectsProgressStarted() {
-//        
userNode.loadingStarted(NbBundle.getMessage(DashboardSupport.class, 
"LBL_LoadingIssues"));
-    }
+    public void myProjectsProgressStarted() { }
 
     @Override
-    public void myProjectsProgressFinished() {
-//        userNode.loadingFinished();
-    }
+    public void myProjectsProgressFinished() { }
 
     private void startLoadingMemberProjects(boolean forceRefresh) {
         synchronized( LOCK ) {
@@ -832,7 +718,6 @@
                 return;
             }
             memberProjectsLoader = new MemberProjectsLoader(login, 
forceRefresh);
-//            requestProcessor.post(memberProjectsLoader).waitFinished();
             memberProjectsLoader.run();
         }
     }
@@ -848,8 +733,6 @@
             ArrayList<ProjectHandle<P>> toRemove = new 
ArrayList<>(memberProjects);
             
             memberProjects.clear();
-            memberProjects.addAll(projects);
-            memberProjectsLoaded = true;
             for( ProjectHandle p : projects ) {
                 if( !memberProjects.contains(p) ) {
                     memberProjects.add(p);
@@ -857,14 +740,13 @@
                 }
             }
             Collections.sort(memberProjects);
+            memberProjectsLoaded = true;
             
             toRemove.removeAll(memberProjects);
-            toRemove.removeAll(openProjects);
+            toRemove.removeAll(otherProjects);
             removeProjectNodes( toRemove );
             
 //            storeAllProjects();
-//            addMemberProjectsToModel(-1, memberProjects );
-//            userNode.set(login, !memberProjects.isEmpty());
 
             switchMemberProjects();
 
@@ -882,13 +764,13 @@
         projectPicker.hideMenu(); // in case the mega menu is hanging around
     }
             
-    Map<String, List<TreeListNode>> projectChildren = new HashMap<>();
     private void switchProject(ProjectHandle project) {
         switchContent();
         for( TreeListNode node : model.getRootNodes() ) {
             model.removeRoot(node);
         }
         if(project != null) {
+            synchronized(projectChildren) {
             List<TreeListNode> children = 
projectChildren.get(project.getId());
             if(children == null) {
                 children = createProjectChildren(project);
@@ -900,6 +782,7 @@
             }
         }
     }
+    }
 
     protected List<TreeListNode> createProjectChildren(ProjectHandle 
project) {
         ArrayList<TreeListNode> children = new ArrayList<>();
@@ -963,7 +846,7 @@
                     projectNodes.put(p.getId(), createProjectNode(p));
                 }
             }
-            for (ProjectHandle p : openProjects) {
+            for (ProjectHandle p : otherProjects) {
                 if(!projectNodes.containsKey(p.getId())) {
                     projectNodes.put(p.getId(), createProjectNode(p));
                 }

[hg] main-silver: housekeeping

Tomas Stupka 06/21/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 64 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close