plugin that created a view pane does not work in 2016.3 version

Hello,

I have a plugin that I enhanced from another intellij plugin.

I have a version of intellij 2014 / 2015 / 2016

for some reason the plugin used to work on version 2016.1 but after upgrading to 2016.3 it does not work ( woks partially )

among other things the plugin generates another view.

for some reason instead of my view I see this:

This view is not available until indices are built.

even when this message is gone I still can't see my view.

 

any pointers?

i

0
11 comments

What do you see when the message about indices is gone?

0
Avatar
Permanently deleted user

nothing.

once the message is gone I get a grey screen in the view section and I can't see my plugin's view.

0

If you put a breakpoint in your toolwindow code, is it invoked? Is the component created? What's its size (a breakpoint in "reshape" can help)? Is its "paint" method called?

0
Avatar
Permanently deleted user

I am still a bit green in writing plugins for intellij so I don't know what paint method is.

 

I have a function that extends JPANEL and all it seems working fine ( I deb ugged the code ) but at the end of the day the view is not being shown

public class ReviewBoardToolsWindow implements ToolWindowFactory {
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
ReviewsPanel panel = new ReviewsPanel(project);
Component component = toolWindow.getComponent();
component.getParent().add(panel);
}
}
0

"paint" is a standard Swing method: https://docs.oracle.com/javase/7/docs/api/javax/swing/JComponent.html#paint(java.awt.Graphics)

Please override "paint" and "reshape" in your component and check if they're called.

0
Avatar
Permanently deleted user

I prefer not to change my entire code since it used to work in 2016.1 version

to be exact the view pane exists but for some reason it is grey and nothing is shown inside

 

0

I don't suggest to change your entire code forever. I'm suggesting a way to debug and understand what's wrong.

0
Avatar
Permanently deleted user

Hello, my problem still persists in 2017 versions. I managed to debug it and the view windows is invokded.  all the components are being rendered and prepared by at the end the view is still grey.

 

can you give me a pointer 

0

One suspicious thing in your code is that you manage Swing hierarchy directly, and using component.getParent().add. Have you tried to add components using ContentManager, like this?:

 

toolWindow.getContentManager().addContent(new ContentImpl(panel, ...))
0
Avatar
Permanently deleted user

I just tried it and it gives me an error:

 

Error:(38, 51) java: constructor ContentImpl in class com.intellij.ui.content.impl.ContentImpl cannot be applied to given types;
required: javax.swing.JComponent,java.lang.String,boolean
found: com.ritesh.idea.plugin.ui.toolswindow.reviewpanel.ReviewsPanel
reason: actual and formal argument lists differ in length

 

is it possible to just do casting to  my class  com.ritesh.idea.plugin.ui.toolswindow.reviewpanel.ReviewsPanel to javax.swing.JComponent?

0
Avatar
Permanently deleted user

I have changed it to:

toolWindow.getContentManager().addContent(new ContentImpl((javax.swing.JComponent)panel , "Reviews" , true));


now it works !!!

thanks a lot for your help

0

Please sign in to leave a comment.