本文整理汇总了Java中org.eclipse.jface.text.source.ISharedTextColors类的典型用法代码示例。如果您正苦于以下问题:Java ISharedTextColors类的具体用法?Java ISharedTextColors怎么用?Java ISharedTextColors使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISharedTextColors类属于org.eclipse.jface.text.source包,在下文中一共展示了ISharedTextColors类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createOverviewRuler
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
@Override
protected IOverviewRuler createOverviewRuler(ISharedTextColors sharedColors) {
// Note: create the minimap overview ruler regardless of whether it should be shown or not
// (the setting to show it will control what's drawn).
if (MinimapOverviewRulerPreferencesPage.useMinimap()) {
IOutlineModel outlineModel = (IOutlineModel) this.getAdapter(IOutlineModel.class);
IOverviewRuler ruler = new MinimapOverviewRuler(getAnnotationAccess(), sharedColors, outlineModel);
Iterator e = getAnnotationPreferences().getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference preference = (AnnotationPreference) e.next();
if (preference.contributesToHeader()) {
ruler.addHeaderAnnotationType(preference.getAnnotationType());
}
}
return ruler;
} else {
return super.createOverviewRuler(sharedColors);
}
}
示例2: create
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public static LineNumberChangeRulerColumn create(ISharedTextColors sharedColors) {
try {
ProxyFactory factory = new ProxyFactory();
factory.setSuperclass(LineNumberChangeRulerColumn.class);
factory.setHandler(new LineNumberChangeRulerColumnMethodHandler());
return (LineNumberChangeRulerColumn) factory.create(new Class[] { ISharedTextColors.class },
new Object[] { sharedColors });
} catch (Exception e) {
e.printStackTrace();
return new LineNumberChangeRulerColumn(sharedColors);
}
}
示例3: SQLEditorSourceViewerConfiguration
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public SQLEditorSourceViewerConfiguration(ISharedTextColors sharedColors,
IPreferenceStore store, SQLEditor editor) {
super(store);
fSharedColors= sharedColors;
this.prefs = Activator.getDefault().getPreferenceStore();
this.editor = editor;
}
示例4: configureAnnotationPreferences
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
private SourceViewerDecorationSupport configureAnnotationPreferences() {
ISharedTextColors textColors = EditorsUI.getSharedTextColors();
IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess();
final SourceViewerDecorationSupport support = new SourceViewerDecorationSupport(
sourceViewer, null, annotationAccess, textColors);
List annotationPreferences = new MarkerAnnotationPreferences()
.getAnnotationPreferences();
Iterator e = annotationPreferences.iterator();
while (e.hasNext())
support.setAnnotationPreference((AnnotationPreference) e.next());
support.install(EditorsUI.getPreferenceStore());
return support;
}
示例5: MinimapOverviewRuler
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public MinimapOverviewRuler(IAnnotationAccess annotationAccess, ISharedTextColors sharedColors,
IOutlineModel outlineModel) {
super(annotationAccess, MinimapOverviewRulerPreferencesPage.getMinimapWidth(), sharedColors);
this.fOutlineModel = outlineModel;
propertyListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (MinimapOverviewRulerPreferencesPage.MINIMAP_WIDTH.equals(event.getProperty())) {
updateWidth();
}
}
};
if (outlineModel != null) {
modelListener = new ICallbackListener<IOutlineModel>() {
@Override
public Object call(IOutlineModel obj) {
lastModelChange = System.currentTimeMillis();
update();
return null;
}
};
ICallbackWithListeners<IOutlineModel> onModelChangedListener = outlineModel.getOnModelChangedCallback();
onModelChangedListener.registerListener(modelListener);
}
}
示例6: SourceViewer
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public SourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
boolean showAnnotationsOverview, int styles, IAnnotationAccess annotationAccess, ISharedTextColors sharedColors,
IDocument document)
{
super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, SWT.BOLD);
int id = currentId++;
filename = VIEWER_CLASS_NAME + id++ + ".java";
this.sharedColors=sharedColors;
this.annotationAccess=annotationAccess;
this.fOverviewRuler=overviewRuler;
oldAnnotations= new HashMap<ProjectionAnnotation, Position>();
IJavaProject javaProject = JavaCore.create(BuildExpressionEditorDataSturcture.INSTANCE.getCurrentProject());
try
{
IPackageFragmentRoot[] ipackageFragmentRootList=javaProject.getPackageFragmentRoots();
IPackageFragmentRoot ipackageFragmentRoot=null;
for(IPackageFragmentRoot tempIpackageFragmentRoot:ipackageFragmentRootList)
{
if(tempIpackageFragmentRoot.getKind()==IPackageFragmentRoot.K_SOURCE
&& StringUtils.equals(PathConstant.TEMP_BUILD_PATH_SETTINGS_FOLDER,tempIpackageFragmentRoot.getPath().removeFirstSegments(1).toString()))
{
ipackageFragmentRoot=tempIpackageFragmentRoot;
break;
}
}
IPackageFragment compilationUnitPackage= ipackageFragmentRoot.createPackageFragment(HYDROGRAPH_COMPILATIONUNIT_PACKAGE, true, new NullProgressMonitor());
compilatioUnit= compilationUnitPackage.createCompilationUnit(filename,document.get(),true, new NullProgressMonitor());
}
catch (Exception exception) {
LOGGER.warn("Exception occurred while initializing source viewer", exception);
} finally {
if (javaProject != null) {
try {
javaProject.close();
} catch (JavaModelException javaModelException) {
LOGGER.warn("Exception occurred while closing java-project", javaModelException);
}
}
}
initializeViewer(document);
updateContents();
}
示例7: getSharedColors
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
protected ISharedTextColors getSharedColors() {
return EditorsUI.getSharedTextColors();
}
示例8: createPartControl
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public void createPartControl(Composite parent)
{
int VERTICAL_RULER_WIDTH = 12;
int styles = SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
ISharedTextColors sharedColors = EditorsPlugin.getDefault().getSharedTextColors();
IOverviewRuler overviewRuler = new OverviewRuler(null, VERTICAL_RULER_WIDTH, sharedColors);
CompositeRuler ruler = new CompositeRuler(VERTICAL_RULER_WIDTH);
_document = new Document();
_document.set(_docString);
_annotationModel = new AnnotationModel();
_annotationModel.connect(_document);
_sourceViewer = new SourceViewer(parent, ruler, overviewRuler, true, styles);
_sourceViewer.configure(new SourceViewerConfiguration());
_sds = new SourceViewerDecorationSupport(_sourceViewer, overviewRuler, null, sharedColors);
AnnotationPreference ap = new AnnotationPreference();
ap.setColorPreferenceKey(ANNO_KEY_COLOR);
ap.setHighlightPreferenceKey(ANNO_KEY_HIGHLIGHT);
ap.setVerticalRulerPreferenceKey(ANNO_KEY_VERTICAL);
ap.setOverviewRulerPreferenceKey(ANNO_KEY_OVERVIEW);
ap.setTextPreferenceKey(ANNO_KEY_TEXT);
ap.setAnnotationType(ANNO_TYPE);
_sds.setAnnotationPreference(ap);
// _sds.install(EditorsPlugin.getDefault().getPreferenceStore());
_sourceViewer.setDocument(_document, _annotationModel);
_sourceViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
ruler.addDecorator(0, new LineNumberRulerColumn());
Annotation annotation = new Annotation(false);
annotation.setType(ANNO_TYPE);
Position position = new Position(0, 4);
_annotationModel.addAnnotation(annotation, position);
parent.layout();
}
示例9: getSharedColors
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
protected ISharedTextColors getSharedColors() {
return EditorsPlugin.getDefault().getSharedTextColors();
}
示例10: createSimpleSourceViewerConfiguration
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
return new XMLSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
示例11: createSimpleSourceViewerConfiguration
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
return new CSSSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
示例12: createSimpleSourceViewerConfiguration
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
return new JSSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
示例13: createSimpleSourceViewerConfiguration
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter);
示例14: createSimpleSourceViewerConfiguration
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
return new HTMLSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
示例15: CommonLineNumberChangeRulerColumn
import org.eclipse.jface.text.source.ISharedTextColors; //导入依赖的package包/类
/**
* Creates a new instance.
*
* @param sharedColors the shared colors provider to use
*/
public CommonLineNumberChangeRulerColumn(ISharedTextColors sharedColors) {
Assert.isNotNull(sharedColors);
fRevisionPainter= new RevisionPainter(this, sharedColors);
fDiffPainter= new DiffPainter(this, sharedColors);
}