mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
simplified create answer placeholder dialog
This commit is contained in:
+2
-3
@@ -83,9 +83,8 @@ public class CCAddAnswerPlaceholder extends DumbAwareAction {
|
||||
answerPlaceholder.setStart(realStart);
|
||||
answerPlaceholder.setPossibleAnswer(model.getSelectedText());
|
||||
|
||||
CCCreateAnswerPlaceholderDialog dlg = new CCCreateAnswerPlaceholderDialog(project, answerPlaceholder, lesson.getIndex(),
|
||||
task.getIndex(), file.getVirtualFile().getNameWithoutExtension(),
|
||||
taskFile.getAnswerPlaceholders().size() + 1);
|
||||
CCCreateAnswerPlaceholderDialog dlg = new CCCreateAnswerPlaceholderDialog(project, answerPlaceholder
|
||||
);
|
||||
dlg.show();
|
||||
if (dlg.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
|
||||
return;
|
||||
|
||||
+1
-2
@@ -174,8 +174,7 @@ public class CCCreateCourseArchive extends DumbAwareAction {
|
||||
@NotNull final Document document,
|
||||
@NotNull final AnswerPlaceholder answerPlaceholder) {
|
||||
final String taskText = answerPlaceholder.getTaskText();
|
||||
final int lineStartOffset = document.getLineStartOffset(answerPlaceholder.getLine());
|
||||
final int offset = lineStartOffset + answerPlaceholder.getStart();
|
||||
final int offset = answerPlaceholder.getRealStartOffset(document);
|
||||
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
+2
-3
@@ -29,9 +29,8 @@ public class CCShowAnswerPlaceholderDetails extends CCAnswerPlaceholderAction {
|
||||
final Task task = service.getTask(taskDir.getVirtualFile().getPath());
|
||||
final TaskFile taskFile = state.getTaskFile();
|
||||
AnswerPlaceholder answerPlaceholder = state.getAnswerPlaceholder();
|
||||
CCCreateAnswerPlaceholderDialog dlg = new CCCreateAnswerPlaceholderDialog(project, answerPlaceholder, lesson.getIndex(), task.getIndex(),
|
||||
file.getVirtualFile().getNameWithoutExtension(),
|
||||
taskFile.getAnswerPlaceholders().size() + 1);
|
||||
CCCreateAnswerPlaceholderDialog dlg = new CCCreateAnswerPlaceholderDialog(project, answerPlaceholder
|
||||
);
|
||||
dlg.setTitle("Edit Answer Placeholder");
|
||||
dlg.show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user