/** * Inserts a page after the page with the specified full title. If we cannot find the page with the specified title, * the page will be added to the end as append(page). * * @param page page to be inserted. * @param title the title of the page after when the new page will be inserted. */ public void insertAfter(AbstractDialogPage page, String title) { int index = getPageIndexByFullTitle(title); if (index == -1 || index == getPageCount() - 1) { append(page); } else { insertElementAt(page, index + 1); } }
public void contentsChanged(ListDataEvent e) { if (e.getIndex0() == -1 && e.getIndex1() == -1 && e.getType() == ListDataEvent.CONTENTS_CHANGED) { int index = _pageList.getPageIndexByFullTitle(_pageList.getCurrentPage().getFullTitle()); list.setSelectedIndex(index); } } });
public void contentsChanged(ListDataEvent e) { if (e.getIndex0() == -1 && e.getIndex1() == -1 && e.getType() == ListDataEvent.CONTENTS_CHANGED) { if (_pageList.getCurrentPage() != null) { int index = _pageList.getPageIndexByFullTitle(_pageList.getCurrentPage().getFullTitle()); list.setSelectedIndex(index); } } } });