当前位置: 首页>>代码示例>>Java>>正文


Java ChangePreviewViewerInput类代码示例

本文整理汇总了Java中org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput的典型用法代码示例。如果您正苦于以下问题:Java ChangePreviewViewerInput类的具体用法?Java ChangePreviewViewerInput怎么用?Java ChangePreviewViewerInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChangePreviewViewerInput类属于org.eclipse.ltk.ui.refactoring包,在下文中一共展示了ChangePreviewViewerInput类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: feedInput

import org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput; //导入依赖的package包/类
public ChangePreview feedInput(IChangePreviewViewer viewer, List categories)
    throws CoreException {
  InternalTextEditChangeNode element = getTextEditChangeNode();
  if (element != null) {
    Change change = element.getChange();
    if (change instanceof TextEditBasedChange) {
      IRegion range = getTextRange(this);
      ChangePreviewViewerInput input = null;
      if (range != null) {
        input =
            TextEditChangePreviewViewer.createInput(
                change, new TextEditBasedChangeGroup[] {fChangeGroup}, range);
      } else {
        input = TextEditChangePreviewViewer.createInput(change, fChangeGroup, 2);
      }
      return viewer.setInput(input);
    }
  } else {
    return viewer.setInput(null);
  }
  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:TextEditGroupNode.java

示例2: createInput

import org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput; //导入依赖的package包/类
public static ChangePreviewViewerInput createInput(
    Change change, TextEditBasedChangeGroup group, int surroundingLines) {
  TextEditBasedChangeInput input = new TextEditBasedChangeInput(change);
  input.group = group;
  input.surroundingLines = surroundingLines;
  return input;
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:TextEditChangePreviewViewer.java

示例3: feedInput

import org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput; //导入依赖的package包/类
public ChangePreview feedInput(IChangePreviewViewer viewer, List categories)
    throws CoreException {
  return viewer.setInput(new ChangePreviewViewerInput(fChange));
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:AbstractChangeNode.java

示例4: 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


注:本文中的org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。