@Override protected void init() { super.init(); myEnableCheckBox = new JCheckBox(ApplicationBundle.message("checkbox.enable.javadoc.formatting")); myEnableCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { update(); } }); myPanel.setBorder(new CustomLineBorder(OnePixelDivider.BACKGROUND, 1, 0, 0, 0)); myJavaDocPanel.add(BorderLayout.CENTER, myPanel); myJavaDocPanel.add(myEnableCheckBox, BorderLayout.NORTH); }
@Override @NotNull public JBTabsPresentation setTabsPosition(final JBTabsPosition position) { myPosition = position; OnePixelDivider divider = mySplitter.getDivider(); if ((position == JBTabsPosition.left || position == JBTabsPosition.right) && divider.getParent() == null) { add(divider); } else if (divider.getParent() == this) { remove(divider); } relayout(true, false); return this; }
private void rebuildCommitPanels(int[] selection) { myEmptyText.setText(""); int selectionLength = selection.length; // for each commit besides the first there are two components: Separator and CommitPanel int existingCount = (myMainContentPanel.getComponentCount() + 1) / 2; int requiredCount = Math.min(selectionLength, MAX_ROWS); for (int i = existingCount; i < requiredCount; i++) { if (i > 0) { myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null)); } myMainContentPanel.add(new CommitPanel(myLogData, myColorManager)); } // clear superfluous items while (myMainContentPanel.getComponentCount() > 2 * requiredCount - 1) { myMainContentPanel.remove(myMainContentPanel.getComponentCount() - 1); } if (selectionLength > MAX_ROWS) { myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null)); JBLabel label = new JBLabel("(showing " + MAX_ROWS + " of " + selectionLength + " selected commits)"); label.setFont(VcsHistoryUtil.getCommitDetailsFont()); label.setBorder(CommitPanel.getDetailsBorder()); myMainContentPanel.add(label); } mySelection = Ints.asList(Arrays.copyOf(selection, requiredCount)); repaint(); }
@Override protected Divider createDivider() { return new OnePixelDivider(isVertical(), this); }
TabsSideSplitter(@NotNull JBTabsImpl tabs) { myTabs = tabs; myTabs.addPropertyChangeListener(JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY.toString(), this); myDivider = new OnePixelDivider(false, this); }
OnePixelDivider getDivider() { return myDivider; }
@Override public void doLayout() { try { myHeaderFitSize = computeHeaderFitSize(); final Collection<TabLabel> labels = myInfo2Label.values(); List<TabInfo> visible = new ArrayList<>(); visible.addAll(getVisibleInfos()); if (myDropInfo != null && !visible.contains(myDropInfo) && myShowDropLocation) { if (getDropInfoIndex() >= 0 && getDropInfoIndex() < visible.size()) { visible.add(getDropInfoIndex(), myDropInfo); } else { visible.add(myDropInfo); } } if (isSingleRow()) { myLastLayoutPass = mySingleRowLayout.layoutSingleRow(visible); myTableLayout.myLastTableLayout = null; OnePixelDivider divider = mySplitter.getDivider(); if (divider.getParent() == this) { int location = getTabsPosition() == JBTabsPosition.left ? mySingleRowLayout.myLastSingRowLayout.tabRectangle.width : getWidth() - mySingleRowLayout.myLastSingRowLayout.tabRectangle.width; divider.setBounds(location, 0, 1, getHeight()); } } else { myLastLayoutPass = myTableLayout.layoutTable(visible); mySingleRowLayout.myLastSingRowLayout = null; } if (isStealthModeEffective() && !isHideTabs()) { final TabLabel label = getSelectedLabel(); final Rectangle bounds = label.getBounds(); final Insets insets = getLayoutInsets(); layout(label, insets.left, bounds.y, getWidth() - insets.right - insets.left, bounds.height); } moveDraggedTabLabel(); myTabActionsAutoHideListener.processMouseOver(); } finally { myForcedRelayout = false; } applyResetComponents(); }
TabsSideSplitter(@NotNull JBTabsImpl tabs) { myTabs = tabs; // myTabs.addPropertyChangeListener(JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY.toString(), this); myDivider = new OnePixelDivider(false, this); }