Example usage for org.eclipse.jdt.internal.core Openable close

List of usage examples for org.eclipse.jdt.internal.core Openable close

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core Openable close.

Prototype

public void close() throws JavaModelException 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.ElementCache.java

License:Open Source License

/**
 * Returns true if the element is successfully closed and
 * removed from the cache, otherwise false.
 *
 * <p>NOTE: this triggers an external removal of this element
 * by closing the element./*from w  w  w . j  a v  a 2  s  .  co  m*/
 */
protected boolean close(LRUCacheEntry entry) {
    Openable element = (Openable) entry.key;
    try {
        if (!element.canBeRemovedFromCache()) {
            return false;
        } else {
            element.close();
            return true;
        }
    } catch (JavaModelException npe) {
        return false;
    }
}