/** * Gets the all page titles as vector. * * @return the vector which has all the page titles. */ public List<String> getPageTitlesAsList() { List<String> list = new ArrayList<String>(); for (int i = 0; i < getPageCount(); i++) { AbstractDialogPage page = getPage(i); list.add(page.getTitle()); } return list; }
@Override public JComponent createIndexPanel() { if (getPageList().getPageCount() > 1) { return super.createIndexPanel(); } return null; }
private JComponent createTreePanel() { final DefaultMutableTreeNode root = new DefaultMutableTreeNode("", true); _titleNodeMap = new HashMap<String, MutableTreeNode>((int) (_pageList.getPageCount() * 0.75)); for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage dialogPage = _pageList.getPage(i); addPage(dialogPage, root, false);
private JComponent createTreePanel() { final DefaultMutableTreeNode root = new DefaultMutableTreeNode("", true); _titleNodeMap = new HashMap<String, MutableTreeNode>((int) (_pageList.getPageCount() * 0.75)); for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage dialogPage = _pageList.getPage(i); addPage(dialogPage, root, false);
/** * 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); } }
private JComponent createListPanel() { final DefaultListModel listModel = new DefaultListModel(); for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage optionsPanel = _pageList.getPage(i); listModel.addElement(optionsPanel);
private JComponent createListPanel() { final DefaultListModel listModel = new DefaultListModel(); for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage optionsPanel = _pageList.getPage(i); listModel.addElement(optionsPanel);
private void applySectionChanges() { for (int i = 0; i < getPageList().getPageCount(); i++){ ((Section)getPageList().getPage(i)).applyChanges(); } } }
public SettingsDialog(Window parent, String title, Section... sections) throws HeadlessException { super((Frame)parent, title); setStyle(MultiplePageDialog.LIST_STYLE); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); PageList model = new PageList(); for (Section s: sections) { model.append(s); } setPageList(model); pack(); for(int i = 0; i < model.getPageCount(); i++){ ((Section)model.getPage(i)).populate(); } getOkButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (getApplyButton().isEnabled()){ applySectionChanges(); } } }); getApplyButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { applySectionChanges(); } }); setLocationRelativeTo(parent); }
/** * Implements the method in StandardDialog. You can override this method to create a ContentPanel. By default, a * JPanel with BorderLayout is created. IndexPanel is added to WEST and PagesPanel is added to CENTER. * * @return the ContentPanel */ @Override public JComponent createContentPanel() { _indexPanel = createIndexPanel(); _pagesPanel = createPagesPanel(); if (_pageList.getPageCount() > 0) { if (getInitialPageTitle() != null) { setCurrentPage(getInitialPageTitle()); } else { setCurrentPage(_pageList.getPage(0)); } } return setupContentPanel(_indexPanel, _pagesPanel); }
/** * Implements the method in StandardDialog. You can override this method to create a ContentPanel. By default, a * JPanel with BorderLayout is created. IndexPanel is added to WEST and PagesPanel is added to CENTER. * * @return the ContentPanel */ @Override public JComponent createContentPanel() { _indexPanel = createIndexPanel(); _pagesPanel = createPagesPanel(); if (_pageList.getPageCount() > 0) { if (getInitialPageTitle() != null) { setCurrentPage(getInitialPageTitle()); } else { setCurrentPage(_pageList.getPage(0)); } } return setupContentPanel(_indexPanel, _pagesPanel); }
for (int i = 0; i < _pageList.getPageCount(); i++) { final AbstractDialogPage optionsPanel = _pageList.getPage(i); final JideButton button = createIconButton(optionsPanel.getTitle(), optionsPanel.getIcon()); buttonsPanel.addButton(button); group.add(button); if (_pageList.getPageCount() > 0) { if (getInitialPageTitle() != null && getInitialPageTitle().equals(optionsPanel.getFullTitle())) { group.setSelected(button.getModel(), true);
for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage page = _pageList.getPage(i); page.addButtonListener(getButtonPanel()); pagesPanel.setLayout(_cardLayout); for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage page = _pageList.getPage(i); page.addButtonListener(getButtonPanel());
for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage page = _pageList.getPage(i); page.addButtonListener(getButtonPanel()); pagesPanel.setLayout(_cardLayout); for (int i = 0; i < _pageList.getPageCount(); i++) { AbstractDialogPage page = _pageList.getPage(i); page.addButtonListener(getButtonPanel());
for (int i = 0; i < _pageList.getPageCount(); i++) { final AbstractDialogPage optionsPanel = _pageList.getPage(i); final JideButton button = createIconButton(optionsPanel.getTitle(), optionsPanel.getIcon());