protected void showFirstPage() { if (tabbedPanel.getTabCount() <= 0) cardLayout.show(finalPanel, "FirstPanel"); else { cardLayout.show(finalPanel, "TabbedPanel"); tabbedPanel.setSelectedIndex(0); } }
protected void addPage(String _typeOfPage, String _name, String _code, boolean _enabled) { cardLayout.show(finalPanel, "TabbedPanel"); _name = getUniqueName(_name); Editor page = createPage(_typeOfPage, _name, _code); page.setFont(myFont); page.setColor(myColor); int index = tabbedPanel.getSelectedIndex(); if (index == -1) { pageList.addElement(page); if (tabbedPanel.getTabCount() == 0) { tabbedPanel.addTab( page.getName(), null, page.getComponent(), tooltip); // This causes an exception sometimes } else { tabbedPanel.insertTab( page.getName(), null, page.getComponent(), tooltip, tabbedPanel.getTabCount()); } index = 0; } else { index++; pageList.insertElementAt(page, index); tabbedPanel.insertTab(page.getName(), null, page.getComponent(), tooltip, index); } tabbedPanel.setSelectedComponent(page.getComponent()); page.setActive(_enabled); if (!_enabled) tabbedPanel.setTitleAt(index, page.getName() + " (D)"); updatePageCounterField(pageList.size()); // tabbedPanel.validate(); This hangs the computer when reading a file at start-up !!!??? tabbedPanel.repaint(); changed = true; }
protected void removeCurrentPage() { int index = tabbedPanel.getSelectedIndex(); if (index < 0) return; tabbedPanel.removeTabAt(index); pageList.removeElementAt(index); updatePageCounterField(pageList.size()); changed = true; if (tabbedPanel.getTabCount() <= 0) cardLayout.show(finalPanel, "FirstPanel"); ejs.getModelEditor().getVariablesEditor().updateControlValues(false); }
public void showPage(Editor anEditor) { for (int i = 0, n = tabbedPanel.getComponentCount(); i < n; i++) { if (tabbedPanel.getComponent(i) == anEditor.getComponent()) { // System.out.println ("Found editor "+anEditor.getName()+ " at i="+i); ejs.showPanel(defaultHeader); cardLayout.show(finalPanel, anEditor.getName()); tabbedPanel.setSelectedComponent(anEditor.getComponent()); return; } } }