本文整理汇总了Java中org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput.getChange方法的典型用法代码示例。如果您正苦于以下问题:Java ChangePreviewViewerInput.getChange方法的具体用法?Java ChangePreviewViewerInput.getChange怎么用?Java ChangePreviewViewerInput.getChange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput
的用法示例。
在下文中一共展示了ChangePreviewViewerInput.getChange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setInput
import org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public void setInput(ChangePreviewViewerInput input) {
Change change= input.getChange();
if (change != null) {
Object element= change.getModifiedElement();
if (element instanceof IAdaptable) {
IAdaptable adaptable= (IAdaptable) element;
IWorkbenchAdapter workbenchAdapter= (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class);
if (workbenchAdapter != null) {
fPane.setImageDescriptor(workbenchAdapter.getImageDescriptor(element));
} else {
fPane.setImageDescriptor(null);
}
} else {
fPane.setImageDescriptor(null);
}
}
if (!(change instanceof CreateTextFileChange)) {
fSourceViewer.setInput(null);
fPane.setText(""); //$NON-NLS-1$
return;
}
CreateTextFileChange textFileChange= (CreateTextFileChange) change;
fPane.setText(textFileChange.getName());
IDocument document= new Document(textFileChange.getPreview());
// This is a temporary work around until we get the
// source viewer registry.
fSourceViewer.unconfigure();
String textType= textFileChange.getTextType();
JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
if ("java".equals(textType)) { //$NON-NLS-1$
textTools.setupJavaDocumentPartitioner(document);
fSourceViewer.configure(new JavaSourceViewerConfiguration(textTools.getColorManager(), store, null, null));
} else if ("properties".equals(textType)) { //$NON-NLS-1$
PropertiesFileDocumentSetupParticipant.setupDocument(document);
fSourceViewer.configure(new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
} else {
fSourceViewer.configure(new SourceViewerConfiguration());
}
fSourceViewer.setInput(document);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:45,代码来源:CreateTextFileChangePreviewViewer.java