|
What this is
Other links
The source code/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.modules.editor.java;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.ref.SoftReference;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.swing.Timer;
import org.netbeans.editor.Settings;
import org.netbeans.editor.SettingsChangeEvent;
import org.netbeans.editor.SettingsChangeListener;
import org.netbeans.editor.SettingsUtil;
import org.netbeans.editor.ext.DataAccessor;
import org.netbeans.editor.ext.ExtSettingsDefaults;
import org.netbeans.editor.ext.ExtSettingsNames;
import org.netbeans.editor.ext.FileAccessor;
import org.netbeans.editor.ext.java.DAFileProvider;
import org.netbeans.editor.ext.java.JavaCompletion;
import org.netbeans.editor.ext.java.JavaCompletionQuery;
import org.netbeans.editor.ext.java.JCUtilities;
import org.netbeans.editor.ext.java.JCClass;
import org.netbeans.editor.ext.java.JCClassProvider;
import org.netbeans.editor.ext.java.JCFileProvider;
import org.netbeans.editor.ext.java.JCFinder;
import org.netbeans.modules.editor.options.BaseOptions;
import org.netbeans.modules.editor.options.JavaOptions;
import org.openide.ErrorManager;
import org.openide.awt.StatusDisplayer;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.filesystems.FileStateInvalidException;
import org.openide.filesystems.FileSystem;
import org.openide.filesystems.FileSystemCapability;
import org.openide.filesystems.Repository;
import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectNotFoundException;
import org.openide.util.NbBundle;
/**
* Management of Java Completion storage
*
* @author Miloslav Metelka
* @version 1.00
*/
public class JCStorage implements SettingsChangeListener {
private static final String DB_DIR = "ParserDB"; // NOI18N
private static final String STORAGE = "storage"; // NOI18N
private static final String STORAGE_EXT = "ser"; // NOI18N
public static final int STATUS_PARSED = 0;
public static final int STATUS_PARSING = 1;
public static final int STATUS_QUEUED = 2;
public static final int STATUS_CANCELLED = 3;
public static final String PROP_PROJECTS_CHANGED_START = "projects-changed-start"; //NOI18N
public static final String PROP_PROJECTS_CHANGED_END = "projects-changed-end"; //NOI18N
public static final String PROP_STORAGE_REFRESHED = "storage-refreshed"; //NOI18N
/** Whether debug messages about loading of the databases should be displayed */
private static final boolean debug
= Boolean.getBoolean("netbeans.debug.editor.jcstorage"); // NOI18N
/** Flag for testing the support by debugging messages. */
private static final boolean debugUpdater
= Boolean.getBoolean("netbeans.debug.editor.updater"); // NOI18N
private static final String PROVIDER_FILE_EXT
= JCFileProvider.SKEL_FILE_EXT;
private static boolean inited;
private static JCStorage storage;
private FileObject dbFolder; // Code Completion db folder
private ArrayList elementList = new ArrayList();
private final Object ELEMENT_LIST_LOCK = new Object();
private HashSet updatingElements = new HashSet();
private Map updatedFS = Collections.synchronizedMap(new HashMap());
private JCFinder finder;
private PropertyChangeSupport pcs;
private Set parsingFSQueue = Collections.synchronizedSet(new HashSet());
private Map paramFinders = new HashMap(5);
private static final Object PARAM_FINDERS_LOCK = new Object();
private Map params = new HashMap(5);
private Timer timer;
private ActionListener timerAction;
private static final int TIMER_TRESHOLD = 4000;
private boolean ignoreChanges = false;
/** Gets java completion storage.
* @return
|
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.