Search in sources :

Example 1 with CommitFileDiffViewer

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);
}
Also used : CommitFileDiffViewer(org.eclipse.egit.ui.internal.history.CommitFileDiffViewer) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite)

Example 2 with CommitFileDiffViewer

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);
}
Also used : CommitFileDiffViewer(org.eclipse.egit.ui.internal.history.CommitFileDiffViewer) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite)

Aggregations

CommitFileDiffViewer (org.eclipse.egit.ui.internal.history.CommitFileDiffViewer)2 Composite (org.eclipse.swt.widgets.Composite)2 Control (org.eclipse.swt.widgets.Control)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2