├── php.laravel4 ├── nbproject │ ├── suite.properties │ ├── project.properties │ ├── genfiles.properties │ ├── build-impl.xml │ └── project.xml ├── src │ └── org │ │ └── nbphpcouncil │ │ └── modules │ │ └── php │ │ └── laravel4 │ │ ├── ui │ │ ├── resources │ │ │ └── laravel_badge_8.png │ │ ├── wizards │ │ │ ├── Bundle.properties │ │ │ ├── NewProjectConfigurationPanel.form │ │ │ └── NewProjectConfigurationPanel.java │ │ ├── customizer │ │ │ ├── Bundle.properties │ │ │ ├── Laravel4CustomizerPanel.form │ │ │ └── Laravel4CustomizerPanel.java │ │ ├── options │ │ │ ├── Bundle.properties │ │ │ ├── Laravel4OptionsPanelController.java │ │ │ ├── Laravel4OptionsPanel.form │ │ │ └── Laravel4OptionsPanel.java │ │ └── actions │ │ │ └── Laravel4PhpModuleActionsExtender.java │ │ ├── resources │ │ ├── Bundle.properties │ │ └── layer.xml │ │ ├── Laravel4PhpModuleIgnoredFilesExtender.java │ │ ├── commands │ │ ├── Artisan.java │ │ └── Laravel4CommandSupport.java │ │ ├── support │ │ ├── Utils.java │ │ ├── Laravel4Support.java │ │ └── PhpProjectSupport.java │ │ ├── validation │ │ ├── OptionsValidator.java │ │ └── CustomizerValidator.java │ │ ├── preferences │ │ └── Laravel4Preferences.java │ │ ├── options │ │ └── Laravel4Options.java │ │ ├── Laravel4PhpModuleCustomizerExtender.java │ │ ├── Laravel4PhpFrameworkProvider.java │ │ └── Laravel4PhpModuleExtender.java ├── manifest.mf └── build.xml ├── .gitignore ├── README.md ├── nbproject ├── project.xml ├── project.properties ├── genfiles.properties ├── platform.properties ├── platform.xml └── build-impl.xml └── license.txt /php.laravel4/nbproject/suite.properties: -------------------------------------------------------------------------------- 1 | suite.dir=${basedir}/.. 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /php.laravel4/nbproject/private/ 3 | /nbproject/private/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | nb-laravel-plugin 2 | ================= 3 | 4 | Laravel Framework plugin for NetBeans 7.4+ 5 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/resources/laravel_badge_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbphpcouncil/nb-laravel-plugin/HEAD/php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/resources/laravel_badge_8.png -------------------------------------------------------------------------------- /php.laravel4/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | javac.source=1.6 2 | javac.compilerargs=-Xlint -Xlint:-serial 3 | license.file=../license.txt 4 | nbm.homepage=http://www.nbphpcouncil.org 5 | nbm.module.author=NetBeans PHP Community Council 6 | project.license=cddl-netbeans-sun 7 | -------------------------------------------------------------------------------- /php.laravel4/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | OpenIDE-Module: org.nbphpcouncil.modules.php.laravel4/1 3 | OpenIDE-Module-Implementation-Version: 1 4 | OpenIDE-Module-Layer: org/nbphpcouncil/modules/php/laravel4/resources/layer.xml 5 | OpenIDE-Module-Localizing-Bundle: org/nbphpcouncil/modules/php/laravel4/resources/Bundle.properties 6 | OpenIDE-Module-Specification-Version: 0.1.1 7 | 8 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.apisupport.project.suite 4 | 5 | 6 | nblaravel4 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /php.laravel4/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=e965deda 2 | build.xml.script.CRC32=87bdee85 3 | build.xml.stylesheet.CRC32=a56c6a5b@2.56.1 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=e965deda 7 | nbproject/build-impl.xml.script.CRC32=ee525419 8 | nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.56.1 9 | -------------------------------------------------------------------------------- /php.laravel4/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Builds, tests, and runs the project org.nbphpcouncil.modules.php.laravel4. 7 | 8 | 9 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | auxiliary.org-netbeans-modules-apisupport-installer.license-type=cddl+gplv2 2 | auxiliary.org-netbeans-modules-apisupport-installer.os-linux=false 3 | auxiliary.org-netbeans-modules-apisupport-installer.os-macosx=true 4 | auxiliary.org-netbeans-modules-apisupport-installer.os-solaris=false 5 | auxiliary.org-netbeans-modules-apisupport-installer.os-windows=false 6 | auxiliary.org-netbeans-modules-apisupport-installer.pack200-enabled=true 7 | modules=\ 8 | ${project.org.netbeans.modules.php.laravel4} 9 | project.org.netbeans.modules.php.laravel4=php.laravel4 10 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=fab5242d 2 | build.xml.script.CRC32=dfed1293 3 | build.xml.stylesheet.CRC32=eaf9f76a@2.56.1 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=fab5242d 7 | nbproject/build-impl.xml.script.CRC32=f4ab3ac3 8 | nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.56.1 9 | nbproject/platform.xml.data.CRC32=fab5242d 10 | nbproject/platform.xml.script.CRC32=6dcbd131 11 | nbproject/platform.xml.stylesheet.CRC32=4e1f53d4@2.62.1 12 | -------------------------------------------------------------------------------- /nbproject/platform.properties: -------------------------------------------------------------------------------- 1 | cluster.path=\ 2 | ${nbplatform.active.dir}/apisupport:\ 3 | ${nbplatform.active.dir}/enterprise:\ 4 | ${nbplatform.active.dir}/ergonomics:\ 5 | ${nbplatform.active.dir}/groovy:\ 6 | ${nbplatform.active.dir}/harness:\ 7 | ${nbplatform.active.dir}/ide:\ 8 | ${nbplatform.active.dir}/java:\ 9 | ${nbplatform.active.dir}/javafx:\ 10 | ${nbplatform.active.dir}/nb:\ 11 | ${nbplatform.active.dir}/php:\ 12 | ${nbplatform.active.dir}/platform:\ 13 | ${nbplatform.active.dir}/profiler:\ 14 | ${nbplatform.active.dir}/webcommon:\ 15 | ${nbplatform.active.dir}/websvccommon 16 | nbplatform.active=default 17 | -------------------------------------------------------------------------------- /nbproject/platform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /php.laravel4/nbproject/build-impl.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | You must set 'suite.dir' to point to your containing module suite 17 | 18 | 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 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/resources/Bundle.properties: -------------------------------------------------------------------------------- 1 | OpenIDE-Module-Display-Category=PHP 2 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | # 4 | # Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | # Other names may be trademarks of their respective owners. 8 | # 9 | # The contents of this file are subject to the terms of either the GNU 10 | # General Public License Version 2 only ("GPL") or the Common 11 | # Development and Distribution License("CDDL") (collectively, the 12 | # "License"). You may not use this file except in compliance with the 13 | # License. You can obtain a copy of the License at 14 | # http://www.netbeans.org/cddl-gplv2.html 15 | # or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | # specific language governing permissions and limitations under the 17 | # License. When distributing the software, include this License Header 18 | # Notice in each file and include the License file at 19 | # nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | # particular file as subject to the "Classpath" exception as provided 21 | # by Oracle in the GPL Version 2 section of the License file that 22 | # accompanied this code. If applicable, add the following below the 23 | # License Header, with the fields enclosed by brackets [] replaced by 24 | # your own identifying information: 25 | # "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | # 27 | # If you wish your version of this file to be governed by only the CDDL 28 | # or only the GPL Version 2, indicate your decision by adding 29 | # "[Contributor] elects to include this software in this distribution 30 | # under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | # single choice of license, a recipient has the option to distribute 32 | # your version of this file under either the CDDL, the GPL Version 2 or 33 | # to extend the choice of license to its licensees as provided above. 34 | # However, if you add GPL Version 2 code and therefore, elected the GPL 35 | # Version 2 license, then the option applies only if the new code is 36 | # made subject to such option by the copyright holder. 37 | # 38 | # Contributor(s): 39 | # 40 | # Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | OpenIDE-Module-Name=Laravel4 Framework 42 | OpenIDE-Module-Short-Description=NetBeans Plugin for Laravel Framework 43 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/wizards/Bundle.properties: -------------------------------------------------------------------------------- 1 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 | # 3 | # Copyright 2013 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Oracle and Java are registered trademarks of Oracle and/or its affiliates. 6 | # Other names may be trademarks of their respective owners. 7 | # 8 | # The contents of this file are subject to the terms of either the GNU 9 | # General Public License Version 2 only ("GPL") or the Common 10 | # Development and Distribution License("CDDL") (collectively, the 11 | # "License"). You may not use this file except in compliance with the 12 | # License. You can obtain a copy of the License at 13 | # http://www.netbeans.org/cddl-gplv2.html 14 | # or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 15 | # specific language governing permissions and limitations under the 16 | # License. When distributing the software, include this License Header 17 | # Notice in each file and include the License file at 18 | # nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 19 | # particular file as subject to the "Classpath" exception as provided 20 | # by Oracle in the GPL Version 2 section of the License file that 21 | # accompanied this code. If applicable, add the following below the 22 | # License Header, with the fields enclosed by brackets [] replaced by 23 | # your own identifying information: 24 | # "Portions Copyrighted 2013 NetBeans PHP Community Council" 25 | # 26 | # If you wish your version of this file to be governed by only the CDDL 27 | # or only the GPL Version 2, indicate your decision by adding 28 | # "[Contributor] elects to include this software in this distribution 29 | # under the [CDDL or GPL Version 2] license." If you do not indicate a 30 | # single choice of license, a recipient has the option to distribute 31 | # your version of this file under either the CDDL, the GPL Version 2 or 32 | # to extend the choice of license to its licensees as provided above. 33 | # However, if you add GPL Version 2 code and therefore, elected the GPL 34 | # Version 2 license, then the option applies only if the new code is 35 | # made subject to such option by the copyright holder. 36 | # 37 | # Contributor(s): 38 | # 39 | # Portions Copyrighted 2013 Sun Microsystems, Inc. 40 | NewProjectConfigurationPanel.infoLabel.text=Selected Laravel Skeleton Application will be used. 41 | NewProjectConfigurationPanel.optionsLabel.text=Options... 42 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/customizer/Bundle.properties: -------------------------------------------------------------------------------- 1 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 | # 3 | # Copyright 2013 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Oracle and Java are registered trademarks of Oracle and/or its affiliates. 6 | # Other names may be trademarks of their respective owners. 7 | # 8 | # The contents of this file are subject to the terms of either the GNU 9 | # General Public License Version 2 only ("GPL") or the Common 10 | # Development and Distribution License("CDDL") (collectively, the 11 | # "License"). You may not use this file except in compliance with the 12 | # License. You can obtain a copy of the License at 13 | # http://www.netbeans.org/cddl-gplv2.html 14 | # or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 15 | # specific language governing permissions and limitations under the 16 | # License. When distributing the software, include this License Header 17 | # Notice in each file and include the License file at 18 | # nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 19 | # particular file as subject to the "Classpath" exception as provided 20 | # by Oracle in the GPL Version 2 section of the License file that 21 | # accompanied this code. If applicable, add the following below the 22 | # License Header, with the fields enclosed by brackets [] replaced by 23 | # your own identifying information: 24 | # "Portions Copyrighted 2013 NetBeans PHP Community Council" 25 | # 26 | # If you wish your version of this file to be governed by only the CDDL 27 | # or only the GPL Version 2, indicate your decision by adding 28 | # "[Contributor] elects to include this software in this distribution 29 | # under the [CDDL or GPL Version 2] license." If you do not indicate a 30 | # single choice of license, a recipient has the option to distribute 31 | # your version of this file under either the CDDL, the GPL Version 2 or 32 | # to extend the choice of license to its licensees as provided above. 33 | # However, if you add GPL Version 2 code and therefore, elected the GPL 34 | # Version 2 license, then the option applies only if the new code is 35 | # made subject to such option by the copyright holder. 36 | # 37 | # Contributor(s): 38 | # 39 | # Portions Copyrighted 2013 Sun Microsystems, Inc. 40 | Laravel4CustomizerPanel.enabledCheckBox.text=&Enabled 41 | Laravel4CustomizerPanel.enabledInfoLabel.text=Enable support for Laravel4 for this project 42 | Laravel4CustomizerPanel.appDirectoryLabel.text=App Directory: 43 | Laravel4CustomizerPanel.appDirectoryTextField.text= 44 | Laravel4CustomizerPanel.appDirectoryBrowseButton.text=&Browse... 45 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/resources/layer.xml: -------------------------------------------------------------------------------- 1 | 2 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/options/Bundle.properties: -------------------------------------------------------------------------------- 1 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 | # 3 | # Copyright 2013 Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Oracle and Java are registered trademarks of Oracle and/or its affiliates. 6 | # Other names may be trademarks of their respective owners. 7 | # 8 | # The contents of this file are subject to the terms of either the GNU 9 | # General Public License Version 2 only ("GPL") or the Common 10 | # Development and Distribution License("CDDL") (collectively, the 11 | # "License"). You may not use this file except in compliance with the 12 | # License. You can obtain a copy of the License at 13 | # http://www.netbeans.org/cddl-gplv2.html 14 | # or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 15 | # specific language governing permissions and limitations under the 16 | # License. When distributing the software, include this License Header 17 | # Notice in each file and include the License file at 18 | # nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 19 | # particular file as subject to the "Classpath" exception as provided 20 | # by Oracle in the GPL Version 2 section of the License file that 21 | # accompanied this code. If applicable, add the following below the 22 | # License Header, with the fields enclosed by brackets [] replaced by 23 | # your own identifying information: 24 | # "Portions Copyrighted 2013 NetBeans PHP Community Council" 25 | # 26 | # If you wish your version of this file to be governed by only the CDDL 27 | # or only the GPL Version 2, indicate your decision by adding 28 | # "[Contributor] elects to include this software in this distribution 29 | # under the [CDDL or GPL Version 2] license." If you do not indicate a 30 | # single choice of license, a recipient has the option to distribute 31 | # your version of this file under either the CDDL, the GPL Version 2 or 32 | # to extend the choice of license to its licensees as provided above. 33 | # However, if you add GPL Version 2 code and therefore, elected the GPL 34 | # Version 2 license, then the option applies only if the new code is 35 | # made subject to such option by the copyright holder. 36 | # 37 | # Contributor(s): 38 | # 39 | # Portions Copyrighted 2013 Sun Microsystems, Inc. 40 | Laravel4OptionsPanel.skeletonInfoLabel.text=Provide path to Laravel Skeleton Application (*.zip). 41 | Laravel4OptionsPanel.skeletonLabel.text=Laravel: 42 | Laravel4OptionsPanel.skeletonTextField.text= 43 | Laravel4OptionsPanel.browseSkeletonButton.text=&Browse... 44 | Laravel4OptionsPanel.noteLabel.text=Note: 45 | Laravel4OptionsPanel.downloadSkeletonLabel.text=Download Laravel Skeleton Application. 46 | Laravel4OptionsPanel.errorLabel.text=ERROR 47 | -------------------------------------------------------------------------------- /nbproject/build-impl.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 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 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/actions/Laravel4PhpModuleActionsExtender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.ui.actions; 43 | 44 | import org.netbeans.modules.php.spi.framework.PhpModuleActionsExtender; 45 | import org.openide.util.NbBundle; 46 | 47 | /** 48 | * PHP module action extender for Laravel4 PHP framework. 49 | */ 50 | public class Laravel4PhpModuleActionsExtender extends PhpModuleActionsExtender { 51 | 52 | @NbBundle.Messages("LBL_MenuName=Laravel4") 53 | @Override 54 | public String getMenuName() { 55 | return Bundle.LBL_MenuName(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/Laravel4PhpModuleIgnoredFilesExtender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4; 43 | 44 | import java.io.File; 45 | import java.util.Collections; 46 | import java.util.Set; 47 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 48 | import org.netbeans.modules.php.spi.framework.PhpModuleIgnoredFilesExtender; 49 | 50 | /** 51 | * PHP module ignore files extender for Laravel4 PHP framework. 52 | */ 53 | public class Laravel4PhpModuleIgnoredFilesExtender extends PhpModuleIgnoredFilesExtender { 54 | 55 | private final PhpModule phpModule; 56 | 57 | public Laravel4PhpModuleIgnoredFilesExtender(PhpModule phpModule) { 58 | this.phpModule = phpModule; 59 | } 60 | 61 | @Override 62 | public Set getIgnoredFiles() { 63 | // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 64 | return Collections.emptySet(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/commands/Artisan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.commands; 43 | 44 | import java.util.Collections; 45 | import java.util.List; 46 | import java.util.logging.Logger; 47 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 48 | import org.openide.filesystems.FileObject; 49 | 50 | /** 51 | * Represents Laravel4 command line tool. 52 | */ 53 | public class Artisan { 54 | 55 | public static final String SCRIPT_NAME = "artisan"; // NOI18N 56 | private static final Logger LOGGER = Logger.getLogger(Artisan.class.getName()); 57 | private static final List DEFAULT_PARAMS = Collections.singletonList("--ansi"); // NOI18N 58 | 59 | /** 60 | * @return console script or {@code null} if not valid 61 | */ 62 | public static FileObject getPath(PhpModule phpModule) { 63 | FileObject sourceDirectory = phpModule.getSourceDirectory(); 64 | 65 | if (sourceDirectory == null) { 66 | // broken project 67 | return null; 68 | } 69 | 70 | return sourceDirectory.getFileObject(SCRIPT_NAME); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/wizards/NewProjectConfigurationPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 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 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/support/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.support; 43 | 44 | /** 45 | * Utils class for Laravel4 PHP framework. 46 | */ 47 | public class Utils { 48 | 49 | public static boolean contains(Object[] array, Object objectToFind) { 50 | return indexOf(array, objectToFind) != -1; 51 | } 52 | 53 | public static int indexOf(Object[] array, Object objectToFind) { 54 | int index = -1; 55 | 56 | if (array != null) { 57 | if (objectToFind == null) { 58 | for (int i = 0; i < array.length; i++) { 59 | if (array[i] == null) { 60 | index = i; 61 | break; 62 | } 63 | } 64 | } else { 65 | for (int i = 0; i < array.length; i++) { 66 | if (objectToFind.equals(array[i])) { 67 | index = i; 68 | break; 69 | } 70 | } 71 | } 72 | } 73 | 74 | return index; 75 | } 76 | 77 | public static String join(Object[] array, CharSequence delimiter) { 78 | StringBuilder sb = new StringBuilder(); 79 | 80 | for (int i = 0; i < array.length; i++) { 81 | if (i > 0) { 82 | sb.append(delimiter); 83 | } 84 | 85 | sb.append(array[i]); 86 | } 87 | 88 | return sb.toString(); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/validation/OptionsValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.validation; 43 | 44 | import java.io.File; 45 | import org.netbeans.modules.php.api.util.FileUtils; 46 | import org.netbeans.modules.php.api.validation.ValidationResult; 47 | import org.openide.util.NbBundle; 48 | 49 | /** 50 | * Options validator 51 | */ 52 | public class OptionsValidator { 53 | 54 | private final ValidationResult result = new ValidationResult(); 55 | 56 | public ValidationResult getResult() { 57 | return new ValidationResult(result); 58 | } 59 | 60 | public OptionsValidator validate(String skeleton) { 61 | String err = validateSkeleton(skeleton); 62 | 63 | if (err != null) { 64 | result.addError(new ValidationResult.Message("skeleton", err)); // NOI18N 65 | } 66 | 67 | return this; 68 | } 69 | 70 | @NbBundle.Messages({ 71 | "OptionsValidator.skeleton.title=Skeleton Application", 72 | "OptionsValidator.skeleton.notZip=Skeleton Applivation is not Zip file." 73 | }) 74 | private String validateSkeleton(String skeleton) { 75 | String error = FileUtils.validateFile(Bundle.OptionsValidator_skeleton_title(), skeleton, false); 76 | 77 | if (error == null) { 78 | if (!new File(skeleton).getName().toLowerCase().endsWith(".zip")) { // NOI18N 79 | error = Bundle.OptionsValidator_skeleton_notZip(); 80 | } 81 | } 82 | 83 | return error; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/commands/Laravel4CommandSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.commands; 43 | 44 | import java.io.File; 45 | import java.util.List; 46 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 47 | import org.netbeans.modules.php.spi.framework.commands.FrameworkCommand; 48 | import org.netbeans.modules.php.spi.framework.commands.FrameworkCommandSupport; 49 | import org.openide.util.NbBundle; 50 | 51 | /** 52 | * Command support for Laravel4 PHP framework. 53 | */ 54 | public class Laravel4CommandSupport extends FrameworkCommandSupport { 55 | 56 | public Laravel4CommandSupport(PhpModule phpModule) { 57 | super(phpModule); 58 | } 59 | 60 | @NbBundle.Messages("LBL_Laravel4=Laravel4") 61 | @Override 62 | public String getFrameworkName() { 63 | return Bundle.LBL_Laravel4(); 64 | } 65 | 66 | @Override 67 | public void runCommand(CommandDescriptor cd, Runnable r) { 68 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 69 | } 70 | 71 | @Override 72 | protected String getOptionsPath() { 73 | return null; 74 | } 75 | 76 | @Override 77 | protected File getPluginsDirectory() { 78 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 79 | } 80 | 81 | @Override 82 | protected List getFrameworkCommandsInternal() { 83 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/preferences/Laravel4Preferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.preferences; 43 | 44 | import java.util.prefs.Preferences; 45 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 46 | import org.nbphpcouncil.modules.php.laravel4.Laravel4PhpFrameworkProvider; 47 | 48 | /** 49 | * Preferences for Laravel4 PHP framework. 50 | */ 51 | public class Laravel4Preferences { 52 | 53 | private static final String ENABLED = "enabled"; // NOI18N 54 | private static final String APP_DIRECTORY_PATH = "appDirectory-path"; // NOI18N 55 | private static final String DEFAULT_APP_DIRECTORY_PATH = "app"; // NOI18N 56 | 57 | private Laravel4Preferences() { 58 | } 59 | 60 | @org.netbeans.api.annotations.common.SuppressWarnings("NP_BOOLEAN_RETURN_NULL") 61 | public static Boolean isEnabled(PhpModule module) { 62 | String enabled = getPreferences(module).get(ENABLED, null); 63 | if (enabled == null) { 64 | return null; 65 | } 66 | return Boolean.valueOf(enabled); 67 | } 68 | 69 | public static void setEnabled(PhpModule module, boolean enabled) { 70 | getPreferences(module).putBoolean(ENABLED, enabled); 71 | } 72 | 73 | public static String getAppDirectory(PhpModule module) { 74 | return getPreferences(module).get(APP_DIRECTORY_PATH, DEFAULT_APP_DIRECTORY_PATH); 75 | } 76 | 77 | public static void setAppDirectory(PhpModule phpModule, String appDirectoryPath) { 78 | if (appDirectoryPath.equals(DEFAULT_APP_DIRECTORY_PATH)) { 79 | getPreferences(phpModule).remove(APP_DIRECTORY_PATH); 80 | } else { 81 | getPreferences(phpModule).put(APP_DIRECTORY_PATH, appDirectoryPath); 82 | } 83 | } 84 | 85 | private static Preferences getPreferences(PhpModule phpModule) { 86 | return phpModule.getPreferences(Laravel4PhpFrameworkProvider.class, true); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/options/Laravel4Options.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.options; 43 | 44 | import java.util.prefs.PreferenceChangeEvent; 45 | import java.util.prefs.PreferenceChangeListener; 46 | import java.util.prefs.Preferences; 47 | import javax.swing.event.ChangeListener; 48 | import org.openide.util.ChangeSupport; 49 | import org.openide.util.NbPreferences; 50 | 51 | /** 52 | * Options for Laravel4 PHP framework. 53 | */ 54 | public class Laravel4Options { 55 | // Do not change arbitrary - consult with layer's folder OptionsExport 56 | // Path to Preferences node for storing these preferences 57 | 58 | private static final String PREFERENCES_PATH = "laravel4"; // NOI18N 59 | private static final Laravel4Options INSTANCE = new Laravel4Options(); 60 | // properties 61 | private static final String SKELETON = "skeleton"; // NOI18N 62 | final ChangeSupport changeSupport = new ChangeSupport(this); 63 | 64 | public static Laravel4Options getInstance() { 65 | return INSTANCE; 66 | } 67 | 68 | private Laravel4Options() { 69 | getPreferences().addPreferenceChangeListener(new PreferenceChangeListener() { 70 | @Override 71 | public void preferenceChange(PreferenceChangeEvent evt) { 72 | changeSupport.fireChange(); 73 | } 74 | }); 75 | } 76 | 77 | public String getSkeleton() { 78 | return getPreferences().get(SKELETON, null); 79 | } 80 | 81 | public void setSkeleton(String skelton) { 82 | getPreferences().put(SKELETON, skelton); 83 | } 84 | 85 | public void addChangeListener(ChangeListener listener) { 86 | changeSupport.addChangeListener(listener); 87 | } 88 | 89 | public void removeChangeListener(ChangeListener listener) { 90 | changeSupport.removeChangeListener(listener); 91 | } 92 | 93 | private Preferences getPreferences() { 94 | return NbPreferences.forModule(Laravel4Options.class).node(PREFERENCES_PATH); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/validation/CustomizerValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.validation; 43 | 44 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 45 | import org.netbeans.modules.php.api.util.StringUtils; 46 | import org.netbeans.modules.php.api.validation.ValidationResult; 47 | import org.openide.filesystems.FileObject; 48 | import org.openide.filesystems.FileUtil; 49 | import org.openide.util.NbBundle; 50 | 51 | /** 52 | * Customizer validator 53 | */ 54 | public class CustomizerValidator { 55 | 56 | private final PhpModule phpModule; 57 | private final ValidationResult result = new ValidationResult(); 58 | 59 | public CustomizerValidator(PhpModule phpModule) { 60 | this.phpModule = phpModule; 61 | } 62 | 63 | public ValidationResult getResult() { 64 | return new ValidationResult(result); 65 | } 66 | 67 | public CustomizerValidator validate(String appDirectory) { 68 | String error = validateAppDirectory(appDirectory); 69 | 70 | if (error != null) { 71 | result.addError(new ValidationResult.Message("appDirectory", error)); // NOI18N 72 | } 73 | 74 | return this; 75 | } 76 | 77 | @NbBundle.Messages({ 78 | "CustomizerValidator.error.sources.invalid=Source Files are invalid.", 79 | "CustomizerValidator.error.appDirectory.empty=App directory must be set.", 80 | "CustomizerValidator.error.appDirectory.notChild=App directory must be underneath Source Files.",}) 81 | private String validateAppDirectory(String appDirectory) { 82 | FileObject sources = phpModule.getSourceDirectory(); 83 | 84 | if (sources == null) { 85 | // broken project 86 | assert false : "Customizer extender for no sources of: " + phpModule.getName(); 87 | 88 | return Bundle.CustomizerValidator_error_sources_invalid(); 89 | } 90 | 91 | if (!StringUtils.hasText(appDirectory)) { 92 | return Bundle.CustomizerValidator_error_appDirectory_empty(); 93 | } 94 | 95 | FileObject fo = sources.getFileObject(appDirectory); 96 | 97 | if (fo == null || !FileUtil.isParentOf(sources, fo)) { 98 | return Bundle.CustomizerValidator_error_appDirectory_notChild(); 99 | } 100 | 101 | return null; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/customizer/Laravel4CustomizerPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 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 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
95 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/Laravel4PhpModuleCustomizerExtender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4; 43 | 44 | import java.util.EnumSet; 45 | import javax.swing.JComponent; 46 | import javax.swing.event.ChangeListener; 47 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 48 | import org.netbeans.modules.php.api.validation.ValidationResult; 49 | import org.nbphpcouncil.modules.php.laravel4.preferences.Laravel4Preferences; 50 | import org.nbphpcouncil.modules.php.laravel4.ui.customizer.Laravel4CustomizerPanel; 51 | import org.nbphpcouncil.modules.php.laravel4.validation.CustomizerValidator; 52 | import org.netbeans.modules.php.spi.framework.PhpModuleCustomizerExtender; 53 | import org.openide.util.HelpCtx; 54 | import org.openide.util.NbBundle; 55 | 56 | /** 57 | * PHP module customizer extender for Laravel4 PHP framework. 58 | * 59 | */ 60 | public class Laravel4PhpModuleCustomizerExtender extends PhpModuleCustomizerExtender { 61 | 62 | private final PhpModule phpModule; 63 | private final boolean originalEnabled; 64 | private final String originalAppDirectory; 65 | // @GuardedBy(EDT) 66 | private Laravel4CustomizerPanel component; 67 | 68 | public Laravel4PhpModuleCustomizerExtender(PhpModule phpModule) { 69 | this.phpModule = phpModule; 70 | this.originalEnabled = Laravel4PhpFrameworkProvider.getInstance().isInPhpModule(phpModule); 71 | this.originalAppDirectory = Laravel4Preferences.getAppDirectory(phpModule); 72 | } 73 | 74 | @NbBundle.Messages("LBL_Laravel4=Laravel4") 75 | @Override 76 | public String getDisplayName() { 77 | return Bundle.LBL_Laravel4(); 78 | } 79 | 80 | @Override 81 | public void addChangeListener(ChangeListener listener) { 82 | getPanel().addChangeListener(listener); 83 | } 84 | 85 | @Override 86 | public void removeChangeListener(ChangeListener listener) { 87 | getPanel().removeChangeListener(listener); 88 | } 89 | 90 | @Override 91 | public JComponent getComponent() { 92 | return getPanel(); 93 | } 94 | 95 | @Override 96 | public HelpCtx getHelp() { 97 | return null; 98 | } 99 | 100 | @Override 101 | public boolean isValid() { 102 | return getErrorMessage() == null; 103 | } 104 | 105 | @Override 106 | public String getErrorMessage() { 107 | if (getPanel().isSupportEnabled()) { 108 | // validate 109 | ValidationResult validationResult = new CustomizerValidator(phpModule) 110 | .validate(getPanel().getAppDirectory()) 111 | .getResult(); 112 | 113 | if (validationResult.hasErrors()) { 114 | return validationResult.getErrors().get(0).getMessage(); 115 | } 116 | } 117 | 118 | return null; 119 | } 120 | 121 | @Override 122 | public EnumSet save(PhpModule phpModule) { 123 | EnumSet changes = EnumSet.noneOf(Change.class); 124 | saveEnabled(changes); 125 | saveAppDirectory(changes); 126 | 127 | if (changes.isEmpty()) { 128 | return null; 129 | } 130 | 131 | return changes; 132 | } 133 | 134 | private void saveEnabled(EnumSet changes) { 135 | boolean newEnabled = getPanel().isSupportEnabled(); 136 | 137 | if (newEnabled != originalEnabled) { 138 | Laravel4Preferences.setEnabled(phpModule, newEnabled); 139 | changes.add(Change.FRAMEWORK_CHANGE); 140 | } 141 | } 142 | 143 | private void saveAppDirectory(EnumSet changes) { 144 | String newAppDirectory = getPanel().getAppDirectory(); 145 | 146 | if (!newAppDirectory.equals(originalAppDirectory)) { 147 | Laravel4Preferences.setAppDirectory(phpModule, newAppDirectory); 148 | changes.add(Change.FRAMEWORK_CHANGE); 149 | } 150 | } 151 | 152 | private Laravel4CustomizerPanel getPanel() { 153 | if (component == null) { 154 | component = new Laravel4CustomizerPanel(phpModule.getSourceDirectory()); 155 | component.setSupportEnabled(originalEnabled); 156 | component.setAppDirectory(originalAppDirectory); 157 | } 158 | 159 | return component; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/support/Laravel4Support.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.support; 43 | 44 | import java.io.File; 45 | import java.io.IOException; 46 | import java.util.HashMap; 47 | import java.util.Map; 48 | import org.netbeans.api.project.Project; 49 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 50 | import org.openide.filesystems.FileObject; 51 | import org.openide.filesystems.FileUtil; 52 | import org.openide.loaders.DataFolder; 53 | import org.openide.loaders.DataObject; 54 | import org.openide.util.Exceptions; 55 | 56 | /** 57 | * Support class for Laravel4 PHP framework. 58 | */ 59 | public class Laravel4Support { 60 | 61 | private static final String AUTO_COMPLETE_DIRECORY = "autocomplete"; // NOI18N 62 | private static final String AUTO_COMPLETE_FILE_NAME = "__l4_auto_complete__"; // NOI18N 63 | private static final String AUTO_COMPLETE_FILE = AUTO_COMPLETE_FILE_NAME + ".php"; // NOI18N 64 | private static final String AUTO_COMPLETE_TEMPLATE_PATH = "org-nbphpcouncil-modules-php-laravel4/__l4_auto_complete__.php"; // NOI18N 65 | 66 | public static void generateAutoCompletionFile(PhpModule phpModule) { 67 | Project project = PhpProjectSupport.getProject(phpModule.getSourceDirectory()); 68 | FileObject projectDirectory = project.getProjectDirectory(); 69 | FileObject nbProjectDirectory = PhpProjectSupport.getNbProjectDirectory(projectDirectory); 70 | 71 | if (nbProjectDirectory != null) { 72 | FileObject autoCompleteTemplateFile = FileUtil.getConfigFile(AUTO_COMPLETE_TEMPLATE_PATH); 73 | 74 | if (autoCompleteTemplateFile != null) { 75 | Map parameters = new HashMap(); 76 | 77 | try { 78 | FileObject autoCompleteDirectory = getAutoCompleteDirectory(nbProjectDirectory); 79 | File autoCompleteFile = new File(autoCompleteDirectory.getPath(), AUTO_COMPLETE_FILE); 80 | 81 | if (autoCompleteFile.exists()) { 82 | autoCompleteFile.delete(); 83 | } 84 | 85 | DataFolder autoCompleteDirectoryDataFolder = DataFolder.findFolder(autoCompleteDirectory); 86 | DataObject autoCompleteTemplateDataObject = DataObject.find(autoCompleteTemplateFile); 87 | autoCompleteTemplateDataObject.createFromTemplate(autoCompleteDirectoryDataFolder, AUTO_COMPLETE_FILE_NAME, parameters); 88 | PhpProjectSupport.setIncludePath(project, FileUtil.getRelativePath(projectDirectory, autoCompleteDirectory)); 89 | } catch (IOException ex) { 90 | Exceptions.printStackTrace(ex); 91 | } 92 | } 93 | } 94 | } 95 | 96 | public static void removeAutoCompletionFile(PhpModule phpModule) { 97 | Project project = PhpProjectSupport.getProject(phpModule.getSourceDirectory()); 98 | FileObject projectDirectory = project.getProjectDirectory(); 99 | FileObject nbProjectDirectory = PhpProjectSupport.getNbProjectDirectory(projectDirectory); 100 | 101 | if (nbProjectDirectory != null) { 102 | try { 103 | FileObject autoCompleteDirectory = getAutoCompleteDirectory(nbProjectDirectory); 104 | 105 | if (autoCompleteDirectory != null) { 106 | File autoCompleteFile = new File(autoCompleteDirectory.getPath(), AUTO_COMPLETE_FILE); 107 | 108 | if (autoCompleteFile.exists()) { 109 | autoCompleteFile.delete(); 110 | 111 | } 112 | 113 | if (autoCompleteDirectory.getChildren().length == 0) { 114 | autoCompleteDirectory.delete(); 115 | } 116 | } 117 | } catch (IOException ex) { 118 | Exceptions.printStackTrace(ex); 119 | } 120 | } 121 | } 122 | 123 | private static FileObject getAutoCompleteDirectory(FileObject nbProjectDirectory) throws IOException { 124 | FileObject autoCompleteDirectory = null; 125 | File directory = new File(nbProjectDirectory.getPath(), AUTO_COMPLETE_DIRECORY); 126 | 127 | if (directory.exists()) { 128 | try { 129 | autoCompleteDirectory = FileUtil.createFolder(nbProjectDirectory, AUTO_COMPLETE_DIRECORY); 130 | } catch (IOException ex) { 131 | Exceptions.printStackTrace(ex); 132 | } 133 | } else { 134 | FileUtil.createFolder(directory); 135 | autoCompleteDirectory = FileUtil.toFileObject(directory); 136 | } 137 | 138 | return autoCompleteDirectory; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/support/PhpProjectSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.support; 43 | 44 | import java.io.File; 45 | import org.netbeans.api.project.FileOwnerQuery; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.spi.project.support.ant.AntProjectHelper; 48 | import org.netbeans.spi.project.support.ant.EditableProperties; 49 | import org.netbeans.spi.project.support.ant.PropertyUtils; 50 | import org.openide.filesystems.FileObject; 51 | import org.openide.filesystems.FileUtil; 52 | 53 | /** 54 | * PHP project support for Laravel4 PHP framework. 55 | */ 56 | public class PhpProjectSupport { 57 | 58 | private static final String NB_PROJECT_DIRECTORY = "nbproject"; // NOI18N 59 | private static final String INCLUDE_PATH = "include.path"; // NOI18N 60 | private static final String REFERENCE_ID_PREFIX = "file.reference."; 61 | 62 | public static Project getProject(FileObject fo) { 63 | return FileOwnerQuery.getOwner(fo); 64 | } 65 | 66 | public static FileObject getProjectDirectory(FileObject fo) { 67 | FileObject projectDirectory = null; 68 | 69 | Project project = getProject(fo); 70 | 71 | if (project != null) { 72 | projectDirectory = project.getProjectDirectory(); 73 | } 74 | 75 | return projectDirectory; 76 | } 77 | 78 | public static FileObject getNbProjectDirectory(FileObject fo) { 79 | FileObject nbProjectDirectory = null; 80 | FileObject projectDirectory = getProjectDirectory(fo); 81 | 82 | if (projectDirectory != null) { 83 | nbProjectDirectory = projectDirectory.getFileObject(NB_PROJECT_DIRECTORY); 84 | } 85 | 86 | return nbProjectDirectory; 87 | } 88 | 89 | public static String getIncludePath(Project project) { 90 | assert project != null; 91 | 92 | String includePath = null; 93 | AntProjectHelper helper = getProjectHelper(project); 94 | 95 | if (helper != null) { 96 | EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); 97 | 98 | if (properties != null) { 99 | includePath = properties.getProperty(INCLUDE_PATH); 100 | } 101 | } 102 | 103 | return includePath; 104 | } 105 | 106 | public static String[] getIncludePathArray(Project project) { 107 | String includePath = getIncludePath(project); 108 | 109 | return PropertyUtils.tokenizePath(includePath == null ? "" : includePath); 110 | } 111 | 112 | public static void setIncludePath(Project project, String includePath) { 113 | assert project != null; 114 | 115 | AntProjectHelper helper = getProjectHelper(project); 116 | 117 | if (helper != null) { 118 | EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); 119 | 120 | if (properties != null) { 121 | String referencePath = createForeignFileReference(project, includePath); 122 | String referencePathProperty = "${" + referencePath + "}"; 123 | String[] referencePathProperties = getIncludePathArray(project); 124 | 125 | if (!Utils.contains(referencePathProperties, referencePathProperty)) { 126 | int length = referencePathProperties.length; 127 | String[] newArray = new String[length + 1]; 128 | System.arraycopy(referencePathProperties, 0, newArray, 0, length); 129 | newArray[length] = referencePathProperty; 130 | referencePathProperties = newArray; 131 | } 132 | 133 | properties.setProperty(referencePath, includePath); 134 | properties.setProperty(INCLUDE_PATH, Utils.join(referencePathProperties, ":")); // NOI18N 135 | 136 | helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, properties); 137 | } 138 | } 139 | } 140 | 141 | private static AntProjectHelper getProjectHelper(Project project) { 142 | assert project != null; 143 | 144 | return project.getLookup().lookup(AntProjectHelper.class); 145 | } 146 | 147 | private static String createForeignFileReference(final Project project, final String path) { 148 | File projectDirectory = FileUtil.toFile(project.getProjectDirectory()); 149 | File normalizedFile = FileUtil.normalizeFile(PropertyUtils.resolveFile(projectDirectory, path)); 150 | 151 | String property = normalizedFile.getName(); 152 | 153 | if (normalizedFile.isDirectory() && normalizedFile.getParentFile() != null) { 154 | property = normalizedFile.getParentFile().getName() + "-" + property; 155 | } 156 | 157 | return REFERENCE_ID_PREFIX + property; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/options/Laravel4OptionsPanelController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.ui.options; 43 | 44 | import java.beans.PropertyChangeListener; 45 | import java.beans.PropertyChangeSupport; 46 | import javax.swing.JComponent; 47 | import javax.swing.event.ChangeEvent; 48 | import javax.swing.event.ChangeListener; 49 | import org.netbeans.modules.php.api.util.UiUtils; 50 | import org.netbeans.modules.php.api.validation.ValidationResult; 51 | import org.nbphpcouncil.modules.php.laravel4.options.Laravel4Options; 52 | import org.nbphpcouncil.modules.php.laravel4.validation.OptionsValidator; 53 | import org.netbeans.spi.options.OptionsPanelController; 54 | import org.openide.util.HelpCtx; 55 | import org.openide.util.Lookup; 56 | 57 | @OptionsPanelController.SubRegistration( 58 | location = "org-netbeans-modules-php-project-ui-options-PHPOptionsCategory", 59 | displayName = "#AdvancedOption_DisplayName_Laravel4", 60 | keywords = "#AdvancedOption_Keywords_Laravel4", 61 | keywordsCategory = "org-netbeans-modules-php-project-ui-options-PHPOptionsCategory/Laravel4") 62 | @org.openide.util.NbBundle.Messages({"AdvancedOption_DisplayName_Laravel4=Laravel4", "AdvancedOption_Keywords_Laravel4=laravel4 php web framework"}) 63 | public final class Laravel4OptionsPanelController extends OptionsPanelController implements ChangeListener { 64 | 65 | public static final String OPTIONS_SUBPATH = "Laravel4"; // NOI18N 66 | private Laravel4OptionsPanel panel; 67 | private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); 68 | private boolean changed = false; 69 | 70 | public static String getOptionsPath() { 71 | return UiUtils.OPTIONS_PATH + "/" + OPTIONS_SUBPATH; // NOI18N 72 | } 73 | 74 | @Override 75 | public void update() { 76 | panel.setSkeleton(getOptions().getSkeleton()); 77 | 78 | changed = false; 79 | } 80 | 81 | @Override 82 | public void applyChanges() { 83 | getOptions().setSkeleton(panel.getSkeleton()); 84 | 85 | changed = false; 86 | } 87 | 88 | @Override 89 | public void cancel() { 90 | // need not do anything special, if no changes have been persisted yet 91 | } 92 | 93 | @Override 94 | public boolean isValid() { 95 | // clean up 96 | panel.setError(" "); // NOI18N 97 | 98 | // validate 99 | ValidationResult validationResult = new OptionsValidator() 100 | .validate(panel.getSkeleton()) 101 | .getResult(); 102 | String warning = null; 103 | // get first message 104 | if (validationResult.hasErrors()) { 105 | for (ValidationResult.Message message : validationResult.getErrors()) { 106 | warning = message.getMessage(); 107 | break; 108 | } 109 | } else if (validationResult.hasWarnings()) { 110 | for (ValidationResult.Message message : validationResult.getWarnings()) { 111 | warning = message.getMessage(); 112 | break; 113 | } 114 | } 115 | 116 | panel.setWarning(warning); 117 | 118 | // everything ok 119 | return true; 120 | } 121 | 122 | @Override 123 | public boolean isChanged() { 124 | return changed; 125 | } 126 | 127 | @Override 128 | public HelpCtx getHelpCtx() { 129 | return null; // new HelpCtx("...ID") if you have a help set 130 | } 131 | 132 | @Override 133 | public JComponent getComponent(Lookup masterLookup) { 134 | return getPanel(); 135 | } 136 | 137 | @Override 138 | public void addPropertyChangeListener(PropertyChangeListener l) { 139 | pcs.addPropertyChangeListener(l); 140 | } 141 | 142 | @Override 143 | public void removePropertyChangeListener(PropertyChangeListener l) { 144 | pcs.removePropertyChangeListener(l); 145 | } 146 | 147 | @Override 148 | public void stateChanged(ChangeEvent ce) { 149 | if (!changed) { 150 | changed = true; 151 | pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); 152 | } 153 | 154 | pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); 155 | } 156 | 157 | private Laravel4OptionsPanel getPanel() { 158 | if (panel == null) { 159 | panel = new Laravel4OptionsPanel(); 160 | panel.addChangeListener(this); 161 | } 162 | 163 | return panel; 164 | } 165 | 166 | void changed() { 167 | if (!changed) { 168 | changed = true; 169 | pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); 170 | } 171 | 172 | pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); 173 | } 174 | 175 | private Laravel4Options getOptions() { 176 | return Laravel4Options.getInstance(); 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /php.laravel4/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.apisupport.project 4 | 5 | 6 | org.nbphpcouncil.modules.php.laravel4 7 | 8 | 9 | 10 | org.jdesktop.layout 11 | 12 | 13 | 14 | 1 15 | 1.24.1 16 | 17 | 18 | 19 | org.netbeans.api.annotations.common 20 | 21 | 22 | 23 | 1 24 | 1.17.1 25 | 26 | 27 | 28 | org.netbeans.modules.options.api 29 | 30 | 31 | 32 | 1 33 | 1.31.1 34 | 35 | 36 | 37 | org.netbeans.modules.php.api.executable 38 | 39 | 40 | 41 | 0 42 | 43 | 44 | 45 | 46 | org.netbeans.modules.php.api.framework 47 | 48 | 49 | 50 | 0 51 | 52 | 53 | 54 | 55 | org.netbeans.modules.php.api.phpmodule 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | org.netbeans.modules.php.composer 64 | 65 | 66 | 67 | 0 68 | 69 | 70 | 71 | 72 | org.netbeans.modules.php.kit 73 | 74 | 1.47.1 75 | 76 | 77 | 78 | org.netbeans.modules.project.ant 79 | 80 | 81 | 82 | 1 83 | 1.51.1 84 | 85 | 86 | 87 | org.netbeans.modules.projectapi 88 | 89 | 90 | 91 | 1 92 | 1.50.1 93 | 94 | 95 | 96 | org.openide.awt 97 | 98 | 99 | 100 | 7.55.1 101 | 102 | 103 | 104 | org.openide.filesystems 105 | 106 | 107 | 108 | 8.5.1 109 | 110 | 111 | 112 | org.openide.loaders 113 | 114 | 115 | 116 | 7.44.2 117 | 118 | 119 | 120 | org.openide.nodes 121 | 122 | 123 | 124 | 7.33.1 125 | 126 | 127 | 128 | org.openide.util 129 | 130 | 131 | 132 | 8.29.2 133 | 134 | 135 | 136 | org.openide.util.lookup 137 | 138 | 139 | 140 | 8.19.1 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/Laravel4PhpFrameworkProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4; 43 | 44 | import java.io.File; 45 | import org.netbeans.modules.php.api.framework.BadgeIcon; 46 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 47 | import org.netbeans.modules.php.api.phpmodule.PhpModuleProperties; 48 | import org.nbphpcouncil.modules.php.laravel4.commands.Artisan; 49 | import org.nbphpcouncil.modules.php.laravel4.commands.Laravel4CommandSupport; 50 | import org.nbphpcouncil.modules.php.laravel4.preferences.Laravel4Preferences; 51 | import org.nbphpcouncil.modules.php.laravel4.ui.actions.Laravel4PhpModuleActionsExtender; 52 | import org.netbeans.modules.php.spi.framework.PhpFrameworkProvider; 53 | import org.netbeans.modules.php.spi.framework.PhpModuleActionsExtender; 54 | import org.netbeans.modules.php.spi.framework.PhpModuleCustomizerExtender; 55 | import org.netbeans.modules.php.spi.framework.PhpModuleExtender; 56 | import org.netbeans.modules.php.spi.framework.PhpModuleIgnoredFilesExtender; 57 | import org.netbeans.modules.php.spi.framework.commands.FrameworkCommandSupport; 58 | import org.openide.filesystems.FileObject; 59 | import org.openide.filesystems.FileUtil; 60 | import org.openide.util.ImageUtilities; 61 | import org.openide.util.NbBundle; 62 | 63 | /** 64 | * PHP framework provider for Laravel4 PHP framework. 65 | */ 66 | public class Laravel4PhpFrameworkProvider extends PhpFrameworkProvider { 67 | 68 | private static final Laravel4PhpFrameworkProvider INSTANCE = new Laravel4PhpFrameworkProvider(); 69 | private static final String ICON_PATH = "org/nbphpcouncil/modules/php/laravel4/ui/resources/laravel_badge_8.png"; // NOI18N 70 | private static final String CONFIG_DIRECTORY = "app/config"; // NOI18N 71 | private final BadgeIcon badgeIcon; 72 | 73 | @PhpFrameworkProvider.Registration(position = 201) // left after Zend 74 | public static Laravel4PhpFrameworkProvider getInstance() { 75 | return INSTANCE; 76 | } 77 | 78 | @NbBundle.Messages({ 79 | "LBL_FrameworkName=Laravel4 PHP Web Framework", 80 | "LBL_FrameworkDescription=Laravel4 PHP Web Framework" 81 | }) 82 | private Laravel4PhpFrameworkProvider() { 83 | super("Laravel4 PHP Web Framework", Bundle.LBL_FrameworkName(), Bundle.LBL_FrameworkDescription()); // NOI18N 84 | badgeIcon = new BadgeIcon( 85 | ImageUtilities.loadImage(ICON_PATH), 86 | Laravel4PhpFrameworkProvider.class.getResource("/" + ICON_PATH)); // NOI18N 87 | } 88 | 89 | @Override 90 | public BadgeIcon getBadgeIcon() { 91 | return badgeIcon; 92 | } 93 | 94 | @Override 95 | public boolean isInPhpModule(PhpModule phpModule) { 96 | Boolean enabled = Laravel4Preferences.isEnabled(phpModule); 97 | if (enabled != null) { 98 | // set manually 99 | return enabled; 100 | } 101 | 102 | // autodetection 103 | FileObject artisan = Artisan.getPath(phpModule); 104 | 105 | return artisan != null && artisan.isData(); 106 | } 107 | 108 | @Override 109 | public File[] getConfigurationFiles(PhpModule phpModule) { 110 | FileObject sourceDirectory = phpModule.getSourceDirectory(); 111 | 112 | if (sourceDirectory == null) { 113 | // broken project 114 | return new File[0]; 115 | } 116 | 117 | FileObject configDirectory = sourceDirectory.getFileObject(CONFIG_DIRECTORY); 118 | 119 | if (configDirectory != null && configDirectory.isFolder() && configDirectory.isValid()) { 120 | File[] configFiles = FileUtil.toFile(configDirectory).listFiles(); 121 | 122 | if (configFiles != null) { 123 | return configFiles; 124 | } 125 | } 126 | 127 | return new File[0]; 128 | } 129 | 130 | @Override 131 | public PhpModuleExtender createPhpModuleExtender(PhpModule phpModule) { 132 | return new Laravel4PhpModuleExtender(); 133 | } 134 | 135 | @Override 136 | public PhpModuleCustomizerExtender createPhpModuleCustomizerExtender(PhpModule phpModule) { 137 | return new Laravel4PhpModuleCustomizerExtender(phpModule); 138 | } 139 | 140 | @Override 141 | public PhpModuleProperties getPhpModuleProperties(PhpModule phpModule) { 142 | PhpModuleProperties properties = new PhpModuleProperties(); 143 | FileObject sourceDirectory = phpModule.getSourceDirectory(); 144 | 145 | if (sourceDirectory == null) { 146 | // broken project 147 | return properties; 148 | } 149 | 150 | FileObject publicDirectory = sourceDirectory.getFileObject("public"); // NOI18N 151 | 152 | if (publicDirectory != null) { 153 | properties = properties.setWebRoot(publicDirectory); 154 | } 155 | 156 | FileObject testsDirectory = sourceDirectory.getFileObject("app/tests"); // NOI18N 157 | 158 | if(testsDirectory != null) { 159 | properties = properties.setTests(testsDirectory); 160 | } 161 | 162 | return properties; 163 | } 164 | 165 | @Override 166 | public PhpModuleActionsExtender getActionsExtender(PhpModule phpModule) { 167 | return new Laravel4PhpModuleActionsExtender(); 168 | } 169 | 170 | @Override 171 | public PhpModuleIgnoredFilesExtender getIgnoredFilesExtender(PhpModule phpModule) { 172 | return new Laravel4PhpModuleIgnoredFilesExtender(phpModule); 173 | } 174 | 175 | @Override 176 | public FrameworkCommandSupport getFrameworkCommandSupport(PhpModule phpModule) { 177 | return new Laravel4CommandSupport(phpModule); 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/Laravel4PhpModuleExtender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4; 43 | 44 | import java.io.File; 45 | import java.io.IOException; 46 | import java.util.HashSet; 47 | import java.util.Set; 48 | import java.util.concurrent.ExecutionException; 49 | import java.util.logging.Level; 50 | import java.util.logging.Logger; 51 | import java.util.zip.ZipEntry; 52 | import javax.swing.JComponent; 53 | import javax.swing.event.ChangeListener; 54 | import org.netbeans.modules.php.api.executable.InvalidPhpExecutableException; 55 | import org.netbeans.modules.php.api.phpmodule.PhpModule; 56 | import org.netbeans.modules.php.api.util.FileUtils; 57 | import org.netbeans.modules.php.api.util.UiUtils; 58 | import org.netbeans.modules.php.composer.api.Composer; 59 | import org.nbphpcouncil.modules.php.laravel4.options.Laravel4Options; 60 | import org.nbphpcouncil.modules.php.laravel4.support.Laravel4Support; 61 | import org.nbphpcouncil.modules.php.laravel4.ui.options.Laravel4OptionsPanelController; 62 | import org.nbphpcouncil.modules.php.laravel4.ui.wizards.NewProjectConfigurationPanel; 63 | import org.netbeans.modules.php.spi.framework.PhpModuleExtender; 64 | import org.openide.filesystems.FileObject; 65 | import org.openide.filesystems.FileUtil; 66 | import org.openide.util.HelpCtx; 67 | import org.openide.util.NbBundle; 68 | 69 | /** 70 | * PHP module extender for Laravel4 PHP framework. 71 | */ 72 | public class Laravel4PhpModuleExtender extends PhpModuleExtender { 73 | 74 | private static final String SKELETON_ZIP_ENTRY_PREFIX = "laravel-master/"; // NOI18N 75 | 76 | private static final Logger LOGGER = Logger.getLogger(Laravel4PhpModuleExtender.class.getName()); 77 | //@GuardedBy(this) 78 | private NewProjectConfigurationPanel panel = null; 79 | 80 | @Override 81 | public void addChangeListener(ChangeListener listener) { 82 | getPanel().addChangeListener(listener); 83 | } 84 | 85 | @Override 86 | public void removeChangeListener(ChangeListener listener) { 87 | getPanel().removeChangeListener(listener); 88 | } 89 | 90 | @Override 91 | public JComponent getComponent() { 92 | return getPanel(); 93 | } 94 | 95 | @Override 96 | public HelpCtx getHelp() { 97 | return null; 98 | } 99 | 100 | @Override 101 | public boolean isValid() { 102 | return getErrorMessage() == null; 103 | } 104 | 105 | @Override 106 | public String getErrorMessage() { 107 | String error = getPanel().getErrorMessage(); 108 | 109 | if (error != null) { 110 | return error; 111 | } 112 | 113 | try { 114 | // validate composer 115 | Composer.getDefault(); 116 | } catch (InvalidPhpExecutableException ex) { 117 | return ex.getLocalizedMessage(); 118 | } 119 | 120 | return null; 121 | } 122 | 123 | @Override 124 | public String getWarningMessage() { 125 | return getPanel().getWarningMessage(); 126 | } 127 | 128 | @NbBundle.Messages("Laravel4PhpModuleExtender.not.extended=Laravel 4 project not created!
(verify Laravel Application Skeleton in Tools > Options > PHP > Laravel 4 or review IDE log)") 129 | @Override 130 | public Set extend(PhpModule phpModule) throws ExtendingException { 131 | try { 132 | unpackSkeleton(phpModule); 133 | } catch (IOException ex) { 134 | LOGGER.log(Level.INFO, "Cannot unpack Laravel Application Skeleton.", ex); 135 | throw new ExtendingException(Bundle.Laravel4PhpModuleExtender_not_extended(), ex); 136 | } 137 | 138 | // generate auto completion file. 139 | Laravel4Support.generateAutoCompletionFile(phpModule); 140 | 141 | // install framework via composer 142 | try { 143 | Composer.getDefault().install(phpModule).get(); 144 | } catch (InvalidPhpExecutableException ex) { 145 | assert false : "Should not happen since Composer is validated in the wizard panel"; 146 | LOGGER.log(Level.INFO, "Composer is not valid so no install cannot be done.", ex); 147 | } catch (InterruptedException ex) { 148 | Thread.currentThread().interrupt(); 149 | } catch (ExecutionException ex) { 150 | UiUtils.processExecutionException(ex, Laravel4OptionsPanelController.OPTIONS_SUBPATH); 151 | } 152 | 153 | return getInitialFiles(phpModule); 154 | } 155 | 156 | private void unpackSkeleton(PhpModule phpModule) throws IOException { 157 | String skeleton = Laravel4Options.getInstance().getSkeleton(); 158 | final File sourceDir = FileUtil.toFile(phpModule.getSourceDirectory()); 159 | FileUtils.unzip(skeleton, sourceDir, new FileUtils.ZipEntryFilter() { 160 | @Override 161 | public boolean accept(ZipEntry zipEntry) { 162 | return !SKELETON_ZIP_ENTRY_PREFIX.equals(zipEntry.getName()); 163 | } 164 | 165 | @Override 166 | public String getName(ZipEntry zipEntry) { 167 | String entryName = zipEntry.getName(); 168 | if (entryName.startsWith(SKELETON_ZIP_ENTRY_PREFIX)) { 169 | entryName = entryName.replaceFirst(SKELETON_ZIP_ENTRY_PREFIX, ""); // NOI18N 170 | } 171 | 172 | return entryName; 173 | } 174 | }); 175 | } 176 | 177 | private Set getInitialFiles(PhpModule phpModule) { 178 | Set files = new HashSet(); 179 | addSourceFile(files, phpModule, "app/config/app.php"); // NOI18N 180 | addSourceFile(files, phpModule, "app/controllers/HomeController.php"); // NOI18N 181 | addSourceFile(files, phpModule, "app/views/hello.php"); // NOI18N 182 | 183 | return files; 184 | } 185 | 186 | private void addSourceFile(Set files, PhpModule phpModule, String relativePath) { 187 | FileObject sourceDirectory = phpModule.getSourceDirectory(); 188 | 189 | if (sourceDirectory == null) { 190 | // broken project 191 | assert false : "Module extender for no sources of: " + phpModule.getName(); 192 | 193 | return; 194 | } 195 | 196 | FileObject fileObject = sourceDirectory.getFileObject(relativePath); 197 | 198 | if (fileObject != null) { 199 | files.add(fileObject); 200 | } 201 | } 202 | 203 | private synchronized NewProjectConfigurationPanel getPanel() { 204 | if (panel == null) { 205 | panel = new NewProjectConfigurationPanel(); 206 | } 207 | 208 | return panel; 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/options/Laravel4OptionsPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 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 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |
143 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/wizards/NewProjectConfigurationPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.ui.wizards; 43 | 44 | import java.awt.Cursor; 45 | import java.beans.PropertyChangeEvent; 46 | import java.beans.PropertyChangeListener; 47 | import javax.swing.event.ChangeEvent; 48 | import javax.swing.event.ChangeListener; 49 | import org.netbeans.api.options.OptionsDisplayer; 50 | import org.netbeans.modules.php.api.validation.ValidationResult; 51 | import org.nbphpcouncil.modules.php.laravel4.options.Laravel4Options; 52 | import org.nbphpcouncil.modules.php.laravel4.ui.options.Laravel4OptionsPanelController; 53 | import org.nbphpcouncil.modules.php.laravel4.validation.OptionsValidator; 54 | import org.openide.util.ChangeSupport; 55 | 56 | /** 57 | * New project configuration panel for Laravel4 PHP framework. 58 | */ 59 | public class NewProjectConfigurationPanel extends javax.swing.JPanel implements ChangeListener { 60 | 61 | private final ChangeSupport changeSupport = new ChangeSupport(this); 62 | 63 | /** 64 | * Creates new form NewProjectConfigurationPanel 65 | */ 66 | public NewProjectConfigurationPanel() { 67 | initComponents(); 68 | 69 | init(); 70 | initListeners(); 71 | } 72 | 73 | public String getErrorMessage() { 74 | ValidationResult validationResult = new OptionsValidator() 75 | .validate(Laravel4Options.getInstance().getSkeleton()) 76 | .getResult(); 77 | 78 | if (validationResult.hasErrors()) { 79 | return validationResult.getErrors().get(0).getMessage(); 80 | } 81 | 82 | return null; 83 | } 84 | 85 | public String getWarningMessage() { 86 | ValidationResult validationResult = new OptionsValidator() 87 | .validate(Laravel4Options.getInstance().getSkeleton()) 88 | .getResult(); 89 | 90 | if (validationResult.hasWarnings()) { 91 | return validationResult.getWarnings().get(0).getMessage(); 92 | } 93 | 94 | return null; 95 | } 96 | 97 | public void addChangeListener(ChangeListener listener) { 98 | changeSupport.addChangeListener(listener); 99 | } 100 | 101 | public void removeChangeListener(ChangeListener listener) { 102 | changeSupport.removeChangeListener(listener); 103 | } 104 | 105 | @Override 106 | public void addNotify() { 107 | Laravel4Options.getInstance().addChangeListener(this); 108 | super.addNotify(); 109 | } 110 | 111 | @Override 112 | public void removeNotify() { 113 | Laravel4Options.getInstance().removeChangeListener(this); 114 | super.removeNotify(); 115 | } 116 | 117 | @Override 118 | public void stateChanged(ChangeEvent ce) { 119 | fireChange(); 120 | } 121 | 122 | void enableOptionsLabel() { 123 | optionsLabel.setVisible(infoLabel.isEnabled()); 124 | } 125 | 126 | void fireChange() { 127 | changeSupport.fireChange(); 128 | } 129 | 130 | private void init() { 131 | // work around - keep the label on the right side 132 | optionsLabel.setMaximumSize(optionsLabel.getPreferredSize()); 133 | } 134 | 135 | private void initListeners() { 136 | infoLabel.addPropertyChangeListener("enabled", new PropertyChangeListener() { // NOI18N 137 | @Override 138 | public void propertyChange(PropertyChangeEvent evt) { 139 | enableOptionsLabel(); 140 | } 141 | }); 142 | enableOptionsLabel(); 143 | } 144 | 145 | /** 146 | * This method is called from within the constructor to initialize the form. 147 | * WARNING: Do NOT modify this code. The content of this method is always 148 | * regenerated by the Form Editor. 149 | */ 150 | @SuppressWarnings("unchecked") 151 | // //GEN-BEGIN:initComponents 152 | private void initComponents() { 153 | 154 | infoLabel = new javax.swing.JLabel(); 155 | optionsLabel = new javax.swing.JLabel(); 156 | 157 | org.openide.awt.Mnemonics.setLocalizedText(infoLabel, org.openide.util.NbBundle.getMessage(NewProjectConfigurationPanel.class, "NewProjectConfigurationPanel.infoLabel.text")); // NOI18N 158 | 159 | org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, org.openide.util.NbBundle.getMessage(NewProjectConfigurationPanel.class, "NewProjectConfigurationPanel.optionsLabel.text")); // NOI18N 160 | optionsLabel.addMouseListener(new java.awt.event.MouseAdapter() { 161 | public void mouseClicked(java.awt.event.MouseEvent evt) { 162 | optionsLabelMouseClicked(evt); 163 | } 164 | public void mouseEntered(java.awt.event.MouseEvent evt) { 165 | optionsLabelMouseEntered(evt); 166 | } 167 | }); 168 | 169 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 170 | this.setLayout(layout); 171 | layout.setHorizontalGroup( 172 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 173 | .add(layout.createSequentialGroup() 174 | .add(infoLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 175 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 176 | .add(optionsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 177 | ); 178 | layout.setVerticalGroup( 179 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 180 | .add(layout.createSequentialGroup() 181 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 182 | .add(infoLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 183 | .add(optionsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 184 | .add(0, 154, Short.MAX_VALUE)) 185 | ); 186 | }// //GEN-END:initComponents 187 | 188 | private void optionsLabelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_optionsLabelMouseEntered 189 | evt.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 190 | }//GEN-LAST:event_optionsLabelMouseEntered 191 | 192 | private void optionsLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_optionsLabelMouseClicked 193 | OptionsDisplayer.getDefault().open(Laravel4OptionsPanelController.getOptionsPath()); 194 | }//GEN-LAST:event_optionsLabelMouseClicked 195 | 196 | // Variables declaration - do not modify//GEN-BEGIN:variables 197 | private javax.swing.JLabel infoLabel; 198 | private javax.swing.JLabel optionsLabel; 199 | // End of variables declaration//GEN-END:variables 200 | } 201 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/customizer/Laravel4CustomizerPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.ui.customizer; 43 | 44 | import java.awt.event.ItemEvent; 45 | import java.awt.event.ItemListener; 46 | import java.io.File; 47 | import javax.swing.event.ChangeListener; 48 | import javax.swing.event.DocumentEvent; 49 | import javax.swing.event.DocumentListener; 50 | import org.openide.filesystems.FileChooserBuilder; 51 | import org.openide.filesystems.FileObject; 52 | import org.openide.filesystems.FileUtil; 53 | import org.openide.util.ChangeSupport; 54 | import org.openide.util.NbBundle; 55 | 56 | /** 57 | * Customizer panel for Laravel4 PHP framework. 58 | */ 59 | public class Laravel4CustomizerPanel extends javax.swing.JPanel { 60 | 61 | private final FileObject source; 62 | private final ChangeSupport changeSupport = new ChangeSupport(this); 63 | 64 | /** 65 | * Creates new form Laravel4CustomizerPanel 66 | */ 67 | public Laravel4CustomizerPanel(FileObject source) { 68 | this.source = source; 69 | 70 | initComponents(); 71 | init(); 72 | } 73 | 74 | public boolean isSupportEnabled() { 75 | return enabledCheckBox.isSelected(); 76 | } 77 | 78 | public void setSupportEnabled(boolean enabled) { 79 | enabledCheckBox.setSelected(enabled); 80 | } 81 | 82 | public String getAppDirectory() { 83 | return appDirectoryTextField.getText().replace(File.separatorChar, '/'); // NOI18N 84 | } 85 | 86 | public void setAppDirectory(String appDir) { 87 | appDirectoryTextField.setText(appDir.replace('/', File.separatorChar)); // NOI18N 88 | } 89 | 90 | public void addChangeListener(ChangeListener listener) { 91 | changeSupport.addChangeListener(listener); 92 | } 93 | 94 | public void removeChangeListener(ChangeListener listener) { 95 | changeSupport.removeChangeListener(listener); 96 | } 97 | 98 | final void setFieldsEnabled(boolean enabled) { 99 | appDirectoryTextField.setEnabled(enabled); 100 | appDirectoryBrowseButton.setEnabled(enabled); 101 | } 102 | 103 | void fireChange() { 104 | changeSupport.fireChange(); 105 | } 106 | 107 | private void init() { 108 | enabledCheckBox.addItemListener(new ItemListener() { 109 | @Override 110 | public void itemStateChanged(ItemEvent e) { 111 | fireChange(); 112 | setFieldsEnabled(e.getStateChange() == ItemEvent.SELECTED); 113 | } 114 | }); 115 | appDirectoryTextField.getDocument().addDocumentListener(new DocumentListener() { 116 | @Override 117 | public void insertUpdate(DocumentEvent e) { 118 | processChange(); 119 | } 120 | @Override 121 | public void removeUpdate(DocumentEvent e) { 122 | processChange(); 123 | } 124 | @Override 125 | public void changedUpdate(DocumentEvent e) { 126 | processChange(); 127 | } 128 | private void processChange() { 129 | fireChange(); 130 | } 131 | }); 132 | } 133 | 134 | /** 135 | * This method is called from within the constructor to initialize the form. 136 | * WARNING: Do NOT modify this code. The content of this method is always 137 | * regenerated by the Form Editor. 138 | */ 139 | @SuppressWarnings("unchecked") 140 | // //GEN-BEGIN:initComponents 141 | private void initComponents() { 142 | 143 | enabledCheckBox = new javax.swing.JCheckBox(); 144 | enabledInfoLabel = new javax.swing.JLabel(); 145 | appDirectoryLabel = new javax.swing.JLabel(); 146 | appDirectoryTextField = new javax.swing.JTextField(); 147 | appDirectoryBrowseButton = new javax.swing.JButton(); 148 | 149 | org.openide.awt.Mnemonics.setLocalizedText(enabledCheckBox, org.openide.util.NbBundle.getMessage(Laravel4CustomizerPanel.class, "Laravel4CustomizerPanel.enabledCheckBox.text")); // NOI18N 150 | 151 | org.openide.awt.Mnemonics.setLocalizedText(enabledInfoLabel, org.openide.util.NbBundle.getMessage(Laravel4CustomizerPanel.class, "Laravel4CustomizerPanel.enabledInfoLabel.text")); // NOI18N 152 | 153 | org.openide.awt.Mnemonics.setLocalizedText(appDirectoryLabel, org.openide.util.NbBundle.getMessage(Laravel4CustomizerPanel.class, "Laravel4CustomizerPanel.appDirectoryLabel.text")); // NOI18N 154 | 155 | appDirectoryTextField.setText(org.openide.util.NbBundle.getMessage(Laravel4CustomizerPanel.class, "Laravel4CustomizerPanel.appDirectoryTextField.text")); // NOI18N 156 | 157 | org.openide.awt.Mnemonics.setLocalizedText(appDirectoryBrowseButton, org.openide.util.NbBundle.getMessage(Laravel4CustomizerPanel.class, "Laravel4CustomizerPanel.appDirectoryBrowseButton.text")); // NOI18N 158 | appDirectoryBrowseButton.addActionListener(new java.awt.event.ActionListener() { 159 | public void actionPerformed(java.awt.event.ActionEvent evt) { 160 | appDirectoryBrowseButtonActionPerformed(evt); 161 | } 162 | }); 163 | 164 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 165 | this.setLayout(layout); 166 | layout.setHorizontalGroup( 167 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 168 | .add(layout.createSequentialGroup() 169 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 170 | .add(enabledCheckBox) 171 | .add(layout.createSequentialGroup() 172 | .add(29, 29, 29) 173 | .add(enabledInfoLabel))) 174 | .add(0, 101, Short.MAX_VALUE)) 175 | .add(layout.createSequentialGroup() 176 | .add(appDirectoryLabel) 177 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 178 | .add(appDirectoryTextField) 179 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 180 | .add(appDirectoryBrowseButton)) 181 | ); 182 | layout.setVerticalGroup( 183 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 184 | .add(layout.createSequentialGroup() 185 | .add(enabledCheckBox) 186 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 187 | .add(enabledInfoLabel) 188 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) 189 | .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 190 | .add(appDirectoryLabel) 191 | .add(appDirectoryTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 192 | .add(appDirectoryBrowseButton))) 193 | ); 194 | }// //GEN-END:initComponents 195 | 196 | @NbBundle.Messages("Laravel4CustomizerPanel.browseAppDir.title=Select \"app\" directory") 197 | private void appDirectoryBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_appDirectoryBrowseButtonActionPerformed 198 | // TODO add your handling code here: 199 | File appDirectory = new FileChooserBuilder(Laravel4CustomizerPanel.class) 200 | .setTitle(Bundle.Laravel4CustomizerPanel_browseAppDir_title()) 201 | .setDirectoriesOnly(true) 202 | .setDefaultWorkingDirectory(FileUtil.toFile(source)) 203 | .forceUseOfDefaultWorkingDirectory(true) 204 | .showOpenDialog(); 205 | if (appDirectory != null) { 206 | appDirectory = FileUtil.normalizeFile(appDirectory); 207 | FileObject fo = FileUtil.toFileObject(appDirectory); 208 | 209 | if (FileUtil.isParentOf(source, fo)) { 210 | // it is ok 211 | String relativePath = FileUtil.getRelativePath(source, fo); 212 | assert relativePath != null : source + " not parent of " + fo; 213 | setAppDirectory(relativePath); 214 | } else { 215 | // not ok 216 | appDirectoryTextField.setText(appDirectory.getAbsolutePath()); 217 | } 218 | } 219 | }//GEN-LAST:event_appDirectoryBrowseButtonActionPerformed 220 | 221 | // Variables declaration - do not modify//GEN-BEGIN:variables 222 | private javax.swing.JButton appDirectoryBrowseButton; 223 | private javax.swing.JLabel appDirectoryLabel; 224 | private javax.swing.JTextField appDirectoryTextField; 225 | private javax.swing.JCheckBox enabledCheckBox; 226 | private javax.swing.JLabel enabledInfoLabel; 227 | // End of variables declaration//GEN-END:variables 228 | 229 | } 230 | -------------------------------------------------------------------------------- /php.laravel4/src/org/nbphpcouncil/modules/php/laravel4/ui/options/Laravel4OptionsPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2013 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted 2013 NetBeans PHP Community Council" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | * 40 | * Portions Copyrighted 2013 Sun Microsystems, Inc. 41 | */ 42 | package org.nbphpcouncil.modules.php.laravel4.ui.options; 43 | 44 | import java.awt.Cursor; 45 | import java.io.File; 46 | import java.net.MalformedURLException; 47 | import java.net.URL; 48 | import javax.swing.UIManager; 49 | import javax.swing.event.ChangeListener; 50 | import javax.swing.event.DocumentEvent; 51 | import javax.swing.event.DocumentListener; 52 | import javax.swing.filechooser.FileFilter; 53 | import org.openide.awt.HtmlBrowser; 54 | import org.openide.filesystems.FileChooserBuilder; 55 | import org.openide.filesystems.FileUtil; 56 | import org.openide.util.ChangeSupport; 57 | import org.openide.util.Exceptions; 58 | import org.openide.util.NbBundle; 59 | 60 | final class Laravel4OptionsPanel extends javax.swing.JPanel { 61 | 62 | private static final String SKELETON_LAST_FOLDER_SUFFIX = ".skeleton"; // NOI18N 63 | @NbBundle.Messages("Laravel4OptionsPanel.zip.filter=Zip File (*.zip)") 64 | private static final FileFilter ZIP_FILE_FILTER = new FileFilter() { 65 | @Override 66 | public boolean accept(File f) { 67 | if (f.isDirectory()) { 68 | return true; 69 | } 70 | 71 | return f.isFile() && f.getName().toLowerCase().endsWith(".zip"); // NOI18N 72 | } 73 | 74 | @Override 75 | public String getDescription() { 76 | return Bundle.Laravel4OptionsPanel_zip_filter(); 77 | } 78 | }; 79 | private final ChangeSupport changeSupport = new ChangeSupport(this); 80 | 81 | public Laravel4OptionsPanel() { 82 | initComponents(); 83 | 84 | errorLabel.setText(" "); // NOI18N 85 | 86 | initListeners(); 87 | } 88 | 89 | public String getSkeleton() { 90 | return skeletonTextField.getText(); 91 | } 92 | 93 | public void setSkeleton(String skeleton) { 94 | skeletonTextField.setText(skeleton); 95 | } 96 | 97 | public void setError(String message) { 98 | errorLabel.setText(" "); // NOI18N 99 | errorLabel.setForeground(UIManager.getColor("nb.errorForeground")); // NOI18N 100 | errorLabel.setText(message); 101 | } 102 | 103 | public void setWarning(String message) { 104 | errorLabel.setText(" "); // NOI18N 105 | errorLabel.setForeground(UIManager.getColor("nb.warningForeground")); // NOI18N 106 | errorLabel.setText(message); 107 | } 108 | 109 | public void addChangeListener(ChangeListener listener) { 110 | changeSupport.addChangeListener(listener); 111 | } 112 | 113 | public void removeChangeListener(ChangeListener listener) { 114 | changeSupport.removeChangeListener(listener); 115 | } 116 | 117 | /** 118 | * This method is called from within the constructor to initialize the form. 119 | * WARNING: Do NOT modify this code. The content of this method is always 120 | * regenerated by the Form Editor. 121 | */ 122 | // //GEN-BEGIN:initComponents 123 | private void initComponents() { 124 | 125 | jComboBox1 = new javax.swing.JComboBox(); 126 | skeletonLabel = new javax.swing.JLabel(); 127 | skeletonTextField = new javax.swing.JTextField(); 128 | browseSkeletonButton = new javax.swing.JButton(); 129 | skeletonInfoLabel = new javax.swing.JLabel(); 130 | noteLabel = new javax.swing.JLabel(); 131 | downloadSkeletonLabel = new javax.swing.JLabel(); 132 | errorLabel = new javax.swing.JLabel(); 133 | 134 | jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); 135 | 136 | org.openide.awt.Mnemonics.setLocalizedText(skeletonLabel, org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.skeletonLabel.text")); // NOI18N 137 | 138 | skeletonTextField.setText(org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.skeletonTextField.text")); // NOI18N 139 | 140 | org.openide.awt.Mnemonics.setLocalizedText(browseSkeletonButton, org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.browseSkeletonButton.text")); // NOI18N 141 | browseSkeletonButton.addActionListener(new java.awt.event.ActionListener() { 142 | public void actionPerformed(java.awt.event.ActionEvent evt) { 143 | browseSkeletonButtonActionPerformed(evt); 144 | } 145 | }); 146 | 147 | org.openide.awt.Mnemonics.setLocalizedText(skeletonInfoLabel, org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.skeletonInfoLabel.text")); // NOI18N 148 | 149 | org.openide.awt.Mnemonics.setLocalizedText(noteLabel, org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.noteLabel.text")); // NOI18N 150 | 151 | org.openide.awt.Mnemonics.setLocalizedText(downloadSkeletonLabel, org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.downloadSkeletonLabel.text")); // NOI18N 152 | downloadSkeletonLabel.addMouseListener(new java.awt.event.MouseAdapter() { 153 | public void mousePressed(java.awt.event.MouseEvent evt) { 154 | downloadSkeletonLabelMousePressed(evt); 155 | } 156 | public void mouseEntered(java.awt.event.MouseEvent evt) { 157 | downloadSkeletonLabelMouseEntered(evt); 158 | } 159 | }); 160 | 161 | org.openide.awt.Mnemonics.setLocalizedText(errorLabel, org.openide.util.NbBundle.getMessage(Laravel4OptionsPanel.class, "Laravel4OptionsPanel.errorLabel.text")); // NOI18N 162 | 163 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 164 | this.setLayout(layout); 165 | layout.setHorizontalGroup( 166 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 167 | .addGroup(layout.createSequentialGroup() 168 | .addComponent(skeletonLabel) 169 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 170 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 171 | .addGroup(layout.createSequentialGroup() 172 | .addComponent(skeletonInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 173 | .addGap(0, 0, Short.MAX_VALUE)) 174 | .addGroup(layout.createSequentialGroup() 175 | .addComponent(skeletonTextField) 176 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 177 | .addComponent(browseSkeletonButton)))) 178 | .addGroup(layout.createSequentialGroup() 179 | .addContainerGap() 180 | .addComponent(downloadSkeletonLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 181 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 182 | .addGroup(layout.createSequentialGroup() 183 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 184 | .addComponent(noteLabel) 185 | .addComponent(errorLabel)) 186 | .addGap(0, 0, Short.MAX_VALUE)) 187 | ); 188 | layout.setVerticalGroup( 189 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 190 | .addGroup(layout.createSequentialGroup() 191 | .addContainerGap() 192 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 193 | .addComponent(skeletonLabel) 194 | .addComponent(skeletonTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 195 | .addComponent(browseSkeletonButton)) 196 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 197 | .addComponent(skeletonInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 198 | .addGap(18, 18, 18) 199 | .addComponent(noteLabel) 200 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 201 | .addComponent(downloadSkeletonLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 202 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 203 | .addComponent(errorLabel) 204 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 205 | ); 206 | }// //GEN-END:initComponents 207 | 208 | private void downloadSkeletonLabelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downloadSkeletonLabelMouseEntered 209 | evt.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 210 | }//GEN-LAST:event_downloadSkeletonLabelMouseEntered 211 | 212 | private void downloadSkeletonLabelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downloadSkeletonLabelMousePressed 213 | // TODO add your handling code here: 214 | try { 215 | URL url = new URL("https://github.com/laravel/laravel"); // NOI18N 216 | HtmlBrowser.URLDisplayer.getDefault().showURL(url); 217 | } catch (MalformedURLException ex) { 218 | Exceptions.printStackTrace(ex); 219 | } 220 | }//GEN-LAST:event_downloadSkeletonLabelMousePressed 221 | 222 | @NbBundle.Messages("Laravel4OptionsPanel.browse.skeleton=Select Laravel Skeleton Application (.zip)") 223 | private void browseSkeletonButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseSkeletonButtonActionPerformed 224 | File skeleton = new FileChooserBuilder(Laravel4OptionsPanel.class.getName() + SKELETON_LAST_FOLDER_SUFFIX) 225 | .setTitle(Bundle.Laravel4OptionsPanel_browse_skeleton()) 226 | .setFilesOnly(true) 227 | .setFileFilter(ZIP_FILE_FILTER) 228 | .showOpenDialog(); 229 | 230 | if (skeleton != null) { 231 | skeleton = FileUtil.normalizeFile(skeleton); 232 | skeletonTextField.setText(skeleton.getAbsolutePath()); 233 | } 234 | }//GEN-LAST:event_browseSkeletonButtonActionPerformed 235 | 236 | void fireChange() { 237 | changeSupport.fireChange(); 238 | } 239 | 240 | private void initListeners() { 241 | skeletonTextField.getDocument().addDocumentListener(new DocumentListener() { 242 | @Override 243 | public void insertUpdate(DocumentEvent e) { 244 | processUpdate(); 245 | } 246 | 247 | @Override 248 | public void removeUpdate(DocumentEvent e) { 249 | processUpdate(); 250 | } 251 | 252 | @Override 253 | public void changedUpdate(DocumentEvent e) { 254 | processUpdate(); 255 | } 256 | 257 | private void processUpdate() { 258 | fireChange(); 259 | } 260 | }); 261 | } 262 | // Variables declaration - do not modify//GEN-BEGIN:variables 263 | private javax.swing.JButton browseSkeletonButton; 264 | private javax.swing.JLabel downloadSkeletonLabel; 265 | private javax.swing.JLabel errorLabel; 266 | private javax.swing.JComboBox jComboBox1; 267 | private javax.swing.JLabel noteLabel; 268 | private javax.swing.JLabel skeletonInfoLabel; 269 | private javax.swing.JLabel skeletonLabel; 270 | private javax.swing.JTextField skeletonTextField; 271 | // End of variables declaration//GEN-END:variables 272 | } 273 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | LICENSE #1: GPLv2 with Classpath Exception. 2 | 3 | LICENSE #2: CDDL. 4 | ************************************************************ 5 | 6 | LICENSE #1: 7 | 8 | The GNU General Public License (GPL) Version 2, June 1991 9 | 10 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 11 | 12 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 13 | 14 | Everyone is permitted to copy and distribute verbatim copies 15 | of this license document, but changing it is not allowed. 16 | 17 | Preamble 18 | 19 | The licenses for most software are designed to take away 20 | your freedom to share and change it. By contrast, the GNU 21 | General Public License is intended to guarantee your freedom 22 | to share and change free software--to make sure the software 23 | is free for all its users. This General Public License 24 | applies to most of the Free Software Foundation's software 25 | and to any other program whose authors commit to using it. 26 | (Some other Free Software Foundation software is covered by 27 | the GNU Library General Public License instead.) You can 28 | apply it to your programs, too. When we speak of free 29 | software, we are referring to freedom, not price. Our 30 | General Public Licenses are designed to make sure that you 31 | have the freedom to distribute copies of free software (and 32 | charge for this service if you wish), that you receive 33 | source code or can get it if you want it, that you can 34 | change the software or use pieces of it in new free 35 | programs; and that you know you can do these things. To 36 | protect your rights, we need to make restrictions that 37 | forbid anyone to deny you these rights or to ask you to 38 | surrender the rights. These restrictions translate to 39 | certain responsibilities for you if you distribute copies of 40 | the software, or if you modify it. 41 | 42 | For example, if you distribute copies of such a program, 43 | whether gratis or for a fee, you must give the recipients 44 | all the rights that you have. You must make sure that they, 45 | too, receive or can get the source code. And you must show 46 | them these terms so they know their rights. 47 | 48 | We protect your rights with two steps: (1) copyright the 49 | software, and (2) offer you this license which gives you 50 | legal permission to copy, distribute and/or modify the 51 | software. 52 | 53 | Also, for each author's protection and ours, we want to make 54 | certain that everyone understands that there is no warranty 55 | for this free software. If the software is modified by 56 | someone else and passed on, we want its recipients to know 57 | that what they have is not the original, so that any 58 | problems introduced by others will not reflect on the 59 | original authors' reputations. 60 | 61 | Finally, any free program is threatened constantly by 62 | software patents. We wish to avoid the danger that 63 | redistributors of a free program will individually obtain 64 | patent licenses, in effect making the program proprietary. 65 | To prevent this, we have made it clear that any patent must 66 | be licensed for everyone's free use or not licensed at all. 67 | 68 | The precise terms and conditions for copying, distribution 69 | and modification follow. TERMS AND CONDITIONS FOR COPYING, 70 | DISTRIBUTION AND MODIFICATION 0. This License applies to any 71 | program or other work which contains a notice placed by the 72 | copyright holder saying it may be distributed under the 73 | terms of this General Public License. The "Program", below, 74 | refers to any such program or work, and a "work based on the 75 | Program" means either the Program or any derivative work 76 | under copyright law: that is to say, a work containing the 77 | Program or a portion of it, either verbatim or with 78 | modifications and/or translated into another language. 79 | (Hereinafter, translation is included without limitation in 80 | the term "modification".) Each licensee is addressed as 81 | "you". 82 | 83 | Activities other than copying, distribution and modification 84 | are not covered by this License; they are outside its scope. 85 | The act of running the Program is not restricted, and the 86 | output from the Program is covered only if its contents 87 | constitute a work based on the Program (independent of 88 | having been made by running the Program). Whether that is 89 | true depends on what the Program does. 90 | 91 | 1. You may copy and distribute verbatim copies of the 92 | Program's source code as you receive it, in any medium, 93 | provided that you conspicuously and appropriately publish on 94 | each copy an appropriate copyright notice and disclaimer of 95 | warranty; keep intact all the notices that refer to this 96 | License and to the absence of any warranty; and give any 97 | other recipients of the Program a copy of this License along 98 | with the Program. 99 | 100 | You may charge a fee for the physical act of transferring a 101 | copy, and you may at your option offer warranty protection 102 | in exchange for a fee. 103 | 104 | 2. You may modify your copy or copies of the Program or any 105 | portion of it, thus forming a work based on the Program, and 106 | copy and distribute such modifications or work under the 107 | terms of Section 1 above, provided that you also meet all of 108 | these conditions: 109 | 110 | a) You must cause the modified files to carry prominent 111 | notices stating that you changed the files and the date of 112 | any change. 113 | 114 | b) You must cause any work that you distribute or publish, 115 | that in whole or in part contains or is derived from the 116 | Program or any part thereof, to be licensed as a whole at no 117 | charge to all third parties under the terms of this License. 118 | 119 | c) If the modified program normally reads commands 120 | interactively when run, you must cause it, when started 121 | running for such interactive use in the most ordinary way, 122 | to print or display an announcement including an appropriate 123 | copyright notice and a notice that there is no warranty (or 124 | else, saying that you provide a warranty) and that users may 125 | redistribute the program under these conditions, and telling 126 | the user how to view a copy of this License. (Exception: if 127 | the Program itself is interactive but does not normally 128 | print such an announcement, your work based on the Program 129 | is not required to print an announcement.) 130 | 131 | These requirements apply to the modified work as a whole. If 132 | identifiable sections of that work are not derived from the 133 | Program, and can be reasonably considered independent and 134 | separate works in themselves, then this License, and its 135 | terms, do not apply to those sections when you distribute 136 | them as separate works. But when you distribute the same 137 | sections as part of a whole which is a work based on the 138 | Program, the distribution of the whole must be on the terms 139 | of this License, whose permissions for other licensees 140 | extend to the entire whole, and thus to each and every part 141 | regardless of who wrote it. 142 | 143 | Thus, it is not the intent of this section to claim rights 144 | or contest your rights to work written entirely by you; 145 | rather, the intent is to exercise the right to control the 146 | distribution of derivative or collective works based on the 147 | Program. In addition, mere aggregation of another work not 148 | based on the Program with the Program (or with a work based 149 | on the Program) on a volume of a storage or distribution 150 | medium does not bring the other work under the scope of this 151 | License. 152 | 153 | 3. You may copy and distribute the Program (or a work based 154 | on it, under Section 2) in object code or executable form 155 | under the terms of Sections 1 and 2 above provided that you 156 | also do one of the following: 157 | 158 | a) Accompany it with the complete corresponding 159 | machine-readable source code, which must be distributed 160 | under the terms of Sections 1 and 2 above on a medium 161 | customarily used for software interchange; or, 162 | 163 | b) Accompany it with a written offer, valid for at least 164 | three years, to give any third party, for a charge no more 165 | than your cost of physically performing source distribution, 166 | a complete machine-readable copy of the corresponding source 167 | code, to be distributed under the terms of Sections 1 and 2 168 | above on a medium customarily used for software interchange; 169 | or, 170 | 171 | c) Accompany it with the information you received as to the 172 | offer to distribute corresponding source code. (This 173 | alternative is allowed only for noncommercial distribution 174 | and only if you received the program in object code or 175 | executable form with such an offer, in accord with 176 | Subsection b above.) 177 | 178 | The source code for a work means the preferred form of the 179 | work for making modifications to it. For an executable work, 180 | complete source code means all the source code for all 181 | modules it contains, plus any associated interface 182 | definition files, plus the scripts used to control 183 | compilation and installation of the executable. However, as 184 | a special exception, the source code distributed need not 185 | include anything that is normally distributed (in either 186 | source or binary form) with the major components (compiler, 187 | kernel, and so on) of the operating system on which the 188 | executable runs, unless that component itself accompanies 189 | the executable. If distribution of executable or object code 190 | is made by offering access to copy from a designated place, 191 | then offering equivalent access to copy the source code from 192 | the same place counts as distribution of the source code, 193 | even though third parties are not compelled to copy the 194 | source along with the object code. 195 | 196 | 4. You may not copy, modify, sublicense, or distribute the 197 | Program except as expressly provided under this License. Any 198 | attempt otherwise to copy, modify, sublicense or distribute 199 | the Program is void, and will automatically terminate your 200 | rights under this License. However, parties who have 201 | received copies, or rights, from you under this License will 202 | not have their licenses terminated so long as such parties 203 | remain in full compliance. 204 | 205 | 5. You are not required to accept this License, since you 206 | have not signed it. However, nothing else grants you 207 | permission to modify or distribute the Program or its 208 | derivative works. These actions are prohibited by law if you 209 | do not accept this License. Therefore, by modifying or 210 | distributing the Program (or any work based on the Program), 211 | you indicate your acceptance of this License to do so, and 212 | all its terms and conditions for copying, distributing or 213 | modifying the Program or works based on it. 214 | 215 | 6. Each time you redistribute the Program (or any work based 216 | on the Program), the recipient automatically receives a 217 | license from the original licensor to copy, distribute or 218 | modify the Program subject to these terms and conditions. 219 | You may not impose any further restrictions on the 220 | recipients' exercise of the rights granted herein. You are 221 | not responsible for enforcing compliance by third parties to 222 | this License. 223 | 224 | 7. If, as a consequence of a court judgment or allegation of 225 | patent infringement or for any other reason (not limited to 226 | patent issues), conditions are imposed on you (whether by 227 | court order, agreement or otherwise) that contradict the 228 | conditions of this License, they do not excuse you from the 229 | conditions of this License. If you cannot distribute so as 230 | to satisfy simultaneously your obligations under this 231 | License and any other pertinent obligations, then as a 232 | consequence you may not distribute the Program at all. For 233 | example, if a patent license would not permit royalty-free 234 | redistribution of the Program by all those who receive 235 | copies directly or indirectly through you, then the only way 236 | you could satisfy both it and this License would be to 237 | refrain entirely from distribution of the Program. 238 | 239 | If any portion of this section is held invalid or 240 | unenforceable under any particular circumstance, the balance 241 | of the section is intended to apply and the section as a 242 | whole is intended to apply in other circumstances. It is not 243 | the purpose of this section to induce you to infringe any 244 | patents or other property right claims or to contest 245 | validity of any such claims; this section has the sole 246 | purpose of protecting the integrity of the free software 247 | distribution system, which is implemented by public license 248 | practices. Many people have made generous contributions to 249 | the wide range of software distributed through that system 250 | in reliance on consistent application of that system; it is 251 | up to the author/donor to decide if he or she is willing to 252 | distribute software through any other system and a licensee 253 | cannot impose that choice. 254 | 255 | This section is intended to make thoroughly clear what is 256 | believed to be a consequence of the rest of this License. 257 | 258 | 8. If the distribution and/or use of the Program is 259 | restricted in certain countries either by patents or by 260 | copyrighted interfaces, the original copyright holder who 261 | places the Program under this License may add an explicit 262 | geographical distribution limitation excluding those 263 | countries, so that distribution is permitted only in or 264 | among countries not thus excluded. In such case, this 265 | License incorporates the limitation as if written in the 266 | body of this License. 267 | 268 | 9. The Free Software Foundation may publish revised and/or 269 | new versions of the General Public License from time to 270 | time. Such new versions will be similar in spirit to the 271 | present version, but may differ in detail to address new 272 | problems or concerns. 273 | 274 | Each version is given a distinguishing version number. If 275 | the Program specifies a version number of this License which 276 | applies to it and "any later version", you have the option 277 | of following the terms and conditions either of that version 278 | or of any later version published by the Free Software 279 | Foundation. If the Program does not specify a version number 280 | of this License, you may choose any version ever published 281 | by the Free Software Foundation. 282 | 283 | 10. If you wish to incorporate parts of the Program into 284 | other free programs whose distribution conditions are 285 | different, write to the author to ask for permission. For 286 | software which is copyrighted by the Free Software 287 | Foundation, write to the Free Software Foundation; we 288 | sometimes make exceptions for this. Our decision will be 289 | guided by the two goals of preserving the free status of all 290 | derivatives of our free software and of promoting the 291 | sharing and reuse of software generally. 292 | 293 | NO WARRANTY 294 | 295 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS 296 | NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 297 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE 298 | COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM 299 | "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR 300 | IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 301 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 302 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE 303 | OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 304 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 305 | REPAIR OR CORRECTION. 306 | 307 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED 308 | TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY 309 | WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED 310 | ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, 311 | SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF 312 | THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT 313 | LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR 314 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE 315 | PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH 316 | HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 317 | SUCH DAMAGES. 318 | 319 | END OF TERMS AND CONDITIONS 320 | 321 | How to Apply These Terms to Your New Programs 322 | 323 | If you develop a new program, and you want it to be of the 324 | greatest possible use to the public, the best way to achieve 325 | this is to make it free software which everyone can 326 | redistribute and change under these terms. 327 | 328 | To do so, attach the following notices to the program. It is 329 | safest to attach them to the start of each source file to 330 | most effectively convey the exclusion of warranty; and each 331 | file should have at least the "copyright" line and a pointer 332 | to where the full notice is found. 333 | 334 | One line to give the program's name and a brief idea of what 335 | it does. 336 | 337 | Copyright (C) 338 | 339 | This program is free software; you can redistribute it 340 | and/or modify it under the terms of the GNU General Public 341 | License as published by the Free Software Foundation; either 342 | version 2 of the License, or (at your option) any later 343 | version. This program is distributed in the hope that it 344 | will be useful, but WITHOUT ANY WARRANTY; without even the 345 | implied warranty of MERCHANTABILITY or FITNESS FOR A 346 | PARTICULAR PURPOSE. See the GNU General Public License for 347 | more details. You should have received a copy of the GNU 348 | General Public License along with this program; if not, 349 | write to the Free Software Foundation, Inc., 59 Temple 350 | Place, Suite 330, Boston, MA 02111-1307 USA 351 | 352 | Also add information on how to contact you by electronic and 353 | paper mail. 354 | 355 | If the program is interactive, make it output a short notice 356 | like this when it starts in an interactive mode: 357 | 358 | Gnomovision version 69, Copyright (C) year name of author 359 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details 360 | type `show w'. This is free software, and you are welcome to 361 | redistribute it under certain conditions; type `show c' for 362 | details. The hypothetical commands `show w' and `show c' 363 | should show the appropriate parts of the General Public 364 | License. Of course, the commands you use may be called 365 | something other than `show w' and `show c'; they could even 366 | be mouse-clicks or menu items--whatever suits your program. 367 | 368 | You should also get your employer (if you work as a 369 | programmer) or your school, if any, to sign a "copyright 370 | disclaimer" for the program, if necessary. Here is a sample; 371 | alter the names: 372 | 373 | Yoyodyne, Inc., hereby disclaims all copyright interest in 374 | the program `Gnomovision' (which makes passes at compilers) 375 | written by James Hacker. 376 | 377 | signature of Ty Coon, 1 April 1989 378 | Ty Coon, President of Vice 379 | 380 | This General Public License does not permit incorporating 381 | your program into proprietary programs. If your program is a 382 | subroutine library, you may consider it more useful to 383 | permit linking proprietary applications with the library. If 384 | this is what you want to do, use the GNU Library General 385 | Public License instead of this License. 386 | 387 | "CLASSPATH" EXCEPTION TO THE GPL VERSION 2 388 | 389 | Certain source files distributed by Sun Microsystems, Inc. 390 | are subject to the following clarification and special 391 | exception to the GPL Version 2, but only where Sun has 392 | expressly included in the particular source file's header 393 | the words "Sun designates this particular file as subject 394 | to the "Classpath" exception as provided by Sun in the 395 | License file that accompanied this code." 396 | 397 | Linking this library statically or dynamically with other 398 | modules is making a combined work based on this library. 399 | Thus, the terms and conditions of the GNU General Public 400 | License Version 2 cover the whole combination. 401 | 402 | As a special exception, the copyright holders of this 403 | library give you permission to link this library with 404 | independent modules to produce an executable, regardless of 405 | the license terms of these independent modules, and to copy 406 | and distribute the resulting executable under terms of your 407 | choice, provided that you also meet, for each linked 408 | independent module, the terms and conditions of the license 409 | of that module. An independent module is a module which is 410 | not derived from or based on this library. If you modify 411 | this library, you may extend this exception to your version 412 | of the library, but you are not obligated to do so. If you 413 | do not wish to do so, delete this exception statement from 414 | your version. 415 | 416 | 417 | ************************************************************ 418 | 419 | LICENSE #2: 420 | 421 | COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 422 | Version 1.0 423 | 424 | 1. Definitions. 425 | 1.1. "Contributor" means each individual or entity that 426 | creates or contributes to the creation of Modifications. 427 | 428 | 1.2. "Contributor Version" means the combination of the 429 | Original Software, prior Modifications used by a 430 | Contributor (if any), and the Modifications made by that 431 | particular Contributor. 432 | 433 | 1.3. "Covered Software" means (a) the Original Software, or 434 | (b) Modifications, or (c) the combination of files 435 | containing Original Software with files containing 436 | Modifications, in each case including portions thereof. 437 | 438 | 1.4. "Executable" means the Covered Software in any form 439 | other than Source Code. 440 | 441 | 1.5. "Initial Developer" means the individual or entity 442 | that first makes Original Software available under this 443 | License. 444 | 445 | 1.6. "Larger Work" means a work which combines Covered 446 | Software or portions thereof with code not governed by the 447 | terms of this License. 448 | 449 | 1.7. "License" means this document. 450 | 451 | 1.8. "Licensable" means having the right to grant, to the 452 | maximum extent possible, whether at the time of the initial 453 | grant or subsequently acquired, any and all of the rights 454 | conveyed herein. 455 | 456 | 1.9. "Modifications" means the Source Code and Executable 457 | form of any of the following: 458 | 459 | A. Any file that results from an addition to, 460 | deletion from or modification of the contents of a 461 | file containing Original Software or previous 462 | Modifications; 463 | 464 | B. Any new file that contains any part of the 465 | Original Software or previous Modification; or 466 | 467 | C. Any new file that is contributed or otherwise made 468 | available under the terms of this License. 469 | 470 | 1.10. "Original Software" means the Source Code and 471 | Executable form of computer software code that is 472 | originally released under this License. 473 | 474 | 1.11. "Patent Claims" means any patent claim(s), now owned 475 | or hereafter acquired, including without limitation, 476 | method, process, and apparatus claims, in any patent 477 | Licensable by grantor. 478 | 479 | 1.12. "Source Code" means (a) the common form of computer 480 | software code in which modifications are made and (b) 481 | associated documentation included in or with such code. 482 | 483 | 1.13. "You" (or "Your") means an individual or a legal 484 | entity exercising rights under, and complying with all of 485 | the terms of, this License. For legal entities, "You" 486 | includes any entity which controls, is controlled by, or is 487 | under common control with You. For purposes of this 488 | definition, "control" means (a) the power, direct or 489 | indirect, to cause the direction or management of such 490 | entity, whether by contract or otherwise, or (b) ownership 491 | of more than fifty percent (50%) of the outstanding shares 492 | or beneficial ownership of such entity. 493 | 494 | 2. License Grants. 495 | 496 | 2.1. The Initial Developer Grant. 497 | Conditioned upon Your compliance with Section 3.1 below and 498 | subject to third party intellectual property claims, the 499 | Initial Developer hereby grants You a world-wide, 500 | royalty-free, non-exclusive license: 501 | 502 | (a) under intellectual property rights (other than 503 | patent or trademark) Licensable by Initial Developer, 504 | to use, reproduce, modify, display, perform, 505 | sublicense and distribute the Original Software (or 506 | portions thereof), with or without Modifications, 507 | and/or as part of a Larger Work; and 508 | 509 | (b) under Patent Claims infringed by the making, 510 | using or selling of Original Software, to make, have 511 | made, use, practice, sell, and offer for sale, and/or 512 | otherwise dispose of the Original Software (or 513 | portions thereof). 514 | 515 | (c) The licenses granted in Sections 2.1(a) and (b) 516 | are effective on the date Initial Developer first 517 | distributes or otherwise makes the Original Software 518 | available to a third party under the terms of this 519 | License. 520 | 521 | (d) Notwithstanding Section 2.1(b) above, no patent 522 | license is granted: (1) for code that You delete from 523 | the Original Software, or (2) for infringements 524 | caused by: (i) the modification of the Original 525 | Software, or (ii) the combination of the Original 526 | Software with other software or devices. 527 | 528 | 2.2. Contributor Grant. 529 | Conditioned upon Your compliance with Section 3.1 below and 530 | subject to third party intellectual property claims, each 531 | Contributor hereby grants You a world-wide, royalty-free, 532 | non-exclusive license: 533 | 534 | (a) under intellectual property rights (other than 535 | patent or trademark) Licensable by Contributor to 536 | use, reproduce, modify, display, perform, sublicense 537 | and distribute the Modifications created by such 538 | Contributor (or portions thereof), either on an 539 | unmodified basis, with other Modifications, as 540 | Covered Software and/or as part of a Larger Work; and 541 | 542 | (b) under Patent Claims infringed by the making, 543 | using, or selling of Modifications made by that 544 | Contributor either alone and/or in combination with 545 | its Contributor Version (or portions of such 546 | combination), to make, use, sell, offer for sale, 547 | have made, and/or otherwise dispose of: (1) 548 | Modifications made by that Contributor (or portions 549 | thereof); and (2) the combination of Modifications 550 | made by that Contributor with its Contributor Version 551 | (or portions of such combination). 552 | 553 | (c) The licenses granted in Sections 2.2(a) and 554 | 2.2(b) are effective on the date Contributor first 555 | distributes or otherwise makes the Modifications 556 | available to a third party. 557 | 558 | (d) Notwithstanding Section 2.2(b) above, no patent 559 | license is granted: (1) for any code that Contributor 560 | has deleted from the Contributor Version; (2) for 561 | infringements caused by: (i) third party 562 | modifications of Contributor Version, or (ii) the 563 | combination of Modifications made by that Contributor 564 | with other software (except as part of the 565 | Contributor Version) or other devices; or (3) under 566 | Patent Claims infringed by Covered Software in the 567 | absence of Modifications made by that Contributor. 568 | 569 | 3. Distribution Obligations. 570 | 571 | 3.1. Availability of Source Code. 572 | Any Covered Software that You distribute or otherwise make 573 | available in Executable form must also be made available in 574 | Source Code form and that Source Code form must be 575 | distributed only under the terms of this License. You must 576 | include a copy of this License with every copy of the 577 | Source Code form of the Covered Software You distribute or 578 | otherwise make available. You must inform recipients of any 579 | such Covered Software in Executable form as to how they can 580 | obtain such Covered Software in Source Code form in a 581 | reasonable manner on or through a medium customarily used 582 | for software exchange. 583 | 584 | 3.2. Modifications. 585 | The Modifications that You create or to which You 586 | contribute are governed by the terms of this License. You 587 | represent that You believe Your Modifications are Your 588 | original creation(s) and/or You have sufficient rights to 589 | grant the rights conveyed by this License. 590 | 591 | 3.3. Required Notices. 592 | You must include a notice in each of Your Modifications 593 | that identifies You as the Contributor of the Modification. 594 | You may not remove or alter any copyright, patent or 595 | trademark notices contained within the Covered Software, or 596 | any notices of licensing or any descriptive text giving 597 | attribution to any Contributor or the Initial Developer. 598 | 599 | 3.4. Application of Additional Terms. 600 | You may not offer or impose any terms on any Covered 601 | Software in Source Code form that alters or restricts the 602 | applicable version of this License or the recipients' 603 | rights hereunder. You may choose to offer, and to charge a 604 | fee for, warranty, support, indemnity or liability 605 | obligations to one or more recipients of Covered Software. 606 | However, you may do so only on Your own behalf, and not on 607 | behalf of the Initial Developer or any Contributor. You 608 | must make it absolutely clear that any such warranty, 609 | support, indemnity or liability obligation is offered by 610 | You alone, and You hereby agree to indemnify the Initial 611 | Developer and every Contributor for any liability incurred 612 | by the Initial Developer or such Contributor as a result of 613 | warranty, support, indemnity or liability terms You offer. 614 | 615 | 3.5. Distribution of Executable Versions. 616 | You may distribute the Executable form of the Covered 617 | Software under the terms of this License or under the terms 618 | of a license of Your choice, which may contain terms 619 | different from this License, provided that You are in 620 | compliance with the terms of this License and that the 621 | license for the Executable form does not attempt to limit 622 | or alter the recipient's rights in the Source Code form 623 | from the rights set forth in this License. If You 624 | distribute the Covered Software in Executable form under a 625 | different license, You must make it absolutely clear that 626 | any terms which differ from this License are offered by You 627 | alone, not by the Initial Developer or Contributor. You 628 | hereby agree to indemnify the Initial Developer and every 629 | Contributor for any liability incurred by the Initial 630 | Developer or such Contributor as a result of any such terms 631 | You offer. 632 | 633 | 3.6. Larger Works. 634 | You may create a Larger Work by combining Covered Software 635 | with other code not governed by the terms of this License 636 | and distribute the Larger Work as a single product. In such 637 | a case, You must make sure the requirements of this License 638 | are fulfilled for the Covered Software. 639 | 640 | 4. Versions of the License. 641 | 642 | 4.1. New Versions. 643 | Sun Microsystems, Inc. is the initial license steward and 644 | may publish revised and/or new versions of this License 645 | from time to time. Each version will be given a 646 | distinguishing version number. Except as provided in 647 | Section 4.3, no one other than the license steward has the 648 | right to modify this License. 649 | 650 | 4.2. Effect of New Versions. 651 | You may always continue to use, distribute or otherwise 652 | make the Covered Software available under the terms of the 653 | version of the License under which You originally received 654 | the Covered Software. If the Initial Developer includes a 655 | notice in the Original Software prohibiting it from being 656 | distributed or otherwise made available under any 657 | subsequent version of the License, You must distribute and 658 | make the Covered Software available under the terms of the 659 | version of the License under which You originally received 660 | the Covered Software. Otherwise, You may also choose to 661 | use, distribute or otherwise make the Covered Software 662 | available under the terms of any subsequent version of the 663 | License published by the license steward. 664 | 665 | 4.3. Modified Versions. 666 | When You are an Initial Developer and You want to create a 667 | new license for Your Original Software, You may create and 668 | use a modified version of this License if You: (a) rename 669 | the license and remove any references to the name of the 670 | license steward (except to note that the license differs 671 | from this License); and (b) otherwise make it clear that 672 | the license contains terms which differ from this License. 673 | 674 | 5. DISCLAIMER OF WARRANTY. 675 | 676 | COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS 677 | IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR 678 | IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE 679 | COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A 680 | PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO 681 | THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH 682 | YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY 683 | RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER 684 | CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, 685 | REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY 686 | CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY 687 | COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS 688 | DISCLAIMER. 689 | 690 | 6. TERMINATION. 691 | 692 | 6.1. This License and the rights granted hereunder will 693 | terminate automatically if You fail to comply with terms 694 | herein and fail to cure such breach within 30 days of 695 | becoming aware of the breach. Provisions which, by their 696 | nature, must remain in effect beyond the termination of 697 | this License shall survive. 698 | 699 | 6.2. If You assert a patent infringement claim (excluding 700 | declaratory judgment actions) against Initial Developer or 701 | a Contributor (the Initial Developer or Contributor against 702 | whom You assert such claim is referred to as "Participant") 703 | alleging that the Participant Software (meaning the 704 | Contributor Version where the Participant is a Contributor 705 | or the Original Software where the Participant is the 706 | Initial Developer) directly or indirectly infringes any 707 | patent, then any and all rights granted directly or 708 | indirectly to You by such Participant, the Initial 709 | Developer (if the Initial Developer is not the Participant) 710 | and all Contributors under Sections 2.1 and/or 2.2 of this 711 | License shall, upon 60 days notice from Participant 712 | terminate prospectively and automatically at the expiration 713 | of such 60 day notice period, unless if within such 60 day 714 | period You withdraw Your claim with respect to the 715 | Participant Software against such Participant either 716 | unilaterally or pursuant to a written agreement with 717 | Participant. 718 | 719 | 6.3. In the event of termination under Sections 6.1 or 6.2 720 | above, all end user licenses that have been validly granted 721 | by You or any distributor hereunder prior to termination 722 | (excluding licenses granted to You by any distributor) 723 | shall survive termination. 724 | 725 | 7. LIMITATION OF LIABILITY. 726 | 727 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER 728 | TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL 729 | YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY 730 | DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF 731 | SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, 732 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY 733 | CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST 734 | PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE 735 | OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR 736 | LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE 737 | POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY 738 | SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY 739 | RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT 740 | APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS 741 | DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR 742 | CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY 743 | NOT APPLY TO YOU. 744 | 745 | 8. U.S. GOVERNMENT END USERS. 746 | 747 | The Covered Software is a "commercial item," as that term is 748 | defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of 749 | "commercial computer software" (as that term is defined at 750 | 48 C.F.R. 252.227-7014(a)(1)) and "commercial computer 751 | software documentation" as such terms are used in 48 C.F.R. 752 | 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 753 | C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. 754 | Government End Users acquire Covered Software with only 755 | those rights set forth herein. This U.S. Government Rights 756 | clause is in lieu of, and supersedes, any other FAR, DFAR, 757 | or other clause or provision that addresses Government 758 | rights in computer software under this License. 759 | 760 | 9. MISCELLANEOUS. 761 | 762 | This License represents the complete agreement concerning 763 | subject matter hereof. If any provision of this License is 764 | held to be unenforceable, such provision shall be reformed 765 | only to the extent necessary to make it enforceable. This 766 | License shall be governed by the law of the jurisdiction 767 | specified in a notice contained within the Original Software 768 | (except to the extent applicable law, if any, provides 769 | otherwise), excluding such jurisdiction's conflict-of-law 770 | provisions. Any litigation relating to this License shall be 771 | subject to the jurisdiction of the courts located in the 772 | jurisdiction and venue specified in a notice contained 773 | within the Original Software, with the losing party 774 | responsible for costs, including, without limitation, court 775 | costs and reasonable attorneys' fees and expenses. The 776 | application of the United Nations Convention on Contracts 777 | for the International Sale of Goods is expressly excluded. 778 | Any law or regulation which provides that the language of a 779 | contract shall be construed against the drafter shall not 780 | apply to this License. You agree that You alone are 781 | responsible for compliance with the United States export 782 | administration regulations (and the export control laws and 783 | regulation of any other countries) when You use, distribute 784 | or otherwise make available any Covered Software. 785 | 786 | 10. RESPONSIBILITY FOR CLAIMS. 787 | 788 | As between Initial Developer and the Contributors, each 789 | party is responsible for claims and damages arising, 790 | directly or indirectly, out of its utilization of rights 791 | under this License and You agree to work with Initial 792 | Developer and Contributors to distribute such responsibility 793 | on an equitable basis. Nothing herein is intended or shall 794 | be deemed to constitute any admission of liability. 795 | --------------------------------------------------------------------------------