boolean () { // Heuristics for automake postpone decision: // 1. There are unsaved documents OR // 2. The IDE is not idle: the last activity happened less than 3 seconds ago (registry-configurable) if (FileDocumentManager.getInstance().getUnsavedDocuments().length > 0) { return true; } final long threshold = Registry.intValue("compiler.automake.postpone.when.idle.less.than", 3000); // todo: UI option instead of registry? final long idleSinceLastActivity = ApplicationManager.getApplication().getIdleTime(); return idleSinceLastActivity < threshold; }