1 /*******************************************************************************
2 * Copyright (c) 2013 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.graphfile.hack;
17 import org.eclipse.core.resources.FileInfoMatcherDescription;
18 import org.eclipse.core.resources.IBuildConfiguration;
19 import org.eclipse.core.resources.IContainer;
20 import org.eclipse.core.resources.IFile;
21 import org.eclipse.core.resources.IFolder;
22 import org.eclipse.core.resources.IMarker;
23 import org.eclipse.core.resources.IPathVariableManager;
24 import org.eclipse.core.resources.IProject;
25 import org.eclipse.core.resources.IProjectDescription;
26 import org.eclipse.core.resources.IProjectNature;
27 import org.eclipse.core.resources.IResource;
28 import org.eclipse.core.resources.IResourceFilterDescription;
29 import org.eclipse.core.resources.IResourceProxy;
30 import org.eclipse.core.resources.IResourceProxyVisitor;
31 import org.eclipse.core.resources.IResourceVisitor;
32 import org.eclipse.core.resources.IWorkspace;
33 import org.eclipse.core.resources.ResourceAttributes;
34 import org.eclipse.core.runtime.CoreException;
35 import org.eclipse.core.runtime.IPath;
36 import org.eclipse.core.runtime.IPluginDescriptor;
37 import org.eclipse.core.runtime.IProgressMonitor;
38 import org.eclipse.core.runtime.Path;
39 import org.eclipse.core.runtime.QualifiedName;
40 import org.eclipse.core.runtime.content.IContentTypeMatcher;
41 import org.eclipse.core.runtime.jobs.ISchedulingRule;
43 @SuppressWarnings("deprecation")
44 public class SystemProject implements IProject{
46 private SystemProject(){};
47 private static SystemProject INSTANCE;
49 public static SystemProject getDefault() {
51 INSTANCE = new SystemProject();
56 public boolean exists(IPath path) {
57 // TODO Auto-generated method stub
62 public IResource findMember(String name) {
63 // TODO Auto-generated method stub
68 public IResource findMember(String name, boolean includePhantoms) {
69 // TODO Auto-generated method stub
74 public IResource findMember(IPath path) {
75 // TODO Auto-generated method stub
80 public IResource findMember(IPath path, boolean includePhantoms) {
81 // TODO Auto-generated method stub
86 public String getDefaultCharset() throws CoreException {
91 public String getDefaultCharset(boolean checkImplicit) throws CoreException {
96 public IFile getFile(IPath path) {
97 // TODO Auto-generated method stub
102 public IFolder getFolder(IPath path) {
103 // TODO Auto-generated method stub
108 public IResource[] members() throws CoreException {
109 // TODO Auto-generated method stub
114 public IResource[] members(boolean includePhantoms) throws CoreException {
115 // TODO Auto-generated method stub
120 public IResource[] members(int memberFlags) throws CoreException {
121 // TODO Auto-generated method stub
126 public IFile[] findDeletedMembersWithHistory(int depth,
127 IProgressMonitor monitor) throws CoreException {
128 // TODO Auto-generated method stub
133 public void setDefaultCharset(String charset) throws CoreException {
134 // TODO Auto-generated method stub
139 public void setDefaultCharset(String charset, IProgressMonitor monitor)
140 throws CoreException {
141 // TODO Auto-generated method stub
146 public IResourceFilterDescription createFilter(int type,
147 FileInfoMatcherDescription matcherDescription, int updateFlags,
148 IProgressMonitor monitor) throws CoreException {
149 // TODO Auto-generated method stub
154 public IResourceFilterDescription[] getFilters() throws CoreException {
155 // TODO Auto-generated method stub
160 public void accept(IResourceProxyVisitor visitor, int memberFlags)
161 throws CoreException {
162 // TODO Auto-generated method stub
167 public void accept(IResourceVisitor visitor) throws CoreException {
168 // TODO Auto-generated method stub
173 public void accept(IResourceVisitor visitor, int depth,
174 boolean includePhantoms) throws CoreException {
175 // TODO Auto-generated method stub
180 public void accept(IResourceVisitor visitor, int depth, int memberFlags)
181 throws CoreException {
182 // TODO Auto-generated method stub
187 public void accept(IResourceProxyVisitor visitor, int depth, int memberFlags) throws CoreException {
188 // TODO Auto-generated method stub
193 public void clearHistory(IProgressMonitor monitor) throws CoreException {
194 // TODO Auto-generated method stub
199 public void copy(IPath destination, boolean force, IProgressMonitor monitor)
200 throws CoreException {
201 // TODO Auto-generated method stub
206 public void copy(IPath destination, int updateFlags,
207 IProgressMonitor monitor) throws CoreException {
208 // TODO Auto-generated method stub
213 public void copy(IProjectDescription description, boolean force,
214 IProgressMonitor monitor) throws CoreException {
215 // TODO Auto-generated method stub
220 public void copy(IProjectDescription description, int updateFlags,
221 IProgressMonitor monitor) throws CoreException {
222 // TODO Auto-generated method stub
227 public IMarker createMarker(String type) throws CoreException {
228 // TODO Auto-generated method stub
233 public IResourceProxy createProxy() {
234 // TODO Auto-generated method stub
239 public void delete(boolean force, IProgressMonitor monitor)
240 throws CoreException {
241 // TODO Auto-generated method stub
246 public void delete(int updateFlags, IProgressMonitor monitor)
247 throws CoreException {
248 // TODO Auto-generated method stub
253 public void deleteMarkers(String type, boolean includeSubtypes, int depth)
254 throws CoreException {
255 // TODO Auto-generated method stub
260 public boolean exists() {
261 // TODO Auto-generated method stub
266 public IMarker findMarker(long id) throws CoreException {
267 // TODO Auto-generated method stub
272 public IMarker[] findMarkers(String type, boolean includeSubtypes, int depth)
273 throws CoreException {
274 // TODO Auto-generated method stub
279 public int findMaxProblemSeverity(String type, boolean includeSubtypes,
280 int depth) throws CoreException {
281 // TODO Auto-generated method stub
286 public String getFileExtension() {
287 // TODO Auto-generated method stub
292 public IPath getFullPath() {
297 public long getLocalTimeStamp() {
298 // TODO Auto-generated method stub
303 public IPath getLocation() {
308 public URI getLocationURI() {
309 // TODO Auto-generated method stub
314 public IMarker getMarker(long id) {
315 // TODO Auto-generated method stub
320 public long getModificationStamp() {
321 // TODO Auto-generated method stub
326 public String getName() {
327 return "SystemProject";
331 public IPathVariableManager getPathVariableManager() {
332 // TODO Auto-generated method stub
337 public IContainer getParent() {
338 // TODO Auto-generated method stub
342 @SuppressWarnings({ "rawtypes", "unchecked" })
344 public Map getPersistentProperties() throws CoreException {
345 // TODO Auto-generated method stub
350 public String getPersistentProperty(QualifiedName key) throws CoreException {
351 // TODO Auto-generated method stub
356 public IProject getProject() {
361 public IPath getProjectRelativePath() {
366 public IPath getRawLocation() {
371 public URI getRawLocationURI() {
372 // TODO Auto-generated method stub
377 public ResourceAttributes getResourceAttributes() {
378 // TODO Auto-generated method stub
382 @SuppressWarnings({ "unchecked", "rawtypes" })
384 public Map getSessionProperties() throws CoreException {
385 // TODO Auto-generated method stub
390 public Object getSessionProperty(QualifiedName key) throws CoreException {
391 // TODO Auto-generated method stub
396 public int getType() {
397 return IProject.PROJECT;
401 public IWorkspace getWorkspace() {
402 // TODO Auto-generated method stub
407 public boolean isAccessible() {
408 // TODO Auto-generated method stub
413 public boolean isDerived() {
414 // TODO Auto-generated method stub
419 public boolean isDerived(int options) {
420 // TODO Auto-generated method stub
425 public boolean isHidden() {
426 // TODO Auto-generated method stub
431 public boolean isHidden(int options) {
432 // TODO Auto-generated method stub
437 public boolean isLinked() {
438 // TODO Auto-generated method stub
443 public boolean isVirtual() {
444 // TODO Auto-generated method stub
449 public boolean isLinked(int options) {
450 // TODO Auto-generated method stub
455 public boolean isLocal(int depth) {
456 // TODO Auto-generated method stub
461 public boolean isPhantom() {
462 // TODO Auto-generated method stub
467 public boolean isReadOnly() {
468 // TODO Auto-generated method stub
473 public boolean isSynchronized(int depth) {
474 // TODO Auto-generated method stub
479 public boolean isTeamPrivateMember() {
480 // TODO Auto-generated method stub
485 public boolean isTeamPrivateMember(int options) {
486 // TODO Auto-generated method stub
491 public void move(IPath destination, boolean force, IProgressMonitor monitor)
492 throws CoreException {
493 // TODO Auto-generated method stub
498 public void move(IPath destination, int updateFlags,
499 IProgressMonitor monitor) throws CoreException {
500 // TODO Auto-generated method stub
505 public void move(IProjectDescription description, boolean force,
506 boolean keepHistory, IProgressMonitor monitor) throws CoreException {
507 // TODO Auto-generated method stub
512 public void move(IProjectDescription description, int updateFlags,
513 IProgressMonitor monitor) throws CoreException {
514 // TODO Auto-generated method stub
519 public void refreshLocal(int depth, IProgressMonitor monitor)
520 throws CoreException {
521 // TODO Auto-generated method stub
526 public void revertModificationStamp(long value) throws CoreException {
527 // TODO Auto-generated method stub
532 public void setDerived(boolean isDerived) throws CoreException {
533 // TODO Auto-generated method stub
538 public void setDerived(boolean isDerived, IProgressMonitor monitor)
539 throws CoreException {
540 // TODO Auto-generated method stub
545 public void setHidden(boolean isHidden) throws CoreException {
546 // TODO Auto-generated method stub
551 public void setLocal(boolean flag, int depth, IProgressMonitor monitor)
552 throws CoreException {
553 // TODO Auto-generated method stub
558 public long setLocalTimeStamp(long value) throws CoreException {
559 // TODO Auto-generated method stub
564 public void setPersistentProperty(QualifiedName key, String value)
565 throws CoreException {
566 // TODO Auto-generated method stub
571 public void setReadOnly(boolean readOnly) {
572 // TODO Auto-generated method stub
577 public void setResourceAttributes(ResourceAttributes attributes)
578 throws CoreException {
579 // TODO Auto-generated method stub
584 public void setSessionProperty(QualifiedName key, Object value)
585 throws CoreException {
586 // TODO Auto-generated method stub
591 public void setTeamPrivateMember(boolean isTeamPrivate)
592 throws CoreException {
593 // TODO Auto-generated method stub
598 public void touch(IProgressMonitor monitor) throws CoreException {
599 // TODO Auto-generated method stub
604 public boolean contains(ISchedulingRule rule) {
605 if (this.equals(rule))
611 public boolean isConflicting(ISchedulingRule rule) {
612 if (this.equals(rule))
614 // TODO Auto-generated method stub
618 @SuppressWarnings("rawtypes")
620 public Object getAdapter(Class adapter) {
621 // TODO Auto-generated method stub
625 @SuppressWarnings("rawtypes")
627 public void build(int kind, String builderName, Map args,
628 IProgressMonitor monitor) throws CoreException {
629 // TODO Auto-generated method stub
635 public void build(int kind, IProgressMonitor monitor) throws CoreException {
636 // TODO Auto-generated method stub
641 public void close(IProgressMonitor monitor) throws CoreException {
642 // TODO Auto-generated method stub
647 public void create(IProjectDescription description, IProgressMonitor monitor)
648 throws CoreException {
649 // TODO Auto-generated method stub
654 public void create(IProgressMonitor monitor) throws CoreException {
655 // TODO Auto-generated method stub
660 public void create(IProjectDescription description, int updateFlags,
661 IProgressMonitor monitor) throws CoreException {
662 // TODO Auto-generated method stub
667 public void delete(boolean deleteContent, boolean force,
668 IProgressMonitor monitor) throws CoreException {
669 // TODO Auto-generated method stub
674 public IContentTypeMatcher getContentTypeMatcher() throws CoreException {
675 // TODO Auto-generated method stub
680 public IProjectDescription getDescription() throws CoreException {
681 // TODO Auto-generated method stub
686 public IFile getFile(String name) {
687 // TODO Auto-generated method stub
692 public IFolder getFolder(String name) {
693 // TODO Auto-generated method stub
698 public IProjectNature getNature(String natureId) throws CoreException {
699 // TODO Auto-generated method stub
704 public IPath getPluginWorkingLocation(IPluginDescriptor plugin) {
705 // TODO Auto-generated method stub
710 public IPath getWorkingLocation(String id) {
711 // TODO Auto-generated method stub
716 public IProject[] getReferencedProjects() throws CoreException {
717 // TODO Auto-generated method stub
722 public IProject[] getReferencingProjects() {
723 // TODO Auto-generated method stub
728 public boolean hasNature(String natureId) throws CoreException {
729 // TODO Auto-generated method stub
734 public boolean isNatureEnabled(String natureId) throws CoreException {
735 // TODO Auto-generated method stub
740 public boolean isOpen() {
741 // TODO Auto-generated method stub
746 public void loadSnapshot(int options, URI snapshotLocation,
747 IProgressMonitor monitor) throws CoreException {
748 // TODO Auto-generated method stub
753 public void move(IProjectDescription description, boolean force,
754 IProgressMonitor monitor) throws CoreException {
755 // TODO Auto-generated method stub
760 public void open(int updateFlags, IProgressMonitor monitor)
761 throws CoreException {
762 // TODO Auto-generated method stub
767 public void open(IProgressMonitor monitor) throws CoreException {
768 // TODO Auto-generated method stub
773 public void saveSnapshot(int options, URI snapshotLocation,
774 IProgressMonitor monitor) throws CoreException {
775 // TODO Auto-generated method stub
780 public void setDescription(IProjectDescription description,
781 IProgressMonitor monitor) throws CoreException {
782 // TODO Auto-generated method stub
787 public void setDescription(IProjectDescription description,
788 int updateFlags, IProgressMonitor monitor) throws CoreException {
789 // TODO Auto-generated method stub
795 public void build(IBuildConfiguration config, int kind,
796 IProgressMonitor monitor) throws CoreException {
797 // TODO Auto-generated method stub
804 public IBuildConfiguration getActiveBuildConfig() throws CoreException {
805 // TODO Auto-generated method stub
810 public IBuildConfiguration getBuildConfig(String configName)
811 throws CoreException {
812 // TODO Auto-generated method stub
817 public IBuildConfiguration[] getBuildConfigs() throws CoreException {
818 // TODO Auto-generated method stub
823 public IBuildConfiguration[] getReferencedBuildConfigs(String configName,
824 boolean includeMissing) throws CoreException {
825 // TODO Auto-generated method stub
830 public boolean hasBuildConfig(String configName) throws CoreException {
831 // TODO Auto-generated method stub
836 public void clearCachedDynamicReferences() {
837 // TODO Auto-generated method stub