-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from SeeSharpSoft/master
Release 1.4.1
- Loading branch information
Showing
11 changed files
with
227 additions
and
74 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
src/main/java/net/seesharpsoft/intellij/plugins/filepreview/PreviewDocumentListener.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.seesharpsoft.intellij.plugins.filepreview; | ||
|
||
import com.intellij.openapi.editor.event.DocumentEvent; | ||
import com.intellij.openapi.editor.event.DocumentListener; | ||
import com.intellij.openapi.fileEditor.FileDocumentManager; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class PreviewDocumentListener implements DocumentListener { | ||
protected final Project myProject; | ||
|
||
public PreviewDocumentListener(Project project) { | ||
myProject = project; | ||
} | ||
|
||
@Override | ||
public void documentChanged(@NotNull DocumentEvent event) { | ||
final VirtualFile file = FileDocumentManager.getInstance().getFile(event.getDocument()); | ||
PreviewUtil.disposePreview(myProject, file); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ain/java/net/seesharpsoft/intellij/plugins/filepreview/PreviewEditorTabColorProvider.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.seesharpsoft.intellij.plugins.filepreview; | ||
|
||
import com.intellij.openapi.fileEditor.impl.EditorTabColorProvider; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.awt.*; | ||
|
||
public class PreviewEditorTabColorProvider implements EditorTabColorProvider { | ||
@Nullable | ||
@Override | ||
public Color getEditorTabColor(@NotNull Project project, @NotNull VirtualFile file) { | ||
if (PreviewUtil.isPreviewed(file)) { | ||
return PreviewSettings.getInstance().getPreviewTabColor(); | ||
} | ||
return null; | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.