diff options
Diffstat (limited to 'platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java')
-rw-r--r-- | platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java new file mode 100644 index 000000000000..7937f08fc7b4 --- /dev/null +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/NonProjectDirectoryInfo.java @@ -0,0 +1,127 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.openapi.roots.impl; + +import com.intellij.openapi.module.Module; +import com.intellij.openapi.roots.OrderEntry; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collections; +import java.util.List; + +/** + * @author nik + */ +class NonProjectDirectoryInfo extends DirectoryInfo { + public static final NonProjectDirectoryInfo IGNORED = new NonProjectDirectoryInfo("ignored") { + @Override + public boolean isIgnored() { + return true; + } + }; + public static final NonProjectDirectoryInfo EXCLUDED = new NonProjectDirectoryInfo("excluded from project") { + @Override + public boolean isExcluded() { + return true; + } + }; + public static final NonProjectDirectoryInfo NOT_UNDER_PROJECT_ROOTS = new NonProjectDirectoryInfo("not under project roots"); + public static final NonProjectDirectoryInfo INVALID = new NonProjectDirectoryInfo("invalid"); + public static final NonProjectDirectoryInfo NOT_SUPPORTED_VIRTUAL_FILE_IMPLEMENTATION = new NonProjectDirectoryInfo("not supported VirtualFile implementation"); + private final String myDebugName; + + private NonProjectDirectoryInfo(String debugName) { + myDebugName = debugName; + } + + public boolean isInProject() { + return false; + } + + @NotNull + @Override + public OrderEntry[] getOrderEntries() { + return OrderEntry.EMPTY_ARRAY; + } + + @Nullable + OrderEntry findOrderEntryWithOwnerModule(@NotNull Module ownerModule) { + return null; + } + + @NotNull + List<OrderEntry> findAllOrderEntriesWithOwnerModule(@NotNull Module ownerModule) { + return Collections.emptyList(); + } + + @Override + public String toString() { + return "DirectoryInfo: " + myDebugName; + } + + @Override + public boolean equals(Object o) { + return this == o; + } + + @Override + public int hashCode() { + return System.identityHashCode(this); + } + + public boolean isIgnored() { + return false; + } + + @Nullable + public VirtualFile getSourceRoot() { + return null; + } + + public VirtualFile getLibraryClassRoot() { + return null; + } + + @Nullable + public VirtualFile getContentRoot() { + return null; + } + + public boolean isInModuleSource() { + return false; + } + + public boolean isInLibrarySource() { + return false; + } + + public boolean isExcluded() { + return false; + } + + public Module getModule() { + return null; + } + + void assertConsistency() { + } + + public int getSourceRootTypeId() { + return 0; + } +} |