use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class ToolsMenuDisableAnAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
if (project == null)
return;
DiscordIntegrationApplicationComponent applicationComponent = DiscordIntegrationApplicationComponent.getInstance();
DiscordIntegrationProjectComponent projectComponent = DiscordIntegrationProjectComponent.getInstance(project);
InstanceInfo instanceInfo = applicationComponent.getInstanceInfo();
if (projectComponent != null) {
ProjectInfo projectInfo = projectComponent.getProjectInfo();
ProjectSettingsStorage settings = DiscordIntegrationProjectSettings.getInstance(project).getState();
settings.setEnabled(!settings.isEnabled());
applicationComponent.updateData(data -> data.projectSetSettings(System.currentTimeMillis(), instanceInfo, projectInfo, settings));
update(e);
DiscordIntegrationProjectConfigurable.getInstance(project).reset();
}
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class EditorMouseListener method mousePressed.
@Override
public void mousePressed(EditorMouseEvent event) {
LOG.trace("EditorMouseListener#mousePressed({})", 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()));
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class FileDocumentManagerListener method beforeDocumentSaving.
@Override
public void beforeDocumentSaving(@NotNull Document document) {
LOG.trace("FileDocumentManagerListener#beforeDocumentSaving({})", document);
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 fileOpened.
@Override
public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
LOG.trace("FileEditorManagerListener#fileOpened({}, {})", source, file);
Project project = source.getProject();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(project);
if (component != null)
component.fileUpdateTimeAccessed(file);
}
use of com.almightyalpaca.jetbrains.plugins.discord.components.DiscordIntegrationProjectComponent in project Intellij-Discord-Integration by Almighty-Alpaca.
the class FileEditorManagerListener method selectionChanged.
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
LOG.trace("FileEditorManagerListener#selectionChanged({})", event);
Project project = event.getManager().getProject();
DiscordIntegrationProjectComponent component = DiscordIntegrationProjectComponent.getInstance(project);
if (component != null)
component.fileUpdateTimeAccessed(event.getNewFile());
}
Aggregations