├── .gitignore ├── README.md ├── pom.xml └── src └── main ├── java └── org │ └── panda_lang │ └── lily │ ├── Lily.java │ ├── LilyComposition.java │ ├── LilyConstants.java │ ├── LilyLauncher.java │ ├── plugin │ ├── LilyPlugin.java │ ├── PluginFinder.java │ ├── PluginManager.java │ ├── PluginProperties.java │ ├── console │ │ ├── ConsolePane.java │ │ └── ConsolePlugin.java │ ├── editor │ │ ├── EditorPlugin.java │ │ └── EditorTab.java │ ├── menu │ │ ├── Menu.java │ │ ├── MenuPlugin.java │ │ └── MenuUtils.java │ └── project │ │ ├── ProjectPlugin.java │ │ └── ProjectView.java │ ├── ui │ ├── LilyLayout.java │ └── LilyUI.java │ └── util │ ├── CloseHandler.java │ ├── FXCSSUpdater.java │ ├── FXMLLoaderUtils.java │ ├── FileComparator.java │ └── ResourcesBuilder.java └── resources ├── libs └── codemirror │ ├── panda.min.js │ ├── script.min.js │ └── style.min.css ├── plugins ├── default_plugins.pc ├── editor │ ├── editor.html │ ├── editor_pane.fxml │ └── tab.fxml ├── menu │ └── menu.fxml └── project │ └── project_view.fxml └── ui ├── icons ├── icon.png ├── material_defaultFileIcon.png └── material_defaultFolderIcon.png └── themes ├── dark_material.css └── light_material.css /.gitignore: -------------------------------------------------------------------------------- 1 | ### Maven ### 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | pom.xml.next 7 | release.properties 8 | dependency-reduced-pom.xml 9 | buildNumber.properties 10 | .mvn/timing.properties 11 | 12 | 13 | ### Intellij ### 14 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 15 | 16 | *.iml 17 | 18 | ## Directory-based project format: 19 | .idea/ 20 | # if you remove the above rule, at least ignore the following: 21 | 22 | # User-specific stuff: 23 | # .idea/workspace.xml 24 | # .idea/tasks.xml 25 | # .idea/dictionaries 26 | 27 | # Sensitive or high-churn files: 28 | # .idea/dataSources.ids 29 | # .idea/dataSources.xml 30 | # .idea/sqlDataSources.xml 31 | # .idea/dynamic.xml 32 | # .idea/uiDesigner.xml 33 | 34 | # Gradle: 35 | # .idea/gradle.xml 36 | # .idea/libraries 37 | 38 | # Mongo Explorer plugin: 39 | # .idea/mongoSettings.xml 40 | 41 | ## File-based project format: 42 | *.ipr 43 | *.iws 44 | 45 | ## Plugin-specific files: 46 | 47 | # IntelliJ 48 | /out/ 49 | 50 | # mpeltonen/sbt-idea plugin 51 | .idea_modules/ 52 | 53 | # JIRA plugin 54 | atlassian-ide-plugin.xml 55 | 56 | # Crashlytics plugin (for Android Studio and IntelliJ) 57 | com_crashlytics_export_strings.xml 58 | crashlytics.properties 59 | crashlytics-build.properties 60 | 61 | 62 | ### Eclipse ### 63 | *.pydevproject 64 | .metadata 65 | .gradle 66 | bin/ 67 | tmp/ 68 | *.tmp 69 | *.bak 70 | *.swp 71 | *~.nib 72 | local.properties 73 | .settings/ 74 | .loadpath 75 | 76 | # Eclipse Core 77 | .project 78 | 79 | # External tool builders 80 | .externalToolBuilders/ 81 | 82 | # Locally stored "Eclipse launch configurations" 83 | *.launch 84 | 85 | # CDT-specific 86 | .cproject 87 | 88 | # JDT-specific (Eclipse Java Development Tools) 89 | .classpath 90 | 91 | # Java annotation processor (APT) 92 | .factorypath 93 | 94 | # PDT-specific 95 | .buildpath 96 | 97 | # sbteclipse plugin 98 | .target 99 | 100 | # TeXlipse plugin 101 | .texlipse 102 | 103 | 104 | ### Java ### 105 | *.class 106 | 107 | # Mobile Tools for Java (J2ME) 108 | .mtj.tmp/ 109 | 110 | # Package Files # 111 | *.war 112 | *.ear 113 | 114 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 115 | hs_err_pid* 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lily 2 | Lily is a lightweight IDE for Panda based programming languages. For now, it's still in development phase. 3 | 4 | ![Lily](https://user-images.githubusercontent.com/4235722/107151409-b6d42500-6962-11eb-827f-dfcd22eb6632.png) 5 | 6 | ##### Download 7 | Releases: [Lily Releases](https://github.com/panda-lang/lily/releases)
8 | Current version: [1.0.3](https://github.com/panda-lang/lily/releases/tag/1.0.3) 9 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4.0.0 2 | org.panda-lang 3 | lily 4 | 2024.3.6 5 | jar 6 | 7 | Lily 8 | Lily the Panda IDE 9 | https://panda-lang.org 10 | 11 | 12 | scm:git:https://github.com/panda-lang/lily.git 13 | scm:git:https://github.com/panda-lang/lily.git 14 | https://github.com/panda-lang/lily 15 | 16 | 17 | 18 | 19 | Apache License, Version 2.0 20 | https://www.apache.org/licenses/LICENSE-2.0.txt 21 | repo 22 | 23 | 24 | 25 | 26 | 27 | central 28 | https://repo.maven.apache.org/maven2 29 | 30 | 31 | panda-repository 32 | https://maven.reposilite.com/releases 33 | 34 | 35 | 36 | 37 | 11 38 | 11 39 | ${project.version} 40 | 41 | 42 | 43 | 44 | org.panda-lang 45 | panda 46 | 0.5.2-alpha 47 | 48 | 49 | org.reflections 50 | reflections 51 | 0.9.10 52 | 53 | 54 | org.fxmisc.richtext 55 | richtextfx 56 | 0.6.10 57 | 58 | 59 | org.controlsfx 60 | controlsfx 61 | 8.40.11 62 | 63 | 64 | org.eclipse.jgit 65 | org.eclipse.jgit 66 | 4.4.1.201607150455-r 67 | 68 | 69 | org.openjfx 70 | javafx 71 | 11.0.2 72 | pom 73 | 74 | 75 | org.openjfx 76 | javafx-fxml 77 | 11.0.2 78 | 79 | 80 | org.openjfx 81 | javafx-web 82 | 11.0.2 83 | 84 | 85 | org.openjfx 86 | javafx-controls 87 | 11.0.2 88 | 89 | 90 | org.openjfx 91 | javafx-graphics 92 | 11.0.2 93 | 94 | 95 | 96 | 97 | clean install 98 | 99 | 100 | maven-shade-plugin 101 | 3.5.2 102 | 103 | 104 | package 105 | 106 | shade 107 | 108 | 109 | 110 | 111 | 112 | maven-compiler-plugin 113 | 3.12.1 114 | 115 | 116 | org.codehaus.plexus 117 | plexus-compiler-eclipse 118 | 2.5 119 | 120 | 121 | 122 | ${java.languageLevel} 123 | ${java.version} 124 | 125 | 126 | 127 | org.apache.maven.plugins 128 | maven-jar-plugin 129 | 3.3.0 130 | 131 | 132 | 133 | ${project.name} 134 | ${lily.version} 135 | 136 | 137 | org.panda_lang.lily.Lily 138 | 139 | 140 | 141 | 142 | 143 | org.openjfx 144 | javafx-maven-plugin 145 | 0.0.8 146 | 147 | org.panda_lang.lily.Lily 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/Lily.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily; 18 | 19 | import javafx.application.Application; 20 | import javafx.application.Platform; 21 | import javafx.stage.Stage; 22 | import org.panda_lang.lily.plugin.PluginFinder; 23 | import org.panda_lang.lily.plugin.PluginManager; 24 | import org.panda_lang.lily.ui.LilyUI; 25 | import panda.interpreter.Panda; 26 | import panda.interpreter.PandaFactory; 27 | 28 | public class Lily extends Application { 29 | 30 | public static Lily instance; 31 | 32 | private final Panda panda; 33 | private final PluginManager pluginManager; 34 | private final LilyComposition composition; 35 | private Stage stage; 36 | private LilyUI ui; 37 | 38 | public Lily() { 39 | instance = this; 40 | 41 | this.panda = new PandaFactory().createPanda(); 42 | this.pluginManager = new PluginManager(this); 43 | this.composition = new LilyComposition(this); 44 | } 45 | 46 | @Override 47 | public void start(Stage stage) throws Exception { 48 | this.stage = stage; 49 | this.ui = new LilyUI(this); 50 | 51 | PluginFinder pluginFinder = new PluginFinder(pluginManager); 52 | pluginFinder.find(); 53 | 54 | ui.initialize(); 55 | pluginManager.loadPlugins(); 56 | pluginManager.enablePlugins(); 57 | 58 | stage.show(); 59 | } 60 | 61 | public void exit() { 62 | pluginManager.disablePlugins(); 63 | 64 | Platform.exit(); 65 | System.exit(-1); 66 | } 67 | 68 | public LilyUI getUI() { 69 | return this.ui; 70 | } 71 | 72 | public Stage getStage() { 73 | return this.stage; 74 | } 75 | 76 | public LilyComposition getComposition() { 77 | return composition; 78 | } 79 | 80 | public PluginManager getPluginManager() { 81 | return pluginManager; 82 | } 83 | 84 | public Panda getPanda() { 85 | return panda; 86 | } 87 | 88 | public static Lily getInstance() { 89 | return instance; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/LilyComposition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily; 18 | 19 | public class LilyComposition { 20 | 21 | public LilyComposition(Lily lily) { 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/LilyConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily; 18 | 19 | public class LilyConstants { 20 | 21 | public static final String NAME = "Lily"; 22 | 23 | public static final String VERSION = "2016.0.1"; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/LilyLauncher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily; 18 | 19 | import javafx.application.*; 20 | 21 | public class LilyLauncher { 22 | 23 | public static void main(String[] args) { 24 | Application.launch(Lily.class, args); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/LilyPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin; 18 | 19 | import org.panda_lang.lily.Lily; 20 | 21 | public abstract class LilyPlugin { 22 | 23 | protected PluginProperties pluginProperties; 24 | 25 | public LilyPlugin() { 26 | this.pluginProperties = getClass().getAnnotation(PluginProperties.class); 27 | } 28 | 29 | protected final void initialize() { 30 | if (pluginProperties == null) { 31 | throw new RuntimeException("LilyPlugin without PluginProperties annotation."); 32 | } 33 | } 34 | 35 | public void onLoad() { 36 | } 37 | 38 | public String getVersion() { 39 | return pluginProperties.version(); 40 | } 41 | 42 | public String getName() { 43 | return pluginProperties.name(); 44 | } 45 | 46 | public PluginProperties getPluginProperties() { 47 | return pluginProperties; 48 | } 49 | 50 | public abstract void onEnable(Lily lily); 51 | 52 | public abstract void onDisable(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/PluginFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin; 18 | 19 | import org.panda_lang.lily.Lily; 20 | import org.reflections.Reflections; 21 | import org.reflections.util.ConfigurationBuilder; 22 | 23 | import java.util.Set; 24 | 25 | public class PluginFinder { 26 | 27 | private final PluginManager pluginManager; 28 | 29 | public PluginFinder(PluginManager pluginManager) { 30 | this.pluginManager = pluginManager; 31 | } 32 | 33 | public void find() throws Exception { 34 | ConfigurationBuilder config = new ConfigurationBuilder(); 35 | config.setClassLoaders(new ClassLoader[]{ getClass().getClassLoader() }); 36 | config.addUrls(Lily.class.getProtectionDomain().getCodeSource().getLocation().toURI().toURL()); 37 | 38 | Reflections reflections = new Reflections(config); 39 | Set> annotated = reflections.getTypesAnnotatedWith(PluginProperties.class); 40 | 41 | for (Class clazz : annotated) { 42 | Object objectInstance = clazz.newInstance(); 43 | 44 | if (!(objectInstance instanceof LilyPlugin)) { 45 | continue; 46 | } 47 | 48 | LilyPlugin lilyPlugin = (LilyPlugin) objectInstance; 49 | pluginManager.registerPlugin(lilyPlugin); 50 | } 51 | 52 | System.out.println("Amount of loaded plugins: " + annotated.size()); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/PluginManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin; 18 | 19 | import org.panda_lang.lily.Lily; 20 | 21 | import java.util.ArrayList; 22 | import java.util.Collection; 23 | 24 | public class PluginManager { 25 | 26 | private final Lily lily; 27 | private final Collection plugins; 28 | 29 | public PluginManager(Lily lily) { 30 | this.lily = lily; 31 | this.plugins = new ArrayList<>(); 32 | } 33 | 34 | public void loadPlugins() { 35 | for (LilyPlugin plugin : plugins) { 36 | plugin.onLoad(); 37 | } 38 | } 39 | 40 | public void enablePlugins() { 41 | for (LilyPlugin plugin : plugins) { 42 | plugin.onEnable(lily); 43 | } 44 | } 45 | 46 | public void disablePlugins() { 47 | for (LilyPlugin plugin : plugins) { 48 | plugin.onDisable(); 49 | } 50 | } 51 | 52 | public void registerPlugin(LilyPlugin lilyPlugin) { 53 | plugins.add(lilyPlugin); 54 | } 55 | 56 | @SuppressWarnings("unchecked") 57 | public T getPlugin(String name) { 58 | for (LilyPlugin plugin : plugins) { 59 | String pluginName = plugin.getName(); 60 | 61 | if (name.equals(pluginName)) { 62 | return (T) plugin; 63 | } 64 | } 65 | 66 | return null; 67 | } 68 | 69 | public Collection getPlugins() { 70 | return plugins; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/PluginProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Target(ElementType.TYPE) 25 | @Retention(RetentionPolicy.RUNTIME) 26 | 27 | public @interface PluginProperties { 28 | 29 | String name(); 30 | 31 | String version(); 32 | 33 | } -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/console/ConsolePane.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.console; 18 | 19 | import javafx.scene.control.TextArea; 20 | import javafx.scene.layout.BorderPane; 21 | import javafx.scene.layout.Region; 22 | 23 | import java.io.IOException; 24 | import java.io.OutputStream; 25 | import java.io.PrintStream; 26 | 27 | public class ConsolePane extends BorderPane { 28 | 29 | private static ConsolePane instance; 30 | private final ConsoleOutputStream consoleOutputStream; 31 | private final TextArea textArea; 32 | 33 | protected ConsolePane() { 34 | this.textArea = new TextArea(); 35 | this.consoleOutputStream = new ConsoleOutputStream(this); 36 | 37 | instance = this; 38 | setCenter(textArea); 39 | System.setOut(new PrintStream(consoleOutputStream)); 40 | } 41 | 42 | public void bind(Region parent) { 43 | prefWidthProperty().bind(parent.prefWidthProperty()); 44 | prefHeightProperty().bind(parent.prefHeightProperty()); 45 | } 46 | 47 | public void clear() { 48 | textArea.setText(""); 49 | } 50 | 51 | public void write(char c) { 52 | textArea.setText(textArea.getText() + c); 53 | } 54 | 55 | public TextArea getTextArea() { 56 | return textArea; 57 | } 58 | 59 | public ConsoleOutputStream getConsoleOutputStream() { 60 | return consoleOutputStream; 61 | } 62 | 63 | public static ConsolePane getInstance() { 64 | return instance == null ? new ConsolePane() : instance; 65 | } 66 | 67 | private class ConsoleOutputStream extends OutputStream { 68 | 69 | private final ConsolePane consolePane; 70 | 71 | public ConsoleOutputStream(ConsolePane consolePane) { 72 | this.consolePane = consolePane; 73 | } 74 | 75 | @Override 76 | public void write(int b) throws IOException { 77 | consolePane.write((char) b); 78 | } 79 | 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/console/ConsolePlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.console; 18 | 19 | import org.panda_lang.lily.Lily; 20 | import org.panda_lang.lily.LilyConstants; 21 | import org.panda_lang.lily.plugin.LilyPlugin; 22 | import org.panda_lang.lily.plugin.PluginProperties; 23 | import org.panda_lang.lily.ui.LilyUI; 24 | 25 | @PluginProperties(name = "Console", version = LilyConstants.VERSION) 26 | public class ConsolePlugin extends LilyPlugin { 27 | 28 | private ConsolePane consolePane; 29 | 30 | @Override 31 | public void onEnable(Lily lily) { 32 | this.consolePane = new ConsolePane(); 33 | 34 | LilyUI ui = lily.getUI(); 35 | } 36 | 37 | @Override 38 | public void onDisable() { 39 | 40 | } 41 | 42 | public ConsolePane getConsolePane() { 43 | return consolePane; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/editor/EditorPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.editor; 18 | 19 | import org.panda_lang.lily.Lily; 20 | import org.panda_lang.lily.LilyConstants; 21 | import org.panda_lang.lily.plugin.LilyPlugin; 22 | import org.panda_lang.lily.plugin.PluginProperties; 23 | 24 | @PluginProperties(name = "Editor", version = LilyConstants.VERSION) 25 | public class EditorPlugin extends LilyPlugin { 26 | 27 | @Override 28 | public void onEnable(Lily lily) { 29 | 30 | } 31 | 32 | @Override 33 | public void onDisable() { 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/editor/EditorTab.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.editor; 18 | 19 | import javafx.fxml.FXML; 20 | import javafx.fxml.Initializable; 21 | import javafx.scene.control.Tab; 22 | import javafx.scene.control.TabPane; 23 | import javafx.scene.input.KeyCode; 24 | import javafx.scene.input.KeyCodeCombination; 25 | import javafx.scene.input.KeyCombination; 26 | import javafx.scene.layout.GridPane; 27 | import javafx.scene.layout.Priority; 28 | import javafx.scene.web.WebEngine; 29 | import javafx.scene.web.WebView; 30 | import org.panda_lang.lily.Lily; 31 | import org.panda_lang.lily.util.FXMLLoaderUtils; 32 | import org.panda_lang.lily.util.ResourcesBuilder; 33 | import panda.utilities.FileUtils; 34 | import panda.utilities.IOUtils; 35 | import panda.utilities.StringUtils; 36 | 37 | import java.io.File; 38 | import java.io.IOException; 39 | import java.net.URL; 40 | import java.util.ResourceBundle; 41 | 42 | public class EditorTab extends Tab implements Initializable { 43 | 44 | private static final String template; 45 | 46 | static { 47 | // Initialize template 48 | ResourcesBuilder resourcesBuilder = new ResourcesBuilder(); 49 | resourcesBuilder.importCss("/libs/codemirror/style.min.css"); 50 | resourcesBuilder.importScript("/libs/codemirror/script.min.js"); 51 | resourcesBuilder.importScript("/libs/codemirror/panda.min.js"); 52 | template = IOUtils.convertStreamToString(Lily.class.getResourceAsStream("/plugins/editor/editor.html")) 53 | .map(it -> it.replace("{imports}", resourcesBuilder.toString())) 54 | .get(); 55 | } 56 | 57 | @FXML private WebView webView; 58 | 59 | private WebEngine webEngine; 60 | private String title; 61 | private boolean changed; 62 | private boolean succeeded; 63 | 64 | public EditorTab() { 65 | super(); 66 | FXMLLoaderUtils.loadElementFromResources(this, "/plugins/editor/tab.fxml"); 67 | } 68 | 69 | public static String getTemplate() { 70 | return template; 71 | } 72 | 73 | @Override 74 | public void initialize(URL location, ResourceBundle resources) { 75 | // Style 76 | webEngine = webView.getEngine(); 77 | GridPane.setHgrow(webView, Priority.ALWAYS); 78 | GridPane.setVgrow(webView, Priority.ALWAYS); 79 | } 80 | 81 | public void run(TabPane pane, File file) throws IOException { 82 | if (file == null) { 83 | return; 84 | } 85 | 86 | // Tab Settings 87 | this.title = file.getName(); 88 | setText(title); 89 | 90 | // Engine settings 91 | webView.setVisible(true); 92 | webEngine.setJavaScriptEnabled(true); 93 | 94 | // Load source 95 | String source = FileUtils.getContentOfFile(file); 96 | source = StringUtils.replace(source, " ", "\t"); 97 | 98 | // Load content 99 | String content = template.replace("{code}", source); 100 | webEngine.loadContent(content); 101 | webView.setUserData(file); 102 | 103 | // Tabs 104 | pane.getTabs().add(this); 105 | pane.getSelectionModel().select(this); 106 | 107 | // Accelerators 108 | webView.getScene().getAccelerators().put(new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_ANY), () -> { 109 | File f = (File) webView.getUserData(); 110 | String src = (String) webEngine.executeScript("editor.getValue()"); 111 | // StringUtils.replace(src, "\t", " ") 112 | try { 113 | FileUtils.overrideFile(f, src); 114 | } catch (IOException e) { 115 | throw new RuntimeException(e); 116 | } 117 | setText(title); 118 | changed = false; 119 | }); 120 | 121 | // State listener 122 | webEngine.getLoadWorker().stateProperty().addListener((obs, oldValue, newValue) -> { 123 | switch (newValue) { 124 | case SUCCEEDED: { 125 | succeeded = true; 126 | } 127 | } 128 | }); 129 | 130 | // Events 131 | webView.setOnKeyPressed(key -> { 132 | if (!changed) { 133 | KeyCode keyCode = key.getCode(); 134 | if (keyCode.isLetterKey() || keyCode.isDigitKey() || keyCode.isWhitespaceKey() || keyCode == KeyCode.BACK_SPACE) { 135 | setText(title + " *"); 136 | changed = true; 137 | } 138 | } 139 | }); 140 | } 141 | 142 | public boolean isChanged() { 143 | return changed; 144 | } 145 | 146 | public boolean isSucceeded() { 147 | return succeeded; 148 | } 149 | 150 | public WebEngine getWebEngine() { 151 | return webEngine; 152 | } 153 | 154 | public WebView getWebView() { 155 | return webView; 156 | } 157 | 158 | public void setWebView(WebView webView) { 159 | this.webView = webView; 160 | } 161 | 162 | public Tab getTab() { 163 | return this; 164 | } 165 | 166 | public String getTitle() { 167 | return title; 168 | } 169 | 170 | } 171 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/menu/Menu.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.menu; 18 | 19 | import javafx.fxml.FXML; 20 | import javafx.fxml.Initializable; 21 | import javafx.scene.control.MenuItem; 22 | import javafx.scene.layout.BorderPane; 23 | import org.panda_lang.lily.util.FXMLLoaderUtils; 24 | 25 | import java.net.URL; 26 | import java.util.ResourceBundle; 27 | 28 | public class Menu extends BorderPane implements Initializable { 29 | 30 | @FXML public MenuItem menuFileSettings; 31 | @FXML public MenuItem menuFileSaveAll; 32 | @FXML public MenuItem menuEditRedo; 33 | @FXML public MenuItem menuEditCut; 34 | @FXML public MenuItem menuEditCopy; 35 | @FXML public MenuItem menuEditPaste; 36 | @FXML public MenuItem menuEditFind; 37 | @FXML public MenuItem menuEditSelectAll; 38 | @FXML public MenuItem menuEditDelete; 39 | @FXML private MenuItem menuFileNew; 40 | @FXML private MenuItem menuFileOpenFile; 41 | @FXML private MenuItem menuFileOpenFolder; 42 | @FXML private MenuItem menuFileExit; 43 | @FXML private MenuItem menuEditUndo; 44 | @FXML private MenuItem menuRunRun; 45 | @FXML private MenuItem menuGitClone; 46 | @FXML private MenuItem menuHelpAbout; 47 | 48 | public Menu() { 49 | FXMLLoaderUtils.loadElementFromResources(this, "/plugins/menu/menu.fxml"); 50 | } 51 | 52 | @Override 53 | public void initialize(URL location, ResourceBundle resources) { 54 | MenuUtils.extend(menuFileOpenFolder); 55 | MenuUtils.extend(menuEditUndo); 56 | MenuUtils.extend(menuRunRun); 57 | MenuUtils.extend(menuGitClone); 58 | MenuUtils.extend(menuHelpAbout); 59 | 60 | /* 61 | // Action: File -> New 62 | menuFileNew.setOnAction(event -> { 63 | FileChooser fileChooser = new FileChooser(); 64 | fileChooser.setInitialDirectory(tree.getDirectory()); 65 | fileChooser.showOpenDialog(Lily.instance.getStage()); 66 | tree.open(tree.getDirectory()); 67 | }); 68 | 69 | // Action: File -> Open 70 | menuFileOpenFile.setOnAction(event -> { 71 | FileChooser fileChooser = new FileChooser(); 72 | File file = fileChooser.showOpenDialog(Lily.instance.getStage()); 73 | if (file != null) { 74 | tree.open(file); 75 | } 76 | }); 77 | // Action: File -> Open folder 78 | menuFileOpenFolder.setOnAction(event -> { 79 | DirectoryChooser fileChooser = new DirectoryChooser(); 80 | File file = fileChooser.showDialog(Lily.instance.getStage()); 81 | if (file != null) { 82 | tree.open(file); 83 | } 84 | }); 85 | // Action: File -> Exit 86 | menuFileExit.setOnAction(event -> System.exit(-1)); 87 | 88 | // Action: Run -> Run 89 | menuRunRun.setOnAction(event -> { 90 | ConsolePane consolePane = ConsolePane.getInstance(); 91 | consolePane.clear(); 92 | workspaceAssistantsPane.getItems().clear(); 93 | workspaceAssistantsPane.getItems().add(consolePane); 94 | consolePane.bind(workspaceAssistantsPane); 95 | 96 | String source = (String) getCurrentTab().getWebEngine().executeScript("editor.getValue()"); 97 | 98 | // TODO 99 | // PandaScript pandaScript = Lily.instance.getPanda().getPandaLoader().loadSimpleScript(source); 100 | // pandaScript.call(MethodBlock.class, "main"); 101 | }); 102 | */ 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/menu/MenuPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.menu; 18 | 19 | import javafx.scene.layout.BorderPane; 20 | import org.panda_lang.lily.Lily; 21 | import org.panda_lang.lily.LilyConstants; 22 | import org.panda_lang.lily.plugin.LilyPlugin; 23 | import org.panda_lang.lily.plugin.PluginProperties; 24 | import org.panda_lang.lily.ui.LilyLayout; 25 | import org.panda_lang.lily.ui.LilyUI; 26 | 27 | @PluginProperties(name = "Console", version = LilyConstants.VERSION) 28 | public class MenuPlugin extends LilyPlugin { 29 | 30 | private Menu menu; 31 | 32 | @Override 33 | public void onEnable(Lily lily) { 34 | this.menu = new Menu(); 35 | 36 | LilyUI ui = lily.getUI(); 37 | LilyLayout layout = ui.getLayout(); 38 | BorderPane borderPane = layout.getBorderPane(); 39 | 40 | LilyLayout menuLayout = new LilyLayout("menu", menu); 41 | layout.addLayout(menuLayout); 42 | borderPane.setTop(menu); 43 | } 44 | 45 | @Override 46 | public void onDisable() { 47 | 48 | } 49 | 50 | public Menu getMenu() { 51 | return menu; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/menu/MenuUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.menu; 18 | 19 | import javafx.scene.control.MenuItem; 20 | 21 | public class MenuUtils { 22 | 23 | public static void extend(MenuItem menuItem) { 24 | String currentName = menuItem.getText(); 25 | StringBuilder builder = new StringBuilder(currentName); 26 | int required = 50 - currentName.length(); 27 | 28 | for (int i = 0; i < required; i++) { 29 | builder.append(' '); 30 | } 31 | 32 | menuItem.setText(builder.toString()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/project/ProjectPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.project; 18 | 19 | import javafx.scene.layout.BorderPane; 20 | import org.panda_lang.lily.Lily; 21 | import org.panda_lang.lily.LilyConstants; 22 | import org.panda_lang.lily.plugin.LilyPlugin; 23 | import org.panda_lang.lily.plugin.PluginProperties; 24 | import org.panda_lang.lily.ui.LilyLayout; 25 | import org.panda_lang.lily.ui.LilyUI; 26 | 27 | import java.io.File; 28 | 29 | @PluginProperties(name = "Project", version = LilyConstants.VERSION) 30 | public class ProjectPlugin extends LilyPlugin { 31 | 32 | private ProjectView projectView; 33 | 34 | @Override 35 | public void onEnable(Lily lily) { 36 | this.projectView = new ProjectView(this); 37 | 38 | LilyUI ui = lily.getUI(); 39 | LilyLayout layout = ui.getLayout(); 40 | BorderPane pane = layout.getBorderPane(); 41 | 42 | LilyLayout projectLayout = new LilyLayout("project"); 43 | layout.addLayout(projectLayout); 44 | 45 | BorderPane projectBorderPane = projectLayout.getBorderPane(); 46 | projectBorderPane.setLeft(projectView); 47 | pane.setCenter(projectBorderPane); 48 | 49 | File currentDirectory = new File("."); 50 | projectView.open(currentDirectory); 51 | } 52 | 53 | @Override 54 | public void onDisable() { 55 | 56 | } 57 | 58 | public ProjectView getProjectView() { 59 | return projectView; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/plugin/project/ProjectView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.plugin.project; 18 | 19 | import javafx.scene.control.Alert; 20 | import javafx.scene.control.TreeItem; 21 | import javafx.scene.control.TreeView; 22 | import javafx.scene.image.Image; 23 | import javafx.scene.image.ImageView; 24 | import javafx.stage.Stage; 25 | import org.panda_lang.lily.util.FXMLLoaderUtils; 26 | import org.panda_lang.lily.util.FileComparator; 27 | 28 | import java.io.File; 29 | import java.util.Arrays; 30 | import java.util.HashMap; 31 | import java.util.Map; 32 | 33 | public class ProjectView extends TreeView { 34 | 35 | private final ProjectView tree; 36 | private final Image defaultFileIcon; 37 | private final Image defaultFolderIcon; 38 | private final Map, File> files; 39 | private final FileComparator comparator; 40 | private File directory; 41 | 42 | public ProjectView(ProjectPlugin projectPlugin) { 43 | super(); 44 | 45 | FXMLLoaderUtils.loadElementFromResources(this, "/plugins/project/project_view.fxml"); 46 | 47 | this.tree = this; 48 | this.files = new HashMap<>(); 49 | this.comparator = new FileComparator(); 50 | this.defaultFileIcon = new Image(getClass().getResourceAsStream("/ui/icons/material_defaultFileIcon.png")); 51 | this.defaultFolderIcon = new Image(getClass().getResourceAsStream("/ui/icons/material_defaultFolderIcon.png")); 52 | 53 | this.setOnMouseClicked(mouseEvent -> { 54 | if (mouseEvent.getClickCount() < 2) { 55 | return; 56 | } 57 | 58 | TreeItem item = tree.getSelectionModel().getSelectedItem(); 59 | File file = files.get(item); 60 | 61 | if (file.isDirectory()) { 62 | return; 63 | } 64 | 65 | double bytes = file.length(); 66 | double kilobytes = (bytes / 1024); 67 | double megabytes = (kilobytes / 1024); 68 | 69 | if (megabytes > 1) { 70 | Alert alert = new Alert(Alert.AlertType.WARNING); 71 | alert.setTitle("Lily Warning"); 72 | alert.setHeaderText("File is too large"); 73 | alert.setContentText("File can not be larger than 1MB"); 74 | 75 | Stage stage = (Stage) alert.getDialogPane().getScene().getWindow(); 76 | stage.getIcons().add(new Image("/ui/icons/icon.png")); 77 | 78 | alert.showAndWait(); 79 | return; 80 | } 81 | 82 | //Lily.instance.getUI().displayFile(file); 83 | }); 84 | } 85 | 86 | public void open(File directory) { 87 | this.directory = directory; 88 | findFiles(directory, null); 89 | } 90 | 91 | private void addFile(TreeItem root, File file) { 92 | TreeItem item = new TreeItem<>(file.getName()); 93 | item.setGraphic(new ImageView(defaultFileIcon)); 94 | root.getChildren().add(item); 95 | files.put(item, file); 96 | } 97 | 98 | private void findFiles(File directory, TreeItem parent) { 99 | TreeItem root = new TreeItem<>(directory.getName()); 100 | 101 | if (directory.isFile()) { 102 | addFile(root, directory); 103 | return; 104 | } 105 | 106 | File[] files = directory.listFiles(); 107 | 108 | if (files != null) { 109 | sort(files); 110 | 111 | for (File file : files) { 112 | if (file.isDirectory()) { 113 | findFiles(file, root); 114 | continue; 115 | } 116 | 117 | addFile(root, file); 118 | } 119 | } 120 | 121 | root.setExpanded(false); 122 | root.setGraphic(new ImageView(defaultFolderIcon)); 123 | 124 | if (parent == null) { 125 | root.setExpanded(true); 126 | tree.setRoot(root); 127 | return; 128 | } 129 | 130 | parent.getChildren().add(root); 131 | } 132 | 133 | public void sort(File[] array) { 134 | Arrays.sort(array, comparator); 135 | } 136 | 137 | public File getDirectory() { 138 | return directory; 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/ui/LilyLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.ui; 18 | 19 | import javafx.scene.layout.BorderPane; 20 | 21 | import java.util.ArrayList; 22 | import java.util.Collection; 23 | 24 | public class LilyLayout { 25 | 26 | private final String name; 27 | private final Collection layouts; 28 | private final BorderPane borderPane; 29 | 30 | public LilyLayout(String name) { 31 | this(name, new BorderPane()); 32 | } 33 | 34 | public LilyLayout(String name, BorderPane borderPane) { 35 | this.name = name; 36 | this.borderPane = borderPane; 37 | this.layouts = new ArrayList<>(); 38 | } 39 | 40 | public LilyLayout findLayout(String name) { 41 | if (getName().equals(name)) { 42 | return this; 43 | } 44 | 45 | for (LilyLayout layout : layouts) { 46 | String layoutName = layout.getName(); 47 | 48 | if (layoutName.equals(name)) { 49 | return layout; 50 | } 51 | } 52 | 53 | return null; 54 | } 55 | 56 | public void addLayout(LilyLayout layout) { 57 | layouts.add(layout); 58 | } 59 | 60 | public BorderPane getBorderPane() { 61 | return borderPane; 62 | } 63 | 64 | public Collection getLayouts() { 65 | return layouts; 66 | } 67 | 68 | public String getName() { 69 | return name; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/ui/LilyUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.ui; 18 | 19 | import javafx.geometry.Rectangle2D; 20 | import javafx.scene.Parent; 21 | import javafx.scene.Scene; 22 | import javafx.scene.image.Image; 23 | import javafx.stage.Screen; 24 | import javafx.stage.Stage; 25 | import org.panda_lang.lily.Lily; 26 | import org.panda_lang.lily.LilyConstants; 27 | import org.panda_lang.lily.util.CloseHandler; 28 | 29 | public class LilyUI { 30 | 31 | private final Lily lily; 32 | private LilyLayout layout; 33 | 34 | public LilyUI(Lily lily) { 35 | this.lily = lily; 36 | this.layout = new LilyLayout("ui"); 37 | } 38 | 39 | public void initialize() { 40 | Rectangle2D bounds = Screen.getPrimary().getVisualBounds(); 41 | 42 | Stage stage = lily.getStage(); 43 | stage.setWidth(bounds.getWidth() - 2); 44 | stage.setHeight(bounds.getHeight() * 0.9); 45 | stage.setX((bounds.getWidth() - stage.getWidth()) / 2); 46 | stage.setY((bounds.getHeight() - stage.getHeight()) / 2); 47 | 48 | Parent root = layout.getBorderPane(); 49 | root.getStylesheets().add("/ui/themes/light_material.css"); 50 | 51 | Scene scene = new Scene(root, stage.getWidth(), stage.getHeight()); 52 | stage.setScene(scene); 53 | 54 | CloseHandler handler = new CloseHandler(lily); 55 | stage.setOnCloseRequest(handler); 56 | 57 | stage.getIcons().add(new Image("/ui/icons/icon.png")); 58 | stage.setTitle(LilyConstants.NAME + " " + LilyConstants.VERSION); 59 | } 60 | 61 | public LilyLayout getLayout() { 62 | return layout; 63 | } 64 | 65 | public Lily getLily() { 66 | return lily; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/util/CloseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.util; 18 | 19 | import javafx.event.EventHandler; 20 | import javafx.stage.WindowEvent; 21 | import org.panda_lang.lily.Lily; 22 | 23 | public class CloseHandler implements EventHandler { 24 | 25 | private final Lily lily; 26 | 27 | public CloseHandler(Lily lily) { 28 | this.lily = lily; 29 | } 30 | 31 | @Override 32 | public void handle(WindowEvent event) { 33 | lily.exit(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/util/FXCSSUpdater.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.util; 18 | 19 | import javafx.application.Platform; 20 | import javafx.beans.property.StringProperty; 21 | import javafx.scene.Parent; 22 | import javafx.scene.Scene; 23 | import panda.utilities.IOUtils; 24 | 25 | import java.io.FileNotFoundException; 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | import java.net.URL; 29 | import java.net.URLConnection; 30 | import java.net.URLStreamHandler; 31 | import java.net.URLStreamHandlerFactory; 32 | 33 | public class FXCSSUpdater { 34 | 35 | { 36 | URL.setURLStreamHandlerFactory(new StringURLStreamHandlerFactory()); 37 | } 38 | 39 | private String css; 40 | private Scene scene; 41 | 42 | public FXCSSUpdater(Scene scene) { 43 | this.scene = scene; 44 | } 45 | 46 | public void bindCss(StringProperty cssProperty){ 47 | cssProperty.addListener(e -> { 48 | this.css = cssProperty.get(); 49 | Platform.runLater(()->{ 50 | scene.getStylesheets().clear(); 51 | scene.getStylesheets().add("internal:stylesheet.css"); 52 | }); 53 | }); 54 | } 55 | 56 | public void applyCssToParent(Parent parent){ 57 | parent.getStylesheets().clear(); 58 | scene.getStylesheets().add("internal:stylesheet.css"); 59 | } 60 | 61 | private class StringURLConnection extends URLConnection { 62 | 63 | public StringURLConnection(URL url){ 64 | super(url); 65 | } 66 | 67 | @Override 68 | public void connect() throws IOException {} 69 | 70 | @Override public InputStream getInputStream() throws IOException { 71 | return IOUtils.convertStringToStream(css); 72 | } 73 | 74 | } 75 | 76 | private class StringURLStreamHandlerFactory implements URLStreamHandlerFactory { 77 | URLStreamHandler streamHandler = new URLStreamHandler(){ 78 | @Override 79 | protected URLConnection openConnection(URL url) throws IOException { 80 | if (url.toString().toLowerCase().endsWith(".css")) { 81 | return new StringURLConnection(url); 82 | } 83 | throw new FileNotFoundException(); 84 | } 85 | }; 86 | 87 | @Override 88 | public URLStreamHandler createURLStreamHandler(String protocol) { 89 | if ("internal".equals(protocol)) { 90 | return streamHandler; 91 | } 92 | return null; 93 | } 94 | 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/util/FXMLLoaderUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.util; 18 | 19 | import javafx.fxml.FXMLLoader; 20 | import org.panda_lang.lily.Lily; 21 | 22 | import java.io.IOException; 23 | 24 | public class FXMLLoaderUtils { 25 | 26 | public static void loadElementFromResources(Object element, String location) { 27 | FXMLLoader fxmlLoader = new FXMLLoader(Lily.class.getResource(location)); 28 | fxmlLoader.setRoot(element); 29 | fxmlLoader.setController(element); 30 | 31 | try { 32 | fxmlLoader.load(); 33 | } catch (IOException exception) { 34 | throw new RuntimeException(exception); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/util/FileComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.util; 18 | 19 | import java.io.File; 20 | import java.util.Comparator; 21 | 22 | public class FileComparator implements Comparator { 23 | 24 | @Override 25 | public int compare(File f1, File f2) { 26 | if (f1.isDirectory() && !f2.isDirectory()) { 27 | return -1; 28 | } 29 | else if (!f1.isDirectory() && f2.isDirectory()) { 30 | return 1; 31 | } 32 | else { 33 | return f1.compareTo(f2); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/panda_lang/lily/util/ResourcesBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | package org.panda_lang.lily.util; 18 | 19 | import org.panda_lang.lily.Lily; 20 | 21 | public class ResourcesBuilder { 22 | 23 | private final StringBuilder stringBuilder; 24 | 25 | public ResourcesBuilder() { 26 | this.stringBuilder = new StringBuilder(); 27 | } 28 | 29 | public void importCss(String file) { 30 | stringBuilder.append(""); 33 | } 34 | 35 | public void importScript(String file) { 36 | stringBuilder.append(""); 39 | } 40 | 41 | public StringBuilder getStringBuilder() { 42 | return stringBuilder; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return stringBuilder.toString(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/resources/libs/codemirror/panda.min.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineSimpleMode("panda", { 2 | start: [ 3 | 4 | {regex: /"(?:[^\\]|\\.)*?"/, 5 | token: "string"}, 6 | 7 | /* 8 | {regex: /(function|on)(\s+)([a-z$][\w$]*)/, 9 | token: ["keyword", null, "variable-2"]}, 10 | */ 11 | 12 | {regex: /(?:function|public|private|final|static|package|extends|super|global|follow|return|if|for|loop|while|else|do|this|vial|group|import|class|method|void|constructor|new|on|command)\b/, 13 | token: "keyword"}, 14 | 15 | {regex: /true|false|null|undefined/, 16 | token: "atom"}, 17 | 18 | {regex: /0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i, 19 | token: "number"}, 20 | 21 | {regex: /\/\/.*/, 22 | token: "comment"}, 23 | 24 | {regex: /\/(?:[^\\]|\\.)*?\//, 25 | token: "variable-3"}, 26 | 27 | {regex: /\/\*/, 28 | token: "comment", next: "comment"}, 29 | 30 | {regex: /[-+\/*=<>!]+/, 31 | token: "operator"}, 32 | 33 | {regex: /[\{\[\(]/, indent: true}, 34 | {regex: /[\}\]\)]/, dedent: true}, 35 | 36 | {regex: /[a-z$][\w$]*/, 37 | token: "variable"}, 38 | 39 | {regex: /<>/}} 41 | ], 42 | 43 | comment: [ 44 | {regex: /.*?\*\//, 45 | token: "comment", next: "start"}, 46 | 47 | {regex: /.*/, 48 | token: "comment"} 49 | ], 50 | 51 | meta: { 52 | dontIndentStates: ["comment"], 53 | lineComment: "//" 54 | } 55 | 56 | }); 57 | -------------------------------------------------------------------------------- /src/main/resources/libs/codemirror/style.min.css: -------------------------------------------------------------------------------- 1 | .CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0} 2 | 3 | .cm-s-lily.CodeMirror, .cm-s-lily .CodeMirror-gutters { 4 | background-color: #2d2d30 !important; 5 | color: #B2BFCE !important; 6 | font-family: Consolas; 7 | font-size: 13px; 8 | border: none; 9 | } 10 | .cm-s-lily .CodeMirror-gutters { color: #282a36; } 11 | .cm-s-lily .CodeMirror-cursor { border-left: solid thin #f8f8f0; } 12 | .cm-s-lily .CodeMirror-linenumber { color: #585F69; } 13 | .cm-s-lily.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } 14 | .cm-s-lily .CodeMirror-line::selection, .cm-s-lily .CodeMirror-line > span::selection, .cm-s-lily .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } 15 | .cm-s-lily .CodeMirror-line::-moz-selection, .cm-s-lily .CodeMirror-line > span::-moz-selection, .cm-s-lily .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } 16 | .cm-s-lily span.cm-comment { color: #6F7680; font-style: italic; } 17 | .cm-s-lily span.cm-string, .cm-s-lily span.cm-string-2 { color: #9FC889; } 18 | .cm-s-lily span.cm-number { color: #A885FF; } 19 | .cm-s-lily span.cm-variable { color: #B2BFCE; } 20 | .cm-s-lily span.cm-variable-2 { color: white; } 21 | .cm-s-lily span.cm-def { color: #67A1FF; } 22 | .cm-s-lily span.cm-keyword { color: #67A1FF; } 23 | .cm-s-lily span.cm-operator { color: white; } 24 | .cm-s-lily span.cm-atom { color: #67A1FF; } 25 | .cm-s-lily span.cm-meta { color: #B2BFCE; } 26 | .cm-s-lily span.cm-tag { color: #ff79c6; } 27 | .cm-s-lily span.cm-attribute { color: #B2BFCE; } 28 | .cm-s-lily span.cm-qualifier { color: #B2BFCE; } 29 | .cm-s-lily span.cm-property { color: #66d9ef; } 30 | .cm-s-lily span.cm-builtin { color: #B2BFCE; } 31 | .cm-s-lily span.cm-variable-3 { color: #B2BFCE; } 32 | 33 | .cm-s-lily .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); } 34 | .cm-s-lily .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } -------------------------------------------------------------------------------- /src/main/resources/plugins/default_plugins.pc: -------------------------------------------------------------------------------- 1 | plugins: 2 | - Editor 3 | - Menu 4 | - Project -------------------------------------------------------------------------------- /src/main/resources/plugins/editor/editor.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | Tab 22 | {imports} 23 | 40 | 41 | 42 | 43 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/main/resources/plugins/editor/editor_pane.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/plugins/editor/tab.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/plugins/menu/menu.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
61 | 62 |
63 | 64 | 65 | 66 |
67 |
68 |
-------------------------------------------------------------------------------- /src/main/resources/plugins/project/project_view.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/ui/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panda-lang/lily/f2ca206d725976279dee2e348d1b3540a633b557/src/main/resources/ui/icons/icon.png -------------------------------------------------------------------------------- /src/main/resources/ui/icons/material_defaultFileIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panda-lang/lily/f2ca206d725976279dee2e348d1b3540a633b557/src/main/resources/ui/icons/material_defaultFileIcon.png -------------------------------------------------------------------------------- /src/main/resources/ui/icons/material_defaultFolderIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panda-lang/lily/f2ca206d725976279dee2e348d1b3540a633b557/src/main/resources/ui/icons/material_defaultFolderIcon.png -------------------------------------------------------------------------------- /src/main/resources/ui/themes/dark_material.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | /* Pane */ 18 | .pane { 19 | -fx-background-color: #2a2a2a; 20 | } 21 | 22 | /* Menu */ 23 | .menu-bar { 24 | -fx-background-color: #2a2a2a; 25 | } 26 | 27 | .menu:hover, .menu:selected, .menu:focused, .menu:showing, .menu:selected:showing { 28 | -fx-background-color: #2a2a2a; 29 | } 30 | 31 | .menu .label { 32 | -fx-text-fill: #ffffff; 33 | } 34 | 35 | .context-menu { 36 | -fx-background-color: #2a2a2a; 37 | } 38 | 39 | .menu-item:hover, .menu-item:focused { 40 | -fx-background-color: #6170c1; 41 | } 42 | 43 | .menu-item:showing, .menu-item:selected, .menu-item:selected:showing { 44 | -fx-background-color: #2a2a2a; 45 | } 46 | 47 | .tool-bar { 48 | -fx-background-color: #2a2a2a; 49 | -fx-border-width: 1 0 0 0; 50 | -fx-border-color: #2c2c2c #2c2c2c #2c2c2c #2c2c2c; 51 | } 52 | 53 | /* SplitPane */ 54 | .split-pane { 55 | -fx-margin: 0; 56 | -fx-padding: 0; 57 | -fx-border-width: 1 0 0 0; 58 | -fx-border-color: #2c2c2c #2c2c2c #2c2c2c #2c2c2c; 59 | -fx-background-color: #2a2a2a; 60 | } 61 | 62 | .split-pane:horizontal > .split-pane-divider, .split-pane:vertical > .split-pane-divider { 63 | -fx-padding: 0 0 0 0; 64 | -fx-border-color: #333333; 65 | -fx-background-color: #2a2a2a; 66 | } 67 | 68 | /* ScrollBar */ 69 | .scroll-bar:horizontal, .scroll-bar:vertical { 70 | -fx-background-color: #2a2a2a; 71 | } 72 | 73 | .scroll-bar:horizontal .track, .scroll-bar:vertical .track { 74 | -fx-background-color: #2a2a2a; 75 | } 76 | 77 | .scroll-bar:horizontal .increment-button, .scroll-bar:horizontal .decrement-button { 78 | -fx-background-color: #2a2a2a; 79 | -fx-padding: 0 -2 0 -2; 80 | } 81 | 82 | .scroll-bar:vertical .increment-button, .scroll-bar:vertical .decrement-button { 83 | -fx-background-color: #2a2a2a; 84 | -fx-padding: 0 -2 0 -2; 85 | } 86 | 87 | .scroll-bar .increment-arrow, .scroll-bar .decrement-arrow { 88 | -fx-background-color: #2a2a2a; 89 | -fx-shape: " "; 90 | } 91 | 92 | .scroll-bar:horizontal .thumb, .scroll-bar:vertical .thumb { 93 | -fx-background-color: #cc0052; 94 | -fx-background-radius: 0; 95 | -fx-background-insets: 0, 0, 0; 96 | } 97 | 98 | /* TreeView */ 99 | .table-view { 100 | -fx-base: #2a2a2a; 101 | -fx-background-color: #2a2a2a; 102 | -fx-width: 400px; 103 | } 104 | 105 | .tree-cell { 106 | -fx-indent: 20; 107 | -fx-text-fill: #FFFFFF; 108 | -fx-background-color: #2a2a2a; 109 | } 110 | 111 | .tree-cell:selected { 112 | -fx-background-color: #6170c1; 113 | } 114 | 115 | /* TabPane */ 116 | .tab-pane { 117 | -fx-background-color: #333333; 118 | -fx-border-width: 0 0 0 0; 119 | } 120 | 121 | .tab-pane *.tab-header-background { 122 | -fx-background-color: #2a2a2a; 123 | -fx-border-width: 0 0 0 0; 124 | } 125 | 126 | .tab { 127 | -fx-background-color: #2d2d30; 128 | -fx-background-radius: 0; 129 | -fx-focus-color: transparent; 130 | -fx-faint-focus-color: transparent; 131 | -fx-padding: 0 15 0 15; 132 | -fx-border-width: 1 1 1 1; 133 | -fx-border-color: #2a2a2a; 134 | -fx-cursor: hand; 135 | } 136 | 137 | .tab-label { 138 | -fx-text-fill: #FFFFFF; 139 | -fx-alignment: CENTER; 140 | -fx-focus-color: transparent; 141 | } 142 | 143 | .tab-close-button { 144 | -fx-font-size: 8; 145 | } 146 | 147 | /* WebView */ 148 | .web-view { 149 | -fx-focus-color: transparent; 150 | -fx-faint-focus-color: transparent; 151 | -fx-border-width: 0; 152 | } 153 | 154 | /* TextArea */ 155 | .text-area, .text-area .content { 156 | width: 100%; 157 | -fx-background-color: #2d2d30; 158 | -fx-font-family: monospace; 159 | -fx-font-size: 12; 160 | -fx-border-width: 0 0 0 0; 161 | -fx-text-fill: #ffffff; 162 | -fx-border-radius: 0; 163 | -fx-border-color: #2d2d30; 164 | -fx-background-radius: 0; 165 | } -------------------------------------------------------------------------------- /src/main/resources/ui/themes/light_material.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2018 Dzikoysk 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 | 17 | --------------------------------------------------------------------------------