├── demo └── src │ └── main │ ├── webapp │ ├── styles.css │ ├── WEB-INF │ │ ├── appengine-web.xml │ │ └── web.xml │ └── index.html │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── demo │ ├── concept │ ├── model │ │ ├── ChildMember.java │ │ ├── EmptyMember.java │ │ ├── PropertyMember.java │ │ ├── ReferenceMember.java │ │ └── NamedMember.java │ └── mapper │ │ └── ConceptMappers.java │ ├── hybridExpr │ └── model │ │ ├── types │ │ ├── Type.java │ │ └── FieldDescriptor.java │ │ ├── ExpressionNode.java │ │ ├── Expression.java │ │ ├── Operation.java │ │ ├── UnaryExpression.java │ │ ├── ExpressionContainer.java │ │ ├── PostfixDecrementExpression.java │ │ ├── PostifxIncrementExpression.java │ │ ├── PrefixDecrementExpression.java │ │ ├── PrefixIncrementExpression.java │ │ ├── DivExpression.java │ │ ├── MulExpression.java │ │ ├── PlusExpression.java │ │ └── MinusExpression.java │ ├── indentDemo │ ├── model │ │ ├── LambdaNode.java │ │ ├── Expr.java │ │ ├── WildCardExpr.java │ │ └── Container.java │ ├── hybrid │ │ ├── ExprCloner.java │ │ └── Tokens.java │ └── mapper │ │ └── WildCardExprMapper.java │ ├── expr │ ├── model │ │ ├── ExpressionAstNode.java │ │ ├── DivExpression.java │ │ ├── MulExpression.java │ │ ├── PlusExpression.java │ │ ├── MinusExpression.java │ │ └── ExpressionContainer.java │ └── mapper │ │ ├── ExpressionMapper.java │ │ ├── ExpressionCell.java │ │ └── ExpressionMappers.java │ ├── diagramExpr │ ├── DiagramExprDemoMain.java │ └── model │ │ ├── SimpleDiagram.java │ │ └── DiagramNodeConnection.java │ ├── ConceptDemoMain.java │ ├── ExpressionDemoMain.java │ ├── HybridExprDemoMain.java │ └── diagram │ └── model │ └── DiagramNodeConnection.java ├── .gitignore ├── base └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── base │ └── Base.gwt.xml ├── svgDemo └── src │ └── main │ ├── webapp │ ├── GwtDemo.css │ ├── WEB-INF │ │ └── web.xml │ └── GwtDemo.html │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── svgDemo │ ├── GwtDemo.gwt.xml │ ├── CssRes.java │ └── GwtDemo.java ├── hybrid └── src │ ├── main │ └── java │ │ └── jetbrains │ │ └── jetpad │ │ └── hybrid │ │ ├── Hybrid.gwt.xml │ │ ├── parser │ │ ├── Parser.java │ │ ├── prettyprint │ │ │ ├── PrettyPrinter.java │ │ │ └── ParseNode.java │ │ ├── ParsingContextFactory.java │ │ ├── simple │ │ │ ├── UnaryExpressionFactory.java │ │ │ └── BinaryExpressionFactory.java │ │ ├── ParsingContext.java │ │ ├── KeywordToken.java │ │ ├── SimpleParsingContextFactory.java │ │ └── Token.java │ │ ├── HybridEditorSpec.java │ │ ├── CommentSpec.java │ │ ├── PairSpec.java │ │ ├── TokenCompletion.java │ │ ├── TokensEditPostProcessor.java │ │ ├── HybridProperty.java │ │ ├── Completer.java │ │ ├── EmptyPairSpec.java │ │ ├── SelectionPosition.java │ │ ├── BaseCompleter.java │ │ └── SimpleHybridEditorSpec.java │ └── test │ └── java │ └── jetbrains │ └── jetpad │ └── hybrid │ ├── testapp │ ├── model │ │ ├── IdExpr.java │ │ ├── EmptyExpr.java │ │ ├── MulExpr.java │ │ ├── Expr.java │ │ ├── PlusExpr.java │ │ ├── AsyncValueExpr.java │ │ ├── PosValueExpr.java │ │ ├── ComplexValueExpr.java │ │ ├── ExprNode.java │ │ ├── ExprList.java │ │ ├── ParenExpr.java │ │ ├── ExprContainer.java │ │ ├── ValueExpr.java │ │ ├── VarExpr.java │ │ ├── CallExpr.java │ │ ├── FactorialExpr.java │ │ ├── PostfixIncrementExpr.java │ │ ├── NumberExpr.java │ │ └── BinExpr.java │ └── mapper │ │ ├── ExprCommentSpec.java │ │ ├── ValueExprMapper.java │ │ ├── PosValueExprMapper.java │ │ └── ValueExprTextGen.java │ └── TestTokenWrapper.java ├── CODE_OF_CONDUCT.md ├── completion └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── completion │ ├── Completion.gwt.xml │ ├── CompletionParameters.java │ ├── CompletionController.java │ ├── BaseCompletionParameters.java │ └── BaseCompletionItem.java ├── dataflow └── src │ └── main │ ├── webapp │ ├── WEB-INF │ │ ├── appengine-web.xml │ │ └── web.xml │ └── index.html │ └── java │ └── jetbrains │ └── mps │ └── diagram │ ├── dataflow │ ├── model │ │ ├── InputPort.java │ │ ├── OutputPort.java │ │ └── Diagram.java │ └── Dataflow.gwt.xml │ └── contentDemo │ ├── view │ └── ContentDemoItemView.java │ └── model │ └── ContentItem.java ├── domUtil └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── domUtil │ ├── DomUtil.gwt.xml │ └── TextMetrics.java ├── event └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── event │ ├── Event.gwt.xml │ ├── ContentKind.java │ ├── ModifierKey.java │ ├── ClipboardContent.java │ ├── KeyStrokeSpec.java │ ├── Events.java │ ├── DerivedEvent.java │ ├── PasteEvent.java │ ├── Event.java │ ├── EmptyClipboardContent.java │ └── PropertyChangeEventWrapper.java ├── projectional └── src │ ├── main │ └── java │ │ └── jetbrains │ │ └── jetpad │ │ └── projectional │ │ ├── Projectional.gwt.xml │ │ ├── binOp │ │ └── Associativity.java │ │ ├── selection │ │ ├── SelectionId.java │ │ ├── Selection.java │ │ └── SelectionListener.java │ │ ├── cell │ │ └── mapping │ │ │ └── ToCellMapping.java │ │ ├── generic │ │ ├── Role.java │ │ └── EmptyRoleCompletion.java │ │ └── util │ │ └── MatchingConstructs.java │ └── test │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── testApp │ ├── model │ ├── IdExpr.java │ ├── DivExpr.java │ ├── EqExpr.java │ ├── MulExpr.java │ ├── MinusExpr.java │ ├── PlusExpr.java │ ├── AssignExpr.java │ ├── ExprNode.java │ └── ExprContainer.java │ └── mapper │ ├── DefaultExprSupplier.java │ └── ExprMappers.java ├── diagram └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── diagram │ ├── Diagram.gwt.xml │ ├── view │ ├── DeleteHandler.java │ ├── RoutingViewConfiguration.java │ ├── MoveHandler.java │ ├── Connection.java │ └── decoration │ │ └── DecorationContainer.java │ ├── algorithm │ └── graph │ │ ├── Graph.java │ │ └── WeightedGraph.java │ └── layout │ └── ConnectionRouter.java ├── grammar └── src │ ├── main │ └── java │ │ └── jetbrains │ │ └── jetpad │ │ └── grammar │ │ ├── Grammar.gwt.xml │ │ ├── Associativity.java │ │ ├── RuleHandler.java │ │ ├── Terminal.java │ │ ├── ParserParameters.java │ │ ├── ParserParameter.java │ │ └── RuleContext.java │ └── test │ └── java │ └── jetbrains │ └── jetpad │ └── grammar │ ├── GrammarTestUtil.java │ ├── slr │ └── SLRParserGenerationTest.java │ └── lr1 │ └── LR1ParserGenerationTest.java ├── view └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── view │ ├── toGwt │ └── SvgUtil.java │ ├── ViewEventHandler.java │ ├── toAwt │ └── AwtConverters.java │ ├── CustomViewFeatureSpec.java │ ├── View.gwt.xml │ ├── ViewEventSpec.java │ └── ViewContainerListener.java ├── cell └── src │ ├── main │ └── java │ │ └── jetbrains │ │ └── jetpad │ │ └── cell │ │ ├── Cell.gwt.xml │ │ ├── HorizontalCell.java │ │ ├── event │ │ ├── EventPriority.java │ │ ├── CellEventHandler.java │ │ └── CompletionEvent.java │ │ ├── util │ │ ├── CellState.java │ │ └── CellStateDifference.java │ │ ├── RootCell.java │ │ ├── indent │ │ ├── updater │ │ │ ├── CellWrapper.java │ │ │ └── IndentUpdaterTarget.java │ │ └── NewLineCell.java │ │ ├── mappersUtil │ │ └── HasCounters.java │ │ ├── completion │ │ └── CompletionConfig.java │ │ ├── toDom │ │ ├── CellToDomBundle.java │ │ ├── RootCellMapper.java │ │ ├── HorizontalCellMapper.java │ │ └── DefaultCellMapper.java │ │ ├── VerticalCell.java │ │ ├── position │ │ └── EmptyPositionHandler.java │ │ ├── toView │ │ └── HorizontalCellMapper.java │ │ ├── dom │ │ └── DomCell.java │ │ └── ImageCell.java │ └── test │ └── java │ └── jetbrains │ └── jetpad │ └── cell │ └── message │ └── IndentCellMessagePopupsTest.java ├── svg └── src │ └── main │ └── java │ └── jetbrains │ └── jetpad │ └── projectional │ └── svg │ ├── SvgCssResource.java │ ├── SvgConstants.java │ ├── Svg.gwt.xml │ ├── event │ ├── SvgEventSpec.java │ └── SvgEventHandler.java │ ├── SvgElementListener.java │ ├── SvgIRI.java │ ├── SvgTransformable.java │ ├── SvgNodeContainerListener.java │ ├── SvgPathData.java │ ├── SvgTransform.java │ ├── SvgLocatable.java │ ├── SvgContainer.java │ └── SvgNodeContainerAdapter.java └── pom.xml /demo/src/main/webapp/styles.css: -------------------------------------------------------------------------------- 1 | .content { 2 | padding: 15px; 3 | } 4 | 5 | .main { 6 | padding: 5px; 7 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | *.vo 4 | *.glob 5 | *.iws 6 | *.db 7 | .DS_Store 8 | source_gen 9 | source_gen.caches 10 | classes_gen 11 | target/ 12 | -------------------------------------------------------------------------------- /base/src/main/java/jetbrains/jetpad/projectional/base/Base.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /svgDemo/src/main/webapp/GwtDemo.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: white; 3 | color: black; 4 | font-family: Arial, sans-serif; 5 | font-size: small; 6 | margin: 8px; 7 | } 8 | -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/Hybrid.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/src/main/webapp/WEB-INF/appengine-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | jb-proj-demo 4 | 1 5 | true 6 | 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | 3 | This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it. 4 | -------------------------------------------------------------------------------- /completion/src/main/java/jetbrains/jetpad/completion/Completion.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /dataflow/src/main/webapp/WEB-INF/appengine-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | mbeddr-dataflow 4 | 1 5 | true 6 | 7 | -------------------------------------------------------------------------------- /domUtil/src/main/java/jetbrains/jetpad/projectional/domUtil/DomUtil.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /dataflow/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/Event.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /svgDemo/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/Projectional.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /svgDemo/src/main/webapp/GwtDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo SVG Application 4 | 5 | 6 | 7 | 8 |

SVG Demo Application

9 |
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/Diagram.gwt.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/Grammar.gwt.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/toGwt/SvgUtil.java: -------------------------------------------------------------------------------- 1 | package jetbrains.jetpad.projectional.view.toGwt; 2 | 3 | import com.google.gwt.dom.client.Element; 4 | 5 | class SvgUtil { 6 | static native Element createSvgElement(String name) /*-{ 7 | return $doc.createElementNS('http://www.w3.org/2000/svg', name); 8 | }-*/; 9 | 10 | static Element createPath() { 11 | return createSvgElement("path"); 12 | } 13 | 14 | static Element createPolyline() { 15 | return createSvgElement("polyline"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /svgDemo/src/main/java/jetbrains/jetpad/projectional/svgDemo/GwtDemo.gwt.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/Cell.gwt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/ContentKind.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public interface ContentKind { 19 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/HorizontalCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell; 17 | 18 | public class HorizontalCell extends Cell { 19 | } -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/Associativity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | public enum Associativity { 19 | LEFT, RIGHT 20 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/event/EventPriority.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.event; 17 | 18 | public enum EventPriority { 19 | NORMAL, LOW 20 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/IdExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class IdExpr extends Expr { 19 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/EmptyExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class EmptyExpr extends Expr { 19 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/MulExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class MulExpr extends BinExpr { 19 | } -------------------------------------------------------------------------------- /dataflow/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Diagram Editor Demo 6 | 7 | 8 | 9 |
10 |

Shortcuts

11 | 18 |

Diagram

19 |
20 |
21 |
22 | 23 | -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/Expr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public abstract class Expr extends ExprNode { 19 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/PlusExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class PlusExpr extends BinExpr { 19 | } -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/RuleHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | public interface RuleHandler { 19 | Object handle(RuleContext ctx); 20 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/AsyncValueExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class AsyncValueExpr extends Expr { 19 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/PosValueExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class PosValueExpr extends Expr { 19 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/ComplexValueExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | public class ComplexValueExpr extends Expr { 19 | } -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/binOp/Associativity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.binOp; 17 | 18 | public enum Associativity { 19 | LEFT, RIGHT 20 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgCssResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | public interface SvgCssResource { 19 | public String css(); 20 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser; 17 | 18 | public interface Parser { 19 | ResultT parse(ParsingContext ctx); 20 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/util/CellState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.util; 17 | 18 | public interface CellState { 19 | CellStateDifference getDifference(CellState state); 20 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/concept/model/ChildMember.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.concept.model; 17 | 18 | public class ChildMember extends NamedMember { 19 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/concept/model/EmptyMember.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.concept.model; 17 | 18 | public class EmptyMember extends ConceptMember { 19 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/concept/model/PropertyMember.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.concept.model; 17 | 18 | public class PropertyMember extends NamedMember { 19 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/concept/model/ReferenceMember.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.concept.model; 17 | 18 | public class ReferenceMember extends NamedMember { 19 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | public interface SvgConstants { 19 | String SVG_TEXT_ANCHOR_ATTRIBUTE = "text-anchor"; 20 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/Svg.gwt.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/RootCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell; 17 | 18 | public class RootCell extends Cell { 19 | RootCell(CellContainer cellContainer) { 20 | super(cellContainer); 21 | } 22 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/indent/updater/CellWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.indent.updater; 17 | 18 | public interface CellWrapper { 19 | CompositeT item(); 20 | void remove(); 21 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/view/DeleteHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.view; 17 | 18 | public interface DeleteHandler { 19 | boolean canDelete(); 20 | void delete(); 21 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/ModifierKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public enum ModifierKey { 19 | CONTROL(), 20 | ALT(), 21 | SHIFT(), 22 | META(); 23 | 24 | ModifierKey() { 25 | } 26 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/ClipboardContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public interface ClipboardContent { 19 | boolean isSupported(ContentKind kind); 20 | T get(ContentKind kind); 21 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/algorithm/graph/Graph.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.algorithm.graph; 17 | 18 | public interface Graph { 19 | Iterable getEdges(NodeT node); 20 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/view/RoutingViewConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.view; 17 | 18 | public interface RoutingViewConfiguration { 19 | boolean preventBlocksOverlapping(); 20 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/event/SvgEventSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg.event; 17 | 18 | public enum SvgEventSpec { 19 | MOUSE_CLICKED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_OVER, MOUSE_MOVE, MOUSE_OUT 20 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/mappersUtil/HasCounters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.mappersUtil; 17 | 18 | public interface HasCounters { 19 | int getCounter(CounterSpec spec); 20 | void changeCounter(CounterSpec spec, int delta); 21 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/KeyStrokeSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | import java.util.Set; 19 | 20 | public interface KeyStrokeSpec { 21 | boolean matches(KeyStroke keyStroke); 22 | Set getKeyStrokes(); 23 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/prettyprint/PrettyPrinter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser.prettyprint; 17 | 18 | public interface PrettyPrinter { 19 | void print(NodeT value, PrettyPrinterContext ctx); 20 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/view/MoveHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.view; 17 | 18 | import jetbrains.jetpad.geometry.Vector; 19 | 20 | public interface MoveHandler { 21 | void move(Vector delta); 22 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/IdExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class IdExpr extends Expr { 19 | @Override 20 | public String toString() { 21 | return "id"; 22 | } 23 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/completion/CompletionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.completion; 17 | 18 | public interface CompletionConfig { 19 | 20 | boolean canDoRightTransform(CompletionItems completionItems, String prefixText); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /dataflow/src/main/java/jetbrains/mps/diagram/dataflow/model/InputPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.mps.diagram.dataflow.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public class InputPort extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /dataflow/src/main/java/jetbrains/mps/diagram/dataflow/model/OutputPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.mps.diagram.dataflow.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public class OutputPort extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/DivExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class DivExpr extends BinExpr { 19 | @Override 20 | protected String getSign() { 21 | return "/"; 22 | } 23 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/EqExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class EqExpr extends BinExpr { 19 | @Override 20 | protected String getSign() { 21 | return "=="; 22 | } 23 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/MulExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class MulExpr extends BinExpr { 19 | @Override 20 | protected String getSign() { 21 | return "*"; 22 | } 23 | } -------------------------------------------------------------------------------- /dataflow/src/main/java/jetbrains/mps/diagram/dataflow/Dataflow.gwt.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/ExprNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public abstract class ExprNode extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/MinusExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class MinusExpr extends BinExpr { 19 | @Override 20 | protected String getSign() { 21 | return "-"; 22 | } 23 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/PlusExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class PlusExpr extends BinExpr { 19 | @Override 20 | protected String getSign() { 21 | return "+"; 22 | } 23 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/AssignExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | public class AssignExpr extends BinExpr { 19 | @Override 20 | protected String getSign() { 21 | return "="; 22 | } 23 | } -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/ViewEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.view; 17 | 18 | import jetbrains.jetpad.event.Event; 19 | 20 | public interface ViewEventHandler { 21 | void handle(View view, EventT e); 22 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/algorithm/graph/WeightedGraph.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.algorithm.graph; 17 | 18 | public interface WeightedGraph extends Graph { 19 | Iterable getEdgeWeights(NodeT node); 20 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/ExprNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public class ExprNode extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /domUtil/src/main/java/jetbrains/jetpad/projectional/domUtil/TextMetrics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.domUtil; 17 | 18 | 19 | import jetbrains.jetpad.geometry.DoubleVector; 20 | 21 | public interface TextMetrics { 22 | DoubleVector dimension(); 23 | int baseLine(); 24 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/HybridEditorSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Parser; 19 | 20 | public interface HybridEditorSpec extends SimpleHybridEditorSpec { 21 | Parser getParser(); 22 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/ParsingContextFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser; 17 | 18 | import java.util.List; 19 | 20 | public interface ParsingContextFactory { 21 | 22 | ParsingContext getParsingContext(List tokenList); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/toDom/CellToDomBundle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.toDom; 17 | 18 | import com.google.gwt.resources.client.ClientBundle; 19 | 20 | public interface CellToDomBundle extends ClientBundle { 21 | @Source("style.css") 22 | CellToDomCss style(); 23 | } -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/Terminal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | /** 19 | * Terminal symbol of a grammar 20 | */ 21 | public final class Terminal extends Symbol { 22 | Terminal(Grammar grammar, String name) { 23 | super(grammar, name); 24 | } 25 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/event/CellEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.event; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | import jetbrains.jetpad.event.Event; 20 | 21 | public interface CellEventHandler { 22 | void handle(Cell cell, EventT e); 23 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/view/Connection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.view; 17 | 18 | import jetbrains.jetpad.projectional.view.View; 19 | 20 | public interface Connection { 21 | View view(); 22 | 23 | void attach(); 24 | void detach(); 25 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/Events.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public class Events { 19 | public static Event getCause(Event e) { 20 | while (e instanceof DerivedEvent) { 21 | e = ((DerivedEvent) e).getCause(); 22 | } 23 | return e; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/selection/SelectionId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.selection; 17 | 18 | import jetbrains.jetpad.model.id.BaseId; 19 | 20 | public class SelectionId extends BaseId { 21 | public SelectionId() { 22 | super(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/types/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model.types; 17 | 18 | import java.util.List; 19 | 20 | public interface Type { 21 | List getFields(); 22 | List getMethods(); 23 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/model/LambdaNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public abstract class LambdaNode extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/layout/ConnectionRouter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.layout; 17 | 18 | import jetbrains.jetpad.projectional.diagram.view.DiagramView; 19 | 20 | public interface ConnectionRouter { 21 | void findRoutes(DiagramView view); 22 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/ExprList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildList; 19 | 20 | public class ExprList extends ExprNode { 21 | public final ChildList expr = new ChildList<>(this); 22 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/simple/UnaryExpressionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser.simple; 17 | 18 | import jetbrains.jetpad.grammar.ParserParameters; 19 | 20 | public interface UnaryExpressionFactory { 21 | ExprT create(ParserParameters params, ExprT expr); 22 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgElementListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | import jetbrains.jetpad.projectional.svg.event.SvgAttributeEvent; 19 | 20 | public interface SvgElementListener { 21 | public void onAttrSet(SvgAttributeEvent event); 22 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/model/ExpressionAstNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public abstract class ExpressionAstNode extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/ExpressionNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | 20 | public abstract class ExpressionNode extends SimpleComposite { 21 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/simple/BinaryExpressionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser.simple; 17 | 18 | import jetbrains.jetpad.grammar.ParserParameters; 19 | 20 | public interface BinaryExpressionFactory { 21 | ExprT create(ParserParameters params, ExprT left, ExprT right); 22 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/ParenExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | 20 | public class ParenExpr extends Expr { 21 | public final ChildProperty expr = new ChildProperty(this); 22 | } -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/selection/Selection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.selection; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | 20 | public interface Selection { 21 | Cell getStart(); 22 | Object getStartPosition(); 23 | Cell getEnd(); 24 | Object getEndPosition(); 25 | } 26 | -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/Expression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | 20 | public abstract class Expression extends ExpressionNode { 21 | public abstract Type getType(); 22 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/DerivedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public class DerivedEvent extends Event { 19 | private final Event myCause; 20 | 21 | public DerivedEvent(Event cause) { 22 | myCause = cause; 23 | } 24 | 25 | public Event getCause() { 26 | return myCause; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/ExprContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | 20 | public class ExprContainer extends ExprNode { 21 | public final ChildProperty expr = new ChildProperty(this); 22 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/event/SvgEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg.event; 17 | 18 | import jetbrains.jetpad.event.Event; 19 | import jetbrains.jetpad.projectional.svg.SvgNode; 20 | 21 | public interface SvgEventHandler { 22 | void handle(SvgNode node, EventT e); 23 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/CommentSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | public interface CommentSpec { 19 | 20 | CommentSpec EMPTY = new CommentSpec() { 21 | @Override 22 | public String getCommentPrefix() { 23 | return null; 24 | } 25 | }; 26 | 27 | String getCommentPrefix(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/cell/mapping/ToCellMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.cell.mapping; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | 20 | import java.util.List; 21 | 22 | public interface ToCellMapping { 23 | List getCells(Object source); 24 | Object getSource(Cell cell); 25 | } 26 | -------------------------------------------------------------------------------- /completion/src/main/java/jetbrains/jetpad/completion/CompletionParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.completion; 17 | 18 | public interface CompletionParameters { 19 | CompletionParameters EMPTY = new BaseCompletionParameters(); 20 | 21 | boolean isEndRightTransform(); 22 | boolean isMenu(); 23 | 24 | boolean isBulkCompletionRequired(); 25 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/Operation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | 20 | public abstract class Operation extends ExpressionNode { 21 | public abstract Type getType(Type operandType); 22 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/model/Expr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.model; 17 | 18 | public abstract class Expr extends LambdaNode { 19 | public abstract Expr copy(); 20 | 21 | protected Expr copy(Expr e) { 22 | if (e == null) return null; 23 | return e.copy(); 24 | } 25 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/ValueExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public class ValueExpr extends Expr { 22 | public Property val = new ValueProperty(); 23 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/VarExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public class VarExpr extends Expr { 22 | public final Property name = new ValueProperty<>(); 23 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/CallExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public class CallExpr extends Expr { 22 | public final Property name = new ValueProperty<>(""); 23 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/PairSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | 20 | public interface PairSpec { 21 | public static final PairSpec EMPTY = new EmptyPairSpec(); 22 | 23 | boolean isLeft(Token t); 24 | boolean isRight(Token t); 25 | boolean isPair(Token l, Token r); 26 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/FactorialExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public class FactorialExpr extends Expr { 22 | public final Property expr = new ValueProperty<>(); 23 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/model/ExprContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | 20 | public class ExprContainer extends ExprNode { 21 | public final ChildProperty expr = new ChildProperty(this); 22 | } -------------------------------------------------------------------------------- /completion/src/main/java/jetbrains/jetpad/completion/CompletionController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.completion; 17 | 18 | public interface CompletionController { 19 | boolean isActive(); 20 | boolean canActivate(); 21 | 22 | void activate(); 23 | void activate(Runnable restoreState); 24 | void deactivate(); 25 | 26 | boolean hasAmbiguousMatches(); 27 | } -------------------------------------------------------------------------------- /diagram/src/main/java/jetbrains/jetpad/projectional/diagram/view/decoration/DecorationContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.diagram.view.decoration; 17 | 18 | import jetbrains.jetpad.projectional.view.View; 19 | 20 | public interface DecorationContainer { 21 | void addDecoration(View decoration); 22 | ParentT getDecoratedView(); 23 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/PasteEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public class PasteEvent extends Event { 19 | private ClipboardContent myContent; 20 | 21 | public PasteEvent(ClipboardContent content) { 22 | myContent = content; 23 | } 24 | 25 | public ClipboardContent getContent() { 26 | return myContent; 27 | } 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/model/WildCardExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.model; 17 | 18 | public class WildCardExpr extends Expr { 19 | @Override 20 | public Expr copy() { 21 | return new WildCardExpr(); 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return "?"; 27 | } 28 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/PostfixIncrementExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public class PostfixIncrementExpr extends Expr { 22 | public final Property expr = new ValueProperty<>(); 23 | } -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | jetbrains.jetpad 6 | projectional-container 7 | 1.1-SNAPSHOT 8 | pom 9 | 10 | 11 | projectional-deps 12 | 13 | base 14 | 15 | cell 16 | completion 17 | view 18 | event 19 | hybrid 20 | projectional 21 | demo 22 | grammar 23 | dataflow 24 | diagram 25 | domUtil 26 | svg 27 | svgDemo 28 | 29 | 30 | -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/selection/SelectionListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.selection; 17 | 18 | public interface SelectionListener { 19 | void onSelectionOpened(SelectionId id, Selection selection); 20 | void onSelectionChanged(SelectionId id, Selection selection); 21 | void onSelectionClosed(SelectionId id); 22 | } 23 | -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgIRI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | public class SvgIRI { 19 | private String myElementId; 20 | 21 | public SvgIRI(String elementId) { 22 | myElementId = elementId; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "url(#" + myElementId + ")"; 28 | } 29 | } -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/toAwt/AwtConverters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.view.toAwt; 17 | 18 | import jetbrains.jetpad.values.Color; 19 | 20 | class AwtConverters { 21 | static java.awt.Color toAwtColor(Color color) { 22 | return new java.awt.Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()); 23 | } 24 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/toDom/RootCellMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.toDom; 17 | 18 | import com.google.gwt.user.client.DOM; 19 | import jetbrains.jetpad.cell.RootCell; 20 | 21 | class RootCellMapper extends BaseCellMapper { 22 | RootCellMapper(RootCell source, CellToDomContext ctx) { 23 | super(source, ctx, DOM.createDiv()); 24 | } 25 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/diagramExpr/DiagramExprDemoMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.diagramExpr; 17 | 18 | import jetbrains.jetpad.projectional.view.toAwt.AwtViewDemo; 19 | 20 | public class DiagramExprDemoMain { 21 | public static void main(String[] args) { 22 | AwtViewDemo.show(DiagramExprDemo.createContainer()); 23 | } 24 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/ParsingContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser; 17 | 18 | import java.util.List; 19 | 20 | public interface ParsingContext { 21 | 22 | List getTokens(); 23 | 24 | Token current(); 25 | 26 | void advance(); 27 | 28 | State saveState(); 29 | 30 | interface State { 31 | void restore(); 32 | } 33 | } -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/CustomViewFeatureSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.view; 17 | 18 | public class CustomViewFeatureSpec { 19 | private String myName; 20 | 21 | public CustomViewFeatureSpec(String name) { 22 | myName = name; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return myName; 28 | } 29 | } -------------------------------------------------------------------------------- /dataflow/src/main/java/jetbrains/mps/diagram/contentDemo/view/ContentDemoItemView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.mps.diagram.contentDemo.view; 17 | 18 | import jetbrains.jetpad.projectional.view.RectView; 19 | import jetbrains.jetpad.values.Color; 20 | 21 | public class ContentDemoItemView extends RectView { 22 | public ContentDemoItemView() { 23 | background().set(Color.BLUE); 24 | } 25 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/prettyprint/ParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser.prettyprint; 17 | 18 | import com.google.common.collect.Range; 19 | 20 | import java.util.List; 21 | 22 | public interface ParseNode { 23 | ParseNode getParent(); 24 | 25 | Object getValue(); 26 | List getChildren(); 27 | Range getRange(); 28 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public class Event { 19 | private boolean myConsumed; 20 | 21 | public boolean isConsumed() { 22 | return myConsumed; 23 | } 24 | 25 | public void consume() { 26 | if (myConsumed) { 27 | throw new IllegalStateException(); 28 | } 29 | myConsumed = true; 30 | } 31 | } -------------------------------------------------------------------------------- /svgDemo/src/main/java/jetbrains/jetpad/projectional/svgDemo/CssRes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svgDemo; 17 | 18 | import jetbrains.jetpad.projectional.svg.SvgCssResource; 19 | 20 | public class CssRes implements SvgCssResource { 21 | @Override 22 | public String css() { 23 | return ".ellipse-yellow { \n" + 24 | "fill: yellow;\n" + 25 | "}"; 26 | } 27 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/TokenCompletion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import com.google.common.base.Function; 19 | import jetbrains.jetpad.completion.CompletionSupplier; 20 | import jetbrains.jetpad.hybrid.parser.Token; 21 | 22 | public interface TokenCompletion { 23 | CompletionSupplier getTokenCompletion(Function tokenHandler); 24 | } 25 | -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/TokensEditPostProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | 20 | import java.util.List; 21 | 22 | public interface TokensEditPostProcessor { 23 | void afterTokensEdit(List tokens, SourceT value); 24 | void afterTokenCompleted(List tokens, SourceT value); 25 | } 26 | -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/mapper/ExprCommentSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.mapper; 17 | 18 | import jetbrains.jetpad.hybrid.CommentSpec; 19 | 20 | final class ExprCommentSpec implements CommentSpec { 21 | 22 | ExprCommentSpec() { 23 | } 24 | 25 | @Override 26 | public String getCommentPrefix() { 27 | return "#"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/VerticalCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | 20 | public class VerticalCell extends Cell { 21 | public static final CellPropertySpec INDENTED = new CellPropertySpec<>("indented", false); 22 | 23 | public Property indented() { 24 | return getProp(INDENTED); 25 | } 26 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/util/CellStateDifference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.util; 17 | 18 | public enum CellStateDifference { 19 | EQUAL, NAVIGATION, EDIT; 20 | 21 | public static CellStateDifference max(CellStateDifference difference1, CellStateDifference difference2) { 22 | return difference1.ordinal() > difference2.ordinal() ? difference1 : difference2; 23 | } 24 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/ConceptDemoMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo; 17 | 18 | import jetbrains.jetpad.projectional.demo.concept.ConceptDemo; 19 | import jetbrains.jetpad.projectional.util.awt.AwtCellDemo; 20 | 21 | public class ConceptDemoMain { 22 | public static void main(String[] args) { 23 | AwtCellDemo.show(ConceptDemo.create()); 24 | } 25 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/model/DivExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.model; 17 | 18 | public class DivExpression extends BinaryExpression { 19 | @Override 20 | protected BinaryExpression createCopy() { 21 | return new DivExpression(); 22 | } 23 | 24 | @Override 25 | protected String getSign() { 26 | return "/"; 27 | } 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/model/MulExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.model; 17 | 18 | public class MulExpression extends BinaryExpression { 19 | @Override 20 | protected BinaryExpression createCopy() { 21 | return new MulExpression(); 22 | } 23 | 24 | @Override 25 | protected String getSign() { 26 | return "*"; 27 | } 28 | } -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/ParserParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | public interface ParserParameters { 19 | ParserParameters EMPTY = new ParserParameters() { 20 | @Override 21 | public ValueT get(ParserParameter key) { 22 | return null; 23 | } 24 | }; 25 | 26 | ValueT get(ParserParameter key); 27 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/NumberExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public class NumberExpr extends Expr { 22 | public final Property value = new ValueProperty<>(0); 23 | 24 | public NumberExpr() { 25 | } 26 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/ExpressionDemoMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo; 17 | 18 | import jetbrains.jetpad.projectional.demo.expr.ExprDemo; 19 | import jetbrains.jetpad.projectional.util.awt.AwtCellDemo; 20 | 21 | public class ExpressionDemoMain { 22 | public static void main(String[] args) { 23 | AwtCellDemo.show(ExprDemo.createDemo()); 24 | } 25 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/model/PlusExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.model; 17 | 18 | public class PlusExpression extends BinaryExpression { 19 | @Override 20 | protected BinaryExpression createCopy() { 21 | return new PlusExpression(); 22 | } 23 | 24 | @Override 25 | protected String getSign() { 26 | return "+"; 27 | } 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/model/Container.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | import jetbrains.jetpad.model.property.Property; 20 | 21 | public class Container extends LambdaNode { 22 | public final Property expr = new ChildProperty(this); 23 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/mapper/DefaultExprSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.mapper; 17 | 18 | import com.google.common.base.Supplier; 19 | import jetbrains.jetpad.projectional.testApp.model.Expr; 20 | 21 | class DefaultExprSupplier implements Supplier { 22 | @Override 23 | public Expr get() { 24 | return new Expr(); 25 | } 26 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgTransformable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | 20 | public interface SvgTransformable extends SvgLocatable { 21 | static final SvgAttributeSpec TRANSFORM = SvgAttributeSpec.createSpec("transform"); 22 | 23 | public Property transform(); 24 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/model/MinusExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.model; 17 | 18 | public class MinusExpression extends BinaryExpression { 19 | @Override 20 | protected BinaryExpression createCopy() { 21 | return new MinusExpression(); 22 | } 23 | 24 | @Override 25 | protected String getSign() { 26 | return "-"; 27 | } 28 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/EmptyClipboardContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | public class EmptyClipboardContent implements ClipboardContent { 19 | @Override 20 | public boolean isSupported(ContentKind kind) { 21 | return false; 22 | } 23 | 24 | @Override 25 | public T get(ContentKind kind) { 26 | throw new UnsupportedOperationException(); 27 | } 28 | } -------------------------------------------------------------------------------- /dataflow/src/main/java/jetbrains/mps/diagram/contentDemo/model/ContentItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.mps.diagram.contentDemo.model; 17 | 18 | import jetbrains.jetpad.geometry.Vector; 19 | import jetbrains.jetpad.model.property.Property; 20 | import jetbrains.jetpad.model.property.ValueProperty; 21 | 22 | public class ContentItem { 23 | public final Property size = new ValueProperty<>(new Vector(15, 15)); 24 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/HybridProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | import jetbrains.jetpad.model.collections.list.ObservableList; 20 | import jetbrains.jetpad.model.property.ReadableProperty; 21 | 22 | public interface HybridProperty extends ReadableProperty { 23 | ObservableList getTokens(); 24 | } 25 | -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgNodeContainerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | import jetbrains.jetpad.projectional.svg.event.SvgAttributeEvent; 19 | 20 | public interface SvgNodeContainerListener { 21 | void onAttributeSet(SvgElement element, SvgAttributeEvent event); 22 | void onNodeAttached(SvgNode node); 23 | void onNodeDetached(SvgNode node); 24 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/HybridExprDemoMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.HybridExprDemo; 19 | import jetbrains.jetpad.projectional.util.awt.AwtCellDemo; 20 | 21 | public class HybridExprDemoMain { 22 | public static void main(String[] args) { 23 | AwtCellDemo.show(HybridExprDemo.createDemo()); 24 | } 25 | } -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/View.gwt.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/TestTokenWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | 20 | public class TestTokenWrapper { 21 | public final Token token; 22 | 23 | public TestTokenWrapper(Token token) { 24 | this.token = token; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return token.toString(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/ViewEventSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.view; 17 | 18 | import jetbrains.jetpad.event.Event; 19 | 20 | public class ViewEventSpec { 21 | private String myName; 22 | 23 | public ViewEventSpec(String name) { 24 | myName = name; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return myName; 30 | } 31 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/event/CompletionEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.event; 17 | 18 | import jetbrains.jetpad.event.Event; 19 | 20 | public class CompletionEvent extends Event { 21 | private boolean myAutoInvoked; 22 | 23 | public CompletionEvent(boolean autoInvoked) { 24 | myAutoInvoked = autoInvoked; 25 | } 26 | 27 | public boolean isAutoInvoked() { 28 | return myAutoInvoked; 29 | } 30 | } -------------------------------------------------------------------------------- /dataflow/src/main/java/jetbrains/mps/diagram/dataflow/model/Diagram.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.mps.diagram.dataflow.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildList; 19 | import jetbrains.jetpad.model.collections.list.ObservableList; 20 | 21 | public class Diagram { 22 | public final ObservableList blocks = new ChildList<>(this); 23 | public final ObservableList connectors = new ChildList<>(this); 24 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/model/BinExpr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | 20 | public abstract class BinExpr extends Expr { 21 | public final ChildProperty left = new ChildProperty(this); 22 | public final ChildProperty right = new ChildProperty(this); 23 | } -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/generic/Role.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.generic; 17 | 18 | /** 19 | * Role, i.e. position where we might get or set value of type TargetT. 20 | * 21 | * It might be a value stored in a property as well as an item in a list 22 | * with particular index. 23 | */ 24 | public interface Role { 25 | TargetT get(); 26 | Runnable set(TargetT target); 27 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgPathData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | public class SvgPathData { 19 | public static final SvgPathData EMPTY = new SvgPathData(""); 20 | 21 | private String myPathData; 22 | 23 | SvgPathData(String pathData) { 24 | myPathData = pathData; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return myPathData; 30 | } 31 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/position/EmptyPositionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.position; 17 | 18 | class EmptyPositionHandler extends DefaultPositionHandler { 19 | @Override 20 | public boolean isHome() { 21 | return true; 22 | } 23 | 24 | @Override 25 | public boolean isEnd() { 26 | return true; 27 | } 28 | 29 | @Override 30 | public boolean isEmpty() { 31 | return true; 32 | } 33 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/mapper/ExpressionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.mapper; 17 | 18 | import jetbrains.jetpad.mapper.Mapper; 19 | import jetbrains.jetpad.projectional.demo.expr.model.Expression; 20 | 21 | class ExpressionMapper extends Mapper { 22 | ExpressionMapper(Expression source) { 23 | super(source, new ExpressionCell()); 24 | } 25 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/hybrid/ExprCloner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.ValueToken; 19 | import jetbrains.jetpad.projectional.demo.indentDemo.model.Expr; 20 | 21 | class ExprCloner implements ValueToken.ValueCloner { 22 | @Override 23 | public Expr clone(Expr val) { 24 | return val.copy(); 25 | } 26 | } -------------------------------------------------------------------------------- /grammar/src/test/java/jetbrains/jetpad/grammar/GrammarTestUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | import jetbrains.jetpad.grammar.parser.Lexeme; 19 | 20 | class GrammarTestUtil { 21 | static Lexeme[] asLexemes(Terminal... ts) { 22 | Lexeme[] result = new Lexeme[ts.length]; 23 | for (int i = 0; i < ts.length; i++) { 24 | result[i] = new Lexeme(ts[i], "" + ts[i]); 25 | } 26 | return result; 27 | } 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/model/ExpressionContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | import jetbrains.jetpad.model.property.Property; 20 | 21 | public class ExpressionContainer extends ExpressionAstNode { 22 | public final Property expression = new ChildProperty(this); 23 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/UnaryExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | import jetbrains.jetpad.model.property.Property; 20 | 21 | public abstract class UnaryExpression extends Expression { 22 | public final Property expression = new ChildProperty(this); 23 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/hybrid/Tokens.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.SimpleToken; 19 | import jetbrains.jetpad.hybrid.parser.Token; 20 | 21 | class Tokens { 22 | static final Token LP = new SimpleToken("("); 23 | static final Token RP = new SimpleToken(")"); 24 | static final Token WILDCARD = new SimpleToken("?"); 25 | } -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/ParserParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | /** 19 | * Key object for passing to {@link Rule}s via {@link RuleContext} 20 | */ 21 | public class ParserParameter { 22 | private String myName; 23 | 24 | public ParserParameter(String name) { 25 | myName = name; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return myName; 31 | } 32 | } -------------------------------------------------------------------------------- /grammar/src/test/java/jetbrains/jetpad/grammar/slr/SLRParserGenerationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar.slr; 17 | 18 | import jetbrains.jetpad.grammar.*; 19 | import jetbrains.jetpad.grammar.parser.LRParserTable; 20 | 21 | public class SLRParserGenerationTest extends BaseParserGenerationTest { 22 | @Override 23 | protected LRParserTable generateTable(Grammar g) { 24 | return new SLRTableGenerator(g).generateTable(); 25 | } 26 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/Completer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | 20 | public interface Completer { 21 | Runnable complete(Token token); 22 | Runnable complete(Token... tokens); 23 | 24 | /** 25 | * @param selectionIndex of the passed token to be selected after the action 26 | */ 27 | Runnable complete(int selectionIndex, Token... tokens); 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/ExpressionContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildProperty; 19 | import jetbrains.jetpad.model.property.Property; 20 | 21 | public class ExpressionContainer extends ExpressionNode { 22 | public final Property expression = new ChildProperty(this); 23 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgTransform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | public class SvgTransform { 19 | public static final SvgTransform EMPTY = new SvgTransform(""); 20 | 21 | private String myTransform; 22 | 23 | SvgTransform(String transformString) { 24 | myTransform = transformString; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return myTransform; 30 | } 31 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/indent/updater/IndentUpdaterTarget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.indent.updater; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | 20 | import java.util.List; 21 | 22 | public interface IndentUpdaterTarget { 23 | TargetT newLine(); 24 | TargetT newIndent(int size); 25 | CellWrapper wrap(Cell cell); 26 | 27 | List children(TargetT item); 28 | TargetT parent(TargetT item); 29 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/toView/HorizontalCellMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.toView; 17 | 18 | import jetbrains.jetpad.cell.HorizontalCell; 19 | import jetbrains.jetpad.projectional.view.HorizontalView; 20 | 21 | class HorizontalCellMapper extends BaseCellMapper { 22 | HorizontalCellMapper(HorizontalCell source, CellToViewContext ctx) { 23 | super(source, new HorizontalView(), ctx); 24 | } 25 | } -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/util/MatchingConstructs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.util; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | 20 | public class MatchingConstructs { 21 | public static void pair(Cell c1, Cell c2) { 22 | pairOneWay(c1, c2); 23 | pairOneWay(c2, c1); 24 | } 25 | 26 | private static void pairOneWay(Cell c1, Cell c2) { 27 | c1.set(CellNavigationController.PAIR_CELL, c2); 28 | } 29 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgLocatable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | import jetbrains.jetpad.geometry.DoubleRectangle; 19 | import jetbrains.jetpad.geometry.DoubleVector; 20 | 21 | public interface SvgLocatable { 22 | public DoubleVector pointToTransformedCoordinates(DoubleVector point); 23 | 24 | public DoubleVector pointToAbsoluteCoordinates(DoubleVector point); 25 | 26 | public DoubleRectangle getBBox(); 27 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/indent/NewLineCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.indent; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | import jetbrains.jetpad.model.collections.CollectionItemEvent; 20 | 21 | public class NewLineCell extends IndentCell { 22 | 23 | @Override 24 | protected void onChildAdded(CollectionItemEvent event) { 25 | throw new IllegalStateException("You shouldn't add anything to new line cells"); 26 | } 27 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/KeywordToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser; 17 | 18 | import jetbrains.jetpad.values.Color; 19 | 20 | public class KeywordToken extends SimpleToken { 21 | public KeywordToken(String name) { 22 | super(name); 23 | } 24 | 25 | @Override 26 | public Color getColor() { 27 | return Color.DARK_BLUE; 28 | } 29 | 30 | @Override 31 | public boolean isBold() { 32 | return true; 33 | } 34 | } -------------------------------------------------------------------------------- /svgDemo/src/main/java/jetbrains/jetpad/projectional/svgDemo/GwtDemo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svgDemo; 17 | 18 | import com.google.gwt.core.client.EntryPoint; 19 | import jetbrains.jetpad.projectional.view.toGwt.ViewToDom; 20 | 21 | import static com.google.gwt.query.client.GQuery.$; 22 | 23 | public class GwtDemo implements EntryPoint { 24 | public void onModuleLoad() { 25 | ViewToDom.map(DemoModel.demoViewContainer(), $("#svg").get(0)); 26 | } 27 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/PostfixDecrementExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class PostfixDecrementExpression extends UnaryExpression { 22 | @Override 23 | public Type getType() { 24 | return Types.INT; 25 | } 26 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/PostifxIncrementExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class PostifxIncrementExpression extends UnaryExpression { 22 | @Override 23 | public Type getType() { 24 | return Types.INT; 25 | } 26 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/PrefixDecrementExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class PrefixDecrementExpression extends UnaryExpression { 22 | @Override 23 | public Type getType() { 24 | return Types.INT; 25 | } 26 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/PrefixIncrementExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class PrefixIncrementExpression extends UnaryExpression { 22 | @Override 23 | public Type getType() { 24 | return Types.INT; 25 | } 26 | } -------------------------------------------------------------------------------- /demo/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Projectional Editor Demo 6 | 7 | 8 | 9 | 10 |
11 |

Concept Demo

12 |
13 |
14 | 15 |

Indent Layout Demo

16 |
17 |
18 | 19 |

Hybrid Expression Demo

20 |
21 |
22 | 23 |

Expression Demo

24 |
25 |
26 | 27 |

Diagram Demo

28 |
29 |
30 | 31 |

Diagram+Expr Demo

32 |
33 |
34 |
35 | 36 | -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/SimpleParsingContextFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser; 17 | 18 | import java.util.List; 19 | 20 | public final class SimpleParsingContextFactory implements ParsingContextFactory { 21 | 22 | public SimpleParsingContextFactory() { 23 | } 24 | 25 | @Override 26 | public ParsingContext getParsingContext(List tokenList) { 27 | return new SimpleParsingContext(tokenList); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/dom/DomCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.dom; 17 | 18 | import com.google.gwt.dom.client.Node; 19 | import jetbrains.jetpad.cell.Cell; 20 | import jetbrains.jetpad.cell.CellPropertySpec; 21 | import jetbrains.jetpad.model.property.Property; 22 | 23 | public class DomCell extends Cell { 24 | public static final CellPropertySpec NODE = new CellPropertySpec<>("node"); 25 | 26 | public final Property node = getProp(NODE); 27 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/mapper/ExpressionCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.mapper; 17 | 18 | import jetbrains.jetpad.cell.indent.IndentCell; 19 | 20 | import static jetbrains.jetpad.cell.util.CellFactory.label; 21 | import static jetbrains.jetpad.cell.util.CellFactory.to; 22 | 23 | class ExpressionCell extends IndentCell { 24 | ExpressionCell() { 25 | to( 26 | this, 27 | label("")); 28 | } 29 | } -------------------------------------------------------------------------------- /projectional/src/test/java/jetbrains/jetpad/projectional/testApp/mapper/ExprMappers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.testApp.mapper; 17 | 18 | import jetbrains.jetpad.mapper.Mapper; 19 | import jetbrains.jetpad.cell.Cell; 20 | import jetbrains.jetpad.projectional.testApp.model.ExprContainer; 21 | 22 | public class ExprMappers { 23 | public static Mapper create(ExprContainer source) { 24 | return new ExprContainerMapper(source); 25 | } 26 | } -------------------------------------------------------------------------------- /view/src/main/java/jetbrains/jetpad/projectional/view/ViewContainerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.view; 17 | 18 | import jetbrains.jetpad.model.property.PropertyChangeEvent; 19 | 20 | public interface ViewContainerListener { 21 | void onBeforeCommand(); 22 | void onAfterCommand(); 23 | 24 | void onPropertySet(View view, ViewPropertySpec prop, PropertyChangeEvent event); 25 | void onViewAttached(View view); 26 | void onViewDetached(View view); 27 | } -------------------------------------------------------------------------------- /completion/src/main/java/jetbrains/jetpad/completion/BaseCompletionParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.completion; 17 | 18 | public class BaseCompletionParameters implements CompletionParameters { 19 | @Override 20 | public boolean isEndRightTransform() { 21 | return false; 22 | } 23 | 24 | @Override 25 | public boolean isMenu() { 26 | return false; 27 | } 28 | 29 | @Override 30 | public boolean isBulkCompletionRequired() { 31 | return false; 32 | } 33 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/diagramExpr/model/SimpleDiagram.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.diagramExpr.model; 17 | 18 | import jetbrains.jetpad.model.children.ChildList; 19 | import jetbrains.jetpad.model.collections.list.ObservableList; 20 | 21 | public class SimpleDiagram { 22 | public final ObservableList nodes = new ChildList<>(this); 23 | public final ObservableList connections = new ChildList<>(this); 24 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/EmptyPairSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | 20 | class EmptyPairSpec implements PairSpec { 21 | @Override 22 | public boolean isLeft(Token t) { 23 | return false; 24 | } 25 | 26 | @Override 27 | public boolean isRight(Token t) { 28 | return false; 29 | } 30 | 31 | @Override 32 | public boolean isPair(Token l, Token r) { 33 | return false; 34 | } 35 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/toDom/HorizontalCellMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.toDom; 17 | 18 | import com.google.gwt.user.client.DOM; 19 | import jetbrains.jetpad.cell.HorizontalCell; 20 | 21 | class HorizontalCellMapper extends BaseCellMapper { 22 | HorizontalCellMapper(HorizontalCell source, CellToDomContext ctx) { 23 | super(source, ctx, DOM.createDiv()); 24 | getTarget().addClassName(CellContainerToDomMapper.CSS.horizontal()); 25 | } 26 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/ImageCell.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell; 17 | 18 | import jetbrains.jetpad.geometry.Vector; 19 | import jetbrains.jetpad.model.property.Property; 20 | import jetbrains.jetpad.projectional.base.ImageData; 21 | 22 | public class ImageCell extends Cell { 23 | public static final CellPropertySpec IMAGE = new CellPropertySpec<>("image", ImageData.emptyImage(Vector.ZERO)); 24 | 25 | public final Property image = getProp(IMAGE); 26 | } -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | 20 | public interface SvgContainer { 21 | static final SvgAttributeSpec OPACITY = SvgAttributeSpec.createSpec("opacity"); 22 | static final SvgAttributeSpec CLIP_PATH = SvgAttributeSpec.createSpec("clip-path"); 23 | 24 | public Property opacity(); 25 | public Property clipPath(); 26 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/diagram/model/DiagramNodeConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.diagram.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | import jetbrains.jetpad.model.property.Property; 20 | import jetbrains.jetpad.model.property.ValueProperty; 21 | 22 | public class DiagramNodeConnection extends SimpleComposite { 23 | public final Property target = new ValueProperty<>(); 24 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/SelectionPosition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | public enum SelectionPosition { 19 | /* 20 | * Instruction to select a token in the first position. 21 | * If the first position isn't allowed, use the last position of the prev token 22 | */ 23 | FIRST, 24 | 25 | /* 26 | * Instruction to select a token in the last position. 27 | * If first position isn't allowed, use the first position of the next token 28 | */ 29 | LAST 30 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/mapper/ValueExprMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.mapper; 17 | 18 | import jetbrains.jetpad.mapper.Mapper; 19 | import jetbrains.jetpad.hybrid.testapp.model.ValueExpr; 20 | import jetbrains.jetpad.cell.TextCell; 21 | import jetbrains.jetpad.cell.util.CellFactory; 22 | 23 | class ValueExprMapper extends Mapper { 24 | ValueExprMapper(ValueExpr source) { 25 | super(source, CellFactory.keyword("value")); 26 | } 27 | } -------------------------------------------------------------------------------- /completion/src/main/java/jetbrains/jetpad/completion/BaseCompletionItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.completion; 17 | 18 | public abstract class BaseCompletionItem implements CompletionItem { 19 | @Override 20 | public int getMatchPriority() { 21 | return 0; 22 | } 23 | 24 | @Override 25 | public int getSortPriority() { 26 | return 0; 27 | } 28 | 29 | @Override 30 | public final boolean isMatchPrefix(String text) { 31 | return isStrictMatchPrefix(text) || isMatch(text); 32 | } 33 | } -------------------------------------------------------------------------------- /grammar/src/test/java/jetbrains/jetpad/grammar/lr1/LR1ParserGenerationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar.lr1; 17 | 18 | import jetbrains.jetpad.grammar.BaseParserGenerationTest; 19 | import jetbrains.jetpad.grammar.Grammar; 20 | import jetbrains.jetpad.grammar.parser.LRParserTable; 21 | 22 | public class LR1ParserGenerationTest extends BaseParserGenerationTest { 23 | @Override 24 | protected LRParserTable generateTable(Grammar g) { 25 | return new LR1TableGenerator(g).generateTable(); 26 | } 27 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/concept/mapper/ConceptMappers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.concept.mapper; 17 | 18 | import jetbrains.jetpad.mapper.Mapper; 19 | import jetbrains.jetpad.projectional.demo.concept.model.ConceptDeclaration; 20 | import jetbrains.jetpad.cell.Cell; 21 | 22 | public class ConceptMappers { 23 | public static Mapper create(ConceptDeclaration concept) { 24 | return new ConceptDeclarationMapper(concept); 25 | } 26 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/concept/model/NamedMember.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.concept.model; 17 | 18 | import jetbrains.jetpad.model.property.Property; 19 | import jetbrains.jetpad.model.property.ValueProperty; 20 | 21 | public abstract class NamedMember extends ConceptMember { 22 | public final Property name = new ValueProperty<>(""); 23 | 24 | @Override 25 | public String toString() { 26 | return getClass().getName() + " : " + name.get(); 27 | } 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/diagramExpr/model/DiagramNodeConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.diagramExpr.model; 17 | 18 | import jetbrains.jetpad.model.children.SimpleComposite; 19 | import jetbrains.jetpad.model.property.Property; 20 | import jetbrains.jetpad.model.property.ValueProperty; 21 | 22 | public class DiagramNodeConnection extends SimpleComposite { 23 | public final Property target = new ValueProperty<>(); 24 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/expr/mapper/ExpressionMappers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.expr.mapper; 17 | 18 | import jetbrains.jetpad.mapper.Mapper; 19 | import jetbrains.jetpad.projectional.demo.expr.model.ExpressionContainer; 20 | import jetbrains.jetpad.cell.Cell; 21 | 22 | public class ExpressionMappers { 23 | public static Mapper create(ExpressionContainer source) { 24 | return new ExpressionContainerMapper(source); 25 | } 26 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/parser/Token.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.parser; 17 | 18 | import com.google.common.base.Predicate; 19 | 20 | public interface Token { 21 | boolean noSpaceToLeft(); 22 | boolean noSpaceToRight(); 23 | 24 | /** 25 | * If returns true, then we can invoke right transform by pressing ctrl+space on the end of the token 26 | */ 27 | boolean isRtOnEnd(); 28 | 29 | String text(); 30 | 31 | Token copy(); 32 | 33 | Predicate getValidator(); 34 | } -------------------------------------------------------------------------------- /cell/src/main/java/jetbrains/jetpad/cell/toDom/DefaultCellMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.toDom; 17 | 18 | import com.google.gwt.user.client.DOM; 19 | import jetbrains.jetpad.cell.Cell; 20 | 21 | class DefaultCellMapper extends BaseCellMapper { 22 | DefaultCellMapper(Cell source, CellToDomContext ctx) { 23 | super(source, ctx, DOM.createDiv()); 24 | 25 | getTarget().getStyle().setColor("red"); 26 | getTarget().setInnerText("Can't create a mapper for " + source.getClass().getName()); 27 | } 28 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/types/FieldDescriptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model.types; 17 | 18 | public class FieldDescriptor { 19 | private Type myType; 20 | private String myName; 21 | 22 | public FieldDescriptor(Type type, String name) { 23 | myType = type; 24 | myName = name; 25 | } 26 | 27 | public Type getType() { 28 | return myType; 29 | } 30 | 31 | public String getName() { 32 | return myName; 33 | } 34 | } -------------------------------------------------------------------------------- /event/src/main/java/jetbrains/jetpad/event/PropertyChangeEventWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.event; 17 | 18 | import jetbrains.jetpad.model.property.PropertyChangeEvent; 19 | 20 | public class PropertyChangeEventWrapper extends Event { 21 | private final PropertyChangeEvent myEvent; 22 | 23 | public PropertyChangeEventWrapper(PropertyChangeEvent event) { 24 | myEvent = event; 25 | } 26 | 27 | public PropertyChangeEvent getEvent() { 28 | return myEvent; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/mapper/PosValueExprMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.mapper; 17 | 18 | import jetbrains.jetpad.mapper.Mapper; 19 | import jetbrains.jetpad.hybrid.testapp.model.PosValueExpr; 20 | import jetbrains.jetpad.cell.TextCell; 21 | import jetbrains.jetpad.cell.util.CellFactory; 22 | 23 | class PosValueExprMapper extends Mapper { 24 | PosValueExprMapper(PosValueExpr source) { 25 | super(source, CellFactory.keyword("posValue")); 26 | } 27 | } -------------------------------------------------------------------------------- /grammar/src/main/java/jetbrains/jetpad/grammar/RuleContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.grammar; 17 | 18 | 19 | import com.google.common.collect.Range; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * Context objects which is passed to {@link RuleHandler}s 25 | */ 26 | public interface RuleContext { 27 | ParserParameters getParams(); 28 | Object get(int index); 29 | int getValueCount(); 30 | 31 | ValueT get(ParserParameter key); 32 | 33 | Range getRange(); 34 | List getLexemeValues(); 35 | } -------------------------------------------------------------------------------- /hybrid/src/test/java/jetbrains/jetpad/hybrid/testapp/mapper/ValueExprTextGen.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid.testapp.mapper; 17 | 18 | import jetbrains.jetpad.hybrid.parser.ValueToken; 19 | import jetbrains.jetpad.hybrid.testapp.model.*; 20 | 21 | public class ValueExprTextGen implements ValueToken.ValueTextGen { 22 | @Override 23 | public String toText(Expr val) { 24 | if (val instanceof StringExpr) { 25 | return val.toString(); 26 | } 27 | 28 | throw new UnsupportedOperationException(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/DivExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class DivExpression extends BinaryExpression { 22 | @Override 23 | protected String getSign() { 24 | return "/"; 25 | } 26 | 27 | @Override 28 | public Type getType() { 29 | return Types.INT; 30 | } 31 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/MulExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class MulExpression extends BinaryExpression { 22 | @Override 23 | protected String getSign() { 24 | return "*"; 25 | } 26 | 27 | @Override 28 | public Type getType() { 29 | return Types.INT; 30 | } 31 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/PlusExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class PlusExpression extends BinaryExpression { 22 | @Override 23 | protected String getSign() { 24 | return "+"; 25 | } 26 | 27 | @Override 28 | public Type getType() { 29 | return Types.INT; 30 | } 31 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/BaseCompleter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.hybrid.parser.Token; 19 | 20 | public abstract class BaseCompleter implements Completer { 21 | 22 | protected BaseCompleter() { 23 | } 24 | 25 | @Override 26 | public final Runnable complete(Token token) { 27 | return complete(new Token[] { token }); 28 | } 29 | 30 | @Override 31 | public final Runnable complete(Token... tokens) { 32 | return complete(tokens.length - 1, tokens); 33 | } 34 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/hybridExpr/model/MinusExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.hybridExpr.model; 17 | 18 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Type; 19 | import jetbrains.jetpad.projectional.demo.hybridExpr.model.types.Types; 20 | 21 | public class MinusExpression extends BinaryExpression { 22 | @Override 23 | protected String getSign() { 24 | return "-"; 25 | } 26 | 27 | @Override 28 | public Type getType() { 29 | return Types.INT; 30 | } 31 | } -------------------------------------------------------------------------------- /projectional/src/main/java/jetbrains/jetpad/projectional/generic/EmptyRoleCompletion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.generic; 17 | 18 | import jetbrains.jetpad.completion.CompletionSupplier; 19 | import jetbrains.jetpad.mapper.Mapper; 20 | 21 | public final class EmptyRoleCompletion implements RoleCompletion { 22 | @Override 23 | public CompletionSupplier createRoleCompletion(Mapper mapper, ContextT contextNode, Role target) { 24 | return CompletionSupplier.EMPTY; 25 | } 26 | } -------------------------------------------------------------------------------- /cell/src/test/java/jetbrains/jetpad/cell/message/IndentCellMessagePopupsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.cell.message; 17 | 18 | import jetbrains.jetpad.cell.Cell; 19 | import jetbrains.jetpad.cell.TextCell; 20 | import jetbrains.jetpad.cell.indent.IndentCell; 21 | 22 | public class IndentCellMessagePopupsTest extends MessagePopupsTest { 23 | @Override 24 | protected Cell doCreateCell() { 25 | IndentCell indent = new IndentCell(); 26 | indent.children().add(new TextCell(" ")); // for non-zero dimensions 27 | return indent; 28 | } 29 | } -------------------------------------------------------------------------------- /demo/src/main/java/jetbrains/jetpad/projectional/demo/indentDemo/mapper/WildCardExprMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.demo.indentDemo.mapper; 17 | 18 | import jetbrains.jetpad.cell.TextCell; 19 | import jetbrains.jetpad.cell.util.CellFactory; 20 | import jetbrains.jetpad.mapper.Mapper; 21 | import jetbrains.jetpad.projectional.demo.indentDemo.model.WildCardExpr; 22 | 23 | class WildCardExprMapper extends Mapper { 24 | WildCardExprMapper(WildCardExpr source) { 25 | super(source, CellFactory.label("?")); 26 | } 27 | } -------------------------------------------------------------------------------- /hybrid/src/main/java/jetbrains/jetpad/hybrid/SimpleHybridEditorSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.hybrid; 17 | 18 | import jetbrains.jetpad.completion.CompletionSupplier; 19 | import jetbrains.jetpad.hybrid.parser.prettyprint.PrettyPrinter; 20 | 21 | public interface SimpleHybridEditorSpec extends TokenCompletion { 22 | PrettyPrinter getPrettyPrinter(); 23 | PairSpec getPairSpec(); 24 | CommentSpec getCommentSpec(); 25 | 26 | CompletionSupplier getAdditionalCompletion(CompletionContext ctx, Completer completer); 27 | } 28 | -------------------------------------------------------------------------------- /svg/src/main/java/jetbrains/jetpad/projectional/svg/SvgNodeContainerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 JetBrains s.r.o 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jetbrains.jetpad.projectional.svg; 17 | 18 | import jetbrains.jetpad.projectional.svg.event.SvgAttributeEvent; 19 | 20 | public class SvgNodeContainerAdapter implements SvgNodeContainerListener { 21 | @Override 22 | public void onAttributeSet(SvgElement element, SvgAttributeEvent event) { 23 | } 24 | 25 | @Override 26 | public void onNodeAttached(SvgNode node) { 27 | } 28 | 29 | @Override 30 | public void onNodeDetached(SvgNode element) { 31 | } 32 | } --------------------------------------------------------------------------------