i would like to write a QuickBuild plugin which will add a tab to concrete node view (near UserAttributes, Resources, Server Log tabs). I tried to add MainTab for training, but i have some problems with filling it with content. I created MainTab, that works. I created MainPage to add it to constructor of MainTab, but if i add html file it loops up to StackOverflowError.
How can i add content to MainTab?
How can i add a tab to concrete node view and fill it with content? (the main thing i want to do)
MyPlugin.java
new MainTabContribution() {
@SuppressWarnings("unchecked")
@Override
public List<MainTab> getTabs() {
List<MainTab> mainTabs = new ArrayList<MainTab>();
mainTabs.add(new MainTab("MyCustomMainTab", MyMainPage.class));
return mainTabs;
}
@Override
public int getOrder() {
return 500;
}
}
MyMainTab.java - class of my tab
import com.pmease.quickbuild.extensionpoint.support.MainTab;
import com.pmease.quickbuild.web.page.MainPage;
public class MyMainTab extends MainTab{
private static final long serialVersionUID = 1L;
public MyMainTab(String title, Class<? extends MainPage>[] pageClasses) {
super(title, pageClasses);
}
}
MyMainPage.java - page that i would like to load when i click MyMainTab
package com.example.myplugin;
import org.apache.wicket.markup.html.basic.Label;
import com.pmease.quickbuild.web.page.MainPage;
public class MyMainPage extends MainPage{
private static final long serialVersionUID = 1L;
public MyMainPage() {
super();
add(new Label("message", "Here will be nice content of the page"));
}
}
HTML code of MyMainPage (MyMainPage.html)
<html>
<body>
<span wicket:id="message">Message goes here</span>
</body>
</html>
Cheers