add icons for different scopes
@@ -22,7 +22,7 @@ public final class ProblemsScope extends NamedScope {
|
||||
public static final ProblemsScope INSTANCE = new ProblemsScope();
|
||||
|
||||
private ProblemsScope() {
|
||||
super(NAME, AllIcons.Toolwindows.Problems, new FilteredPackageSet(NAME) {
|
||||
super(NAME, AllIcons.Scope.Problems, new FilteredPackageSet(NAME) {
|
||||
@Override
|
||||
public boolean contains(@NotNull VirtualFile file, @NotNull Project project) {
|
||||
WolfTheProblemSolver solver = project.isDisposed() ? null : WolfTheProblemSolver.getInstance(project);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.psi.search.scope;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
@@ -20,7 +21,7 @@ public final class ProjectFilesScope extends NamedScope {
|
||||
public static final ProjectFilesScope INSTANCE = new ProjectFilesScope();
|
||||
|
||||
public ProjectFilesScope() {
|
||||
super(NAME, new FilteredPackageSet(NAME) {
|
||||
super(NAME, AllIcons.Nodes.Folder, new FilteredPackageSet(NAME) {
|
||||
@Override
|
||||
public boolean contains(@NotNull VirtualFile file, @NotNull Project project) {
|
||||
ProjectFileIndex fileIndex = getFileIndex(project);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.psi.search.scope;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
@@ -8,6 +9,7 @@ import com.intellij.openapi.roots.TestSourcesFilter;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.search.scope.packageSet.FilteredPackageSet;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.ui.OffsetIcon;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -19,7 +21,7 @@ public final class ProjectProductionScope extends NamedScope {
|
||||
public static final ProjectProductionScope INSTANCE = new ProjectProductionScope();
|
||||
|
||||
private ProjectProductionScope() {
|
||||
super(NAME, new FilteredPackageSet(NAME) {
|
||||
super(NAME, new OffsetIcon(AllIcons.Scope.Production), new FilteredPackageSet(NAME) {
|
||||
@Override
|
||||
public boolean contains(@NotNull VirtualFile file, @NotNull Project project) {
|
||||
ProjectFileIndex index = ProjectFilesScope.getFileIndex(project);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.psi.search.scope;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.TestSourcesFilter;
|
||||
@@ -8,6 +9,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.search.scope.packageSet.FilteredPackageSet;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.ui.Colored;
|
||||
import com.intellij.ui.OffsetIcon;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -20,7 +22,7 @@ public final class TestsScope extends NamedScope {
|
||||
public static final TestsScope INSTANCE = new TestsScope();
|
||||
|
||||
private TestsScope() {
|
||||
super(NAME, new FilteredPackageSet(NAME) {
|
||||
super(NAME, new OffsetIcon(AllIcons.Scope.Tests), new FilteredPackageSet(NAME) {
|
||||
@Override
|
||||
public boolean contains(@NotNull VirtualFile file, @NotNull Project project) {
|
||||
return TestSourcesFilter.isTestSources(file, project);
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#9AA7B0" fill-opacity=".8" d="M1,1 L15,1 L15,14 L1,14 L1,1 Z M2,4 L2,13 L14,13 L14,4 L2,4 Z"/>
|
||||
<rect width="10" height="7" x="3" y="5" fill="#40B6E0" fill-opacity=".6"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 326 B |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd" transform="translate(1 1)">
|
||||
<path fill="#9AA7B0" fill-opacity=".8" d="M7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 Z M6.99999972,11.8999995 C9.70619487,11.8999995 11.8999995,9.70619487 11.8999995,6.99999972 C11.8999995,4.29380457 9.70619487,2.09999994 6.99999972,2.09999994 C4.29380457,2.09999994 2.09999994,4.29380457 2.09999994,6.99999972 C2.09999994,9.70619487 4.29380457,11.8999995 6.99999972,11.8999995 Z"/>
|
||||
<circle cx="7" cy="7" r="2.5" fill="#40B6E0" fill-opacity=".6"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 712 B |
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="#9AA7B0" fill-rule="evenodd" transform="translate(1 1)">
|
||||
<rect width="6" height="1" x="4" y="4"/>
|
||||
<rect width="6" height="1" x="4" y="6"/>
|
||||
<rect width="6" height="1" x="4" y="8"/>
|
||||
<path fill-opacity=".8" d="M0,0 L14,0 L14,14 L0,14 L0,0 Z M2,2 L2,12 L12,12 L12,2 L2,2 Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 397 B |
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#9AA7B0" fill-opacity=".8" d="M10.5,12 L10.5,1.5 L0,1.5 L0,0 L12,0 L12,12 L10.5,12 Z" transform="translate(4)"/>
|
||||
<g fill="#9AA7B0" transform="translate(1 3)">
|
||||
<rect width="6" height="1" x="3" y="3"/>
|
||||
<rect width="6" height="1" x="3" y="5"/>
|
||||
<rect width="6" height="1" x="3" y="7"/>
|
||||
<path fill-opacity=".8" d="M0,0 L12,0 L12,12 L0,12 L0,0 Z M2,2 L2,10 L10,10 L10,2 L2,2 Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 563 B |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#F4AF3D" fill-rule="evenodd" d="M8,1 L15,13 L1,13 L8,1 Z M9,9 L9,5 L7,5 L7,9 L9,9 Z M9,12 L9,10 L7,10 L7,12 L9,12 Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 224 B |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#40B6E0" d="M9.260391,6.32522069 L10.5169494,7.2267667 C10.2751175,7.97474329 9.87813029,8.65294387 9.36393041,9.22342575 L7.95490923,8.58778561 C7.55387891,8.94116518 7.08288634,9.21700799 6.56537772,9.39186785 L6.41185475,10.930198 C6.03985489,11.0091942 5.65401853,11.0507569 5.25847469,11.0507569 C4.86293085,11.0507569 4.47709448,11.0091942 4.10509463,10.930198 L3.95157164,9.39186771 C3.43406313,9.21700783 2.96307066,8.94116502 2.56204042,8.58778549 L1.15301897,9.22342575 C0.638819088,8.65294387 0.24183187,7.97474329 -1.8637869e-14,7.2267667 L1.25655873,6.32522044 C1.20515306,6.0665761 1.17819527,5.79912554 1.17819527,5.52537864 C1.17819527,5.25163162 1.20515308,4.98418093 1.2565588,4.72553649 L2.22044605e-14,3.82399018 C0.24183187,3.07601359 0.638819088,2.39781301 1.15301897,1.82733113 L2.56204072,2.46297152 C2.96307088,2.10959213 3.43406324,1.83374943 3.9515716,1.65888959 L4.10509463,0.120558843 C4.47709448,0.0415626284 4.86293085,0 5.25847469,0 C5.65401853,0 6.03985489,0.0415626284 6.41185475,0.120558843 L6.56537776,1.65888945 C7.08288623,1.83374926 7.55387868,2.10959197 7.95490892,2.4629714 L9.36393041,1.82733113 C9.87813029,2.39781301 10.2751175,3.07601359 10.5169494,3.82399018 L9.26039093,4.72553624 C9.31179669,4.98418076 9.33875452,5.25163153 9.33875452,5.52537864 C9.33875452,5.79912563 9.31179671,6.06657628 9.260391,6.32522069 Z M5.25847449,7.48084867 C6.33826511,7.48084867 7.21360836,6.60543007 7.21360836,5.52554652 C7.21360836,4.44566296 6.33826511,3.57024437 5.25847449,3.57024437 C4.17868387,3.57024437 3.30334062,4.44566296 3.30334062,5.52554652 C3.30334062,6.60543007 4.17868387,7.48084867 5.25847449,7.48084867 Z"/>
|
||||
<path fill="#9AA7B0" d="M15.1598391,12.9074185 L15.9956783,13.50711 C15.8348162,14.0046501 15.5707478,14.4557764 15.2287116,14.8352503 L14.291457,14.4124344 C14.0246992,14.6474959 13.7114037,14.8309814 13.3671666,14.9472949 L13.265046,15.9705634 C13.0175987,16.0231102 12.7609475,16.0507569 12.4978391,16.0507569 C12.2347308,16.0507569 11.9780796,16.0231102 11.7306323,15.9705634 L11.6285116,14.9472948 C11.2842747,14.8309813 10.9709793,14.6474958 10.7042214,14.4124343 L9.76696668,14.8352503 C9.42493053,14.4557764 9.16086204,14.0046501 9,13.50711 L9.8358394,12.9074183 C9.8016453,12.7353729 9.78371349,12.5574698 9.78371349,12.3753785 C9.78371349,12.1932871 9.80164532,12.0153839 9.83583944,11.8433384 L9,11.2436467 C9.16086204,10.7461066 9.42493053,10.2949802 9.76696668,9.91550635 L10.7042216,10.3383225 C10.9709794,10.1032611 11.2842747,9.91977568 11.6285116,9.80346218 L11.7306323,8.7801933 C11.9780796,8.72764649 12.2347308,8.69999981 12.4978391,8.69999981 C12.7609475,8.69999981 13.0175987,8.72764649 13.265046,8.7801933 L13.3671667,9.80346208 C13.7114036,9.91977556 14.024699,10.103261 14.2914568,10.3383224 L15.2287116,9.91550635 C15.5707478,10.2949802 15.8348162,10.7461066 15.9956783,11.2436467 L15.1598391,11.8433382 C15.1940332,12.0153838 15.2119651,12.193287 15.2119651,12.3753785 C15.2119651,12.5574699 15.1940332,12.735373 15.1598391,12.9074185 Z M12.497839,13.6761206 C13.2160956,13.6761206 13.7983575,13.0938085 13.7983575,12.3754901 C13.7983575,11.6571718 13.2160956,11.0748597 12.497839,11.0748597 C11.7795825,11.0748597 11.1973205,11.6571718 11.1973205,12.3754901 C11.1973205,13.0938085 11.7795825,13.6761206 12.497839,13.6761206 Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#9AA7B0" fill-opacity=".8" d="M11,4.69999981 C7.86091566,4.69999981 5.25805296,6.99583755 4.77892492,10 L1,10 L1,1 L11,1 L11,4.69999981 Z M4.8277669,4.12066011 L2.70710678,2 L2,2.70710678 L4.12066011,4.8277669 L2,6.94842701 L2.70710678,7.65553379 L4.8277669,5.53487368 L4.82842712,5.53553391 L5.53553391,4.82842712 L5.53487368,4.8277669 L5.53553391,4.82710667 L4.82842712,4.11999989 L4.8277669,4.12066011 Z"/>
|
||||
<path fill="#40B6E0" d="M11.5,10.9928935 L11.5,8.4000001 L10.5,8.4000001 L10.5,11.4000001 L10.507107,11.4000001 L10.5,11.4071071 L12.4834169,13.3905239 L13.1905236,12.6834172 L11.5,10.9928935 Z M11,16 C8.23857625,16 6,13.7614237 6,11 C6,8.23857625 8.23857625,6 11,6 C13.7614237,6 16,8.23857625 16,11 C16,13.7614237 13.7614237,16 11,16 Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 906 B |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<polygon fill="#62B543" points="14 8 9 13 9 3"/>
|
||||
<polygon fill="#F26522" points="2 8 7 3 7 13"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 241 B |
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.scratch;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -80,6 +66,11 @@ public class ScratchProjectViewPane extends ProjectViewPane {
|
||||
return ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return AllIcons.Scope.Scratches;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProjectAbstractTreeStructureBase createStructure() {
|
||||
return new MyTreeStructure(myProject);
|
||||
@@ -217,7 +208,7 @@ public class ScratchProjectViewPane extends ProjectViewPane {
|
||||
@Override
|
||||
protected void update(PresentationData presentation) {
|
||||
presentation.setPresentableText(getValue());
|
||||
presentation.setIcon(AllIcons.General.ProjectTab);
|
||||
presentation.setIcon(AllIcons.Scope.Scratches);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,21 +5,21 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.psi.search.scope.packageSet.FilteredNamedScope;
|
||||
import com.intellij.ui.OffsetIcon;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
public final class ChangeListScope extends FilteredNamedScope {
|
||||
public static final String NAME = IdeBundle.message("scope.modified.files");
|
||||
private final boolean all; // TODO: use different icons instead
|
||||
private static final Icon ICON = new OffsetIcon(AllIcons.Scope.ChangedFiles);
|
||||
|
||||
public ChangeListScope(@NotNull ChangeListManager manager) {
|
||||
super(NAME, AllIcons.Toolwindows.ToolWindowChanges, 0, manager::isFileAffected);
|
||||
all = true;
|
||||
super(NAME, AllIcons.Scope.ChangedFilesAll, 0, manager::isFileAffected);
|
||||
}
|
||||
|
||||
public ChangeListScope(@NotNull ChangeListManager manager, @NotNull String name) {
|
||||
super(name, AllIcons.Toolwindows.ToolWindowChanges, 0,
|
||||
file -> manager.getChangeLists(file).stream().anyMatch(list -> list.getName().equals(name)));
|
||||
all = false;
|
||||
super(name, ICON, 0, file -> manager.getChangeLists(file).stream().anyMatch(list -> list.getName().equals(name)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,7 +32,7 @@ public final class ChangeListScope extends FilteredNamedScope {
|
||||
if (object == this) return true;
|
||||
if (object instanceof ChangeListScope) {
|
||||
ChangeListScope scope = (ChangeListScope)object;
|
||||
return scope.all == all && scope.getName().equals(getName());
|
||||
return scope.getIcon() == getIcon() && scope.getName().equals(getName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public final class ChangeListScope extends FilteredNamedScope {
|
||||
@Override
|
||||
public String toString() {
|
||||
String string = super.toString();
|
||||
if (all) string += "; ALL";
|
||||
if (AllIcons.Scope.ChangedFilesAll == getIcon()) string += "; ALL";
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.intellij.ide.ui.AntialiasingType;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.ui.EngravedTextGraphics;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.OffsetIcon;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.util.ui.GraphicsUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
@@ -121,11 +122,15 @@ public class BaseLabel extends JLabel {
|
||||
if(componentOrientation != null) {
|
||||
setComponentOrientation(componentOrientation);
|
||||
}
|
||||
Icon icon = content.getIcon();
|
||||
if (icon instanceof OffsetIcon) {
|
||||
icon = ((OffsetIcon)icon).getIcon();
|
||||
}
|
||||
if (isSelected) {
|
||||
setIcon(content.getIcon());
|
||||
setIcon(icon);
|
||||
}
|
||||
else {
|
||||
setIcon(content.getIcon() != null ? new WatermarkIcon(content.getIcon(), .5f) : null);
|
||||
setIcon(icon != null ? new WatermarkIcon(icon, .5f) : null);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1284,7 +1284,17 @@ public class AllIcons {
|
||||
public static final Icon WithCoverageLayer = IconLoader.getIcon("/runConfigurations/withCoverageLayer.png"); // 16x16
|
||||
|
||||
}
|
||||
|
||||
public static class Scope {
|
||||
public static final Icon ChangedFiles = IconLoader.getIcon("/scope/changedFiles.svg"); // 16x16
|
||||
public static final Icon ChangedFilesAll = IconLoader.getIcon("/scope/changedFilesAll.svg"); // 16x16
|
||||
public static final Icon Problems = IconLoader.getIcon("/scope/problems.svg"); // 16x16
|
||||
public static final Icon Production = IconLoader.getIcon("/scope/production.svg"); // 16x16
|
||||
public static final Icon Scratches = IconLoader.getIcon("/scope/scratches.svg"); // 16x16
|
||||
public static final Icon Tests = IconLoader.getIcon("/scope/tests.svg"); // 16x16
|
||||
|
||||
}
|
||||
|
||||
public static class Toolbar {
|
||||
public static final Icon Filterdups = IconLoader.getIcon("/toolbar/filterdups.png"); // 16x16
|
||||
public static final Icon Folders = IconLoader.getIcon("/toolbar/folders.png"); // 16x16
|
||||
|
||||