this.container = container;
}
@Override
public void actionPerformed(ActionEvent e) {
DelegateLine2 activeDelegate = null;
//если текущая панель содержит делегата то activeDelegate != null
PageGeneric activePage = container.getActivePage();
if (activePage != null) {
activeDelegate = activePage.getDelegate();
}
for (int i = 0; i < container.getPageCount(); i++) {
PageGeneric page = container.getPage(i);
//Если панель содержит делегата, то pageDelegate != null
DelegateLine2 pageDelegate = null;
pageDelegate = page.getDelegate();
if (page.getClass().getSimpleName().equals(panel.getClassName())) {
if (activeDelegate == null && pageDelegate == null
|| activeDelegate != null && pageDelegate != null
&& activeDelegate.getClass().equals(pageDelegate.getClass())
&& activeDelegate.getID() == pageDelegate.getID()) {
try {
container.activatePage(page);
} catch (PageException ex) {
MessageBox.showException(ex);
}