import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.FrameWrapper;
+import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
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
return;
}
Presentation presentation = e.getPresentation();
- presentation.setEnabled(false);
- presentation.setVisible(false);
+ presentation.setEnabledAndVisible(false);
final PsiFile file = CommonDataKeys.PSI_FILE.getData(e.getDataContext());
if (file != null && file.getName().contains(".answer")) {
- presentation.setEnabled(true);
- presentation.setVisible(true);
+ presentation.setEnabledAndVisible(true);
}
}
if (taskFile == null) {
return;
}
+ if (taskFile.getAnswerPlaceholders().isEmpty()) {
+ Messages.showInfoMessage("Preview is available for task files with answer placeholders only", "No Preview for This File");
+ }
final TaskFile taskFileCopy = new TaskFile();
TaskFile.copy(taskFile, taskFileCopy);
final String taskFileName = CCProjectService.getRealTaskFileName(file.getVirtualFile().getName());