/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Basic implementation of a file list.
*
* @author Jeff Dinkins
*/
public class BasicDirectoryModel extends AbstractListModel<Object> implements PropertyChangeListener {
// PENDING(jeff) pick the size more sensibly
private boolean busy = false;
this.filechooser = filechooser;
}
if (old instanceof BasicFileChooserUI) {
}
}
}
}
/**
* This method is used to interrupt file loading thread.
*/
public void invalidateFileCache() {
if (loadThread != null) {
loadThread = null;
}
}
synchronized(fileCache) {
if (directories != null) {
return directories;
}
return directories;
}
}
synchronized(fileCache) {
return files;
}
);
for (int i = 0; i < getSize(); i++) {
if (filechooser.isTraversable(f)) {
directories.add(f);
} else {
}
}
return files;
}
}
public void validateFileCache() {
if (currentDirectory == null) {
return;
}
if (loadThread != null) {
}
loadThread.start();
}
/**
* Renames a file in the underlying file system.
*
* @param oldFile a <code>File</code> object representing
* the existing file
* @param newFile a <code>File</code> object representing
* the desired new file name
* @return <code>true</code> if rename succeeded,
* otherwise <code>false</code>
* @since 1.4
*/
synchronized(fileCache) {
return true;
}
return false;
}
}
public void fireContentsChanged() {
// System.out.println("BasicDirectoryModel: firecontentschanged");
}
public int getSize() {
}
}
}
}
/**
* Obsolete - not used.
*/
}
/**
* Obsolete - not used.
*/
}
ShellFolder.sort(v);
}
// Obsolete - not used
// First ignore case when comparing
if (diff != 0) {
return diff < 0;
} else {
// May differ in case (e.g. "mail" vs. "Mail")
}
}
int fid;
super("Basic L&F File Loading Thread");
this.currentDirectory = currentDirectory;
}
public void run() {
run0();
}
public void run0() {
if (isInterrupted()) {
return;
}
if (isInterrupted()) {
return;
}
// run through the file list, add directories and selectable files to fileCache
// Note that this block must be OUTSIDE of Invoker thread because of
// deadlock possibility with custom synchronized FileSystemView
if (isTraversable) {
} else if (filechooser.isFileSelectionEnabled()) {
}
if (isInterrupted()) {
return;
}
}
}
// First sort alphabetically by filename
// To avoid loads of synchronizations with Invoker and improve performance we
// execute the whole block on the COM thread
public DoChangeContents call() {
//see if interval is added
for (int i = 0; i < oldSize; i++) {
start = i;
for (int j = i; j < newSize; j++) {
end = j;
break;
}
}
break;
}
}
if (isInterrupted()) {
return null;
}
}
//see if interval is removed
int start = -1;
int end = -1;
for (int i = 0; i < newSize; i++) {
start = i;
break;
}
}
if (isInterrupted()) {
return null;
}
}
}
if (isInterrupted()) {
}
}
return null;
}
});
if (doChangeContents != null) {
}
}
}
}
public void cancelRunnables() {
}
}
/**
* Adds a PropertyChangeListener to the listener list. The listener is
* registered for all bound properties of this class.
* <p>
* If <code>listener</code> is <code>null</code>,
* no exception is thrown and no action is performed.
*
* @param listener the property change listener to be added
*
* @see #removePropertyChangeListener
* @see #getPropertyChangeListeners
*
* @since 1.6
*/
if (changeSupport == null) {
changeSupport = new PropertyChangeSupport(this);
}
}
/**
* Removes a PropertyChangeListener from the listener list.
* <p>
* If listener is null, no exception is thrown and no action is performed.
*
* @param listener the PropertyChangeListener to be removed
*
* @see #addPropertyChangeListener
* @see #getPropertyChangeListeners
*
* @since 1.6
*/
if (changeSupport != null) {
}
}
/**
* Returns an array of all the property change listeners
* registered on this component.
*
* @return all of this component's <code>PropertyChangeListener</code>s
* or an empty array if no property change
* listeners are currently registered
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
* @see java.beans.PropertyChangeSupport#getPropertyChangeListeners
*
* @since 1.6
*/
if (changeSupport == null) {
return new PropertyChangeListener[0];
}
return changeSupport.getPropertyChangeListeners();
}
/**
* Support for reporting bound property changes for boolean properties.
* This method can be called when a bound property has changed and it will
* send the appropriate PropertyChangeEvent to any registered
* PropertyChangeListeners.
*
* @param propertyName the property whose value has changed
* @param oldValue the property's previous value
* @param newValue the property's new value
*
* @since 1.6
*/
if (changeSupport != null) {
}
}
/**
* Set the busy state for the model. The model is considered
* busy when it is running a separate (interruptable)
* thread in order to load the contents of a directory.
*/
public void run() {
}
});
}
}
}
private boolean doFire = true;
private int fid;
public DoChangeContents(List<File> addFiles, int addStart, List<File> remFiles, int remStart, int fid) {
}
synchronized void cancel() {
doFire = false;
}
public synchronized void run() {
synchronized(fileCache) {
if (remSize > 0) {
}
if (addSize > 0) {
}
directories = null;
}
} else {
}
}
}
}
}