/** Set the number of milliseconds between automatic * refreshes of the directory structure. * * @param ms number of milliseconds between two refreshes; if <code><= 0</code> then refreshing is disabled */ protected synchronized final void setRefreshTime(int ms) { if (refresher != null) { refresher.stop(); } if ((ms <= 0) || (System.getProperty("netbeans.debug.heap") != null)) { refresher = null; } else { refresher = new RefreshRequest(this, ms); } }
doLoop(ms); } finally { synchronized (this) {
private void doLoop(int ms) { AbstractFileSystem system = this.system.get(); if (system == null) { // end for ever the fs does not exist no more return; } if ((en == null) || !en.hasMoreElements()) { // start again from root en = NbCollections.checkedEnumerationByFilter(existingFolders(system), AbstractFolder.class, true); } for (int i = 0; (i < REFRESH_COUNT) && en.hasMoreElements(); i++) { AbstractFolder fo = en.nextElement(); if ((fo != null) && (!fo.isFolder() || fo.isInitialized())) { fo.refresh(); } if (refreshTime <= 0) { // after each refresh check the current value of refreshTime // again and if it goes to zero exit as fast a you can return; } } // clear the queue if (!en.hasMoreElements()) { en = null; } }
/** Get the number of milliseconds between automatic * refreshes of the directory structure. * By default, automatic refreshing is disabled. * @return the number of milliseconds, or <code>0</code> if refreshing is disabled */ protected final int getRefreshTime() { RefreshRequest r = refresher; return (r == null) ? 0 : r.getRefreshTime(); }
/** Get the number of milliseconds between automatic * refreshes of the directory structure. * By default, automatic refreshing is disabled. * @return the number of milliseconds, or <code>0</code> if refreshing is disabled */ protected final int getRefreshTime () { RefreshRequest r = refresher; return r == null ? 0 : r.getRefreshTime (); }
/** Set the number of milliseconds between automatic * refreshes of the directory structure. * * @param ms number of milliseconds between two refreshes; if <code><= 0</code> then refreshing is disabled */ protected synchronized final void setRefreshTime (int ms) { if (refresher != null) { refresher.stop (); } if (ms <= 0 || System.getProperty ("netbeans.debug.heap") != null) { refresher = null; } else { refresher = new RefreshRequest (this, ms); } }
/** Get the number of milliseconds between automatic * refreshes of the directory structure. * By default, automatic refreshing is disabled. * @return the number of milliseconds, or <code>0</code> if refreshing is disabled */ protected final int getRefreshTime () { RefreshRequest r = refresher; return r == null ? 0 : r.getRefreshTime (); }
private void doLoop (int ms) { AbstractFileSystem system = (AbstractFileSystem)this.system.get (); if (system == null) { // end for ever the fs does not exist no more return; } if (en == null || !en.hasMoreElements ()) { // start again from root en = existingFolders (system); } for (int i = 0; i < REFRESH_COUNT && en.hasMoreElements (); i++) { AbstractFolder fo = (AbstractFolder)en.nextElement (); if (fo != null && (!fo.isFolder() || fo.isInitialized ())) { fo.refresh (); } if (refreshTime <= 0) { // after each refresh check the current value of refreshTime // again and if it goes to zero exit as fast a you can return; } } // clear the queue if (!en.hasMoreElements ()) { en = null; } }
doLoop (ms); } finally { synchronized (this) {
/** Set the number of milliseconds between automatic * refreshes of the directory structure. * * @param ms number of milliseconds between two refreshes; if <code><= 0</code> then refreshing is disabled */ protected synchronized final void setRefreshTime (int ms) { if (refresher != null) { refresher.stop (); } if (ms <= 0 || System.getProperty ("netbeans.debug.heap") != null) { refresher = null; } else { refresher = new RefreshRequest (this, ms); } }
private void doLoop (int ms) { AbstractFileSystem system = (AbstractFileSystem)this.system.get (); if (system == null) { // end for ever the fs does not exist no more return; } if (en == null || !en.hasMoreElements ()) { // start again from root en = existingFolders (system); } for (int i = 0; i < REFRESH_COUNT && en.hasMoreElements (); i++) { AbstractFolder fo = (AbstractFolder)en.nextElement (); if (fo != null && (!fo.isFolder() || fo.isInitialized ())) { fo.refresh (); } if (refreshTime <= 0) { // after each refresh check the current value of refreshTime // again and if it goes to zero exit as fast a you can return; } } // clear the queue if (!en.hasMoreElements ()) { en = null; } }
doLoop (ms); } finally { synchronized (this) {