private void setLocation (final int lineNumber, final boolean showLineInLocal) { if (currentDiff == null) { return; } if (showLineInLocal) { currentDiff.setLocation(DiffController.DiffPane.Modified, DiffController.LocationType.LineNumber, lineNumber); } else { currentDiff.getJComponent().putClientProperty("diff.smartScrollDisabled", Boolean.TRUE); currentDiff.setLocation(DiffController.DiffPane.Base, DiffController.LocationType.LineNumber, lineNumber); } }
@Override public void run () { view.setLocation(DiffController.DiffPane.Modified, DiffController.LocationType.LineNumber, rightLine); if (leftLine != -1) { view.getJComponent().putClientProperty("diff.smartScrollDisabled", Boolean.TRUE); view.setLocation(DiffController.DiffPane.Base, DiffController.LocationType.LineNumber, leftLine); } } });
@Override public void run() { try { if (isCanceled()) { showDiffError(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_NoRevisions")); // NOI18N return; } final DiffController view = DiffController.createEnhanced(leftSource, rightSource); int leftMaxLineNumber = getLastLineIndex(leftSource); int rightMaxLineNumber = getLastLineIndex(rightSource); if (currentTask == ShowDiffTask.this) { currentDiff = view; setBottomComponent(currentDiff.getJComponent()); if (leftMaxLineNumber != -1) { setLocation(Math.min(leftMaxLineNumber, lineNumber), false); } if (rightMaxLineNumber != -1) { setLocation(Math.min(rightMaxLineNumber, lineNumber), true); } parent.refreshComponents(false); } } catch (IOException e) { Mercurial.LOG.log(Level.INFO, null, e); } } });
if (currentTask == ShowDiffTask.this) { currentDiff = view; setBottomComponent(currentDiff.getJComponent()); final int dl = diffView.getDividerLocation(); if (!setLocation(view)) {
JComponent jc = diffView.getJComponent();
JComponent diffComponent = DiffController.create(expected, actual).getJComponent(); diffComponent.setPreferredSize(new Dimension(500, 250)); JButton ok = new JButton(Bundle.LBL_OK());
fileComponentSetSelectedIndexContext = false; diffView = view.getJComponent(); diffView.getActionMap().put("jumpNext", nextAction); // NOI18N diffView.getActionMap().put("jumpPrev", prevAction); // NOI18N