JComponent () { final JPanel p = ToolbarDecorator.createDecorator(myVariableTable) .setAddAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { stopVarEditing(); myVariableTableModel.addVariable(); myNamespaceTable.editCellAt(myVariableTableModel.getRowCount() - 1, 0); } }).setRemoveAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { myVariableTableModel.removeVariable(myVariableTable.getSelectedRow()); } }).disableUpDownActions().createPanel(); UIUtil.addBorder(p, IdeBorderFactory.createTitledBorder(XPathBundle.message("border.title.variables"), false)); final JPanel n = ToolbarDecorator.createDecorator(myNamespaceTable) .setAddAction(myContextProvider.getContextElement() != null ? null : new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { final ExternalResourceManager erm = ExternalResourceManager.getInstance(); final List<String> allURIs = new ArrayList<>(Arrays.asList(erm.getResourceUrls(null, true))); final Collection<Namespace> namespaces = myNamespaceTableModel.getNamespaces(); for (Namespace namespace : namespaces) { allURIs.remove(namespace.getUri()); } Collections.sort(allURIs); final DataContext dataContext = DataManager.getInstance().getDataContext(myNamespaceTable); final Project project = CommonDataKeys.PROJECT.getData(dataContext); final AddNamespaceDialog dlg = new AddNamespaceDialog(project, myUnresolvedPrefixes, allURIs, AddNamespaceDialog.Mode.EDITABLE); if (dlg.showAndGet()) { myNamespaceTableModel.addNamespace(new Namespace(dlg.getPrefix(), dlg.getURI())); } } }).setRemoveAction( myContextProvider.getContextElement() != null ? null : new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { myNamespaceTableModel.removeNamespace(myNamespaceTable.getSelectedRow()); } }).disableUpDownActions().createPanel(); UIUtil.addBorder(n, IdeBorderFactory.createTitledBorder(XPathBundle.message("border.title.namespaces"), false)); mySplitter = new JBSplitter(true, getDimensionServiceKey(), 400 / 1000f); mySplitter.setHonorComponentsMinimumSize(true); mySplitter.setFirstComponent(n); mySplitter.setSecondComponent(p); return mySplitter; }