private SourceViewerConfiguration getSourceViewerConfiguration(JavaTextTools textTools) { IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); return new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, getDocumentPartitioning()); }
@Override protected void configureTextViewer(TextViewer textViewer) { if (!(textViewer instanceof SourceViewer)) return; if (fPreferenceStore == null) { fSourceViewerConfigurations= new ArrayList<>(3); fPreferenceStore= JavaPlugin.getDefault().getCombinedPreferenceStore(); fPreferenceChangeListener= new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { Iterator<SourceViewerConfiguration> iter= fSourceViewerConfigurations.iterator(); while (iter.hasNext()) ((PropertiesFileSourceViewerConfiguration)iter.next()).handlePropertyChangeEvent(event); invalidateTextPresentation(); } }; fPreferenceStore.addPropertyChangeListener(fPreferenceChangeListener); } SourceViewerConfiguration sourceViewerConfiguration= new PropertiesFileSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), fPreferenceStore, null, getDocumentPartitioning()); fSourceViewerConfigurations.add(sourceViewerConfiguration); ((SourceViewer)textViewer).configure(sourceViewerConfiguration); }
@Override protected void configureTextViewer(TextViewer textViewer) { if (!(textViewer instanceof SourceViewer)) return; if (fPreferenceStore == null) { fSourceViewerConfigurations= new ArrayList<>(3); fPreferenceStore= JavaPlugin.getDefault().getCombinedPreferenceStore(); fPreferenceChangeListener= new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { Iterator<SourceViewerConfiguration> iter= fSourceViewerConfigurations.iterator(); while (iter.hasNext()) ((PropertiesFileSourceViewerConfiguration)iter.next()).handlePropertyChangeEvent(event); invalidateTextPresentation(); } }; fPreferenceStore.addPropertyChangeListener(fPreferenceChangeListener); } SourceViewerConfiguration sourceViewerConfiguration= new PropertiesFileSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), fPreferenceStore, null, getDocumentPartitioning()); fSourceViewerConfigurations.add(sourceViewerConfiguration); ((SourceViewer)textViewer).configure(sourceViewerConfiguration); }
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); }
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); }
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); }
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); }
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); }
/** * Creates a new properties file editor. */ public PropertiesFileEditor() { 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)); }
private Control createPreviewer(Composite parent) { IPreferenceStore store= new ChainedPreferenceStore(new IPreferenceStore[] { fOverlayStore, JavaPlugin.getDefault().getCombinedPreferenceStore()}); fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, store); fColorManager= new JavaColorManager(false); PropertiesFileSourceViewerConfiguration configuration= new PropertiesFileSourceViewerConfiguration(fColorManager, store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING); fPreviewViewer.configure(configuration); Font font= JFaceResources.getFont(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT); fPreviewViewer.getTextWidget().setFont(font); new SourcePreviewerUpdater(fPreviewViewer, configuration, store); fPreviewViewer.setEditable(false); String content= loadPreviewContentFromFile("PropertiesFileEditorColorSettingPreviewCode.txt"); //$NON-NLS-1$ IDocument document= new Document(content); PropertiesFileDocumentSetupParticipant.setupDocument(document); fPreviewViewer.setDocument(document); return fPreviewViewer.getControl(); }
private Control createPreviewer(Composite parent) { IPreferenceStore store= new ChainedPreferenceStore(new IPreferenceStore[] { fOverlayStore, JavaPlugin.getDefault().getCombinedPreferenceStore()}); fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, store); fColorManager= new JavaColorManager(false); PropertiesFileSourceViewerConfiguration configuration= new PropertiesFileSourceViewerConfiguration(fColorManager, store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING); fPreviewViewer.configure(configuration); Font font= JFaceResources.getFont(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT); fPreviewViewer.getTextWidget().setFont(font); new SourcePreviewerUpdater(fPreviewViewer, configuration, store); fPreviewViewer.setEditable(false); String content= loadPreviewContentFromFile("PropertiesFileEditorColorSettingPreviewCode.txt"); //$NON-NLS-1$ IDocument document= new Document(content); PropertiesFileDocumentSetupParticipant.setupDocument(document); fPreviewViewer.setDocument(document); return fPreviewViewer.getControl(); }
private Control createPreviewer(Composite parent) { IPreferenceStore store= new ChainedPreferenceStore(new IPreferenceStore[] { fOverlayStore, JavaPlugin.getDefault().getCombinedPreferenceStore()}); fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, store); fColorManager= new JavaColorManager(false); PropertiesFileSourceViewerConfiguration configuration= new PropertiesFileSourceViewerConfiguration(fColorManager, store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING); fPreviewViewer.configure(configuration); Font font= JFaceResources.getFont(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT); fPreviewViewer.getTextWidget().setFont(font); new SourcePreviewerUpdater(fPreviewViewer, configuration, store); fPreviewViewer.setEditable(false); String content= loadPreviewContentFromFile("PropertiesFileEditorColorSettingPreviewCode.txt"); //$NON-NLS-1$ IDocument document= new Document(content); PropertiesFileDocumentSetupParticipant.setupDocument(document); fPreviewViewer.setDocument(document); return fPreviewViewer.getControl(); }
@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() { @Override public void propertyChange(PropertyChangeEvent event) { if (AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS.equals(event.getProperty())) handlePreferenceStoreChanged(event); } }; EditorsUI.getPreferenceStore().addPropertyChangeListener(fPropertyChangeListener); }
@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() { @Override public void propertyChange(PropertyChangeEvent event) { if (AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS.equals(event.getProperty())) handlePreferenceStoreChanged(event); } }; EditorsUI.getPreferenceStore().addPropertyChangeListener(fPropertyChangeListener); }
} 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());
} else if ("properties".equals(textType)) { //$NON-NLS-1$ PropertiesFileDocumentSetupParticipant.setupDocument(document); fSourceViewer.configure(new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING)); fSourceViewer.getTextWidget().setOrientation(SWT.LEFT_TO_RIGHT); } else {
} else if ("properties".equals(textType)) { //$NON-NLS-1$ PropertiesFileDocumentSetupParticipant.setupDocument(document); fSourceViewer.configure(new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING)); fSourceViewer.getTextWidget().setOrientation(SWT.LEFT_TO_RIGHT); } else {