package org.jetbrains.mps.samples.ParallelFor.editor;
/*Generated by MPS */
import jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.nodeEditor.cells.EditorCell_Collection;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent;
import jetbrains.mps.openapi.editor.style.Style;
import jetbrains.mps.editor.runtime.style.StyleImpl;
import jetbrains.mps.editor.runtime.style.StyleAttributes;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Vertical;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.CommentStyleClass;
import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Horizontal;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.KeyWordStyleClass;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.LeftParenStyleClass;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.RightParenStyleClass;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.LeftBraceStyleClass;
import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.RightBraceStyleClass;
/*package*/ class ParallelFor_InspectorBuilder_a extends AbstractEditorBuilder {
@NotNull
private SNode myNode;
public ParallelFor_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) {
super(context);
myNode = node;
}
@NotNull
@Override
public SNode getNode() {
return myNode;
}
/*package*/ EditorCell createCell() {
return createCollection_p0t1np_a_0();
}
private EditorCell createCollection_p0t1np_a_0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent());
editorCell.setCellId("Collection_p0t1np_a_0");
editorCell.setBig(true);
editorCell.setCellContext(getCellFactory().getCellContext());
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_CHILDREN_NEWLINE, false);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_p0t1np_a0_0());
editorCell.addEditorCell(createCollection_p0t1np_b0());
editorCell.addEditorCell(createConstant_p0t1np_c0());
editorCell.addEditorCell(createConstant_p0t1np_d0_0());
editorCell.addEditorCell(createConstant_p0t1np_e0());
editorCell.addEditorCell(createConstant_p0t1np_f0_0());
editorCell.addEditorCell(createConstant_p0t1np_g0_0());
editorCell.addEditorCell(createConstant_p0t1np_h0());
editorCell.addEditorCell(createConstant_p0t1np_i0_0());
editorCell.addEditorCell(createConstant_p0t1np_j0_0());
editorCell.addEditorCell(createConstant_p0t1np_k0());
editorCell.addEditorCell(createConstant_p0t1np_l0_0());
editorCell.addEditorCell(createConstant_p0t1np_m0());
editorCell.addEditorCell(createConstant_p0t1np_n0());
editorCell.addEditorCell(createConstant_p0t1np_o0());
editorCell.addEditorCell(createConstant_p0t1np_p0());
editorCell.addEditorCell(createConstant_p0t1np_q0());
return editorCell;
}
private EditorCell createConstant_p0t1np_a0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Loops through a collection in parallel using multiple threads.");
editorCell.setCellId("Constant_p0t1np_a0_0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_p0t1np_b0() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical());
editorCell.setCellId("Collection_p0t1np_b0");
Style style = new StyleImpl();
style.set(StyleAttributes.SELECTABLE, false);
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.addEditorCell(createConstant_p0t1np_a1a());
editorCell.addEditorCell(createConstant_p0t1np_b1a());
editorCell.addEditorCell(createConstant_p0t1np_c1a());
editorCell.addEditorCell(createCollection_p0t1np_d1a());
return editorCell;
}
private EditorCell createConstant_p0t1np_a1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Threads may be taken from a specified thread pool.");
editorCell.setCellId("Constant_p0t1np_a1a");
Style style = new StyleImpl();
new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_b1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "The main thread may or may not wait for the the parallel branches to finish before continuing.");
editorCell.setCellId("Constant_p0t1np_b1a");
Style style = new StyleImpl();
new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_c1a() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Potential Exceptions in branches are collected and re-thrown into the main thread grouped into a single");
editorCell.setCellId("Constant_p0t1np_c1a");
Style style = new StyleImpl();
new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createCollection_p0t1np_d1a() {
EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Horizontal());
editorCell.setCellId("Collection_p0t1np_d1a");
editorCell.addEditorCell(createConstant_p0t1np_a3b0());
editorCell.addEditorCell(createConstant_p0t1np_b3b0());
return editorCell;
}
private EditorCell createConstant_p0t1np_a3b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "ParallelForLoopException");
editorCell.setCellId("Constant_p0t1np_a3b0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_b3b0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "instance.");
editorCell.setCellId("Constant_p0t1np_b3b0");
Style style = new StyleImpl();
new CommentStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_c0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "");
editorCell.setCellId("Constant_p0t1np_c0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_d0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Example:");
editorCell.setCellId("Constant_p0t1np_d0_0");
Style style = new StyleImpl();
style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_e0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "parallel for");
editorCell.setCellId("Constant_p0t1np_e0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_f0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "(");
editorCell.setCellId("Constant_p0t1np_f0_0");
Style style = new StyleImpl();
new LeftParenStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_g0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "int");
editorCell.setCellId("Constant_p0t1np_g0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_h0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "element");
editorCell.setCellId("Constant_p0t1np_h0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_i0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "in");
editorCell.setCellId("Constant_p0t1np_i0_0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_j0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "inputSequence");
editorCell.setCellId("Constant_p0t1np_j0_0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_k0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ")");
editorCell.setCellId("Constant_p0t1np_k0");
Style style = new StyleImpl();
new RightParenStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_l0_0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "using");
editorCell.setCellId("Constant_p0t1np_l0_0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_m0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "threadPool");
editorCell.setCellId("Constant_p0t1np_m0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_n0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "no wait");
editorCell.setCellId("Constant_p0t1np_n0");
Style style = new StyleImpl();
new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_o0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{");
editorCell.setCellId("Constant_p0t1np_o0");
Style style = new StyleImpl();
new LeftBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_p0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "...");
editorCell.setCellId("Constant_p0t1np_p0");
editorCell.setDefaultText("");
return editorCell;
}
private EditorCell createConstant_p0t1np_q0() {
EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}");
editorCell.setCellId("Constant_p0t1np_q0");
Style style = new StyleImpl();
new RightBraceStyleClass(getEditorContext(), getNode()).apply(style, editorCell);
editorCell.getStyle().putAll(style);
editorCell.setDefaultText("");
return editorCell;
}
}