Hi Beni,
in the meantime i managed to get a custom popup. But there’s one thing i do not understand.
I’ve wrote my own theme class deriving from EclipseTheme which looks like this:
...
@Override
public void install(DockController controller)
{
ActionViewConverter converter = controller.getActionViewConverter();
converter.putTheme(ZoomAction.ZOOM, ViewTarget.TITLE, new ViewGenerator<ZoomAction, BasicTitleViewItem<JComponent>>()
{
public BasicTitleViewItem<JComponent> create(ActionViewConverter converter, ZoomAction action, Dockable dockable)
{
ZoomButtonHandler handler = new ZoomButtonHandler(action, dockable);
/**
* Connect action to handler, since there's no other way, to get
* the ZoomButtonHandler later on
*/
action.setHandler(handler);
RoundRectButton button = new RoundRectButton(handler);
handler.setModel(button.getModel());
return handler;
}
});
...
The thing i do not understand is that the method
public BasicTitleViewItem<JComponent> create(ActionViewConverter converter, ZoomAction action, Dockable dockable)
gets called 10 times when my application starts. But I only added the action to 1 view.
I do not understand why this method is called so many times.
Maybe you can tell me why this behavior is like that.
Edit: I wrote a workaround for my problem, which looks like that:
public BasicTitleViewItem<JComponent> create(ActionViewConverter converter, ZoomAction action, Dockable dockable)
{
if(action.getHandler() == null)
{
ZoomButtonHandler handler = new ZoomButtonHandler(action, dockable);
/**
* Connect action to handler, since there's no other way, to get
* the ZoomButtonHandler later on
*/
action.setHandler(handler);
RoundRectButton button = new RoundRectButton(handler);
handler.setModel(button.getModel());
return handler;
}
else
return action.getHandler();
}
It avoids my problem, but i still dunno why this method gets called so often.
Many thanks in advance for any help!!
Greetings, -chris-