Permalink
Browse files

regenerated with latest Xtend

  • Loading branch information...
1 parent a6280cc commit 759a63b3a3d8b4b061bf05f1ddf11fa1f3282861 @holgerschill holgerschill committed Mar 11, 2013
@@ -6,6 +6,7 @@
import com.google.inject.Inject;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xdoc.xdoc.AbstractSection;
@@ -14,12 +15,15 @@
@SuppressWarnings("all")
public class Body {
@Inject
+ @Extension
private XdocExtensions _xdocExtensions;
@Inject
+ @Extension
private HtmlExtensions _htmlExtensions;
@Inject
+ @Extension
private TargetPaths _targetPaths;
public CharSequence body(final AbstractSection rootSection) {
@@ -170,7 +174,7 @@ public CharSequence h3plus(final AbstractSection section, final int hLevel) {
Iterable<? extends AbstractSection> _sections = this._xdocExtensions.getSections(section);
for(final AbstractSection subSection : _sections) {
int _plus = (hLevel + 1);
- CharSequence _h3plus = this.h3plus(subSection, _plus);
+ Object _h3plus = this.h3plus(subSection, _plus);
_builder.append(_h3plus, "");
_builder.newLineIfNotEmpty();
}
@@ -5,6 +5,7 @@
import org.apache.log4j.Logger;
import org.eclipse.xtext.common.types.JvmIdentifiableElement;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function0;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
@@ -23,9 +24,11 @@ public Logger apply() {
}.apply();
@Inject
+ @Extension
private GitExtensions _gitExtensions;
@Inject
+ @Extension
private JavaDocExtension _javaDocExtension;
private final static HashSet<String> NO_JAVADOC_PACKAGE_PREFIXES = new Function0<HashSet<String>>() {
@@ -39,6 +39,7 @@
import org.eclipse.xtext.validation.IResourceValidator;
import org.eclipse.xtext.validation.Issue;
import org.eclipse.xtext.xbase.lib.Exceptions;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.InputOutput;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
@@ -65,23 +66,26 @@ public static void main(final String[] args) {
private MainSite mainSite;
@Inject
+ @Extension
private Menu _menu;
@Inject
+ @Extension
private Body _body;
@Inject
+ @Extension
private PostProcessor _postProcessor;
@Inject
private IResourceValidator validator;
@Inject(optional = true)
- @Named(value = "documentRoot")
+ @Named("documentRoot")
private String documentRoot = "../org.eclipse.xtend.doc.xdoc/xdoc";
@Inject(optional = true)
- @Named(value = "targetDirectory")
+ @Named("targetDirectory")
private String targetDirectory = "../../website/documentation";
public void generate() {
@@ -112,7 +116,7 @@ public void generate() {
public void copyImages(final Document doc, final File sourceDir, final File targetDir) {
Resource _eResource = doc.eResource();
ResourceSet _resourceSet = _eResource.getResourceSet();
- final TreeIterator<?> iter = EcoreUtil.getAllContents(_resourceSet, true);
+ final TreeIterator<Object> iter = EcoreUtil.<Object>getAllContents(_resourceSet, true);
Iterator<ImageRef> _filter = Iterators.<ImageRef>filter(iter, ImageRef.class);
final Procedure1<ImageRef> _function = new Procedure1<ImageRef>() {
public void apply(final ImageRef it) {
@@ -156,18 +160,14 @@ public Document loadDocument() {
final ResourceSet rs = this.provider.get();
PathTraverser _pathTraverser = new PathTraverser();
List<String> _singletonList = Collections.<String>singletonList("../org.eclipse.xtend.doc.xdoc/xdoc");
- final Function1<URI,Boolean> _function = new Function1<URI,Boolean>() {
- public Boolean apply(final URI it) {
+ final Predicate<URI> _function = new Predicate<URI>() {
+ public boolean apply(final URI it) {
String _fileExtension = it.fileExtension();
boolean _equals = ObjectExtensions.operator_equals(_fileExtension, "xdoc");
return _equals;
}
};
- Multimap<String,URI> _resolvePathes = _pathTraverser.resolvePathes(_singletonList, new Predicate<URI>() {
- public boolean apply(URI input) {
- return _function.apply(input);
- }
- });
+ Multimap<String,URI> _resolvePathes = _pathTraverser.resolvePathes(_singletonList, _function);
final Collection<URI> uris = _resolvePathes.values();
for (final URI uri : uris) {
{
@@ -21,6 +21,7 @@
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.common.types.JvmAnnotationType;
import org.eclipse.xtext.common.types.JvmDeclaredType;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.InputOutput;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
@@ -58,12 +59,15 @@
@SuppressWarnings("all")
public class HtmlExtensions {
@Inject
+ @Extension
private CodeRefs _codeRefs;
@Inject
+ @Extension
private ImageExtensions _imageExtensions;
@Inject
+ @Extension
private TargetPaths _targetPaths;
public String href(final Identifiable it) {
@@ -144,21 +148,27 @@ public String hrefId(final Identifiable id) {
Resource _eResource = id.eResource();
ResourceSet _resourceSet = _eResource.getResourceSet();
final EList<Adapter> adapters = _resourceSet.eAdapters();
+ ArtificialIds _elvis = null;
Iterable<ArtificialIds> _filter = Iterables.<ArtificialIds>filter(adapters, ArtificialIds.class);
ArtificialIds _head = IterableExtensions.<ArtificialIds>head(_filter);
- ArtificialIds _artificialIds = new ArtificialIds();
- final Procedure1<ArtificialIds> _function = new Procedure1<ArtificialIds>() {
- public void apply(final ArtificialIds it) {
- adapters.add(it);
- }
- };
- ArtificialIds _doubleArrow = ObjectExtensions.<ArtificialIds>operator_doubleArrow(_artificialIds, _function);
- final ArtificialIds adapter = ObjectExtensions.<ArtificialIds>operator_elvis(_head, _doubleArrow);
+ if (_head != null) {
+ _elvis = _head;
+ } else {
+ ArtificialIds _artificialIds = new ArtificialIds();
+ final Procedure1<ArtificialIds> _function = new Procedure1<ArtificialIds>() {
+ public void apply(final ArtificialIds it) {
+ adapters.add(it);
+ }
+ };
+ ArtificialIds _doubleArrow = ObjectExtensions.<ArtificialIds>operator_doubleArrow(_artificialIds, _function);
+ _elvis = ObjectExtensions.<ArtificialIds>operator_elvis(_head, _doubleArrow);
+ }
+ final ArtificialIds adapter = _elvis;
return adapter.artificialHrefs;
}
protected CharSequence _toHtml(final TextOrMarkup it, final ParagraphState state) {
- CharSequence _xblockexpression = null;
+ String _xblockexpression = null;
{
ParagraphState _xifexpression = null;
boolean _equals = ObjectExtensions.operator_equals(state, ParagraphState.NONE);
@@ -172,14 +182,14 @@ protected CharSequence _toHtml(final TextOrMarkup it, final ParagraphState state
CharSequence _html = this.toHtml(_contents, innerState);
String _string = _html.toString();
final String contentsToHtml = _string.trim();
- CharSequence _xifexpression_1 = null;
+ String _xifexpression_1 = null;
boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(contentsToHtml);
boolean _not = (!_isNullOrEmpty);
if (_not) {
- CharSequence _xifexpression_2 = null;
+ String _xifexpression_2 = null;
boolean _equals_1 = ObjectExtensions.operator_equals(state, ParagraphState.NONE);
if (_equals_1) {
- CharSequence _xblockexpression_1 = null;
+ String _xblockexpression_1 = null;
{
StringConcatenation _builder = new StringConcatenation();
_builder.append("<p>");
@@ -189,7 +199,7 @@ protected CharSequence _toHtml(final TextOrMarkup it, final ParagraphState state
_builder.newLineIfNotEmpty();
_builder.append("</p>");
_builder.newLine();
- final CharSequence result = _builder;
+ final String result = _builder.toString();
_xblockexpression_1 = (result);
}
_xifexpression_2 = _xblockexpression_1;
@@ -474,10 +484,15 @@ protected CharSequence _toHtml(final CodeBlock it, final ParagraphState state) {
if (_or) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("<pre class=\"prettyprint lang-");
+ String _elvis = null;
LangDef _language = it.getLanguage();
String _name = _language==null?(String)null:_language.getName();
String _lowerCase = _name==null?(String)null:_name.toLowerCase();
- String _elvis = ObjectExtensions.<String>operator_elvis(_lowerCase, "xtend");
+ if (_lowerCase != null) {
+ _elvis = _lowerCase;
+ } else {
+ _elvis = ObjectExtensions.<String>operator_elvis(_lowerCase, "xtend");
+ }
_builder.append(_elvis, "");
_builder.append(" linenums\">");
String _markCodeBegin = this.markCodeBegin();
@@ -494,10 +509,15 @@ protected CharSequence _toHtml(final CodeBlock it, final ParagraphState state) {
} else {
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("<code class=\"prettyprint lang-");
+ String _elvis_1 = null;
LangDef _language_1 = it.getLanguage();
String _name_1 = _language_1==null?(String)null:_language_1.getName();
String _lowerCase_1 = _name_1==null?(String)null:_name_1.toLowerCase();
- String _elvis_1 = ObjectExtensions.<String>operator_elvis(_lowerCase_1, "xtend");
+ if (_lowerCase_1 != null) {
+ _elvis_1 = _lowerCase_1;
+ } else {
+ _elvis_1 = ObjectExtensions.<String>operator_elvis(_lowerCase_1, "xtend");
+ }
_builder_1.append(_elvis_1, "");
_builder_1.append("\">");
String _trimCode_1 = this.trimCode(code);
@@ -4,6 +4,7 @@
import bootstrap.XdocExtensions;
import com.google.inject.Inject;
import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xdoc.xdoc.AbstractSection;
import org.eclipse.xtext.xdoc.xdoc.Document;
@@ -12,9 +13,11 @@
@SuppressWarnings("all")
public class Menu {
@Inject
+ @Extension
private XdocExtensions _xdocExtensions;
@Inject
+ @Extension
private HtmlExtensions _htmlExtensions;
public CharSequence menu(final Document document) {
@@ -4,11 +4,13 @@
import com.google.inject.Inject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
@SuppressWarnings("all")
public class PostProcessor {
@Inject
+ @Extension
private HtmlExtensions _htmlExtensions;
protected Pattern _codePattern;
@@ -13,6 +13,7 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
@@ -23,6 +24,7 @@
@SuppressWarnings("all")
public class TargetPaths {
@Inject
+ @Extension
private XdocExtensions _xdocExtensions;
public boolean splitAt(final Document document, final Function1<? super AbstractSection,? extends Boolean> predicate, final String prefix) {
@@ -41,26 +43,46 @@ public boolean splitAt(final Document document, final Function1<? super Abstract
}
public String getTargetPath(final Identifiable element) {
+ String _elvis = null;
TargetPathAdapter _targetPathAdapter = this.getTargetPathAdapter(element);
Map<Identifiable,String> _targetPaths = _targetPathAdapter==null?(Map<Identifiable,String>)null:_targetPathAdapter.targetPaths;
String _get = _targetPaths==null?(String)null:_targetPaths.get(element);
- String _elvis = ObjectExtensions.<String>operator_elvis(_get, "");
+ if (_get != null) {
+ _elvis = _get;
+ } else {
+ _elvis = ObjectExtensions.<String>operator_elvis(_get, "");
+ }
return _elvis;
}
public boolean isTargetRootElement(final AbstractSection element) {
- TargetPathAdapter _targetPathAdapter = this.getTargetPathAdapter(element);
- List<AbstractSection> _targetFileRoots = _targetPathAdapter==null?(List<AbstractSection>)null:_targetPathAdapter.targetFileRoots;
- boolean _contains = _targetFileRoots==null?false:_targetFileRoots.contains(element);
- Object _elvis = ObjectExtensions.<Object>operator_elvis(Boolean.valueOf(_contains), element);
- return (_elvis instanceof Document);
+ boolean _xblockexpression = false;
+ {
+ TargetPathAdapter _targetPathAdapter = this.getTargetPathAdapter(element);
+ final List<AbstractSection> targetFileRoots = _targetPathAdapter==null?(List<AbstractSection>)null:_targetPathAdapter.targetFileRoots;
+ boolean _xifexpression = false;
+ boolean _notEquals = ObjectExtensions.operator_notEquals(targetFileRoots, null);
+ if (_notEquals) {
+ boolean _contains = targetFileRoots.contains(element);
+ _xifexpression = _contains;
+ } else {
+ _xifexpression = (element instanceof Document);
+ }
+ _xblockexpression = (_xifexpression);
+ }
+ return _xblockexpression;
}
public List<? extends AbstractSection> getTargetRoots(final Document document) {
+ List<? extends AbstractSection> _elvis = null;
TargetPathAdapter _targetPathAdapter = this.getTargetPathAdapter(document);
List<AbstractSection> _targetFileRoots = _targetPathAdapter==null?(List<AbstractSection>)null:_targetPathAdapter.targetFileRoots;
- ArrayList<Document> _newArrayList = CollectionLiterals.<Document>newArrayList(document);
- List<? extends AbstractSection> _elvis = ObjectExtensions.<List<? extends AbstractSection>>operator_elvis(_targetFileRoots, _newArrayList);
+ if (_targetFileRoots != null) {
+ _elvis = _targetFileRoots;
+ } else {
+ ArrayList<Document> _newArrayList = CollectionLiterals.<Document>newArrayList(document);
+ _elvis = ObjectExtensions.<List<? extends AbstractSection>>operator_elvis(_targetFileRoots, _newArrayList);
+ }
return _elvis;
}
@@ -22,6 +22,7 @@
import org.eclipse.xtext.nodemodel.ICompositeNode;
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
import org.eclipse.xtext.xbase.lib.Exceptions;
+import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.InputOutput;
import org.eclipse.xtext.xbase.lib.IteratorExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@@ -73,9 +74,11 @@ protected boolean isPopover() {
private DocumentLoad docLoader;
@Inject
+ @Extension
private Body _body;
@Inject
+ @Extension
private HtmlExtensions _htmlExtensions;
@Inject
@@ -95,7 +98,7 @@ public void generateTo(final File targetDir) {
public void copyImages(final Document doc, final File targetDir) {
Resource _eResource = doc.eResource();
ResourceSet _resourceSet = _eResource.getResourceSet();
- final TreeIterator<?> iter = EcoreUtil.getAllContents(_resourceSet, true);
+ final TreeIterator<Object> iter = EcoreUtil.<Object>getAllContents(_resourceSet, true);
Iterator<ImageRef> _filter = Iterators.<ImageRef>filter(iter, ImageRef.class);
final Procedure1<ImageRef> _function = new Procedure1<ImageRef>() {
public void apply(final ImageRef it) {
@@ -131,7 +134,7 @@ public void apply(final ImageRef it) {
InputOutput.<String>println(_canonicalPath_1);
InputSupplier<FileInputStream> _newInputStreamSupplier = Files.newInputStreamSupplier(source);
Files.copy(_newInputStreamSupplier, target);
- } catch (Exception _e) {
+ } catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Oops, something went wrong.

0 comments on commit 759a63b

Please sign in to comment.