@Override protected void handleDispose() { unconfigure(); disposeVisualAnnotationModel(); fVerticalRuler= null; fOverviewRuler= null; // http://dev.eclipse.org/bugs/show_bug.cgi?id=15300 fComposite= null; super.handleDispose(); }
@Override protected void handleDispose() { unconfigure(); disposeVisualAnnotationModel(); fVerticalRuler= null; fOverviewRuler= null; // http://dev.eclipse.org/bugs/show_bug.cgi?id=15300 fComposite= null; super.handleDispose(); }
@Override public void propertyChange(PropertyChangeEvent event) { if (colorPreferenceKeys.contains(event.getProperty())) { if (getSourceViewer() instanceof SourceViewer) { ((SourceViewer) getSourceViewer()).unconfigure(); initializeEditor(); getSourceViewer().configure(sourceViewerConfiguration); } } } };
public void configure(SourceViewerConfiguration configuration) { if (isConfigured ) getSourceViewer().unconfigure(); isConfigured = true; getSourceViewer().configure(configuration); }
@Override protected void configureTextViewer(TextViewer viewer) { if (viewer instanceof SourceViewer) { SourceViewer sourceViewer= (SourceViewer)viewer; if (fSourceViewer == null) fSourceViewer= new ArrayList<>(); if (!fSourceViewer.contains(sourceViewer)) fSourceViewer.add(sourceViewer); JavaTextTools tools= JavaCompareUtilities.getJavaTextTools(); if (tools != null) { IEditorInput editorInput= getEditorInput(sourceViewer); sourceViewer.unconfigure(); if (editorInput == null) { sourceViewer.configure(getSourceViewerConfiguration(sourceViewer, null)); return; } getSourceViewerConfiguration(sourceViewer, editorInput); } } }
@Override protected void configureTextViewer(TextViewer viewer) { if (viewer instanceof SourceViewer) { SourceViewer sourceViewer= (SourceViewer)viewer; if (fSourceViewer == null) fSourceViewer= new ArrayList<>(); if (!fSourceViewer.contains(sourceViewer)) fSourceViewer.add(sourceViewer); JavaTextTools tools= JavaCompareUtilities.getJavaTextTools(); if (tools != null) { IEditorInput editorInput= getEditorInput(sourceViewer); sourceViewer.unconfigure(); if (editorInput == null) { sourceViewer.configure(getSourceViewerConfiguration(sourceViewer, null)); return; } getSourceViewerConfiguration(sourceViewer, editorInput); } } }
public void setInput(Object input) { if (input instanceof ICompareInput) { IJavaProject project= getJavaProject((ICompareInput)input); if (project != null) { setPreferenceStore(createChainedPreferenceStore(project)); if (fSourceViewer != null) { Iterator iterator= fSourceViewer.iterator(); while (iterator.hasNext()) { SourceViewer sourceViewer= (SourceViewer) iterator.next(); sourceViewer.unconfigure(); sourceViewer.configure(getSourceViewerConfiguration()); } } } } super.setInput(input); }
/** * Re-initialize the editor after changes have been done to the preferences. */ void reinitialize(){ if( getSourceViewer() instanceof SourceViewer){ ((SourceViewer) getSourceViewer()).unconfigure(); initializeEditor(); getSourceViewer().configure(sourceViewerConfig); } else { String msg = "Expected source viewer to be of type SourceViewer, but is wasn't. "; msg += "Might cause problems with preferences."; YEditLog.logger.warning(msg); } }
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)); }
@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)); }
protected void configureSourceViewer(SourceViewer sourceViewer) { IEditorInput editorInput = getEditorInput(sourceViewer); SourceViewerConfiguration sourceViewerConfiguration = createSourceViewerConfiguration(sourceViewer, editorInput); sourceViewer.unconfigure(); sourceViewer.configure(sourceViewerConfiguration); if (sourceViewer.getDocument() instanceof IXtextDocument) { IXtextDocument xtextDocument = (IXtextDocument) sourceViewer.getDocument(); if (!xtextDocument.readOnly(TEST_EXISTING_XTEXT_RESOURCE)) { String[] configuredContentTypes = sourceViewerConfiguration.getConfiguredContentTypes(sourceViewer); for (String contentType : configuredContentTypes) { sourceViewer.removeTextHovers(contentType); } sourceViewer.setHyperlinkDetectors(null, sourceViewerConfiguration.getHyperlinkStateMask(sourceViewer)); } } }
fModuleInfoMode= moduleInfoMode; fViewerConfiguration= fModuleInfoMode ? fViewerConfigurationModule : fViewerConfigurationStandard; fSourceViewer.unconfigure(); fSourceViewer.configure(fViewerConfiguration);
@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)); }
private void updateSourceViewer(ITextFileBufferManager manager, IFile sourceFile) { IDocument document = manager.getTextFileBuffer(sourceFile.getFullPath(), LocationKind.IFILE).getDocument(); TreeItem item = fInputViewer.getTree().getSelection()[0]; IPluginModelBase model = ((ModelChange) item.getParentItem().getData()).getParentModel(); if (fSourceViewer.getDocument() != null) fSourceViewer.unconfigure(); if (sourceFile.getFileExtension().equalsIgnoreCase("xml")) { //$NON-NLS-1$ fSourceViewer.configure(fXMLConfig); fXMLSetupParticipant.setup(document); } else { fSourceViewer.configure(fManifestConfig); fManifestSetupParticipant.setup(document); } fSourceViewer.setDocument(document); updatePropertiesLabel(model); }
/** * Configures the details viewer for the debug model * currently being displayed */ protected void configureDetailsViewer() { LazyModelPresentation mp = (LazyModelPresentation)fModelPresentation.getPresentation(getDebugModel()); SourceViewerConfiguration svc = null; if (mp != null) { try { svc = mp.newDetailsViewerConfiguration(); } catch (CoreException e) { DebugUIPlugin.errorDialog(fSourceViewer.getControl().getShell(), DetailMessages.DefaultDetailPane_Error_1, DetailMessages.DefaultDetailPane_2, e); } } if (svc == null) { svc = new SourceViewerConfiguration(); fSourceViewer.setEditable(false); } fSourceViewer.unconfigure(); fSourceViewer.configure(svc); //update actions that depend on the configuration of the source viewer if (isInView()){ updateAction(DETAIL_ASSIGN_VALUE_ACTION); updateAction(DETAIL_CONTENT_ASSIST_ACTION); } if (isInView()){ createUndoRedoActions(); } }
fSourceViewer.unconfigure(); String textType= textFileChange.getTextType(); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
fSourceViewer.unconfigure(); String textType= textFileChange.getTextType(); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
fSourceViewer.unconfigure(); String textType= textFileChange.getTextType(); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();