Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-20 10:25:55 +0000
committerTom Schindl2014-01-20 10:25:55 +0000
commit7aec78df446dc9af59dacb42001d388fcab7b490 (patch)
tree7b875a93672ba5099be2d4ce7463b1440b139fa2
parentb1784c5b48f7cb52d769c85eecbb97da701cbc16 (diff)
downloadorg.eclipse.efxclipse-7aec78df446dc9af59dacb42001d388fcab7b490.tar.gz
org.eclipse.efxclipse-7aec78df446dc9af59dacb42001d388fcab7b490.tar.xz
org.eclipse.efxclipse-7aec78df446dc9af59dacb42001d388fcab7b490.zip
fixed compiler settings
-rwxr-xr-xbundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/contentassist/CssExtDslProposalProvider.java2
-rwxr-xr-xbundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/doc/CssExtDocParser.java384
2 files changed, 194 insertions, 192 deletions
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/contentassist/CssExtDslProposalProvider.java b/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/contentassist/CssExtDslProposalProvider.java
index 720dbd456..31f146bc8 100755
--- a/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/contentassist/CssExtDslProposalProvider.java
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/contentassist/CssExtDslProposalProvider.java
@@ -14,5 +14,5 @@ package org.eclipse.fx.ide.css.cssext.ui.contentassist;
* see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#contentAssist on how to customize content assistant
*/
public class CssExtDslProposalProvider extends AbstractCssExtDslProposalProvider {
-
+ //Nothing todo
}
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/doc/CssExtDocParser.java b/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/doc/CssExtDocParser.java
index 919dc319b..1ed182260 100755
--- a/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/doc/CssExtDocParser.java
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.ui/src/org/eclipse/fx/ide/css/cssext/ui/doc/CssExtDocParser.java
@@ -20,18 +20,9 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.fx.ide.css.cssext.ui.JavaDocParser;
-import org.eclipse.xtext.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.ui.IImageHelper;
-import org.eclipse.xtext.ui.editor.hover.html.XtextElementLinks;
-import org.eclipse.xtext.ui.label.DeclarativeLabelProvider;
import org.eclipse.fx.ide.css.cssDsl.ClassSelector;
-import org.eclipse.fx.ide.css.cssDsl.ColorTok;
-import org.eclipse.fx.ide.css.cssDsl.CssTok;
import org.eclipse.fx.ide.css.cssDsl.ElementSelector;
import org.eclipse.fx.ide.css.cssDsl.IdSelector;
-import org.eclipse.fx.ide.css.cssDsl.IdentifierTok;
-import org.eclipse.fx.ide.css.cssDsl.css_declaration;
import org.eclipse.fx.ide.css.cssDsl.css_property;
import org.eclipse.fx.ide.css.cssDsl.simple_selector;
import org.eclipse.fx.ide.css.cssext.ICssExtManager;
@@ -54,164 +45,164 @@ import org.eclipse.fx.ide.css.cssext.cssExtDsl.Doku;
import org.eclipse.fx.ide.css.cssext.cssExtDsl.ElementDefinition;
import org.eclipse.fx.ide.css.cssext.cssExtDsl.PackageDefinition;
import org.eclipse.fx.ide.css.cssext.cssExtDsl.PropertyDefinition;
+import org.eclipse.fx.ide.css.cssext.ui.JavaDocParser;
+import org.eclipse.xtext.naming.IQualifiedNameProvider;
+import org.eclipse.xtext.ui.editor.hover.html.XtextElementLinks;
import com.google.inject.Inject;
+/**
+ * Parser for the external documentation
+ */
public class CssExtDocParser {
- private @Inject ICssExtManager cssExtManager;
- private @Inject XtextElementLinks elementLinks;
- private @Inject IQualifiedNameProvider nameProvider;
- private @Inject DeclarativeLabelProvider labelProvider;
- private @Inject IImageHelper imageHelper;
-
- public String translateRule(CSSRule r) {
- String result = "";
+ private @Inject
+ ICssExtManager cssExtManager;
+ private @Inject
+ XtextElementLinks elementLinks;
+ private @Inject
+ IQualifiedNameProvider nameProvider;
+
+ // private @Inject DeclarativeLabelProvider labelProvider;
+ // private @Inject IImageHelper imageHelper;
+
+ String translateRule(CSSRule r) {
+ String result = ""; //$NON-NLS-1$
if (r instanceof CSSRuleOr) {
- Iterator<CSSRule> it =((CSSRuleOr) r).getOrs().iterator();
+ Iterator<CSSRule> it = ((CSSRuleOr) r).getOrs().iterator();
while (it.hasNext()) {
result += translateRule(it.next());
if (it.hasNext()) {
- result +=" | ";
+ result += " | "; //$NON-NLS-1$
}
}
- }
- else if (r instanceof CSSRuleConcat) {
- Iterator<CSSRule> it =((CSSRuleConcat) r).getConc().iterator();
+ } else if (r instanceof CSSRuleConcat) {
+ Iterator<CSSRule> it = ((CSSRuleConcat) r).getConc().iterator();
while (it.hasNext()) {
result += translateRule(it.next());
if (it.hasNext()) {
- result +=" ";
+ result += " "; //$NON-NLS-1$
}
}
- }
- else if (r instanceof CSSRuleConcatWithoutSpace) {
- Iterator<CSSRule> it =((CSSRuleConcatWithoutSpace) r).getConc().iterator();
+ } else if (r instanceof CSSRuleConcatWithoutSpace) {
+ Iterator<CSSRule> it = ((CSSRuleConcatWithoutSpace) r).getConc().iterator();
while (it.hasNext()) {
result += translateRule(it.next());
if (it.hasNext()) {
- result +=" ~ ";
+ result += " ~ "; //$NON-NLS-1$
}
}
- }
- else if (r instanceof CSSRuleBracket) {
- result +="[ " + translateRule(((CSSRuleBracket) r).getInner()) + " ]";
- }
- else if (r instanceof CSSRuleXor) {
- Iterator<CSSRule> it =((CSSRuleXor) r).getXors().iterator();
+ } else if (r instanceof CSSRuleBracket) {
+ result += "[ " + translateRule(((CSSRuleBracket) r).getInner()) + " ]"; //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (r instanceof CSSRuleXor) {
+ Iterator<CSSRule> it = ((CSSRuleXor) r).getXors().iterator();
while (it.hasNext()) {
result += translateRule(it.next());
if (it.hasNext()) {
- result +=" || ";
+ result += " || "; //$NON-NLS-1$
}
}
- }
- else if (r instanceof CSSRuleLiteral) {
+ } else if (r instanceof CSSRuleLiteral) {
result += ((CSSRuleLiteral) r).getValue();
- }
- else if (r instanceof CSSNumLiteral) {
- result += ((CSSNumLiteral)r).getValue();
- }
- else if (r instanceof CSSRuleRef) {
- result += elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, ((CSSRuleRef) r).getRef(), "&lt;" + ((CSSRuleRef) r).getRef().getName() + "&gt;");
- }
- else if (r instanceof CSSRulePostfix) {
+ } else if (r instanceof CSSNumLiteral) {
+ result += ((CSSNumLiteral) r).getValue();
+ } else if (r instanceof CSSRuleRef) {
+ result += this.elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, ((CSSRuleRef) r).getRef(), "&lt;" + ((CSSRuleRef) r).getRef().getName() + "&gt;"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (r instanceof CSSRulePostfix) {
result += translateRule(((CSSRulePostfix) r).getRule()) + ((CSSRulePostfix) r).getCardinality();
- }
- else if (r instanceof CSSRuleRegex) {
+ } else if (r instanceof CSSRuleRegex) {
result += ((CSSRuleRegex) r).getRegex();
- }
- else if (r instanceof CSSRuleSymbol) {
+ } else if (r instanceof CSSRuleSymbol) {
result += ((CSSRuleSymbol) r).getSymbol();
- }
- else if (r instanceof CSSType) {
+ } else if (r instanceof CSSType) {
result = ((CSSType) r).getType();
- }
- else {
- if (r == null) result = "<code>null</code>";
- else result = "UNKNOWN: " + r;
+ } else {
+ if (r == null)
+ result = "<code>null</code>"; //$NON-NLS-1$
+ else
+ result = "UNKNOWN: " + r;
}
return result;
}
-
+
protected String getDocForProperty(PropertyDefinition property) {
if (property != null) {
- String rule = "syntax = " +translateRule(property.getRule()) + "<br>";
- String javadoc = prepareDoku(property.getDoku());
- String defaultVal = property.getDefault()==null?"":"default = " + property.getDefault() + "<br>";
+ String rule = "syntax = " + translateRule(property.getRule()) + "<br>"; //$NON-NLS-1$ //$NON-NLS-2$
+ String javadoc = prepareDoku(property.getDoku());
+ // String defaultVal = property.getDefault()==null?"":"default = " + property.getDefault() + "<br>"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
// TODO complete defaultvalue at language level and add here
- return formatRule(rule) + javadoc;
+ return formatRule(rule) + javadoc;
}
return "no documentation found";
}
-
+
protected String getDocForProperty(IFile f, String propertyName) {
- return getDocForProperty(findPropertyByName(f,propertyName));
+ return getDocForProperty(findPropertyByName(f, propertyName));
}
public String getDocumentation(IFile f, EObject o) {
// css ext lang elements
if (o instanceof ElementDefinition) {
- return getDocForElement((ElementDefinition)o);
+ return getDocForElement((ElementDefinition) o);
}
if (o instanceof PropertyDefinition) {
- return getDocForProperty((PropertyDefinition)o);
+ return getDocForProperty((PropertyDefinition) o);
}
if (o instanceof CSSRuleDefinition) {
return getDocumentationForRule((CSSRuleDefinition) o);
}
if (o instanceof PropertyDefinition) {
- return getDocForProperty((PropertyDefinition)o);
+ return getDocForProperty((PropertyDefinition) o);
}
if (o instanceof PackageDefinition) {
- return getDocForPackage((PackageDefinition)o);
+ return getDocForPackage((PackageDefinition) o);
}
-
+
// css lang elements
if (o instanceof ClassSelector) {
- return getDocForStyleClass(f,((ClassSelector)o).getName());
+ return getDocForStyleClass(f, ((ClassSelector) o).getName());
}
if (o instanceof IdSelector) {
return null;
}
if (o instanceof ElementSelector) {
- return getDocForElement(f,((ElementSelector) o).getName());
+ return getDocForElement(f, ((ElementSelector) o).getName());
}
if (o instanceof css_property) {
- return getDocForProperty(f,((css_property) o).getName());
+ return getDocForProperty(f, ((css_property) o).getName());
}
-
+
return "no documentation found";
}
-
- private String formatRule(String rule) {
- return "<p class=\"rule\">"+rule+"</p>";
+
+ private static String formatRule(String rule) {
+ return "<p class=\"rule\">" + rule + "</p>"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
private String getDocumentationForRule(CSSRuleDefinition r) {
- String func = "";
+ String func = ""; //$NON-NLS-1$
if (r.getFunc() != null) {
CSSRuleFunc f = (CSSRuleFunc) r.getFunc();
- func = f.getName() + "(" + translateRule(f.getParams()) + ")";
+ func = f.getName() + "(" + translateRule(f.getParams()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
- String rule = "";
+ String rule = ""; //$NON-NLS-1$
if (r.getRule() != null) {
- rule = r.getName()+" = " +translateRule(r.getRule());
- }
-
- String javadoc = prepareDoku(r.getDoku());
- return formatRule(func + rule) + javadoc;
- }
-
- private String getDocumentationForRule(PropertyDefinition r) {
- String rule = "";
- if (r.getRule() != null) {
- rule = r.getName()+" = " +translateRule(r.getRule());
+ rule = r.getName() + " = " + translateRule(r.getRule()); //$NON-NLS-1$
}
+
String javadoc = prepareDoku(r.getDoku());
- return formatRule(rule) + javadoc;
+ return formatRule(func + rule) + javadoc;
}
-
+
+ // private String getDocumentationForRule(PropertyDefinition r) {
+ // String rule = ""; //$NON-NLS-1$
+ // if (r.getRule() != null) {
+ // rule = r.getName()+" = " +translateRule(r.getRule()); //$NON-NLS-1$
+ // }
+ // String javadoc = prepareDoku(r.getDoku());
+ // return formatRule(rule) + javadoc;
+ // }
+
protected String getDocForStyleClass(IFile f, String styleClass) {
Assert.isNotNull(styleClass);
ElementDefinition element = findElementByStyleClass(f, styleClass);
@@ -219,28 +210,28 @@ public class CssExtDocParser {
return getDocForElement(element);
}
return null;
- }
+ }
protected String getDocForElement(IFile f, String elName) {
Assert.isNotNull(elName);
- ElementDefinition element = findElementByName(f,elName);
+ ElementDefinition element = findElementByName(f, elName);
if (element != null) {
return getDocForElement(element);
}
return null;
}
-
- protected String getDocForElement(ElementDefinition el) {
+
+ protected static String getDocForElement(ElementDefinition el) {
Assert.isNotNull(el);
return prepareDoku(el.getDoku());
}
-
- protected String getDocForPackage(PackageDefinition pkg) {
+
+ protected static String getDocForPackage(PackageDefinition pkg) {
Assert.isNotNull(pkg);
return prepareDoku(pkg.getDoku());
}
-
- private String prepareDoku(Doku doku) {
+
+ private static String prepareDoku(Doku doku) {
if (doku != null) {
return new JavaDocParser().parse(doku.getContent());
}
@@ -253,20 +244,20 @@ public class CssExtDocParser {
if (property != null) {
return getDocHeadForProperty(property);
}
- return "<b>"+propertyName+"</b>";
+ return "<b>" + propertyName + "</b>"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
protected String getDocHeadForProperty(PropertyDefinition property) {
Assert.isNotNull(property);
ElementDefinition element = (ElementDefinition) property.eContainer();
-
+
StringBuffer out = new StringBuffer();
- out.append("<nobr>");
- printImage(out, "property_16x16.png");
+ out.append("<nobr>"); //$NON-NLS-1$
+ printImage(out, "property_16x16.png"); //$NON-NLS-1$
printName(out, property.getName());
- out.append("&nbsp;");
+ out.append("&nbsp;"); //$NON-NLS-1$
printDefiningElement(out, element);
- out.append("</nobr>");
+ out.append("</nobr>"); //$NON-NLS-1$
return out.toString();
}
@@ -280,7 +271,7 @@ public class CssExtDocParser {
}
return null;
}
-
+
protected String getDocHeadForStyleClass(IFile f, String styleClass) {
ElementDefinition element = findElementByStyleClass(f, styleClass);
if (element != null) {
@@ -288,173 +279,184 @@ public class CssExtDocParser {
}
return null;
}
-
- private void printImage(StringBuffer out, String image) {
- URL bundleUrl = Platform.getBundle("org.eclipse.fx.ide.css.ui").getEntry("icons/" + (String) image);
- URL fileUrl = null;
- try {
- fileUrl = FileLocator.toFileURL(bundleUrl);
- String url = fileUrl.toExternalForm();
- out.append("<img class=\"symbol\" src=\""+ url +"\"/>");
- }
- catch (IOException e) {
- e.printStackTrace();
- }
-
-
+
+ private static void printImage(StringBuffer out, String image) {
+ URL bundleUrl = Platform.getBundle("org.eclipse.fx.ide.css.ui").getEntry("icons/" + (String) image); //$NON-NLS-1$ //$NON-NLS-2$
+ URL fileUrl = null;
+ try {
+ fileUrl = FileLocator.toFileURL(bundleUrl);
+ String url = fileUrl.toExternalForm();
+ out.append("<img class=\"symbol\" src=\"" + url + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
}
- private void printName(StringBuffer out, String name) {
- out.append("<span class=\"name\"><b>" + name + "</b></span>"); //$NON-NLS-1$
+
+ private static void printName(StringBuffer out, String name) {
+ out.append("<span class=\"name\"><b>" + name + "</b></span>"); //$NON-NLS-1$ //$NON-NLS-2$
}
- private void printStyleClass(StringBuffer out, ElementDefinition elDef) {
+
+ private static void printStyleClass(StringBuffer out, ElementDefinition elDef) {
if (elDef.getStyleclass() != null) {
- out.append("<br/><span class=\"styleclass\"><span class=\"keyword\">style-class</span> .");
+ out.append("<br/><span class=\"styleclass\"><span class=\"keyword\">style-class</span> ."); //$NON-NLS-1$
out.append(elDef.getStyleclass());
- out.append("</span>");
+ out.append("</span>"); //$NON-NLS-1$
}
}
+
private void printPackageDefinition(StringBuffer out, PackageDefinition pkg) {
- out.append("<span class=\"pkg\">(defined in " + elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, pkg, nameProvider.getFullyQualifiedName(pkg).toString()) + ")</span>");
+ out.append("<span class=\"pkg\">(defined in " + this.elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, pkg, this.nameProvider.getFullyQualifiedName(pkg).toString()) + ")</span>"); //$NON-NLS-1$ //$NON-NLS-2$
}
+
private void printDefiningElement(StringBuffer out, ElementDefinition element) {
- out.append("<span class=\"pkg\">(defined in " + elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, element, nameProvider.getFullyQualifiedName(element).toString()) + ")</span>");
+ out.append("<span class=\"pkg\">(defined in " + this.elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, element, this.nameProvider.getFullyQualifiedName(element).toString()) + ")</span>"); //$NON-NLS-1$ //$NON-NLS-2$
}
+
private void printSuperElements(StringBuffer out, List<ElementDefinition> superEls) {
if (!superEls.isEmpty()) {
- out.append("<br/><span class=\"extends\"><span class=\"keyword\">extends</span> ");
+ out.append("<br/><span class=\"extends\"><span class=\"keyword\">extends</span> "); //$NON-NLS-1$
Iterator<ElementDefinition> supaIt = superEls.iterator();
while (supaIt.hasNext()) {
ElementDefinition supa = supaIt.next();
- out.append(elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, supa, supa.getName()));
+ out.append(this.elementLinks.createLink(XtextElementLinks.XTEXTDOC_SCHEME, supa, supa.getName()));
if (supaIt.hasNext()) {
- out.append(", ");
+ out.append(", "); //$NON-NLS-1$
}
}
- out.append("</span>");
+ out.append("</span>"); //$NON-NLS-1$
}
}
-
+
protected String getDocHeadForElement(ElementDefinition element) {
Assert.isNotNull(element);
-
+
PackageDefinition pkg = findPackage(element);
-
+
StringBuffer out = new StringBuffer();
- out.append("<nobr>");
- printImage(out, "selector_16x16.png");
+ out.append("<nobr>"); //$NON-NLS-1$
+ printImage(out, "selector_16x16.png"); //$NON-NLS-1$
printName(out, element.getName());
- out.append("&nbsp;");
+ out.append("&nbsp;"); //$NON-NLS-1$
printPackageDefinition(out, pkg);
- out.append("</nobr>");
+ out.append("</nobr>"); //$NON-NLS-1$
printStyleClass(out, element);
- out.append("<nobr>");
+ out.append("<nobr>"); //$NON-NLS-1$
printSuperElements(out, element.getSuper());
- out.append("</nobr>");
-
+ out.append("</nobr>"); //$NON-NLS-1$
+
return out.toString();
}
-
- private PackageDefinition findPackage(ElementDefinition element) {
+
+ private static PackageDefinition findPackage(ElementDefinition element) {
return (PackageDefinition) element.eContainer();
}
-
- private PackageDefinition findPackage(CSSRuleDefinition element) {
+
+ private static PackageDefinition findPackage(CSSRuleDefinition element) {
return (PackageDefinition) element.eContainer();
}
-
-
+
private PropertyDefinition findPropertyByName(IFile f, String propertyName) {
- return cssExtManager.findPropertyByName(f, propertyName);
+ return this.cssExtManager.findPropertyByName(f, propertyName);
}
-
+
private ElementDefinition findElementByName(IFile f, String elName) {
- return cssExtManager.findElementByName(f, elName);
+ return this.cssExtManager.findElementByName(f, elName);
}
-
+
private ElementDefinition findElementByStyleClass(IFile f, String styleClass) {
- return cssExtManager.findElementByStyleClass(f, styleClass);
+ return this.cssExtManager.findElementByStyleClass(f, styleClass);
}
+ /**
+ * Get the documentation
+ *
+ * @param f
+ * the file
+ * @param o
+ * the definition
+ * @return the documentation or <code>null</code>
+ */
public String getDocHead(IFile f, EObject o) {
-
+
// css ext lang elements
if (o instanceof CSSRuleDefinition) {
- return getDocHeadForCssRule((CSSRuleDefinition)o);
+ return getDocHeadForCssRule((CSSRuleDefinition) o);
}
if (o instanceof ElementDefinition) {
- return getDocHeadForElement((ElementDefinition)o);
+ return getDocHeadForElement((ElementDefinition) o);
}
if (o instanceof PropertyDefinition) {
- return getDocHeadForProperty((PropertyDefinition)o);
+ return getDocHeadForProperty((PropertyDefinition) o);
}
if (o instanceof PackageDefinition) {
- return getDocHeadForPackage((PackageDefinition)o);
+ return getDocHeadForPackage((PackageDefinition) o);
}
-
+
// css lang elements
if (o instanceof ClassSelector) {
- ElementDefinition element = findElementByStyleClass(f,((ClassSelector) o).getName());
+ ElementDefinition element = findElementByStyleClass(f, ((ClassSelector) o).getName());
if (element != null) {
return getDocHeadForElement(element);
}
}
if (o instanceof ElementSelector) {
- return getDocHeadForElement(f,((ElementSelector) o).getName());
+ return getDocHeadForElement(f, ((ElementSelector) o).getName());
}
if (o instanceof css_property) {
- return getDocHeadForProperty(f,((css_property) o).getName());
+ return getDocHeadForProperty(f, ((css_property) o).getName());
}
if (o instanceof simple_selector) {
- simple_selector s = ((simple_selector)o);
+ simple_selector s = ((simple_selector) o);
String elementName = null;
if (s.getElement() instanceof ElementSelector) {
- elementName = ((ElementSelector)s.getElement()).getName();
+ elementName = ((ElementSelector) s.getElement()).getName();
}
- return getDocHeadForElement(f,elementName);
+ return getDocHeadForElement(f, elementName);
}
// TODO add some color support here
// we may need some kind of type info before
-// if (o instanceof ColorTok) {
-// // TODO implement color here
-// return null;
-// }
-// if (o instanceof IdentifierTok) {
-// css_declaration decl = (css_declaration) ((EObject)o).eContainer();
-// if (decl.getProperty().getName().contains("color")) {
-// // asume color
-// return "COLOR";
-// }
-// }
-
+ // if (o instanceof ColorTok) {
+ // // TODO implement color here
+ // return null;
+ // }
+ // if (o instanceof IdentifierTok) {
+ // css_declaration decl = (css_declaration) ((EObject)o).eContainer();
+ // if (decl.getProperty().getName().contains("color")) {
+ // // asume color
+ // return "COLOR";
+ // }
+ // }
+
return null;
}
private String getDocHeadForCssRule(CSSRuleDefinition rule) {
Assert.isNotNull(rule);
-
+
PackageDefinition pkg = findPackage(rule);
-
+
StringBuffer out = new StringBuffer();
- out.append("<nobr>");
- printImage(out, "rule_16x16.png");
+ out.append("<nobr>"); //$NON-NLS-1$
+ printImage(out, "rule_16x16.png"); //$NON-NLS-1$
printName(out, rule.getName());
- out.append("&nbsp;");
+ out.append("&nbsp;"); //$NON-NLS-1$
printPackageDefinition(out, pkg);
- out.append("</nobr>");
-
+ out.append("</nobr>"); //$NON-NLS-1$
+
return out.toString();
}
-
+
private String getDocHeadForPackage(PackageDefinition pkg) {
Assert.isNotNull(pkg);
-
+
StringBuffer out = new StringBuffer();
- out.append("<nobr>");
- printImage(out, "package_16x16.png");
- printName(out, nameProvider.getFullyQualifiedName(pkg).toString());
- out.append("</nobr>");
-
+ out.append("<nobr>"); //$NON-NLS-1$
+ printImage(out, "package_16x16.png"); //$NON-NLS-1$
+ printName(out, this.nameProvider.getFullyQualifiedName(pkg).toString());
+ out.append("</nobr>"); //$NON-NLS-1$
+
return out.toString();
}
-
+
}

Back to the top