#IntelliJ SDK Plugin buttons not showing
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
code where I see the buttons in the toolbar:
public class TestMyCodeToolbar implements ToolWindowFactory, DumbAware {
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
// get list of selected organization then create multiple
ContentFactory factory = ContentFactory.getInstance();
ContentManager manager = toolWindow.getContentManager();
RunAction runAction = new RunAction();
TestAction testAction = new TestAction();
UploadAction uploadAction = new UploadAction();
ActionGroup actions = new ActionGroup() {
@Override
public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) {
return new AnAction[]{runAction, testAction, uploadAction};
}
};
ActionToolbarImpl actionToolbar = new ActionToolbarImpl(ActionPlaces.TOOLBAR, actions, true);
manager.addContent(factory.createContent(actionToolbar, "Test", false));
}
}
code what I really want to do but buttons are invisible:
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
// get list of selected organization then create multiple
ContentFactory factory = ContentFactory.getInstance();
ContentManager manager = toolWindow.getContentManager();
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(true);
RunAction runAction = new RunAction();
TestAction testAction = new TestAction();
UploadAction uploadAction = new UploadAction();
ActionGroup actions = new ActionGroup() {
@Override
public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) {
return new AnAction[]{runAction, testAction, uploadAction};
}
};
ActionToolbarImpl actionToolbar = new ActionToolbarImpl(ActionPlaces.TOOLBAR, actions, true);
actionToolbar.setTargetComponent(panel);
JBScrollPane courses = new JBScrollPane();
JBViewport view = new JBViewport();
SimpleTree tree = new SimpleTree();
view.add(tree);
courses.add(view);
panel.add(actionToolbar);
panel.add(courses);
manager.addContent(factory.createContent(panel, "Test", false));
}
location on screens are pretty weird
but the SimpleToolWindowPanel is on the correct position:
the JBScrollPane aswell
just got no content
in the second one your adding to "panel', that might be the issue
damn you are right :DDDD took me just some hours to notice that there is a setToolbar method where I should add the buttons instead 💀