/** * Creates the panel that appears when there are no pages * * @return JPanel */ protected JPanel createFirstPanel() { firstButtonPanel = new JPanel(new GridBagLayout()); firstButtonPanel.setBorder(BorderFactory.createLineBorder(Color.black)); firstButtonPanel.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent _evt) { if (OSPRuntime.isPopupTrigger(_evt)) return; // SwingUtilities.isRightMouseButton(_evt)) return; if (!firstButtonPanel.isEnabled()) return; Object obj = JOptionPane.showInputDialog( getComponent(), res.getString("TabbedEditor.NewName"), res.getString("TabbedEditor.Rename"), JOptionPane.QUESTION_MESSAGE, null, null, getUniqueName(defaultString)); if (obj == null) return; String txt = obj.toString().trim(); if (txt.length() > 0) addPage(defaultType, txt, null, true); else addPage(defaultType, defaultString, null, true); } }); String label = res.getOptionalString("TabbedEditor.ClickHere." + defaultHeader); if (label == null) label = res.getString("TabbedEditor.ClickHere"); firstButton = new JLabel(label); firstButton.setFont(firstButton.getFont().deriveFont(TabbedEditor.BUTTON_FONT_SIZE)); firstButtonPanel.add(firstButton); JPanel firstPanel = new JPanel(new GridLayout(0, 1)); firstPanel.add(firstButtonPanel); return firstPanel; }
public void setColor(Color _color) { myColor = _color; tabbedPanel.setForeground(_color); firstButton.setForeground(_color); for (java.util.Enumeration<Editor> e = pageList.elements(); e.hasMoreElements(); ) e.nextElement().setColor(_color); }
public void setActive(boolean _active) { activeEditor = _active; changed = true; firstButtonPanel.setEnabled(_active); firstButton.setEnabled(_active); }