|
From: <ce...@us...> - 2004-01-13 17:15:56
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/text
In directory sc8-pr-cvs1:/tmp/cvs-serv31594/src/net/sourceforge/csseditor/text
Modified Files:
CssSourceViewerConfiguration.java
Log Message:
Cleanup
Index: CssSourceViewerConfiguration.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/text/CssSourceViewerConfiguration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssSourceViewerConfiguration.java 27 Dec 2003 16:53:09 -0000 1.2
--- CssSourceViewerConfiguration.java 13 Jan 2004 17:15:52 -0000 1.3
***************
*** 215,228 ****
ContentAssistant assistant = new ContentAssistant();
assistant.setContentAssistProcessor(
! new CssContentAssistProcessor(getPrefenceStore(), getProfile(),
! this.editor),
IDocument.DEFAULT_CONTENT_TYPE);
assistant.setInformationControlCreator(
getInformationControlCreator(sourceViewer));
! assistant.enableAutoInsert(getPrefenceStore().getBoolean(AUTOINSERT));
! assistant.enableAutoActivation(
! getPrefenceStore().getBoolean(AUTOACTIVATION));
! assistant.setAutoActivationDelay(
! getPrefenceStore().getInt(AUTOACTIVATION_DELAY));
assistant.setContextInformationPopupOrientation(
IContentAssistant.CONTEXT_INFO_BELOW);
--- 215,225 ----
ContentAssistant assistant = new ContentAssistant();
assistant.setContentAssistProcessor(
! new CssContentAssistProcessor(store, getProfile(), editor),
IDocument.DEFAULT_CONTENT_TYPE);
assistant.setInformationControlCreator(
getInformationControlCreator(sourceViewer));
! assistant.enableAutoInsert(store.getBoolean(AUTOINSERT));
! assistant.enableAutoActivation(store.getBoolean(AUTOACTIVATION));
! assistant.setAutoActivationDelay(store.getInt(AUTOACTIVATION_DELAY));
assistant.setContextInformationPopupOrientation(
IContentAssistant.CONTEXT_INFO_BELOW);
***************
*** 230,236 ****
IContentAssistant.PROPOSAL_STACKED);
assistant.setProposalSelectorBackground(getColorManager().getColor(
! PreferenceConverter.getColor(this.store, PROPOSALS_BACKGROUND)));
assistant.setProposalSelectorForeground(getColorManager().getColor(
! PreferenceConverter.getColor(this.store, PROPOSALS_FOREGROUND)));
return assistant;
}
--- 227,233 ----
IContentAssistant.PROPOSAL_STACKED);
assistant.setProposalSelectorBackground(getColorManager().getColor(
! PreferenceConverter.getColor(store, PROPOSALS_BACKGROUND)));
assistant.setProposalSelectorForeground(getColorManager().getColor(
! PreferenceConverter.getColor(store, PROPOSALS_FOREGROUND)));
return assistant;
}
***************
*** 288,302 ****
// Comments
! dr = new DefaultDamagerRepairer(this.textTools.getCommentScanner());
reconciler.setDamager(dr, CssPartitionScanner.CSS_COMMENT);
reconciler.setRepairer(dr, CssPartitionScanner.CSS_COMMENT);
// Strings
! dr = new DefaultDamagerRepairer(this.textTools.getStringScanner());
reconciler.setDamager(dr, CssPartitionScanner.CSS_STRING);
reconciler.setRepairer(dr, CssPartitionScanner.CSS_STRING);
// Code
! dr = new DefaultDamagerRepairer(this.textTools.getCodeScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
--- 285,299 ----
// Comments
! dr = new DefaultDamagerRepairer(textTools.getCommentScanner());
reconciler.setDamager(dr, CssPartitionScanner.CSS_COMMENT);
reconciler.setRepairer(dr, CssPartitionScanner.CSS_COMMENT);
// Strings
! dr = new DefaultDamagerRepairer(textTools.getStringScanner());
reconciler.setDamager(dr, CssPartitionScanner.CSS_STRING);
reconciler.setRepairer(dr, CssPartitionScanner.CSS_STRING);
// Code
! dr = new DefaultDamagerRepairer(textTools.getCodeScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
***************
*** 309,316 ****
*/
public IReconciler getReconciler(ISourceViewer sourceViewer) {
! if ((this.editor != null) && this.editor.isEditable()) {
Reconciler reconciler = new Reconciler();
IReconcilingStrategy strategy =
! new CssReconcilingStrategy(this.editor);
reconciler.setReconcilingStrategy(strategy,
IDocument.DEFAULT_CONTENT_TYPE);
--- 306,313 ----
*/
public IReconciler getReconciler(ISourceViewer sourceViewer) {
! if ((editor != null) && editor.isEditable()) {
Reconciler reconciler = new Reconciler();
IReconcilingStrategy strategy =
! new CssReconcilingStrategy(editor);
reconciler.setReconcilingStrategy(strategy,
IDocument.DEFAULT_CONTENT_TYPE);
***************
*** 330,334 ****
*/
public int getTabWidth(ISourceViewer sourceViewer) {
! return this.store.getInt(TAB_WIDTH);
}
--- 327,331 ----
*/
public int getTabWidth(ISourceViewer sourceViewer) {
! return store.getInt(TAB_WIDTH);
}
***************
*** 338,344 ****
public ITextHover getTextHover(ISourceViewer sourceViewer,
String contentType) {
! if (this.editor != null) {
! IDocumentProvider provider = this.editor.getDocumentProvider();
! IEditorInput input = this.editor.getEditorInput();
IAnnotationModel model = provider.getAnnotationModel(input);
return new CssAnnotationHover(model);
--- 335,341 ----
public ITextHover getTextHover(ISourceViewer sourceViewer,
String contentType) {
! if (editor != null) {
! IDocumentProvider provider = editor.getDocumentProvider();
! IEditorInput input = editor.getEditorInput();
IAnnotationModel model = provider.getAnnotationModel(input);
return new CssAnnotationHover(model);
***************
*** 355,368 ****
*/
private IColorManager getColorManager() {
! if (this.textTools != null) {
! return this.textTools.getColorManager();
}
return null;
}
- private IPreferenceStore getPrefenceStore() {
- return this.store;
- }
-
/**
* Returns the CSS profile for the resource currently being viewed, or
--- 352,361 ----
*/
private IColorManager getColorManager() {
! if (textTools != null) {
! return textTools.getColorManager();
}
return null;
}
/**
* Returns the CSS profile for the resource currently being viewed, or
***************
*** 373,380 ****
*/
private IProfile getProfile() {
! if (this.profile == null) {
IResource resource = null;
! if (this.editor != null) {
! IEditorInput input = this.editor.getEditorInput();
if (input instanceof IFileEditorInput) {
resource = ((IFileEditorInput) input).getFile();
--- 366,373 ----
*/
private IProfile getProfile() {
! if (profile == null) {
IResource resource = null;
! if (editor != null) {
! IEditorInput input = editor.getEditorInput();
if (input instanceof IFileEditorInput) {
resource = ((IFileEditorInput) input).getFile();
***************
*** 383,389 ****
IProfileManager mgr =
CssEditorPlugin.getDefault().getProfileManager();
! this.profile = mgr.getProfile(resource);
}
! return this.profile;
}
--- 376,382 ----
IProfileManager mgr =
CssEditorPlugin.getDefault().getProfileManager();
! profile = mgr.getProfile(resource);
}
! return profile;
}
|