mirror of
https://github.com/hexedtech/codemp-intellij.git
synced 2024-12-22 20:44:53 +01:00
fix: illegal cast
This commit is contained in:
parent
da101168e1
commit
f815e60605
4 changed files with 13 additions and 9 deletions
|
@ -17,8 +17,8 @@ import java.awt.event.ActionEvent;
|
|||
import java.awt.event.MouseEvent;
|
||||
import java.util.Optional;
|
||||
|
||||
public class CodeMPToolWindow extends JPanel {
|
||||
public CodeMPToolWindow(Project project) {
|
||||
public class CodeMPToolPanel extends JPanel {
|
||||
public CodeMPToolPanel(Project project) {
|
||||
this.draw(project);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ public class CodeMPToolWindow extends JPanel {
|
|||
JButton connectButton = new JButton(new AbstractAction("Connect...") {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
InteractionUtil.connect(project, () -> CodeMPToolWindow.this.redraw(project));
|
||||
InteractionUtil.connect(project, () -> CodeMPToolPanel.this.redraw(project));
|
||||
}
|
||||
});
|
||||
this.add(connectButton);
|
||||
|
@ -52,7 +52,7 @@ public class CodeMPToolWindow extends JPanel {
|
|||
InteractionUtil.joinWorkspace(
|
||||
project,
|
||||
workspaceName,
|
||||
() -> CodeMPToolWindow.this.redraw(project)
|
||||
() -> CodeMPToolPanel.this.redraw(project)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -69,7 +69,7 @@ public class CodeMPToolWindow extends JPanel {
|
|||
);
|
||||
|
||||
InteractionUtil.createBuffer(project, bufferPath);
|
||||
CodeMPToolWindow.this.redraw(project);
|
||||
CodeMPToolPanel.this.redraw(project);
|
||||
}
|
||||
});
|
||||
createButton.setSize(createButton.getPreferredSize());
|
|
@ -17,7 +17,7 @@ public class CodeMPWindowFactory implements ToolWindowFactory, DumbAware {
|
|||
) {
|
||||
ContentFactory contentFactory = ContentFactory.getInstance();
|
||||
Content content = contentFactory.createContent(
|
||||
new CodeMPToolWindow(project),
|
||||
new CodeMPToolPanel(project),
|
||||
"",
|
||||
false
|
||||
);
|
||||
|
|
|
@ -21,7 +21,7 @@ import mp.code.intellij.CodeMP;
|
|||
import mp.code.intellij.listeners.BufferEventListener;
|
||||
import mp.code.intellij.listeners.CursorEventListener;
|
||||
import mp.code.intellij.settings.CodeMPSettings;
|
||||
import mp.code.intellij.ui.CodeMPToolWindow;
|
||||
import mp.code.intellij.ui.CodeMPToolPanel;
|
||||
import mp.code.intellij.util.cb.CursorCallback;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -260,7 +260,11 @@ public class InteractionUtil {
|
|||
}
|
||||
|
||||
public static void refreshToolWindow(Project project) {
|
||||
CodeMPToolWindow w = (CodeMPToolWindow) ToolWindowManager.getInstance(project).getToolWindow("CodeMP");
|
||||
CodeMPToolPanel w = (CodeMPToolPanel) ToolWindowManager.getInstance(project)
|
||||
.getToolWindow("CodeMPToolWindow")
|
||||
.getContentManager()
|
||||
.getContent(0)
|
||||
.getComponent();
|
||||
if(w == null) return;
|
||||
w.redraw(project);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
displayName="CodeMP"/>
|
||||
<workspaceModel.fileIndexContributor implementation="mp.code.intellij.vfs.CodeMPFileIndexContributor" />
|
||||
<toolWindow
|
||||
id="CodeMP"
|
||||
id="CodeMPToolWindow"
|
||||
factoryClass="mp.code.intellij.ui.CodeMPWindowFactory"
|
||||
anchor="right"
|
||||
doNotActivateOnStart="false" />
|
||||
|
|
Loading…
Reference in a new issue