本文整理匯總了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