|
From: David C. <dc...@us...> - 2005-10-16 17:29:34
|
Update of /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12845/src/org/rubypeople/eclipse/shams/resources Modified Files: ShamResource.java ShamProject.java Added Files: ShamResourceProxy.java Log Message: Index all projects on plugin (eclipse) start. Index: ShamProject.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamProject.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ShamProject.java 13 Jul 2005 14:29:45 -0000 1.10 --- ShamProject.java 16 Oct 2005 17:29:26 -0000 1.11 *************** *** 1,2 **** --- 1,12 ---- + /* + * Author: David Corbin + * + * Copyright (c) 2005 RubyPeople. + * + * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. + * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use + * RDT except in compliance with the License. For further information see + * org.rubypeople.rdt/rdt.license. + */ package org.rubypeople.eclipse.shams.resources; *************** *** 342,344 **** --- 352,355 ---- + } Index: ShamResource.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamResource.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ShamResource.java 13 Jul 2005 14:29:45 -0000 1.7 --- ShamResource.java 16 Oct 2005 17:29:26 -0000 1.8 *************** *** 1,4 **** --- 1,19 ---- + /* + * Author: David Corbin + * + * Copyright (c) 2005 RubyPeople. + * + * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. + * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use + * RDT except in compliance with the License. For further information see + * org.rubypeople.rdt/rdt.license. + */ package org.rubypeople.eclipse.shams.resources; + import java.util.Collection; + import java.util.Iterator; + + import junit.framework.Assert; + import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IMarker; *************** *** 18,21 **** --- 33,40 ---- public class ShamResource implements IResource { protected IPath path; + private boolean acceptCalled; + private IResourceProxyVisitor proxyVisitorArg; + private int flagsArg; + private Collection resourcesToVisit; public ShamResource(IPath aPath) { *************** *** 223,231 **** throw new RuntimeException("Need to implement on sham."); } ! /* (non-Javadoc) ! * @see org.eclipse.core.resources.IResource#accept(org.eclipse.core.resources.IResourceProxyVisitor, int) ! */ ! public void accept(IResourceProxyVisitor arg0, int arg1) throws CoreException { ! throw new RuntimeException("Need to implement on sham."); } --- 242,265 ---- throw new RuntimeException("Need to implement on sham."); } ! ! public void setResourcesToVisit(Collection resourcesToVisit) { ! this.resourcesToVisit = resourcesToVisit; ! } ! ! public void assertAcceptCalled(IResourceProxyVisitor expectedVisitor, int expectedFlags) { ! Assert.assertTrue("expected call to accept", acceptCalled); ! Assert.assertEquals("visitor", expectedVisitor, proxyVisitorArg); ! Assert.assertEquals("flags", expectedFlags, flagsArg); ! } ! ! public void accept(IResourceProxyVisitor visitor, int flags) throws CoreException { ! proxyVisitorArg = visitor; ! flagsArg = flags; ! for (Iterator iter = resourcesToVisit.iterator(); iter.hasNext();) { ! IResource resource = (IResource) iter.next(); ! visitor.visit(new ShamResourceProxy(resource)); ! ! } ! acceptCalled = true; } *************** *** 258,263 **** public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { // TODO Auto-generated method stub - } } --- 292,300 ---- public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { // TODO Auto-generated method stub } + + public String toString() { + return "Resource [" + path + "]"; + } } --- NEW FILE: ShamResourceProxy.java --- /* * Author: David Corbin * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. * RDT is subject to the "Common Public License (CPL) v 1.0". You may not use * RDT except in compliance with the License. For further information see * org.rubypeople.rdt/rdt.license. */ package org.rubypeople.eclipse.shams.resources; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceProxy; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.QualifiedName; public class ShamResourceProxy implements IResourceProxy { private IResource resource; public ShamResourceProxy(IResource resource) { this.resource = resource; } public long getModificationStamp() { return resource.getModificationStamp(); } public boolean isAccessible() { return resource.isAccessible(); } public boolean isDerived() { return resource.isDerived(); } public boolean isLinked() { return resource.isLinked(); } public boolean isPhantom() { return resource.isPhantom(); } public boolean isTeamPrivateMember() { return resource.isTeamPrivateMember(); } public String getName() { return resource.getName(); } public Object getSessionProperty(QualifiedName key) { try { return resource.getSessionProperty(key); } catch (CoreException e) { throw new RuntimeException(e); } } public int getType() { return resource.getType(); } public IPath requestFullPath() { return resource.getFullPath(); } public IResource requestResource() { return resource; } } |