code cleanup

This commit is contained in:
Liana Bakradze
2015-09-09 13:11:59 +03:00
parent 47fc4d797c
commit a98aa7866b
@@ -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();
}
}