public ContentTest() {
final MyDoggyToolWindowManager myDoggyToolWindowManager =
new MyDoggyToolWindowManager();
ContentManager contentManager =
myDoggyToolWindowManager.getContentManager();
// contentManager.setContentManagerUI(new
MyDoggyDesktopContentManagerUI());
// contentManager.setContentManagerUI(new
MyDoggyMultiSplitContentManagerUI());
JDialog dialog = new JDialog();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
JPanel x = new JPanel(new BorderLayout());
x.add(myDoggyToolWindowManager, BorderLayout.CENTER);
JButton b = new JButton("update UI");
b.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
SwingUtilities.updateComponentTreeUI(myDoggyToolWindowManager);
}
});
x.add(b, BorderLayout.SOUTH);
JButton a = new JButton("Add content");
a.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String generatedTitle =
String.valueOf(System.identityHashCode(new Object()));
JLabel component = new JLabel(generatedTitle);
component.setSize(200, 200);
component.setPreferredSize(new Dimension(200, 200));
Content addContent =
myDoggyToolWindowManager.getContentManager().addContent(generatedTitle
, "Title : " + generatedTitle, null, component);
addContent.setSelected(true);
}
});
x.add(a, BorderLayout.NORTH);
dialog.add(x);
dialog.setPreferredSize(new Dimension(200, 200));
dialog.pack();
dialog.setVisible(true);
}
This goes well, but if i decomment the
ontentManager.setContentManagerUI(new
MyDoggyMultiSplitContentManagerUI()); line, it crashes on an
updateUI. Just this conetentManager is not working well.
Sincerly, Huba
Hi Albu,
thanks for the feedback. It's a ugly bug. I'll try to resolve it as soon as possible.
Best,
./angelo