mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[mod-commands] Improve create directory preview (IJPL-181933)
GitOrigin-RevId: e3c3a581dc2c417ba8d5a8aa63ec97b46bbf8bb4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7d57941ece
commit
68c62875bd
@@ -81,6 +81,6 @@ public final class ModCommandTest extends LightPlatformCodeInsightTestCase {
|
||||
IntentionPreviewInfo preview = ModCommandExecutor.getInstance().getPreview(command, ActionContext.from(null, getFile()));
|
||||
IntentionPreviewInfo.Html html = assertInstanceOf(preview, IntentionPreviewInfo.Html.class);
|
||||
String actual = html.content().toString();
|
||||
assertEquals("<p>Create directories:<ul><li>a</li><li>a/b</li><li>a/c</li></ul></p>", actual);
|
||||
assertEquals("<p>Create directories:<br/>• a<br/>• a/b<br/>• a/c</p>", actual);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -377,8 +377,11 @@ public class ModCommandBatchExecutorImpl implements ModCommandExecutor {
|
||||
return new IntentionPreviewInfo.Html(text(AnalysisBundle.message("preview.create.directory", createdDirs.get(0))));
|
||||
}
|
||||
return new IntentionPreviewInfo.Html(
|
||||
tag("p").addText(AnalysisBundle.message("preview.create.directories"))
|
||||
.child(tag("ul").children(ContainerUtil.map(createdDirs, text -> tag("li").addText(text))))
|
||||
tag("p").addText(AnalysisBundle.message("preview.create.directories")).children(
|
||||
ContainerUtil.map(createdDirs, text -> new HtmlBuilder().br()
|
||||
.appendRaw("• ") //NON-NLS
|
||||
.append(text)
|
||||
.toFragment()))
|
||||
);
|
||||
}
|
||||
return navigateInfo;
|
||||
@@ -463,6 +466,9 @@ public class ModCommandBatchExecutorImpl implements ModCommandExecutor {
|
||||
//noinspection unchecked
|
||||
return IntentionPreviewInfo.addListOption((List<String>)list, optList.label().label(), value -> !oldList.contains(value)).content();
|
||||
}
|
||||
if (newValue == null) {
|
||||
throw new IllegalStateException("Null value is not supported");
|
||||
}
|
||||
throw new IllegalStateException("Value of type " + newValue.getClass() + " is not supported");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user