/* * Copyright 2000-2015 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.ui; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.awt.*; import java.util.Collection; /** * @author spleaner */ public abstract class FileColorManager { public static FileColorManager getInstance(@NotNull final Project project) { return ServiceManager.getService(project, FileColorManager.class); } public abstract boolean isEnabled(); public abstract void setEnabled(boolean enabled); public abstract boolean isEnabledForTabs(); public abstract boolean isEnabledForProjectView(); public abstract Project getProject(); @Nullable public abstract Color getColor(@NotNull String name); @SuppressWarnings({"MethodMayBeStatic"}) public abstract Collection<String> getColorNames(); @Nullable public abstract Color getFileColor(@NotNull final PsiFile file); @Nullable public abstract Color getFileColor(@NotNull final VirtualFile file); @Nullable public abstract Color getScopeColor(@NotNull String scopeName); public abstract boolean isShared(@NotNull final String scopeName); public abstract boolean isColored(@NotNull String scopeName, final boolean shared); @Nullable public abstract Color getRendererBackground(VirtualFile file); @Nullable public abstract Color getRendererBackground(PsiFile file); public abstract void addScopeColor(@NotNull String scopeName, @NotNull String colorName, boolean isProjectLevel); }