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.IProgressMonitor;
37 import org.eclipse.core.runtime.Path;
38 import org.eclipse.core.runtime.QualifiedName;
39 import org.eclipse.core.runtime.content.IContentTypeMatcher;
40 import org.eclipse.core.runtime.jobs.ISchedulingRule;
42 public class SystemProject implements IProject{
44 private SystemProject(){};
45 private static SystemProject INSTANCE;
47 public static SystemProject getDefault() {
49 INSTANCE = new SystemProject();
54 public boolean exists(IPath path) {
55 // TODO Auto-generated method stub
60 public IResource findMember(String name) {
61 // TODO Auto-generated method stub
66 public IResource findMember(String name, boolean includePhantoms) {
67 // TODO Auto-generated method stub
72 public IResource findMember(IPath path) {
73 // TODO Auto-generated method stub
78 public IResource findMember(IPath path, boolean includePhantoms) {
79 // TODO Auto-generated method stub
84 public String getDefaultCharset() throws CoreException {
89 public String getDefaultCharset(boolean checkImplicit) throws CoreException {
94 public IFile getFile(IPath path) {
95 // TODO Auto-generated method stub
100 public IFolder getFolder(IPath path) {
101 // TODO Auto-generated method stub
106 public IResource[] members() throws CoreException {
107 // TODO Auto-generated method stub
112 public IResource[] members(boolean includePhantoms) throws CoreException {
113 // TODO Auto-generated method stub
118 public IResource[] members(int memberFlags) throws CoreException {
119 // TODO Auto-generated method stub
124 public IFile[] findDeletedMembersWithHistory(int depth,
125 IProgressMonitor monitor) throws CoreException {
126 // TODO Auto-generated method stub
131 public void setDefaultCharset(String charset) throws CoreException {
132 // TODO Auto-generated method stub
137 public void setDefaultCharset(String charset, IProgressMonitor monitor)
138 throws CoreException {
139 // TODO Auto-generated method stub
144 public IResourceFilterDescription createFilter(int type,
145 FileInfoMatcherDescription matcherDescription, int updateFlags,
146 IProgressMonitor monitor) throws CoreException {
147 // TODO Auto-generated method stub
152 public IResourceFilterDescription[] getFilters() throws CoreException {
153 // TODO Auto-generated method stub
158 public void accept(IResourceProxyVisitor visitor, int memberFlags)
159 throws CoreException {
160 // TODO Auto-generated method stub
165 public void accept(IResourceVisitor visitor) throws CoreException {
166 // TODO Auto-generated method stub
171 public void accept(IResourceVisitor visitor, int depth,
172 boolean includePhantoms) throws CoreException {
173 // TODO Auto-generated method stub
178 public void accept(IResourceVisitor visitor, int depth, int memberFlags)
179 throws CoreException {
180 // TODO Auto-generated method stub
185 public void accept(IResourceProxyVisitor visitor, int depth, int memberFlags) throws CoreException {
186 // TODO Auto-generated method stub
191 public void clearHistory(IProgressMonitor monitor) throws CoreException {
192 // TODO Auto-generated method stub
197 public void copy(IPath destination, boolean force, IProgressMonitor monitor)
198 throws CoreException {
199 // TODO Auto-generated method stub
204 public void copy(IPath destination, int updateFlags,
205 IProgressMonitor monitor) throws CoreException {
206 // TODO Auto-generated method stub
211 public void copy(IProjectDescription description, boolean force,
212 IProgressMonitor monitor) throws CoreException {
213 // TODO Auto-generated method stub
218 public void copy(IProjectDescription description, int updateFlags,
219 IProgressMonitor monitor) throws CoreException {
220 // TODO Auto-generated method stub
225 public IMarker createMarker(String type) throws CoreException {
226 // TODO Auto-generated method stub
231 public IResourceProxy createProxy() {
232 // TODO Auto-generated method stub
237 public void delete(boolean force, IProgressMonitor monitor)
238 throws CoreException {
239 // TODO Auto-generated method stub
244 public void delete(int updateFlags, IProgressMonitor monitor)
245 throws CoreException {
246 // TODO Auto-generated method stub
251 public void deleteMarkers(String type, boolean includeSubtypes, int depth)
252 throws CoreException {
253 // TODO Auto-generated method stub
258 public boolean exists() {
259 // TODO Auto-generated method stub
264 public IMarker findMarker(long id) throws CoreException {
265 // TODO Auto-generated method stub
270 public IMarker[] findMarkers(String type, boolean includeSubtypes, int depth)
271 throws CoreException {
272 // TODO Auto-generated method stub
277 public int findMaxProblemSeverity(String type, boolean includeSubtypes,
278 int depth) throws CoreException {
279 // TODO Auto-generated method stub
284 public String getFileExtension() {
285 // TODO Auto-generated method stub
290 public IPath getFullPath() {
295 public long getLocalTimeStamp() {
296 // TODO Auto-generated method stub
301 public IPath getLocation() {
306 public URI getLocationURI() {
307 // TODO Auto-generated method stub
312 public IMarker getMarker(long id) {
313 // TODO Auto-generated method stub
318 public long getModificationStamp() {
319 // TODO Auto-generated method stub
324 public String getName() {
325 return "SystemProject";
329 public IPathVariableManager getPathVariableManager() {
330 // TODO Auto-generated method stub
335 public IContainer getParent() {
336 // TODO Auto-generated method stub
340 @SuppressWarnings({ "rawtypes", "unchecked" })
342 public Map getPersistentProperties() throws CoreException {
343 // TODO Auto-generated method stub
348 public String getPersistentProperty(QualifiedName key) throws CoreException {
349 // TODO Auto-generated method stub
354 public IProject getProject() {
359 public IPath getProjectRelativePath() {
364 public IPath getRawLocation() {
369 public URI getRawLocationURI() {
370 // TODO Auto-generated method stub
375 public ResourceAttributes getResourceAttributes() {
376 // TODO Auto-generated method stub
380 @SuppressWarnings({ "unchecked", "rawtypes" })
382 public Map getSessionProperties() throws CoreException {
383 // TODO Auto-generated method stub
388 public Object getSessionProperty(QualifiedName key) throws CoreException {
389 // TODO Auto-generated method stub
394 public int getType() {
395 return IProject.PROJECT;
399 public IWorkspace getWorkspace() {
400 // TODO Auto-generated method stub
405 public boolean isAccessible() {
406 // TODO Auto-generated method stub
411 public boolean isDerived() {
412 // TODO Auto-generated method stub
417 public boolean isDerived(int options) {
418 // TODO Auto-generated method stub
423 public boolean isHidden() {
424 // TODO Auto-generated method stub
429 public boolean isHidden(int options) {
430 // TODO Auto-generated method stub
435 public boolean isLinked() {
436 // TODO Auto-generated method stub
441 public boolean isVirtual() {
442 // TODO Auto-generated method stub
447 public boolean isLinked(int options) {
448 // TODO Auto-generated method stub
453 public boolean isLocal(int depth) {
454 // TODO Auto-generated method stub
459 public boolean isPhantom() {
460 // TODO Auto-generated method stub
465 public boolean isReadOnly() {
466 // TODO Auto-generated method stub
471 public boolean isSynchronized(int depth) {
472 // TODO Auto-generated method stub
477 public boolean isTeamPrivateMember() {
478 // TODO Auto-generated method stub
483 public boolean isTeamPrivateMember(int options) {
484 // TODO Auto-generated method stub
489 public void move(IPath destination, boolean force, IProgressMonitor monitor)
490 throws CoreException {
491 // TODO Auto-generated method stub
496 public void move(IPath destination, int updateFlags,
497 IProgressMonitor monitor) throws CoreException {
498 // TODO Auto-generated method stub
503 public void move(IProjectDescription description, boolean force,
504 boolean keepHistory, IProgressMonitor monitor) throws CoreException {
505 // TODO Auto-generated method stub
510 public void move(IProjectDescription description, int updateFlags,
511 IProgressMonitor monitor) throws CoreException {
512 // TODO Auto-generated method stub
517 public void refreshLocal(int depth, IProgressMonitor monitor)
518 throws CoreException {
519 // TODO Auto-generated method stub
524 public void revertModificationStamp(long value) throws CoreException {
525 // TODO Auto-generated method stub
530 public void setDerived(boolean isDerived) throws CoreException {
531 // TODO Auto-generated method stub
536 public void setDerived(boolean isDerived, IProgressMonitor monitor)
537 throws CoreException {
538 // TODO Auto-generated method stub
543 public void setHidden(boolean isHidden) throws CoreException {
544 // TODO Auto-generated method stub
549 public void setLocal(boolean flag, int depth, IProgressMonitor monitor)
550 throws CoreException {
551 // TODO Auto-generated method stub
556 public long setLocalTimeStamp(long value) throws CoreException {
557 // TODO Auto-generated method stub
562 public void setPersistentProperty(QualifiedName key, String value)
563 throws CoreException {
564 // TODO Auto-generated method stub
569 public void setReadOnly(boolean readOnly) {
570 // TODO Auto-generated method stub
575 public void setResourceAttributes(ResourceAttributes attributes)
576 throws CoreException {
577 // TODO Auto-generated method stub
582 public void setSessionProperty(QualifiedName key, Object value)
583 throws CoreException {
584 // TODO Auto-generated method stub
589 public void setTeamPrivateMember(boolean isTeamPrivate)
590 throws CoreException {
591 // TODO Auto-generated method stub
596 public void touch(IProgressMonitor monitor) throws CoreException {
597 // TODO Auto-generated method stub
602 public boolean contains(ISchedulingRule rule) {
603 if (this.equals(rule))
609 public boolean isConflicting(ISchedulingRule rule) {
610 if (this.equals(rule))
612 // TODO Auto-generated method stub
617 public <T> T getAdapter(Class<T> adapter) {
618 // TODO Auto-generated method stub
622 @SuppressWarnings("rawtypes")
624 public void build(int kind, String builderName, Map args,
625 IProgressMonitor monitor) throws CoreException {
626 // TODO Auto-generated method stub
632 public void build(int kind, IProgressMonitor monitor) throws CoreException {
633 // TODO Auto-generated method stub
638 public void close(IProgressMonitor monitor) throws CoreException {
639 // TODO Auto-generated method stub
644 public void create(IProjectDescription description, IProgressMonitor monitor)
645 throws CoreException {
646 // TODO Auto-generated method stub
651 public void create(IProgressMonitor monitor) throws CoreException {
652 // TODO Auto-generated method stub
657 public void create(IProjectDescription description, int updateFlags,
658 IProgressMonitor monitor) throws CoreException {
659 // TODO Auto-generated method stub
664 public void delete(boolean deleteContent, boolean force,
665 IProgressMonitor monitor) throws CoreException {
666 // TODO Auto-generated method stub
671 public IContentTypeMatcher getContentTypeMatcher() throws CoreException {
672 // TODO Auto-generated method stub
677 public IProjectDescription getDescription() throws CoreException {
678 // TODO Auto-generated method stub
683 public IFile getFile(String name) {
684 // TODO Auto-generated method stub
689 public IFolder getFolder(String name) {
690 // TODO Auto-generated method stub
695 public IProjectNature getNature(String natureId) throws CoreException {
696 // TODO Auto-generated method stub
701 public IPath getWorkingLocation(String id) {
702 // TODO Auto-generated method stub
707 public IProject[] getReferencedProjects() throws CoreException {
708 // TODO Auto-generated method stub
713 public IProject[] getReferencingProjects() {
714 // TODO Auto-generated method stub
719 public boolean hasNature(String natureId) throws CoreException {
720 // TODO Auto-generated method stub
725 public boolean isNatureEnabled(String natureId) throws CoreException {
726 // TODO Auto-generated method stub
731 public boolean isOpen() {
732 // TODO Auto-generated method stub
737 public void loadSnapshot(int options, URI snapshotLocation,
738 IProgressMonitor monitor) throws CoreException {
739 // TODO Auto-generated method stub
744 public void move(IProjectDescription description, boolean force,
745 IProgressMonitor monitor) throws CoreException {
746 // TODO Auto-generated method stub
751 public void open(int updateFlags, IProgressMonitor monitor)
752 throws CoreException {
753 // TODO Auto-generated method stub
758 public void open(IProgressMonitor monitor) throws CoreException {
759 // TODO Auto-generated method stub
764 public void saveSnapshot(int options, URI snapshotLocation,
765 IProgressMonitor monitor) throws CoreException {
766 // TODO Auto-generated method stub
771 public void setDescription(IProjectDescription description,
772 IProgressMonitor monitor) throws CoreException {
773 // TODO Auto-generated method stub
778 public void setDescription(IProjectDescription description,
779 int updateFlags, IProgressMonitor monitor) throws CoreException {
780 // TODO Auto-generated method stub
786 public void build(IBuildConfiguration config, int kind,
787 IProgressMonitor monitor) throws CoreException {
788 // TODO Auto-generated method stub
795 public IBuildConfiguration getActiveBuildConfig() throws CoreException {
796 // TODO Auto-generated method stub
801 public IBuildConfiguration getBuildConfig(String configName)
802 throws CoreException {
803 // TODO Auto-generated method stub
808 public IBuildConfiguration[] getBuildConfigs() throws CoreException {
809 // TODO Auto-generated method stub
814 public IBuildConfiguration[] getReferencedBuildConfigs(String configName,
815 boolean includeMissing) throws CoreException {
816 // TODO Auto-generated method stub
821 public boolean hasBuildConfig(String configName) throws CoreException {
822 // TODO Auto-generated method stub
827 public void clearCachedDynamicReferences() {
828 // TODO Auto-generated method stub