本文整理汇总了Java中org.eclipse.compare.contentmergeviewer.TextMergeViewer类的典型用法代码示例。如果您正苦于以下问题:Java TextMergeViewer类的具体用法?Java TextMergeViewer怎么用?Java TextMergeViewer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextMergeViewer类属于org.eclipse.compare.contentmergeviewer包,在下文中一共展示了TextMergeViewer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createPreviewer
import org.eclipse.compare.contentmergeviewer.TextMergeViewer; //导入依赖的package包/类
private Control createPreviewer(Composite parent) {
final CompareConfiguration compareConfiguration = new CompareConfiguration();
compareConfiguration.setLeftLabel("Original " + docTypeName);
compareConfiguration.setLeftEditable(false);
compareConfiguration.setRightLabel("Updated " + docTypeName);
compareConfiguration.setRightEditable(false);
compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);
compareConfiguration.setProperty(PREFIX_SUFFIX_PROPERTY, fPrefixSuffix);
fViewer = new TextMergeViewer(parent, SWT.NONE, compareConfiguration);
// add initial input in order to avoid problems when disposing the viewer later:
fViewer.setInput(new DiffNode(new TargetElementFromString(""), new TargetElementFromString("")));
Control control = fViewer.getControl();
control.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
compareConfiguration.dispose();
}
});
return control;
}
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:SpecComparePage.java
示例2: createPreviewer
import org.eclipse.compare.contentmergeviewer.TextMergeViewer; //导入依赖的package包/类
private Control createPreviewer(Composite parent) {
final CompareConfiguration compareConfiguration = new CompareConfiguration();
compareConfiguration.setLeftLabel("Original package.json");
compareConfiguration.setLeftEditable(false);
compareConfiguration.setRightLabel("Merged package.json");
compareConfiguration.setRightEditable(false);
compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);
fViewer = new TextMergeViewer(parent, SWT.NONE, compareConfiguration);
// add initial input in order to avoid problems when disposing the viewer later:
fViewer.setInput(new DiffNode(new DiffElementFromString(""), new DiffElementFromString("")));
Control control = fViewer.getControl();
control.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
compareConfiguration.dispose();
}
});
return control;
}
开发者ID:eclipse,项目名称:n4js,代码行数:22,代码来源:PackageJsonComparePage.java
注:本文中的org.eclipse.compare.contentmergeviewer.TextMergeViewer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论