Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.wodclipse/java/org/objectstyle/wolips/wodclipse/builder
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18567/java/org/objectstyle/wolips/wodclipse/builder
Modified Files:
WodBuilder.java
Log Message:
Caching of locate results.
Index: WodBuilder.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.wodclipse/java/org/objectstyle/wolips/wodclipse/builder/WodBuilder.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- WodBuilder.java 29 Oct 2005 17:23:25 -0000 1.13
+++ WodBuilder.java 25 Jan 2006 08:12:55 -0000 1.14
@@ -1,3 +1,46 @@
+/*
+ * ====================================================================
+ *
+ * The ObjectStyle Group Software License, Version 1.0
+ *
+ * Copyright (c) 2005 - 2006 The ObjectStyle Group and individual authors of the
+ * software. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: 1.
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. 2. Redistributions in
+ * binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution. 3. The end-user documentation
+ * included with the redistribution, if any, must include the following
+ * acknowlegement: "This product includes software developed by the ObjectStyle
+ * Group (http://objectstyle.org/)." Alternately, this acknowlegement may
+ * appear in the software itself, if and wherever such third-party
+ * acknowlegements normally appear. 4. The names "ObjectStyle Group" and
+ * "Cayenne" must not be used to endorse or promote products derived from this
+ * software without prior written permission. For written permission, please
+ * contact [email protected]. 5. Products derived from this software may
+ * not be called "ObjectStyle" nor may "ObjectStyle" appear in their names
+ * without prior written permission of the ObjectStyle Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * OBJECTSTYLE GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the ObjectStyle Group. For more information on the ObjectStyle
+ * Group, please see <http://objectstyle.org/> .
+ *
+ */
package org.objectstyle.wolips.wodclipse.builder;
import java.util.HashSet;
@@ -14,10 +57,9 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.part.FileEditorInput;
import org.objectstyle.wolips.core.resources.builder.AbstractDeltaCleanBuilder;
-import org.objectstyle.wolips.locate.Locate;
import org.objectstyle.wolips.locate.LocateException;
+import org.objectstyle.wolips.locate.LocatePlugin;
import org.objectstyle.wolips.locate.result.LocalizedComponentsLocateResult;
-import org.objectstyle.wolips.locate.scope.ComponentLocateScope;
import org.objectstyle.wolips.preferences.Preferences;
import org.objectstyle.wolips.wodclipse.WodclipsePlugin;
import org.objectstyle.wolips.wodclipse.wod.WodFileDocumentProvider;
@@ -70,20 +112,13 @@
if (_resource instanceof IFile) {
IFile file = (IFile) _resource;
String fileExtension = file.getFileExtension();
- LocalizedComponentsLocateResult localizedComponentsLocateResult = new LocalizedComponentsLocateResult();
if ("wod".equals(fileExtension)) {
- // "prefill" the search results
- localizedComponentsLocateResult.add(file.getParent());
validateWodFile = true;
}
else if ("html".equals(fileExtension) && _resource.getParent().getName().endsWith(".wo")) {
- // "prefill" the search results
- localizedComponentsLocateResult.add(file.getParent());
validateWodFile = true;
}
else if ("api".equals(fileExtension)) {
- // "prefill" the search results
- localizedComponentsLocateResult.add(file);
//should we really do something with the component when we change the api?
//shoulnd't we validate all files using the api?
validateWodFile = false;
@@ -97,7 +132,7 @@
}
if (validateWodFile) {
- validateWodFile(localizedComponentsLocateResult, file.getProject(), file.getName(), _monitor, _buildCache);
+ validateWodFile(file, _monitor, _buildCache);
}
}
}
@@ -134,15 +169,12 @@
}
}
- protected void validateWodFile(LocalizedComponentsLocateResult _locateResults, IProject _project, String _resourceName, IProgressMonitor _progressMonitor, Map _buildCache) throws CoreException, LocateException {
- if (_progressMonitor != null) {
+ protected void validateWodFile(IFile file, IProgressMonitor _progressMonitor, Map _buildCache) throws CoreException, LocateException {
+ String _resourceName = file.getName();
+ if (_progressMonitor != null) {
_progressMonitor.subTask("Locating components for " + _resourceName + " ...");
}
-
- ComponentLocateScope componentLocateScope = ComponentLocateScope.createLocateScope(_project, _resourceName);
- Locate locate = new Locate(componentLocateScope, _locateResults);
- locate.locate();
-
+ LocalizedComponentsLocateResult _locateResults = LocatePlugin.getDefault().getLocalizedComponentsLocateResult(file);
IFile wodFile = _locateResults.getFirstWodFile();
if (wodFile != null) {
if (_progressMonitor != null) {
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.