Created
November 15, 2012 18:33
-
-
Save dkandalov/4080326 to your computer and use it in GitHub Desktop.
"open files from current change list" action for intellij-eval
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.notification.* | |
import com.intellij.openapi.application.ApplicationManager | |
import com.intellij.openapi.fileEditor.FileEditorManager | |
import com.intellij.openapi.vcs.changes.Change | |
import com.intellij.openapi.vcs.changes.ChangeListManager | |
import javax.swing.SwingUtilities | |
static show(String htmlBody, String title = "", NotificationType notificationType = NotificationType.INFORMATION) { | |
SwingUtilities.invokeLater({ | |
def notification = new Notification("", title, htmlBody, notificationType) | |
ApplicationManager.application.messageBus.syncPublisher(Notifications.TOPIC).notify(notification) | |
} as Runnable) | |
} | |
def fileEditorManager = FileEditorManager.getInstance(event.project) | |
//fileEditorManager.openFiles.each { fileEditorManager.closeFile(it) } | |
Collection<Change> changes = ChangeListManager.getInstance(project).getDefaultChangeList().getChanges() | |
changes.collect { it.virtualFile }.findAll { it != null }.each { | |
fileEditorManager.openFile(it, false) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment