/** * Refreshs the title of a specified editor. * * @param id The index of the editor */ public void refreshEditorTitle(String id) { AbstractEditorPanel editor = getEditor(id); if (editor != null) { TabComponent tabComponent = (TabComponent) getTabComponentAt(indexOfComponent(editor)); tabComponent.setTitle(editor.getTitle()); } }
@Override public void setTitleAt(int index, String title) { super.setTitleAt(index, title); final Component comp = getTabComponentAt(index); if (comp instanceof TabComponent) ((TabComponent) comp).setTitle(title); }
@Override public void setForegroundAt(int index, Color foreground) { super.setForegroundAt(index, foreground); final Component comp = getTabComponentAt(index); if (comp instanceof TabComponent) ((TabComponent) comp).setForegroundAll(foreground); }
@Override public void setDisabledIconAt(int index, Icon disabledIcon) { super.setDisabledIconAt(index, disabledIcon); final Component comp = getTabComponentAt(index); if (comp instanceof TabComponent) ((TabComponent) comp).setDisabledIcon(disabledIcon); }
@Override public Component add(Component component) { // special case of externalizable panel if (component instanceof ExternalizablePanel) { final TabComponent tabComp = getTabComponent((ExternalizablePanel) component); // already existing ? if (tabComp != null) { // use its parameter insertTab( tabComp.getTitle(), tabComp.getIcon(), component, tabComp.tip, Math.min(tabComp.index, getTabCount())); return component; } } return super.add(component); }