@Nullable @Override public JComponent createComponent() { if (myConfigurables.size() == 1) { return myConfigurables.get(0).createComponent(); } JBTabbedPane tabbedPane = new JBTabbedPane() { @NotNull @Override protected Insets getInsetsForTabComponent() { return JBUI.emptyInsets(); } }; myConfigurables.forEach(configurable -> { JComponent configurableComponent = configurable.createComponent(); JBScrollPane scrollPane = new JBScrollPane(configurableComponent, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setBorder(new JBEmptyBorder(JBUI.emptyInsets())); tabbedPane.add(configurable.getDisplayName(), scrollPane); }); return tabbedPane; }
public GerritChangeDetailsPanel(final Project project) { panel = new JPanel(new CardLayout()); panel.add(UIVcsUtil.errorPanel("Nothing selected", false), NOTHING_SELECTED); panel.add(UIVcsUtil.errorPanel("Loading...", false), LOADING); panel.add(UIVcsUtil.errorPanel("Several commits selected", false), MULTIPLE_SELECTED); presentationData = new MyPresentationData(project); final JPanel wrapper = new JPanel(new BorderLayout()); jEditorPane = new JEditorPane(UIUtil.HTML_MIME, ""); jEditorPane.setPreferredSize(new Dimension(150, 100)); jEditorPane.setEditable(false); jEditorPane.setBackground(UIUtil.getComboBoxDisabledBackground()); jEditorPane.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { GerritChangeDetailsPanel.this.handleHyperlinkEvent(e); } }); final JBScrollPane tableScroll = new JBScrollPane(jEditorPane); tableScroll.setBorder(null); jEditorPane.setBorder(null); wrapper.add(tableScroll, SwingConstants.CENTER); jEditorPane.setBackground(UIUtil.getTableBackground()); wrapper.setBackground(UIUtil.getTableBackground()); panel.add(wrapper, DATA); ((CardLayout) panel.getLayout()).show(panel, NOTHING_SELECTED); }
scrollPane.setPreferredSize(new Dimension(getPopupWidth(), getPreferredPopupHeight())); scrollPane.setViewportView(repositoryTree); scrollPane.setBorder(BorderFactory.createEmptyBorder());
table.getTree().setShowsRootHandles(true); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM + SideBorder.LEFT + SideBorder.TOP));
protected void setupCorners() { setBorder(IdeBorderFactory.createBorder()); setCorner(UPPER_RIGHT_CORNER, new Corner(UPPER_RIGHT_CORNER)); setCorner(UPPER_LEFT_CORNER, new Corner(UPPER_LEFT_CORNER)); setCorner(LOWER_RIGHT_CORNER, new Corner(LOWER_RIGHT_CORNER)); setCorner(LOWER_LEFT_CORNER, new Corner(LOWER_LEFT_CORNER)); }