Java 类org.eclipse.jface.text.source.ISharedTextColors 实例源码

项目:Pydev    文件:BaseEditor.java   
@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);
    }
}
项目:codelens-eclipse    文件:LineNumberChangeRulerColumnPatch.java   
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);
    }
}
项目:pgcodekeeper    文件:SQLEditorSourceViewerConfiguration.java   
public SQLEditorSourceViewerConfiguration(ISharedTextColors sharedColors,
        IPreferenceStore store, SQLEditor editor) {
    super(store);
    fSharedColors= sharedColors;
    this.prefs = Activator.getDefault().getPreferenceStore();
    this.editor = editor;
}
项目:mesfavoris    文件:SpellcheckableMessageArea.java   
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;
}
项目:Pydev    文件:MinimapOverviewRuler.java   
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);
    }
}
项目:Hydrograph    文件:SourceViewer.java   
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();
}
项目:bts    文件:EmbeddedEditorFactory.java   
protected ISharedTextColors getSharedColors() {
    return EditorsUI.getSharedTextColors();
}
项目:bts    文件:WrappedSourceViewer.java   
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();
}
项目:statecharts    文件:StyledTextXtextAdapter.java   
protected ISharedTextColors getSharedColors() {
    return EditorsPlugin.getDefault().getSharedTextColors();
}
项目:PDFReporter-Studio    文件:StyledTextXtextAdapter.java   
protected ISharedTextColors getSharedColors() {
    return EditorsPlugin.getDefault().getSharedTextColors();
}
项目:APICloud-Studio    文件:XMLFormatterFactory.java   
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
        IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
    return new XMLSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
项目:APICloud-Studio    文件:CSSFormatterFactory.java   
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
        IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
    return new CSSSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
项目:APICloud-Studio    文件:JSFormatterFactory.java   
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
        IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
    return new JSSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
项目:APICloud-Studio    文件:IScriptFormatterFactory.java   
SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter);
项目:APICloud-Studio    文件:HTMLFormatterFactory.java   
public SourceViewerConfiguration createSimpleSourceViewerConfiguration(ISharedTextColors colorManager,
        IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter)
{
    return new HTMLSourceViewerConfiguration(preferenceStore, (AbstractThemeableEditor) editor);
}
项目:APICloud-Studio    文件:CommonLineNumberChangeRulerColumn.java   
/**
 * 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);
}
项目:idecore    文件:ApexCodeEditor.java   
@Override
protected ISharedTextColors getSharedColors() {
    ISharedTextColors sharedColors = ForceIdeUIPlugin.getSharedTextColors();
    return sharedColors;
}
项目:idecore    文件:ForceIdeUIPlugin.java   
public static ISharedTextColors getSharedTextColors() {
    if (sharedTextColors == null) {
        sharedTextColors = new SharedTextColors();
    }
    return sharedTextColors;
}
项目:goclipse    文件:AbstractProcessMessageConsole.java   
protected ISharedTextColors getColorManager() {
    return ColorManager.getDefault();
}
项目:Pydev    文件:CopiedOverviewRuler.java   
/**
 * Constructs a overview ruler of the given width using the given annotation
 * access and the given color manager.
 *
 * @param annotationAccess the annotation access
 * @param width the width of the vertical ruler
 * @param sharedColors the color manager
 * @param discolorTemporaryAnnotation <code>true</code> if temporary annotations should be discolored
 * @since 3.4
 */
public CopiedOverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors,
        boolean discolorTemporaryAnnotation) {
    fAnnotationAccess = annotationAccess;
    fWidth = width;
    fSharedTextColors = sharedColors;
    fIsTemporaryAnnotationDiscolored = discolorTemporaryAnnotation;
}
项目:Pydev    文件:CopiedOverviewRuler.java   
/**
 * Constructs a overview ruler of the given width using the given annotation access and the given
 * color manager.
 * <p><strong>Note:</strong> As of 3.4, temporary annotations are no longer discolored.
 * Use {@link #OverviewRuler(IAnnotationAccess, int, ISharedTextColors, boolean)} if you
 * want to keep the old behavior.</p>
 *
 * @param annotationAccess the annotation access
 * @param width the width of the vertical ruler
 * @param sharedColors the color manager
 */
public CopiedOverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors) {
    this(annotationAccess, width, sharedColors, false);
}