use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class VirtualFileListener method propertyChanged.
@Override
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
VirtualFile file = event.getFile();
FileDocumentManager documentManager = FileDocumentManager.getInstance();
Document document = documentManager.getDocument(file);
if (document != null) {
Editor[] editors = EditorFactory.getInstance().getEditors(document);
for (Editor editor : editors) {
Project project = editor.getProject();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(project);
if (component != null && component.getFiles().containsKey(file)) {
if ((event.getPropertyName().equals(VirtualFile.PROP_NAME))) {
component.fileUpdateName(file);
} else if ((event.getPropertyName().equals(VirtualFile.PROP_WRITABLE))) {
component.fileUpdateReadOnly(event.getFile());
}
}
}
}
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class DiscordIntegrationProjectConfigurable method apply.
@Override
public void apply() {
if (this.panel != null) {
this.panel.apply();
InstanceInfo instance = this.applicationComponent.getInstanceInfo();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(this.settingsProviderProject.getProject());
if (component != null) {
ProjectInfo project = component.getProjectInfo();
this.applicationComponent.updateData(data -> data.instanceSetSettings(System.currentTimeMillis(), instance, this.settingsProviderApplication.getSettings()));
this.applicationComponent.updateData(data -> data.projectSetSettings(System.currentTimeMillis(), instance, project, this.settingsProviderProject.getSettings()));
this.applicationComponent.checkExperiementalWindowListener();
}
}
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class DocumentListener method documentChanged.
@Override
public void documentChanged(DocumentEvent event) {
LOG.trace("DocumentListener#documentChanged({})", event.getDocument());
Document document = event.getDocument();
Editor[] editors = EditorFactory.getInstance().getEditors(document);
FileDocumentManager documentManager = FileDocumentManager.getInstance();
for (Editor editor : editors) {
Project project = editor.getProject();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(project);
if (component != null)
component.updateTimeAccessed(documentManager.getFile(document));
}
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class FileEditorManagerListener method fileClosed.
@Override
public void fileClosed(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
LOG.trace("FileEditorManagerListener#fileClosed({}, {})", source, file);
Project project = source.getProject();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(project);
if (component != null)
component.fileRemove(file);
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class VisibleAreaListener method visibleAreaChanged.
@Override
public void visibleAreaChanged(VisibleAreaEvent event) {
LOG.trace("VisibleAreaListener#visibleAreaChanged({})", event);
FileDocumentManager documentManager = FileDocumentManager.getInstance();
Project project = event.getEditor().getProject();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(project);
if (component != null)
component.updateTimeAccessed(documentManager.getFile(event.getEditor().getDocument()));
}
Aggregations