public void refreshPresentation() { // 1. vertical 2. number of lines 3. soft wraps (4. ignore spaces) PresentationState current = new PresentationState(); if (myFragmentedContent != null && !Comparing.equal(myPresentationState, current)) { myFragmentedContent.recalculate(); refreshData(myFragmentedContent); } myPreviousDiff.registerCustomShortcutSet(myPreviousDiff.getShortcutSet(), myParent); myNextDiff.registerCustomShortcutSet(myNextDiff.getShortcutSet(), myParent); }
public void buildUi() { myTopPanel = new JPanel(new BorderLayout()); final JPanel wrapper = new JPanel(); // final BoxLayout boxLayout = new BoxLayout(wrapper, BoxLayout.X_AXIS); wrapper.setLayout(new BorderLayout()); myTitleLabel.setBorder(BorderFactory.createEmptyBorder(1, 2, 0, 0)); wrapper.add(myTitleLabel, BorderLayout.WEST); DefaultActionGroup dag = new DefaultActionGroup(); myPreviousDiff.copyShortcutFrom(ActionManager.getInstance().getAction("PreviousDiff")); myNextDiff.copyShortcutFrom(ActionManager.getInstance().getAction("NextDiff")); dag.add(new MyChangeContextAction()); dag.add(myPreviousDiff); dag.add(myNextDiff); myPreviousDiff.registerCustomShortcutSet(myPreviousDiff.getShortcutSet(), myPanel); myNextDiff.registerCustomShortcutSet(myNextDiff.getShortcutSet(), myPanel); dag.add(new PopupAction()); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, dag, true); wrapper.add(toolbar.getComponent(), BorderLayout.EAST); myTopPanel.add(wrapper, BorderLayout.CENTER); final JPanel wrapperDiffs = new JPanel(new GridBagLayout()); final JPanel oneMore = new JPanel(new BorderLayout()); oneMore.add(wrapperDiffs, BorderLayout.NORTH); myCurrentHorizontal = myConfiguration.SHORT_DIFF_HORISONTALLY; myHorizontal = createPanel(true); myVertical = createPanel(false); myPanel.add(myTopPanel, BorderLayout.NORTH); myPanel.add(getCurrentPanel().getComponent(), BorderLayout.CENTER); myPreviousDiff.registerCustomShortcutSet(myPreviousDiff.getShortcutSet(), myParent); myNextDiff.registerCustomShortcutSet(myNextDiff.getShortcutSet(), myParent); }