mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection tool window: proper insert "of" when tabs.size == 1
This commit is contained in:
@@ -72,6 +72,8 @@ public class InspectionManagerEx extends InspectionManagerBase {
|
||||
toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowInspection);
|
||||
new ContentManagerWatcher(toolWindow, contentManager);
|
||||
contentManager.addContentManagerListener(new ContentManagerAdapter() {
|
||||
private static final String PREFIX = "of ";
|
||||
|
||||
@Override
|
||||
public void contentAdded(ContentManagerEvent event) {
|
||||
handleContentSizeChanged();
|
||||
@@ -84,16 +86,19 @@ public class InspectionManagerEx extends InspectionManagerBase {
|
||||
|
||||
private void handleContentSizeChanged() {
|
||||
final int count = contentManager.getContentCount();
|
||||
String newStripeTitle = null;
|
||||
if (count == 1) {
|
||||
newStripeTitle = InspectionsBundle.message("inspection.tool.window.stripe.title.single.content");
|
||||
final Content content = contentManager.getContent(0);
|
||||
final String displayName = content.getDisplayName();
|
||||
if (!content.getDisplayName().startsWith(PREFIX)) {
|
||||
content.setDisplayName(PREFIX + displayName);
|
||||
}
|
||||
}
|
||||
else if (count > 1) {
|
||||
newStripeTitle = InspectionsBundle.message("inspection.tool.window.stripe.title.multiple.content");
|
||||
}
|
||||
final String stripeTitle = toolWindow.getStripeTitle();
|
||||
if (newStripeTitle != null && !stripeTitle.equals(newStripeTitle)) {
|
||||
toolWindow.setStripeTitle(newStripeTitle);
|
||||
for (Content content : contentManager.getContents()) {
|
||||
if (content.getDisplayName().startsWith(PREFIX)) {
|
||||
content.setDisplayName(content.getDisplayName().substring(PREFIX.length()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -710,5 +710,3 @@ todo.comment.problem.descriptor=TODO comment <code>#ref</code> #loc
|
||||
long.line.display.name=Line is longer than allowed by code style
|
||||
|
||||
inspection.default.annotation.param=Default annotation parameter value
|
||||
inspection.tool.window.stripe.title.single.content=Inspection Results of
|
||||
inspection.tool.window.stripe.title.multiple.content=Inspection Results
|
||||
|
||||
@@ -51,7 +51,7 @@ tool.window.name.run=Run
|
||||
tool.window.name.find=Find
|
||||
tool.window.name.cvs=CVS
|
||||
tool.window.name.hierarchy=Hierarchy
|
||||
tool.window.name.inspection=Inspection
|
||||
tool.window.name.inspection=Inspection Results
|
||||
tool.window.name.todo=TODO
|
||||
tool.window.name.dependency.viewer=Dependency Viewer
|
||||
tool.window.name.version.control=Version Control
|
||||
|
||||
Reference in New Issue
Block a user