Lines 44-49
Link Here
|
44 |
|
44 |
|
45 |
package org.netbeans.api.project; |
45 |
package org.netbeans.api.project; |
46 |
|
46 |
|
|
|
47 |
import java.awt.Component; |
48 |
import java.awt.Graphics; |
47 |
import java.io.File; |
49 |
import java.io.File; |
48 |
import java.io.IOException; |
50 |
import java.io.IOException; |
49 |
import java.io.InputStream; |
51 |
import java.io.InputStream; |
Lines 54-62
Link Here
|
54 |
import java.util.StringTokenizer; |
56 |
import java.util.StringTokenizer; |
55 |
import java.util.WeakHashMap; |
57 |
import java.util.WeakHashMap; |
56 |
import java.util.logging.Logger; |
58 |
import java.util.logging.Logger; |
|
|
59 |
import javax.swing.Icon; |
57 |
import junit.framework.Assert; |
60 |
import junit.framework.Assert; |
58 |
import org.netbeans.junit.NbTestCase; |
61 |
import org.netbeans.junit.NbTestCase; |
59 |
import org.netbeans.spi.project.ProjectFactory; |
62 |
import org.netbeans.spi.project.ProjectFactory; |
|
|
63 |
import org.netbeans.spi.project.ProjectFactory2; |
60 |
import org.netbeans.spi.project.ProjectState; |
64 |
import org.netbeans.spi.project.ProjectState; |
61 |
import org.openide.filesystems.FileObject; |
65 |
import org.openide.filesystems.FileObject; |
62 |
import org.openide.filesystems.FileUtil; |
66 |
import org.openide.filesystems.FileUtil; |
Lines 187-193
Link Here
|
187 |
*/ |
191 |
*/ |
188 |
public static Lookup LOOKUP = null; |
192 |
public static Lookup LOOKUP = null; |
189 |
|
193 |
|
190 |
private static final class TestProjectFactory implements ProjectFactory { |
194 |
public static final String TEST_PROJECT_TYPE = "test.project.type"; |
|
|
195 |
public static final Icon TEST_PROJECT_ICON = new Icon() { |
196 |
@Override |
197 |
public void paintIcon(Component c, Graphics g, int x, int y) { |
198 |
throw new UnsupportedOperationException("Not supported yet."); |
199 |
} |
200 |
@Override |
201 |
public int getIconWidth() { |
202 |
throw new UnsupportedOperationException("Not supported yet."); |
203 |
} |
204 |
@Override |
205 |
public int getIconHeight() { |
206 |
throw new UnsupportedOperationException("Not supported yet."); |
207 |
} |
208 |
}; |
209 |
private static final class TestProjectFactory implements ProjectFactory, ProjectFactory2 { |
191 |
|
210 |
|
192 |
TestProjectFactory() {} |
211 |
TestProjectFactory() {} |
193 |
|
212 |
|
Lines 232-239
Link Here
|
232 |
return testproject != null && testproject.isFolder(); |
251 |
return testproject != null && testproject.isFolder(); |
233 |
} |
252 |
} |
234 |
|
253 |
|
|
|
254 |
@Override |
255 |
public ProjectManager.Result isProject2(FileObject dir) { |
256 |
FileObject testproject = dir.getFileObject("testproject"); |
257 |
if(testproject != null && testproject.isFolder() && testproject.getFileObject("broken") != null) { |
258 |
return new ProjectManager.Result(TEST_PROJECT_ICON); |
235 |
} |
259 |
} |
|
|
260 |
if(testproject != null && testproject.isFolder()) { |
261 |
return new ProjectManager.Result( |
262 |
dir.getName(), |
263 |
TEST_PROJECT_TYPE, |
264 |
TEST_PROJECT_ICON); |
265 |
} |
266 |
return null; |
267 |
} |
236 |
|
268 |
|
|
|
269 |
} |
270 |
|
237 |
private static final class TestProject implements Project { |
271 |
private static final class TestProject implements Project { |
238 |
|
272 |
|
239 |
private final FileObject dir; |
273 |
private final FileObject dir; |