@Override protected ISourceViewer createTypeScriptSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) { return new AdaptedSourceViewer(parent, verticalRuler, overviewRuler, isOverviewRulerVisible, styles, store) { @Override protected void handleDispose() { super.handleDispose(); // dispose the compilation unit adapter dispose(); fEditor.remove(this); if (fEditor.isEmpty()) { fEditor = null; fSite = null; } fSourceViewer.remove(this); if (fSourceViewer.isEmpty()) fSourceViewer = null; } }; }
@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); } }
public FtcSourceViewer(IResource resource, Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean overviewRulerVisible, int styles) { super(parent, ruler, overviewRuler, overviewRulerVisible, styles); this.resource = resource; this.syntaxColoring = new SyntaxColoring(this); }
@Override protected ProjectionViewer createPreviewViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { return new ScriptSourceViewer( parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store); }
public BaseSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IVerticalIndentGuidePreferencesProvider verticalIndentPrefs) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles); verticalLinesPainter = new VerticalIndentGuidesPainter( getIndentGuide(verticalIndentPrefs)); StyledText styledText = this.getTextWidget(); verticalLinesPainter.setStyledText(styledText); styledText.addPaintListener(verticalLinesPainter); styledText.setLeftMargin(Math.max(styledText.getLeftMargin(), 2)); }
@Override protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { IOverviewRuler overviewRuler = getOverviewRuler(); PySourceViewer viewer = new PySourceViewer(parent, ruler, overviewRuler, isOverviewRulerVisible(), styles, this); //ensure decoration support has been created and configured. getSourceViewerDecorationSupport(viewer); return viewer; }
public PySourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles, final PyEditProjection projection) { super(parent, ruler, overviewRuler, showsAnnotationOverview, styles, new PyAbstractIndentGuidePreferencesProvider() { @Override public int getTabWidth() { return ((PyEdit) projection).getIndentPrefs().getTabWidth(); } }); this.projection = new WeakReference<PyEdit>((PyEdit) projection); }
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(); }
public TMViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles); init(); }
public EiffelSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showAnnotationOverview, int styles, EiffelEditor editor) { super(parent, ruler, overviewRuler, showAnnotationOverview, styles); }
public EiffelSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showAnnotationOverview, int styles, EiffelEditor editor) { super(parent, ruler, overviewRuler, showAnnotationOverview, styles); eiffelEditor = editor; }
/** {@inheritDoc} */ @Override public XtextSourceViewer createSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) { return new FixedXtextSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
/** Creates new source viewer. */ public FluentMkSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean isOverviewRulerShowing, int styles, IPreferenceStore store) { super(parent, ruler, overviewRuler, isOverviewRulerShowing, styles); setPreferenceStore(store); }
public AdaptedSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store); }
public TypeScriptSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store); }
protected ISourceViewer createTypeScriptSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) { return new TypeScriptSourceViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles, store); }
XtextSourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles);
public XtextSourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) { return new XtextSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
public XtextSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) { super(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
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(); }
/** * @see org.eclipse.xtext.ui.editor.XtextSourceViewer.Factory#createSourceViewer(org.eclipse.swt.widgets.Composite, * org.eclipse.jface.text.source.IVerticalRuler, * org.eclipse.jface.text.source.IOverviewRuler, boolean, int) */ @Override public XtextSourceViewer createSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) { return new GamaSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
@Override protected ISourceViewer createJavaSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) { return new AdaptedSourceViewer(parent, verticalRuler, overviewRuler, isOverviewRulerVisible, styles, store); }
public JavaSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles); setPreferenceStore(store); }
public LangSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles); }
public ProjectionViewerExt(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) { super(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
/** * Constructs a new source viewer. The vertical ruler is initially visible. * The overview ruler visibility is controlled by the value of * <code>showAnnotationsOverview</code>. The viewer has not yet been * initialized with a source viewer configuration. * * @param parent * the parent of the viewer's control * @param verticalRuler * the vertical ruler used by this source viewer * @param overviewRuler * the overview ruler * @param showAnnotationsOverview * {@code true} if the overview ruler should be visible, * {@code false} otherwise * @param styles * the SWT style bits for the viewer's control, */ public HyperlinkSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles) { super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles); }
/** * @param parent * @param verticalRuler * @param overviewRuler * @param showAnnotationsOverview * @param styles * @param store * @return */ private ProjectionViewer createPreviewViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { ProjectionViewer viewer = new ProjectionViewer(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles); ThemePlugin.getDefault().getControlThemerFactory().apply(viewer); return viewer; }
/** * Creates a new instance of {@link FixedXtextSourceViewer}. * * @param parent * the {@link Composite} parent * @param ruler * the {@link IVerticalRuler} * @param overviewRuler * the {@link IOverviewRuler} * @param showsAnnotationOverview * boolean flag whether to show annotation overview * @param styles * styles flags */ public FixedXtextSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) { super(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
/** * @param parent * @param ruler * @param overviewRuler * @param showsAnnotationOverview * @param styles */ public GamaSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) { super(parent, ruler, overviewRuler, showsAnnotationOverview, styles); isOverviewVisible = showsAnnotationOverview && overviewRuler != null; }
/** * @param parent * @param ruler * @param overviewRuler * @param showsAnnotationOverview * @param styles */ public CommonProjectionViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) { super(parent, ruler, overviewRuler, showsAnnotationOverview, styles); }
/** * Creates the Java source viewer to be used by this editor. * Subclasses may re-implement this method. * * @param parent the parent control * @param verticalRuler the vertical ruler * @param overviewRuler the overview ruler * @param isOverviewRulerVisible <code>true</code> if the overview ruler is visible * @param styles style bits, <code>SWT.WRAP</code> is currently not supported * @param store the preference store * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int) * @return the source viewer */ protected ISourceViewer createJavaSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) { return new JavaSourceViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles, store); }