當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。