protected void handleAdd() { // don't need to check the section as only the direct imports can be added OntologyImportWizard wizard = new OntologyImportWizard( (Frame) SwingUtilities.getAncestorOfClass(Frame.class, editorKit.getWorkspace()), editorKit); int ret = wizard.showModalDialog(); if (ret == Wizard.FINISH_RETURN_CODE) { AddImportsStrategy strategy = new AddImportsStrategy(editorKit, ont, wizard.getImports()); strategy.addImports(); } }
@Override protected int getMaxAvailablePageWidth( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Insets insets = list.getInsets(); // OWLFrameList.ITEM_BORDER.getBorderInsets(); int componentWidth = list.getWidth(); JViewport vp = (JViewport) SwingUtilities.getAncestorOfClass(JViewport.class, list); if (vp != null) { componentWidth = vp.getViewRect().width; } return componentWidth - list.getInsets().left - list.getInsets().right - insets.left + insets.right - 20; }