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

Java JavaSourceViewerConfiguration类代码示例

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

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



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

示例1: createSignaturePreview

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
/**
 * Creates a signature preview viewer in a parent composite with a 1-column GridLayout.
 * 
 * @param parent the parent 
 * @return the preview viewer
 * @since 3.9
 */
public static JavaSourceViewer createSignaturePreview(Composite parent) {
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	JavaSourceViewer signaturePreview= new JavaSourceViewer(parent, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP, store);
	signaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	StyledText textWidget= signaturePreview.getTextWidget();
	textWidget.setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
	textWidget.setAlwaysShowScrollBars(false);
	signaturePreview.adaptBackgroundColor(parent);
	signaturePreview.setDocument(new Document());
	signaturePreview.setEditable(false);

	GridData gdata= new GridData(GridData.FILL_BOTH);
	gdata.widthHint= new PixelConverter(textWidget).convertWidthInCharsToPixels(50);
	gdata.heightHint= textWidget.getLineHeight() * 2;
	textWidget.setLayoutData(gdata);
	
	return signaturePreview;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:InputPageUtil.java


示例2: setPreferenceStore

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


示例3: JavaTextViewer

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


示例4: createSignaturePreview

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createSignaturePreview(Composite composite, RowLayouter layouter) {
	Label previewLabel= new Label(composite, SWT.NONE);
	previewLabel.setText(RefactoringMessages.ExtractMethodInputPage_signature_preview);
	layouter.perform(previewLabel);

	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/, store);
	fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
	fSignaturePreview.adaptBackgroundColor(composite);
	fSignaturePreview.setDocument(fSignaturePreviewDocument);
	fSignaturePreview.setEditable(false);

	//Layouting problems with wrapped text: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866
	Control signaturePreviewControl= fSignaturePreview.getControl();
	PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl);
	GridData gdata= new GridData(GridData.FILL_BOTH);
	gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50);
	gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2);
	signaturePreviewControl.setLayoutData(gdata);
	layouter.perform(signaturePreviewControl);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:23,代码来源:ExtractMethodInputPage.java


示例5: createMethodSignature

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createMethodSignature(Composite parent) {
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	JavaSourceViewer signatureViewer= new JavaSourceViewer(parent, null, null, false, SWT.READ_ONLY | SWT.WRAP /*| SWT.BORDER*/, store);
	signatureViewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	signatureViewer.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
	signatureViewer.adaptBackgroundColor(parent);
	String signatureLabel= JavaElementLabels.getElementLabel(fRefactoring.getMethod(), LABEL_FLAGS);
	signatureViewer.setDocument(new Document(signatureLabel));
	signatureViewer.setEditable(false);

	Control signatureControl= signatureViewer.getControl();
	PixelConverter pixelConverter= new PixelConverter(signatureControl);
	GridData gdata= new GridData(GridData.FILL_HORIZONTAL);
	gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50);
	signatureControl.setLayoutData(gdata);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:17,代码来源:ReplaceInvocationsInputPage.java


示例6: createSignaturePreview

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createSignaturePreview(Composite composite) {
	Label previewLabel= new Label(composite, SWT.NONE);
	previewLabel.setText(RefactoringMessages.ChangeSignatureInputPage_method_Signature_Preview);

	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/, store);
	fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
	fSignaturePreview.adaptBackgroundColor(composite);
	fSignaturePreview.setDocument(fSignaturePreviewDocument);
	fSignaturePreview.setEditable(false);

	//Layouting problems with wrapped text: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866
	Control signaturePreviewControl= fSignaturePreview.getControl();
	PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl);
	GridData gdata= new GridData(GridData.FILL_BOTH);
	gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50);
	gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2);
	signaturePreviewControl.setLayoutData(gdata);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:21,代码来源:IntroduceParameterWizard.java


示例7: createControl

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
  composite = new Composite(parent, SWT.NONE);
  composite.setLayout(new GridLayout(1, false));

  generateJUnitTimeoutEditor = new Button(composite, SWT.CHECK | SWT.LEFT);
  generateJUnitTimeoutEditor.setText("Use timeouts in generated test cases");
  generateJUnitTimeoutEditor.setSelection(EclipseForcesPlugin.getDefault()
      .isGenerateJUnitTimeout());

  codeTemplateLabel = new Label(composite, SWT.NONE);
  codeTemplateLabel.setText("Code template:");

  codeTemplateEditor = new SourceViewer(composite, null, SWT.MULTI | SWT.H_SCROLL
      | SWT.V_SCROLL | SWT.BORDER);
  JavaSourceViewerConfiguration config = new JavaSourceViewerConfiguration(JavaUI.getColorManager(), JavaPlugin.getDefault().getCombinedPreferenceStore(), null, IJavaPartitions.JAVA_PARTITIONING);
  codeTemplateEditor.configure(config);
  Document doc = new Document(EclipseForcesPlugin.getDefault().getCodeTemplate());
  JavaPartitionScanner scanner = new JavaPartitionScanner();
  FastPartitioner fp = new FastPartitioner(scanner, new String[] {IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_MULTI_LINE_COMMENT, IJavaPartitions.JAVA_CHARACTER,
      IJavaPartitions.JAVA_DOC, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT});
  fp.connect(doc);
  doc.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, fp);
  codeTemplateEditor.setDocument(doc);
  codeTemplateEditor.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
  codeTemplateEditor.getControl().pack();
}
 
开发者ID:fmoraes74,项目名称:eclipseforces,代码行数:28,代码来源:JavaPreferencesPage.java


示例8: createSourceViewer

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createSourceViewer(Composite c) {
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	fSourceViewer= new JavaSourceViewer(c, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, store);
	fSourceViewer.configure(new JavaSourceViewerConfiguration(getJavaTextTools().getColorManager(), store, null, null));
	fSourceViewer.setEditable(false);
	fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
	fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
	Document document= new Document();
	getJavaTextTools().setupJavaDocumentPartitioner(document);
	fSourceViewer.setDocument(document);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:RenameTypeWizardSimilarElementsPage.java


示例9: createSourceViewer

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


示例10: createControl

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
	super.createControl(parent);
	final SourceViewer viewer= getSourceViewer();
	viewer.unconfigure();
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	viewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	viewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:JavaStatusContextViewer.java


示例11: createSourceViewer

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createSourceViewer(final Composite c) {
	final IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	fSourceViewer= new JavaSourceViewer(c, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, store);
	fSourceViewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	fSourceViewer.setEditable(false);
	fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
	fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:PullUpMethodPage.java


示例12: handlePropertyChange

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void handlePropertyChange(PropertyChangeEvent event) {
	if (fSourceViewerConfiguration != null) {
		for (Iterator<Entry<SourceViewer, JavaSourceViewerConfiguration>> iterator= fSourceViewerConfiguration.entrySet().iterator(); iterator.hasNext();) {
			Entry<SourceViewer, JavaSourceViewerConfiguration> entry= iterator.next();
			JavaSourceViewerConfiguration configuration= entry.getValue();
			if (configuration.affectsTextPresentation(event)) {
				configuration.handlePropertyChangeEvent(event);
				ITextViewer viewer= entry.getKey();
				viewer.invalidateTextPresentation();
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:JavaMergeViewer.java


示例13: initializeEditor

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


示例14: createSignaturePreview

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createSignaturePreview(Composite composite) {
			Label previewLabel= new Label(composite, SWT.NONE);
			previewLabel.setText(RefactoringMessages.ChangeSignatureInputPage_method_Signature_Preview);

//			//XXX: use ViewForm to draw a flat border. Beware of common problems with wrapping layouts
//			//inside GridLayout. GridData must be constrained to force wrapping. See bug 9866 et al.
//			ViewForm border= new ViewForm(composite, SWT.BORDER | SWT.FLAT);

			IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
			fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/, store);
			fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
			fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
			fSignaturePreview.adaptBackgroundColor(composite);
			fSignaturePreview.setDocument(fSignaturePreviewDocument);
			fSignaturePreview.setEditable(false);

			//Layouting problems with wrapped text: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866
			Control signaturePreviewControl= fSignaturePreview.getControl();
			PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl);
			GridData gdata= new GridData(GridData.FILL_BOTH);
			gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50);
			gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2);
			signaturePreviewControl.setLayoutData(gdata);

//			//XXX must force JavaSourceViewer text widget to wrap:
//			border.setContent(signaturePreviewControl);
//			GridData borderData= new GridData(GridData.FILL_BOTH);
//			borderData.widthHint= gdata.widthHint;
//			borderData.heightHint= gdata.heightHint;
//			border.setLayoutData(borderData);
		}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:32,代码来源:ChangeSignatureWizard.java


示例15: createJavaSourceViewerConfiguration

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


示例16: setInput

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


示例17: affectsTextPresentation

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
@Override
protected boolean affectsTextPresentation(PropertyChangeEvent event) {
	return ((JavaSourceViewerConfiguration)getSourceViewerConfiguration()).affectsTextPresentation(event) || super.affectsTextPresentation(event);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:JavaEditor.java


示例18: configure

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
@Override
public void configure(SourceViewerConfiguration configuration) {

	/*
	 * Prevent access to colors disposed in unconfigure(), see:
	 *   https://bugs.eclipse.org/bugs/show_bug.cgi?id=53641
	 *   https://bugs.eclipse.org/bugs/show_bug.cgi?id=86177
	 */
	StyledText textWidget= getTextWidget();
	if (textWidget != null && !textWidget.isDisposed()) {
		Color foregroundColor= textWidget.getForeground();
		if (foregroundColor != null && foregroundColor.isDisposed())
			textWidget.setForeground(null);
		Color backgroundColor= textWidget.getBackground();
		if (backgroundColor != null && backgroundColor.isDisposed())
			textWidget.setBackground(null);
	}

	super.configure(configuration);
	if (configuration instanceof JavaSourceViewerConfiguration) {
		JavaSourceViewerConfiguration javaSVCconfiguration= (JavaSourceViewerConfiguration)configuration;
		fOutlinePresenter= javaSVCconfiguration.getOutlinePresenter(this, false);
		if (fOutlinePresenter != null)
			fOutlinePresenter.install(this);

		fStructurePresenter= javaSVCconfiguration.getOutlinePresenter(this, true);
		if (fStructurePresenter != null)
			fStructurePresenter.install(this);

		fHierarchyPresenter= javaSVCconfiguration.getHierarchyPresenter(this, true);
		if (fHierarchyPresenter != null)
			fHierarchyPresenter.install(this);

	}

	if (fPreferenceStore != null) {
		fPreferenceStore.addPropertyChangeListener(this);
		initializeViewerColors();
	}

	fIsConfigured= true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:43,代码来源:JavaSourceViewer.java


示例19: createSignaturePreview

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
private void createSignaturePreview(Composite composite) {
	Label previewLabel= new Label(composite, SWT.NONE);
	previewLabel.setText(RefactoringMessages.IntroduceParameterObjectWizard_signaturepreview_label);
	GridData gridData= new GridData(GridData.FILL_HORIZONTAL);
	gridData.horizontalSpan= 2;
	previewLabel.setLayoutData(gridData);

	// //XXX: use ViewForm to draw a flat border. Beware of common
	// problems
	// with wrapping layouts
	// //inside GridLayout. GridData must be constrained to force
	// wrapping.
	// See bug 9866 et al.
	// ViewForm border= new ViewForm(composite, SWT.BORDER | SWT.FLAT);

	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP, store);
	fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null));
	fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
	fSignaturePreview.adaptBackgroundColor(composite);
	fSignaturePreview.setDocument(fSignaturePreviewDocument);
	fSignaturePreview.setEditable(false);

	// Layouting problems with wrapped text: see
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866
	Control signaturePreviewControl= fSignaturePreview.getControl();
	PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl);
	GridData gdata= new GridData(GridData.FILL_BOTH);
	gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50);
	gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2);
	gdata.horizontalSpan= 2;
	signaturePreviewControl.setLayoutData(gdata);

	updateSignaturePreview();
	// //XXX must force JavaSourceViewer text widget to wrap:
	// border.setContent(signaturePreviewControl);
	// GridData borderData= new GridData(GridData.FILL_BOTH);
	// borderData.widthHint= gdata.widthHint;
	// borderData.heightHint= gdata.heightHint;
	// border.setLayoutData(borderData);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:42,代码来源:IntroduceParameterObjectWizard.java


示例20: createJavaSourceViewerConfiguration

import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; //导入依赖的package包/类
/**
 * Returns a new Java source viewer configuration.
 *
 * @return a new <code>JavaSourceViewerConfiguration</code>
 * @since 3.3
 */
protected JavaSourceViewerConfiguration createJavaSourceViewerConfiguration() {
	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	return new JavaSourceViewerConfiguration(textTools.getColorManager(), getPreferenceStore(), this, IJavaPartitions.JAVA_PARTITIONING);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:JavaEditor.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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