• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JavaTextTools类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initializeEditor

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected void initializeEditor() {
	setDocumentProvider(JavaPlugin.getDefault().getPropertiesFileDocumentProvider());
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	setPreferenceStore(store);
	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	setSourceViewerConfiguration(new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, this, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
	setEditorContextMenuId("#TextEditorContext"); //$NON-NLS-1$
	setRulerContextMenuId("#TextRulerContext"); //$NON-NLS-1$
	setHelpContextId(ITextEditorHelpContextIds.TEXT_EDITOR);
	configureInsertMode(SMART_INSERT, false);
	setInsertMode(INSERT);

	// Need to listen on Editors UI preference store because JDT disables this functionality in its preferences.
	fPropertyChangeListener= new IPropertyChangeListener() {
		public void propertyChange(PropertyChangeEvent event) {
			if (AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS.equals(event.getProperty()))
				handlePreferenceStoreChanged(event);
		}
	};
	EditorsUI.getPreferenceStore().addPropertyChangeListener(fPropertyChangeListener);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:PropertiesFileEditor.java


示例2: createPatternViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected SourceViewer createPatternViewer(Composite parent) {
	IDocument document= new Document();
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	JavaSourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL, store);
	SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, false);
	viewer.configure(configuration);
	viewer.setEditable(false);
	viewer.setDocument(document);

	Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
	viewer.getTextWidget().setFont(font);
	new JavaSourcePreviewerUpdater(viewer, configuration, store);

	Control control= viewer.getControl();
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
	control.setLayoutData(data);

	viewer.setEditable(false);
	return viewer;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:JavaTemplatesPage.java


示例3: setPreferenceStore

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected void setPreferenceStore(IPreferenceStore store) {
	super.setPreferenceStore(store);
	SourceViewerConfiguration sourceViewerConfiguration= getSourceViewerConfiguration();
	if (sourceViewerConfiguration == null || sourceViewerConfiguration instanceof JavaSourceViewerConfiguration) {
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		setSourceViewerConfiguration(new JavaSourceViewerConfiguration(textTools.getColorManager(), store, this, IJavaPartitions.JAVA_PARTITIONING));
	}

	if (getSourceViewer() instanceof JavaSourceViewer)
		((JavaSourceViewer)getSourceViewer()).setPreferenceStore(store);

	fMarkOccurrenceAnnotations= store.getBoolean(PreferenceConstants.EDITOR_MARK_OCCURRENCES);
	fStickyOccurrenceAnnotations= store.getBoolean(PreferenceConstants.EDITOR_STICKY_OCCURRENCES);
	fMarkTypeOccurrences= store.getBoolean(PreferenceConstants.EDITOR_MARK_TYPE_OCCURRENCES);
	fMarkMethodOccurrences= store.getBoolean(PreferenceConstants.EDITOR_MARK_METHOD_OCCURRENCES);
	fMarkConstantOccurrences= store.getBoolean(PreferenceConstants.EDITOR_MARK_CONSTANT_OCCURRENCES);
	fMarkFieldOccurrences= store.getBoolean(PreferenceConstants.EDITOR_MARK_FIELD_OCCURRENCES);
	fMarkLocalVariableypeOccurrences= store.getBoolean(PreferenceConstants.EDITOR_MARK_LOCAL_VARIABLE_OCCURRENCES);
	fMarkExceptions= store.getBoolean(PreferenceConstants.EDITOR_MARK_EXCEPTION_OCCURRENCES);
	fMarkImplementors= store.getBoolean(PreferenceConstants.EDITOR_MARK_IMPLEMENTORS);
	fMarkMethodExitPoints= store.getBoolean(PreferenceConstants.EDITOR_MARK_METHOD_EXIT_POINTS);
	fMarkBreakContinueTargets= store.getBoolean(PreferenceConstants.EDITOR_MARK_BREAK_CONTINUE_TARGETS);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:JavaEditor.java


示例4: createViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected SourceViewer createViewer(Composite parent) {
	IDocument document= new Document();
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, store);
	SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, false);
	viewer.configure(configuration);
	viewer.setEditable(false);
	viewer.setDocument(document);

	Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
	viewer.getTextWidget().setFont(font);
	new JavaSourcePreviewerUpdater(viewer, configuration, store);

	Control control= viewer.getControl();
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
	control.setLayoutData(data);

	return viewer;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:JavaTemplatePreferencePage.java


示例5: initialize

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
private void initialize() {

		initializeFields();

		for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++)
			fHighlightingColorList.add(new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1], fSyntaxColorListModel[i][1] + BOLD, fSyntaxColorListModel[i][1] + ITALIC, fSyntaxColorListModel[i][1] + STRIKETHROUGH, fSyntaxColorListModel[i][1] + UNDERLINE, null));

		fHighlightingColorListViewer.setInput(fHighlightingColorList);
		fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0)));

		// Make sure we propagate the colors to the shared color manager
		IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		PropertiesFileSourceViewerConfiguration sharedPropertiesFileSourceViewerConfiguration= new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING);
		new SourcePreviewerUpdater(fPreviewViewer, sharedPropertiesFileSourceViewerConfiguration, store);

	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:PropertiesFileEditorPreferencePage.java


示例6: JavaTextViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
JavaTextViewer(Composite parent) {
	fSourceViewer= new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT | SWT.H_SCROLL | SWT.V_SCROLL);
	JavaTextTools tools= JavaCompareUtilities.getJavaTextTools();
	if (tools != null) {
		IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
		fSourceViewer.configure(new JavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING));
	}

	fSourceViewer.setEditable(false);

	String symbolicFontName= JavaMergeViewer.class.getName();
	Font font= JFaceResources.getFont(symbolicFontName);
	if (font != null)
		fSourceViewer.getTextWidget().setFont(font);

}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:JavaTextViewer.java


示例7: configureTextViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected void configureTextViewer(TextViewer viewer) {
	if (viewer instanceof SourceViewer) {
		SourceViewer sourceViewer= (SourceViewer)viewer;
		if (fSourceViewer == null)
			fSourceViewer= new ArrayList<SourceViewer>();
		if (!fSourceViewer.contains(sourceViewer))
			fSourceViewer.add(sourceViewer);
		JavaTextTools tools= JavaCompareUtilities.getJavaTextTools();
		if (tools != null) {
			IEditorInput editorInput= getEditorInput(sourceViewer);
			sourceViewer.unconfigure();
			if (editorInput == null) {
				sourceViewer.configure(getSourceViewerConfiguration(sourceViewer, null));
				return;
			}
			getSourceViewerConfiguration(sourceViewer, editorInput);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:JavaMergeViewer.java


示例8: createSourceViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
private void createSourceViewer(Composite parent) {
	Composite c= new Composite(parent, SWT.NONE);
	c.setLayoutData(new GridData(GridData.FILL_BOTH));
	GridLayout gl= new GridLayout();
	gl.marginHeight= 0;
	gl.marginWidth= 0;
	c.setLayout(gl);

	Label l= new Label(c, SWT.NONE);
	l.setText(NLSUIMessages.ExternalizeWizardPage_context);
	l.setLayoutData(new GridData());

	// source viewer
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	fSourceViewer= new JavaSourceViewer(c, null, null, false, styles, store);
	fSourceViewer.configure(new JavaSourceViewerConfiguration(tools.getColorManager(), store, null, null));
	fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));

	try {

		String contents= fCu.getBuffer().getContents();
		IDocument document= new Document(contents);
		tools.setupJavaDocumentPartitioner(document);

		fSourceViewer.setDocument(document);
		fSourceViewer.setEditable(false);

		GridData gd= new GridData(GridData.FILL_BOTH);
		gd.heightHint= convertHeightInCharsToPixels(10);
		gd.widthHint= convertWidthInCharsToPixels(40);
		fSourceViewer.getControl().setLayoutData(gd);

	} catch (JavaModelException e) {
		ExceptionHandler.handle(e, NLSUIMessages.ExternalizeWizardPage_exception_title, NLSUIMessages.ExternalizeWizardPage_exception_message);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:39,代码来源:ExternalizeWizardPage.java


示例9: createDocument

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected IDocument createDocument(Object element) throws CoreException {
	IDocument document= super.createDocument(element);
	if (document != null) {
		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
		tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
	}
	return document;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:ClassFileDocumentProvider.java


示例10: JavaPreview

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
public JavaPreview(Map<String, String> workingValues, Composite parent) {
		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
		fPreviewDocument= new Document();
		fWorkingValues= workingValues;
		tools.setupJavaDocumentPartitioner( fPreviewDocument, IJavaPartitions.JAVA_PARTITIONING);

		PreferenceStore prioritizedSettings= new PreferenceStore();
		HashMap<String, String> complianceOptions= new HashMap<String, String>();
		JavaModelUtil.setComplianceOptions(complianceOptions, JavaModelUtil.VERSION_LATEST);
		for (Entry<String, String> complianceOption : complianceOptions.entrySet()) {
			prioritizedSettings.setValue(complianceOption.getKey(), complianceOption.getValue());
		}

		IPreferenceStore[] chain= { prioritizedSettings, JavaPlugin.getDefault().getCombinedPreferenceStore() };
		fPreferenceStore= new ChainedPreferenceStore(chain);
		fSourceViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, fPreferenceStore);
		fSourceViewer.setEditable(false);
		Cursor arrowCursor= fSourceViewer.getTextWidget().getDisplay().getSystemCursor(SWT.CURSOR_ARROW);
		fSourceViewer.getTextWidget().setCursor(arrowCursor);

		// Don't set caret to 'null' as this causes https://bugs.eclipse.org/293263
//		fSourceViewer.getTextWidget().setCaret(null);

		fViewerConfiguration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), fPreferenceStore, null, IJavaPartitions.JAVA_PARTITIONING, true);
		fSourceViewer.configure(fViewerConfiguration);
		fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));

		fMarginPainter= new MarginPainter(fSourceViewer);
		final RGB rgb= PreferenceConverter.getColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR);
		fMarginPainter.setMarginRulerColor(tools.getColorManager().getColor(rgb));
		fSourceViewer.addPainter(fMarginPainter);

		new JavaSourcePreviewerUpdater();
		fSourceViewer.setDocument(fPreviewDocument);
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:36,代码来源:JavaPreview.java


示例11: getContentAssistant

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

	IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	IColorManager manager= textTools.getColorManager();


	ContentAssistant assistant= new ContentAssistant();
	assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
		// Register the same processor for strings and single line comments to get code completion at the start of those partitions.
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_STRING);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_CHARACTER);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
	assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_DOC);

	assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT));
	assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));
	assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
	assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
	assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
	assistant.setInformationControlCreator(new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString());
		}
	});

	Color background= getColor(store, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, manager);
	assistant.setContextInformationPopupBackground(background);
	assistant.setContextSelectorBackground(background);

	Color foreground= getColor(store, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, manager);
	assistant.setContextInformationPopupForeground(foreground);
	assistant.setContextSelectorForeground(foreground);

	return assistant;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:39,代码来源:CodeTemplateSourceViewerConfiguration.java


示例12: createViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
private SourceViewer createViewer(Composite parent, int nColumns) {
		Label label= new Label(parent, SWT.NONE);
		label.setText(PreferencesMessages.CodeTemplateBlock_preview);
		GridData data= new GridData();
		data.horizontalSpan= nColumns;
		label.setLayoutData(data);

		IDocument document= new Document();
		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
		tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
		IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
		SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, store);
		CodeTemplateSourceViewerConfiguration configuration= new CodeTemplateSourceViewerConfiguration(tools.getColorManager(), store, null, fTemplateProcessor);
		viewer.configure(configuration);

		viewer.setEditable(false);
		Cursor arrowCursor= viewer.getTextWidget().getDisplay().getSystemCursor(SWT.CURSOR_ARROW);
		viewer.getTextWidget().setCursor(arrowCursor);

		// Don't set caret to 'null' as this causes https://bugs.eclipse.org/293263
//		viewer.getTextWidget().setCaret(null);

		viewer.setDocument(document);

		Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
		viewer.getTextWidget().setFont(font);
		new JavaSourcePreviewerUpdater(viewer, configuration, store);

		Control control= viewer.getControl();
		data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
		data.horizontalSpan= nColumns;
		data.heightHint= fPixelConverter.convertHeightInCharsToPixels(5);
		control.setLayoutData(data);

		return viewer;
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:37,代码来源:CodeTemplateBlock.java


示例13: PropertiesFileViewer

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
PropertiesFileViewer(Composite parent) {
	fSourceViewer= new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT | SWT.H_SCROLL | SWT.V_SCROLL);
	JavaTextTools tools= JavaCompareUtilities.getJavaTextTools();
	if (tools != null) {
		IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
		fSourceViewer.configure(new PropertiesFileSourceViewerConfiguration(tools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
	}

	fSourceViewer.setEditable(false);

	String symbolicFontName= PropertiesFileMergeViewer.class.getName();
	Font font= JFaceResources.getFont(symbolicFontName);
	if (font != null)
		fSourceViewer.getTextWidget().setFont(font);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:PropertiesFileViewer.java


示例14: initializeEditor

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected void initializeEditor() {
    super.initializeEditor();

    // install java source viewer configuration to allow java syntax highlighting
    JavaTextTools javaTextTools = JavaPlugin.getDefault().getJavaTextTools();
    JavaSourceViewerConfiguration sourceViewerConfiguration = new JavaSourceViewerConfiguration(
            javaTextTools.getColorManager(), JavaPlugin.getDefault().getCombinedPreferenceStore(), this,
            IJavaPartitions.JAVA_PARTITIONING);
    setSourceViewerConfiguration(sourceViewerConfiguration);
    
    
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:14,代码来源:UnifiedDiffEditor.java


示例15: installViewerConfiguration

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
private void installViewerConfiguration() {
	JavaTextTools tools = JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(getDocument(), IJavaPartitions.JAVA_PARTITIONING);
	IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
	configure(new HydrographJavaSourceViewerConfiguration((IColorManager) sharedColors, store, this));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:7,代码来源:SourceViewer.java


示例16: createJavaSourceViewerConfiguration

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
@Override
protected JavaSourceViewerConfiguration createJavaSourceViewerConfiguration() {
  JavaTextTools textTools = JavaPlugin.getDefault().getJavaTextTools();
  return new GWTSourceViewerConfiguration(textTools.getColorManager(),
      getPreferenceStore(), this);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:7,代码来源:GWTJavaEditor.java


示例17: getJavaTextTools

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
private static JavaTextTools getJavaTextTools() {
	return JavaPlugin.getDefault().getJavaTextTools();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:RenameTypeWizardSimilarElementsPage.java


示例18: newJavaDocument

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
private IDocument newJavaDocument(String source) {
	IDocument result= new Document(source);
	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	textTools.setupJavaDocumentPartitioner(result);
	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:JavaStatusContextViewer.java


示例19: setInput

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的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


示例20: setup

import org.eclipse.jdt.ui.text.JavaTextTools; //导入依赖的package包/类
public void setup(IDocument document) {
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:JavaDocumentSetupParticipant.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UndoEdit类代码示例发布时间:2022-05-22
下一篇:
Java TopologyValidationError类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap