-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggested fix for issue #59 - Serial tool window exception #61
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -47,20 +47,22 @@ public class SerialMonitorToolWindow { | |||||||||||
|
||||||||||||
public SerialMonitorToolWindow(Project project) { | ||||||||||||
this.project = project; | ||||||||||||
toolWindow = ToolWindowManager.getInstance(project).registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.BOTTOM, project, true); | ||||||||||||
toolWindow.setIcon(PluginIcons.serial_port_tool); | ||||||||||||
|
||||||||||||
//JPanel mainPanel = new JPanel(new BorderLayout()); | ||||||||||||
//mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); | ||||||||||||
SimpleToolWindowPanel mainPanel = new SimpleToolWindowPanel(false, true); | ||||||||||||
|
||||||||||||
mySerialMonitorPanel = new SerialMonitorPanel(project); | ||||||||||||
mainPanel.add(mySerialMonitorPanel.getComponent()); | ||||||||||||
|
||||||||||||
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); | ||||||||||||
Content content = contentFactory.createContent(mainPanel, Bundle.message("toolwindow.serial-monitor.title"), false); | ||||||||||||
myToolWindowContentMap.put(SERIAL_MONITOR_ID, content); | ||||||||||||
toolWindow.getContentManager().addContent(content); | ||||||||||||
toolWindowManager.invokeLater(() -> { | ||||||||||||
toolWindow = ToolWindowManager.getInstance(project).registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.BOTTOM, project, true); | ||||||||||||
Comment on lines
+50
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. introduce local variable
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you to come up with this fix! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you create a zip or jar, you may be able to install it. (I have not tried it.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this not added 😠 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Gives me: Fail to load plugin descriptor from file CLionArduinoPlugin-patch-1.zip |
||||||||||||
toolWindow.setIcon(PluginIcons.serial_port_tool); | ||||||||||||
|
||||||||||||
//JPanel mainPanel = new JPanel(new BorderLayout()); | ||||||||||||
//mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); | ||||||||||||
SimpleToolWindowPanel mainPanel = new SimpleToolWindowPanel(false, true); | ||||||||||||
|
||||||||||||
mySerialMonitorPanel = new SerialMonitorPanel(project); | ||||||||||||
mainPanel.add(mySerialMonitorPanel.getComponent()); | ||||||||||||
|
||||||||||||
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); | ||||||||||||
Content content = contentFactory.createContent(mainPanel, Bundle.message("toolwindow.serial-monitor.title"), false); | ||||||||||||
myToolWindowContentMap.put(SERIAL_MONITOR_ID, content); | ||||||||||||
toolWindow.getContentManager().addContent(content); | ||||||||||||
}); | ||||||||||||
} | ||||||||||||
|
||||||||||||
public void unregisterToolWindow() { | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it this way and it worked.
eiryu@a7c5854
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.