Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 118630 Details for
Bug 232752
[Semantic Highlighting] need to support second coloring capabilities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
semantic highlighting - example
232752_semantic_highlighting_test.patch (text/plain), 8.55 KB, created by
Nick Sandonato
on 2008-11-24 16:52:36 EST
(
hide
)
Description:
semantic highlighting - example
Filename:
MIME Type:
Creator:
Nick Sandonato
Created:
2008-11-24 16:52:36 EST
Size:
8.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.xml.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.xml.ui/plugin.xml,v >retrieving revision 1.98 >diff -u -r1.98 plugin.xml >--- plugin.xml 14 Oct 2008 15:02:43 -0000 1.98 >+++ plugin.xml 24 Nov 2008 21:45:15 -0000 >@@ -21,6 +21,22 @@ > id="org.eclipse.wst.xml.core.ui.catalogFileType.tld"> > </fileType> > </extension> >+ >+ <extension point="org.eclipse.wst.sse.ui.semanticHighlighting"> >+ <highlighting >+ class="org.eclipse.wst.xml.ui.internal.style.NamespaceHighlighting" >+ target="org.eclipse.jst.j2ee.webDD"> >+ </highlighting> >+ </extension> >+ >+ <extension point="org.eclipse.wst.sse.ui.semanticHighlighting"> >+ <highlighting >+ class="org.eclipse.wst.xml.ui.internal.style.NamespaceHighlightingForXML" >+ target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource"> >+ </highlighting> >+ </extension> >+ >+ > > <!--The org.eclipse.wst.xml.core.xmlsource content type is only for > handling some special cases of ill-formed xml in a reasonable >Index: src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java,v >retrieving revision 1.14 >diff -u -r1.14 XMLUIPreferenceInitializer.java >--- src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java 15 May 2008 21:52:01 -0000 1.14 >+++ src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java 24 Nov 2008 21:45:15 -0000 >@@ -132,6 +132,21 @@ > store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true); > store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, true); > store.setDefault(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, true); >+ >+ store.setDefault("xml.ui.highlighting.task.bold", true); >+ store.setDefault("xml.ui.highlighting.task.italic", false); >+ store.setDefault("xml.ui.highlighting.task.strikethrough", false); >+ store.setDefault("xml.ui.highlighting.task.underline", true); >+ store.setDefault("xml.ui.highlighting.task.enabled", true); >+ store.setDefault("xml.ui.highlighting.task.color", "#FF0000"); >+ >+ store.setDefault("xml.ui.highlighting.namespace.bold", true); >+ store.setDefault("xml.ui.highlighting.namespace.italic", false); >+ store.setDefault("xml.ui.highlighting.namespace.strikethrough", false); >+ store.setDefault("xml.ui.highlighting.namespace.underline", false); >+ store.setDefault("xml.ui.highlighting.namespace.enabled", true); >+ store.setDefault("xml.ui.highlighting.namespace.color", "#FF00FF"); >+ > } > > } >Index: src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlighting.java >=================================================================== >RCS file: src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlighting.java >diff -N src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlighting.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlighting.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,48 @@ >+package org.eclipse.wst.xml.ui.internal.style; >+ >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin; >+ >+public class NamespaceHighlighting extends NamespaceHighlightingForXML { >+ >+ public String getBoldPreferenceKey() { >+ // TODO Auto-generated method stub >+ return "xml.ui.highlighting.namespace.bold"; >+ } >+ >+ public String getColorPreferenceKey() { >+ // TODO Auto-generated method stub >+ return "xml.ui.highlighting.namespace.color"; >+ } >+ >+ public String getDisplayName() { >+ // TODO Auto-generated method stub >+ return "Namespace"; >+ } >+ >+ public String getEnabledPreferenceKey() { >+ // TODO Auto-generated method stub >+ return "xml.ui.highlighting.namespace.enabled"; >+ } >+ >+ public String getItalicPreferenceKey() { >+ // TODO Auto-generated method stub >+ return "xml.ui.highlighting.namespace.italic"; >+ } >+ >+ public IPreferenceStore getPreferenceStore() { >+ // TODO Auto-generated method stub >+ return XMLUIPlugin.getDefault().getPreferenceStore(); >+ } >+ >+ public String getStrikethroughPreferenceKey() { >+ // TODO Auto-generated method stub >+ return "xml.ui.highlighting.namespace.strikethrough"; >+ } >+ >+ public String getUnderlinePreferenceKey() { >+ // TODO Auto-generated method stub >+ return "xml.ui.highlighting.namespace.underline"; >+ } >+ >+} >Index: src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlightingForXML.java >=================================================================== >RCS file: src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlightingForXML.java >diff -N src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlightingForXML.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/xml/ui/internal/style/NamespaceHighlightingForXML.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,95 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.wst.xml.ui.internal.style; >+ >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.jface.text.Position; >+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; >+import org.eclipse.wst.sse.ui.ISemanticHighlighting; >+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; >+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin; >+ >+/** >+ * @author nick >+ * >+ */ >+public class NamespaceHighlightingForXML implements ISemanticHighlighting { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#consumes(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion) >+ */ >+ public Position[] consumes(IStructuredDocumentRegion region) { >+ Position[] p = null; >+ if (region.getType() == DOMRegionContext.XML_TAG_NAME) { >+ if (region.getFullText(region.getRegions().get(1)).contains(":")) { >+ p = new Position[1]; >+ p[0] = new Position(region.getStartOffset(region.getRegions().get(1)), region.getRegions().get(1).getLength()); >+ } >+ } >+ return p; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getBoldPreferenceKey() >+ */ >+ public String getBoldPreferenceKey() { >+ return "xml.ui.highlighting.task.bold"; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getColorPreferenceKey() >+ */ >+ public String getColorPreferenceKey() { >+ return "xml.ui.highlighting.task.color"; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getDisplayName() >+ */ >+ public String getDisplayName() { >+ return "Task"; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getEnabledPreferenceKey() >+ */ >+ public String getEnabledPreferenceKey() { >+ return "xml.ui.highlighting.task.enabled"; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getItalicPreferenceKey() >+ */ >+ public String getItalicPreferenceKey() { >+ return "xml.ui.highlighting.task.italic"; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getPreferenceStore() >+ */ >+ public IPreferenceStore getPreferenceStore() { >+ return XMLUIPlugin.getDefault().getPreferenceStore(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getStrikethroughPreferenceKey() >+ */ >+ public String getStrikethroughPreferenceKey() { >+ return "xml.ui.highlighting.task.strikethrough"; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.wst.sse.ui.internal.provisional.style.SemanticHighlighting#getUnderlinePreferenceKey() >+ */ >+ public String getUnderlinePreferenceKey() { >+ return "xml.ui.highlighting.task.underline"; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232752
:
105688
|
118625
|
118628
| 118630 |
123283