fix: make folders in action menu work

This commit is contained in:
zaaarf 2024-10-09 23:03:14 +02:00
parent c155773753
commit 1e8306f6e4
No known key found for this signature in database
GPG key ID: C91CFF9E2262BBA1
2 changed files with 35 additions and 37 deletions

View file

@ -11,6 +11,8 @@ import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComponentContainer;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowManager;
import mp.code.BufferController;
import mp.code.Client;
@ -260,12 +262,10 @@ public class InteractionUtil {
}
public static void refreshToolWindow(Project project) {
CodeMPToolPanel w = (CodeMPToolPanel) ToolWindowManager.getInstance(project)
.getToolWindow("CodeMPToolWindow")
.getContentManager()
.getContent(0)
.getComponent();
if(w == null) return;
w.redraw(project);
Optional.ofNullable(ToolWindowManager.getInstance(project).getToolWindow("CodeMP"))
.map(ToolWindow::getContentManager)
.map(cm -> cm.getContent(0))
.map(ComponentContainer::getComponent)
.ifPresent(w -> ((CodeMPToolPanel) w).redraw(project));
}
}

View file

@ -10,37 +10,35 @@
<actions>
<group id="codemp" text="CodeMP" popup="true">
<add-to-group group-id="ToolsMenu" anchor="first"/>
<action id="codemp.connect" class="mp.code.intellij.actions.ConnectAction" text="Connect"/>
<action id="codemp.disconnect" class="mp.code.intellij.actions.DisconnectAction" text="Disconnect"/>
<action id="codemp.connect" class="mp.code.intellij.actions.ConnectAction" text="Connect..."/>
<action id="codemp.disconnect" class="mp.code.intellij.actions.DisconnectAction" text="Disconnect..."/>
<group id="codemp.workspace" text="Workspace" popup="true">
<action id="codemp.workspace.create" class="mp.code.intellij.actions.workspace.WorkspaceCreateAction"
text="Create Workspace"/>
<action id="codemp.workspace.join" class="mp.code.intellij.actions.workspace.WorkspaceJoinAction"
text="Join Workspace"/>
<action id="codemp.workspace.invite" class="mp.code.intellij.actions.workspace.WorkspaceInviteAction"
text="Invite To Workspace"/>
<action id="codemp.workspace.delete" class="mp.code.intellij.actions.workspace.WorkspaceDeleteAction"
text="Delete Workspace"/>
<action id="codemp.workspace.leave" class="mp.code.intellij.actions.workspace.WorkspaceLeaveAction"
text="Leave Workspace"/>
</group>
<group id="codemp.buffer" text="Buffer" popup="true">
<action id="codemp.buffer.share" class="mp.code.intellij.actions.buffer.BufferShareAction"
text="Share Current Buffer"/>
<action id="codemp.buffer.attach" class="mp.code.intellij.actions.buffer.BufferAttachAction"
text="Attach to Remote Buffer"/>
<action id="codemp.buffer.detach" class="mp.code.intellij.actions.buffer.BufferDetachAction"
text="Detach from Remote Buffer"/>
<action id="codemp.buffer.create" class="mp.code.intellij.actions.buffer.BufferCreateAction"
text="Create a New Empty Remote Buffer"/>
<action id="codemp.buffer.delete" class="mp.code.intellij.actions.buffer.BufferDeleteAction"
text="Delete a Remote Buffer"/>
<action id="codemp.buffer.sync" class="mp.code.intellij.actions.buffer.BufferSyncAction"
text="Sync Content of a Managed Buffer"/>
</group>
</group>
<group id="codemp.workspace" text="Workspace">
<add-to-group group-id="codemp" anchor="first"/>
<action id="codemp.workspace.create" class="mp.code.intellij.actions.workspace.WorkspaceCreateAction"
text="Create Workspace"/>
<action id="codemp.workspace.join" class="mp.code.intellij.actions.workspace.WorkspaceJoinAction"
text="Join Workspace"/>
<action id="codemp.workspace.invite" class="mp.code.intellij.actions.workspace.WorkspaceInviteAction"
text="Invite To Workspace"/>
<action id="codemp.workspace.delete" class="mp.code.intellij.actions.workspace.WorkspaceDeleteAction"
text="Delete Workspace"/>
<action id="codemp.workspace.leave" class="mp.code.intellij.actions.workspace.WorkspaceLeaveAction"
text="Leave Workspace"/>
</group>
<group id="codemp.buffer" text="Buffer">
<add-to-group group-id="codemp" anchor="first"/>
<action id="codemp.buffer.share" class="mp.code.intellij.actions.buffer.BufferShareAction"
text="Share Current Buffer"/>
<action id="codemp.buffer.attach" class="mp.code.intellij.actions.buffer.BufferAttachAction"
text="Attach to Remote Buffer"/>
<action id="codemp.buffer.detach" class="mp.code.intellij.actions.buffer.BufferDetachAction"
text="Detach from Remote Buffer"/>
<action id="codemp.buffer.create" class="mp.code.intellij.actions.buffer.BufferCreateAction"
text="Create a New Empty Remote Buffer"/>
<action id="codemp.buffer.delete" class="mp.code.intellij.actions.buffer.BufferDeleteAction"
text="Delete a Remote Buffer"/>
<action id="codemp.buffer.sync" class="mp.code.intellij.actions.buffer.BufferSyncAction"
text="Sync Content of a Managed Buffer"/>
</group>
</actions>
<extensions defaultExtensionNs="com.intellij">