public void release() { for (EditorView<T> view : views) { view.release(); view.removePropertyChangeListener(this); } views.clear(); inputTabs.removeChangeListener(inputTabsChangeListener); inputTabs.removeAll(); inspectorPanel.release(); document.release(); }
public Editor(T document) { super(new BorderLayout()); this.document = document; setBackground(Color.LIGHT_GRAY); inputTabs = new JTabbedPane(JTabbedPane.LEFT, JTabbedPane.SCROLL_TAB_LAYOUT); inputTabs.setUI(new VerticalTabbedPaneUI()); inputTabs.setFont(inputTabs.getFont().deriveFont(8)); inputTabsChangeListener = new InputTabsChangeListener(); inputTabs.addChangeListener(inputTabsChangeListener); inspectorPanel = JInspectorPanelFactory.build(inputTabs); add(inspectorPanel.getComponent(), BorderLayout.CENTER); }
public void selectView(String viewId) { for (int c = 0; c < views.size(); c++) { if (views.get(c).getViewId().equals(viewId)) { inputTabs.setSelectedIndex(c); return; } } }
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(EditorView.TITLE_PROPERTY)) { int ix = views.indexOf(evt.getSource()); if (ix == -1) return; inputTabs.setTitleAt(ix, (String) evt.getNewValue()); } }
public void addEditorView(EditorView<T> editorView) { views.add(editorView); inputTabs.addTab( null, new VTextIcon(inputTabs, editorView.getTitle(), VTextIcon.ROTATE_LEFT), editorView.getComponent()); editorView.addPropertyChangeListener(this); editorView.addLocationListener(this); editorView.setDocument(document); }
public void selectView(int viewIndex) { inputTabs.setSelectedIndex(viewIndex); }