Код: Выделить всё
public class SSCCE extends Dialog {
protected SSCCE(Shell parentShell) { super(parentShell); }
protected Control createDialogArea(Composite parent) {
Composite area = (Composite)super.createDialogArea(parent);
CompareConfiguration cc = new CompareConfiguration();
TextMergeViewer tmv = new TextMergeViewer(area, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL, cc);
tmv.setInput(new CompareEditorInput(cc) {
protected Object prepareInput(IProgressMonitor arg0) throws InvocationTargetException, InterruptedException {
return new DiffNode(new CompareEntry("lName", "lContent"), new CompareEntry("lName", "lContent"));
}});
GridDataFactory.fillDefaults().grab(true, true).applyTo(tmv.getControl());
return area;
}
protected boolean isResizable() { return true; }
private class CompareEntry implements IStreamContentAccessor, ITypedElement {
String contents, name;
public CompareEntry(String _contents,String _name) {
contents = _contents; name = _name;
}
public InputStream getContents() throws CoreException {
return new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8));
}
public String getType() { return ITypedElement.TEXT_TYPE; }
public Image getImage() { return null; }
public String getName() { return name; }
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... ng-content
Мобильная версия