ToolAdaptersManagementDialog(AppContext appContext, String title, String helpID) { super(appContext.getApplicationWindow(), title, 0, helpID); this.appContext = appContext; JPanel contentPanel = createContentPanel(); setContent(contentPanel); super.getJDialog().setMinimumSize(contentPanel.getPreferredSize()); }
private JPanel createContentPanel() { // compute content and other buttons SpringLayout springLayout = new SpringLayout(); JPanel panel = new JPanel(springLayout); int panelHeight = 0; JTable propertiesPanel = createPropertiesPanel(); panelHeight += propertiesPanel.getPreferredSize().getHeight(); panel.add(propertiesPanel); panelHeight += 10; panel.add(Box.createVerticalStrut(10)); JScrollPane scrollPane = new JScrollPane(createAdaptersPanel()); panelHeight += scrollPane.getPreferredSize().getHeight(); panel.add(scrollPane); panelHeight += 10; panel.add(Box.createVerticalStrut(10)); JPanel buttonsPanel = createButtonsPanel(); panelHeight += buttonsPanel.getPreferredSize().getHeight(); panel.add(buttonsPanel); springLayout.putConstraint( SpringLayout.NORTH, panel, DEFAULT_PADDING, SpringLayout.NORTH, propertiesPanel); springLayout.putConstraint( SpringLayout.WEST, panel, DEFAULT_PADDING, SpringLayout.WEST, propertiesPanel); springLayout.putConstraint( SpringLayout.EAST, panel, DEFAULT_PADDING, SpringLayout.EAST, propertiesPanel); springLayout.putConstraint( SpringLayout.NORTH, scrollPane, DEFAULT_PADDING, SpringLayout.SOUTH, propertiesPanel); springLayout.putConstraint( SpringLayout.WEST, panel, DEFAULT_PADDING, SpringLayout.WEST, scrollPane); springLayout.putConstraint( SpringLayout.EAST, panel, DEFAULT_PADDING, SpringLayout.EAST, scrollPane); springLayout.putConstraint( SpringLayout.NORTH, scrollPane, DEFAULT_PADDING, SpringLayout.SOUTH, buttonsPanel); springLayout.putConstraint( SpringLayout.WEST, panel, DEFAULT_PADDING, SpringLayout.WEST, buttonsPanel); springLayout.putConstraint( SpringLayout.EAST, panel, DEFAULT_PADDING, SpringLayout.EAST, buttonsPanel); panel.setPreferredSize( new Dimension( CHECK_COLUMN_WIDTH + LABEL_COLUMN_WIDTH + COLUMN_WIDTH - 32, panelHeight + DEFAULT_PADDING)); makeCompactGrid(panel, 5, 1, 0, 0, 0, 0); return panel; }