use of org.eclipse.egit.ui.internal.history.CommitFileDiffViewer in project egit by eclipse.
the class CommitEditorPage method createDiffArea.
void createDiffArea(Composite parent, FormToolkit toolkit, int span) {
diffSection = createSection(parent, toolkit, UIText.CommitEditorPage_SectionFilesEmpty, span, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
Composite filesArea = createSectionClient(diffSection, toolkit);
diffViewer = new CommitFileDiffViewer(filesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle());
Control control = diffViewer.getControl();
control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
GridDataFactory.fillDefaults().hint(SWT.DEFAULT, 50).minSize(1, 50).grab(true, true).applyTo(control);
addToFocusTracking(control);
diffViewer.setContentProvider(ArrayContentProvider.getInstance());
diffViewer.setTreeWalk(getCommit().getRepository(), null);
updateSectionClient(diffSection, filesArea, toolkit);
}
use of org.eclipse.egit.ui.internal.history.CommitFileDiffViewer in project egit by eclipse.
the class StashEditorPage method createIndexArea.
private void createIndexArea(Composite parent, FormToolkit toolkit, int span) {
String sectionTitle = MessageFormat.format(UIText.StashEditorPage_StagedChanges, Integer.valueOf(0));
stagedDiffSection = createSection(parent, toolkit, sectionTitle, span, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
Composite unstagedChangesArea = createSectionClient(stagedDiffSection, toolkit);
stagedDiffViewer = new CommitFileDiffViewer(unstagedChangesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle());
Control control = stagedDiffViewer.getControl();
control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
GridDataFactory.fillDefaults().grab(true, true).applyTo(control);
addToFocusTracking(control);
stagedDiffViewer.setContentProvider(ArrayContentProvider.getInstance());
stagedDiffViewer.setTreeWalk(getCommit().getRepository(), null);
updateSectionClient(stagedDiffSection, unstagedChangesArea, toolkit);
}
Aggregations