mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
code cleanup
This commit is contained in:
+8
-12
@@ -27,8 +27,6 @@ import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.DumbModePermission;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.FrameWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
@@ -55,7 +53,7 @@ public class CCShowPreview extends DumbAwareAction {
|
||||
private static final Logger LOG = Logger.getInstance(CCShowPreview.class.getName());
|
||||
|
||||
public CCShowPreview() {
|
||||
super("Show Preview","Show Preview", null);
|
||||
super("Show Preview", "Show Preview", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,10 +102,13 @@ public class CCShowPreview extends DumbAwareAction {
|
||||
final TaskFile taskFileCopy = new TaskFile();
|
||||
TaskFile.copy(taskFile, taskFileCopy);
|
||||
final String taskFileName = CCProjectService.getRealTaskFileName(file.getVirtualFile().getName());
|
||||
if (taskFileName == null) {
|
||||
return;
|
||||
}
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
EduUtils.createStudentFileFromAnswer(project, taskDir.getVirtualFile(), taskDir.getVirtualFile(), taskFileName, taskFileCopy);
|
||||
@Override
|
||||
public void run() {
|
||||
EduUtils.createStudentFileFromAnswer(project, taskDir.getVirtualFile(), taskDir.getVirtualFile(), taskFileName, taskFileCopy);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -149,11 +150,6 @@ public class CCShowPreview extends DumbAwareAction {
|
||||
createdEditor.setCaretEnabled(false);
|
||||
showPreviewFrame.setComponent(labeledEditor);
|
||||
showPreviewFrame.setSize(new Dimension(500, 500));
|
||||
DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showPreviewFrame.show();
|
||||
}
|
||||
});
|
||||
showPreviewFrame.show();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user