├── .github └── FUNDING.yml ├── .gitignore ├── vagrant ├── nbproject │ ├── suite.properties │ ├── platform.properties │ ├── genfiles.properties │ ├── project.properties │ └── build-impl.xml ├── src │ └── org │ │ └── netbeans │ │ └── modules │ │ └── vagrant │ │ ├── options │ │ └── Bundle.properties │ │ ├── resources │ │ ├── up.png │ │ ├── halt.png │ │ ├── init.png │ │ ├── logo.png │ │ ├── ssh.png │ │ ├── destroy.png │ │ ├── logo24.png │ │ ├── logo_12.png │ │ ├── logo_24.png │ │ ├── logo_32.png │ │ ├── options.png │ │ ├── reload.png │ │ ├── resume.png │ │ ├── share.png │ │ ├── status.png │ │ ├── suspend.png │ │ ├── provision.png │ │ ├── run_command.png │ │ └── virtual_machine.png │ │ ├── ui │ │ ├── customizers │ │ │ └── Bundle.properties │ │ ├── project │ │ │ └── Bundle.properties │ │ ├── node │ │ │ ├── actions │ │ │ │ ├── AbstractVagrantNodeAction.java │ │ │ │ ├── VagrantHaltAction.java │ │ │ │ ├── VagrantShareAction.java │ │ │ │ ├── VagrantReloadAction.java │ │ │ │ ├── VagrantResumeAction.java │ │ │ │ ├── VagrantSuspendAction.java │ │ │ │ ├── VagrantProvisionAction.java │ │ │ │ ├── VagrantUpAction.java │ │ │ │ ├── VagrantReloadStatusAction.java │ │ │ │ ├── OpenVagrantfileAction.java │ │ │ │ ├── DeleteVagrantNodeAction.java │ │ │ │ └── AddVagrantProjectAction.java │ │ │ ├── VirtualMachine.java │ │ │ ├── VagrantProjectNode.java │ │ │ ├── VagrantChildFactory.java │ │ │ ├── VagrantNode.java │ │ │ └── VirtualMachineNode.java │ │ ├── options │ │ │ ├── VagrantCategoryPanel.java │ │ │ ├── Bundle.properties │ │ │ ├── CommandsPanel.form │ │ │ └── VagrantPanel.form │ │ ├── actions │ │ │ ├── VagrantOpenOptionsAction.java │ │ │ ├── VagrantBoxAddAction.java │ │ │ ├── VagrantPluginInstallAction.java │ │ │ ├── VagrantSshConfigAction.java │ │ │ ├── VirtualMachineStartAction.java │ │ │ ├── VagrantUpAction.java │ │ │ ├── VagrantHaltAction.java │ │ │ ├── VagrantShareAction.java │ │ │ ├── VagrantResumeAction.java │ │ │ ├── VagrantReloadAction.java │ │ │ ├── VagrantStatusAction.java │ │ │ ├── VagrantRunCommandAction.java │ │ │ ├── VagrantSuspendAction.java │ │ │ ├── VagrantAction.java │ │ │ ├── VagrantProvisitonAction.java │ │ │ ├── VagrantSshAction.java │ │ │ └── VagrantDestroyAction.java │ │ └── StripeListCellRenderer.java │ │ ├── Bundle.properties │ │ ├── command │ │ ├── InvalidVagrantExecutableException.java │ │ ├── InvalidVirtualMachineExecutableException.java │ │ ├── SshInfo.java │ │ ├── VirtualMachine.java │ │ └── CommandHistory.java │ │ ├── Versionable.java │ │ ├── api │ │ └── VagrantProject.java │ │ ├── plugins │ │ └── VagrantPluginItem.java │ │ ├── boxes │ │ └── VagrantBoxItem.java │ │ ├── VagrantfileMIMEResolver.java │ │ ├── VagrantStatus.java │ │ ├── VagrantVersion.java │ │ └── utils │ │ └── StringUtils.java ├── .gitignore ├── release │ └── modules │ │ └── ext │ │ ├── gson-2.2.4-for-vagrant.jar │ │ ├── jsoup-1.7.2-for-nb-vagrant-plugin.jar │ │ └── jsoup-License ├── manifest.mf ├── pom.xml ├── build.xml └── test │ └── unit │ └── src │ └── org │ └── netbeans │ └── modules │ └── vagrant │ └── utils │ └── StringUtilsTest.java ├── screenshots ├── nb-vagrant-add-box.png ├── nb-vagrant-options.png ├── nb-vagrant-statusbar.png ├── nb-vagrant-context-menu.png ├── nb-vagrant-run-command.png ├── nb-vagrant-install-plugin.png ├── nb-vagrant-closing-confirmation.png ├── nb-vagrant-status-management-window.png └── nb-vagrant-syntax-highlight-vagrantfile.png └── nbproject ├── project.properties ├── platform.properties ├── project.xml ├── genfiles.properties ├── platform.xml └── build-impl.xml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: junichi11 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | nbproject/private 3 | -------------------------------------------------------------------------------- /vagrant/nbproject/suite.properties: -------------------------------------------------------------------------------- 1 | suite.dir=${basedir}/.. 2 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/options/Bundle.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vagrant/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | nbproject/private 3 | lib 4 | pom.xml.asc 5 | -------------------------------------------------------------------------------- /screenshots/nb-vagrant-add-box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-add-box.png -------------------------------------------------------------------------------- /screenshots/nb-vagrant-options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-options.png -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | modules=\ 2 | ${project.org.netbeans.modules.vagrant} 3 | project.org.netbeans.modules.vagrant=vagrant 4 | -------------------------------------------------------------------------------- /screenshots/nb-vagrant-statusbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-statusbar.png -------------------------------------------------------------------------------- /screenshots/nb-vagrant-context-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-context-menu.png -------------------------------------------------------------------------------- /screenshots/nb-vagrant-run-command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-run-command.png -------------------------------------------------------------------------------- /screenshots/nb-vagrant-install-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-install-plugin.png -------------------------------------------------------------------------------- /screenshots/nb-vagrant-closing-confirmation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-closing-confirmation.png -------------------------------------------------------------------------------- /screenshots/nb-vagrant-status-management-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-status-management-window.png -------------------------------------------------------------------------------- /vagrant/release/modules/ext/gson-2.2.4-for-vagrant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/release/modules/ext/gson-2.2.4-for-vagrant.jar -------------------------------------------------------------------------------- /screenshots/nb-vagrant-syntax-highlight-vagrantfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/screenshots/nb-vagrant-syntax-highlight-vagrantfile.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/up.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/halt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/halt.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/init.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/logo.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/ssh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/ssh.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/destroy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/destroy.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/logo24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/logo24.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/logo_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/logo_12.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/logo_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/logo_24.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/logo_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/logo_32.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/options.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/reload.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/resume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/resume.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/share.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/status.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/suspend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/suspend.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/provision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/provision.png -------------------------------------------------------------------------------- /vagrant/release/modules/ext/jsoup-1.7.2-for-nb-vagrant-plugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/release/modules/ext/jsoup-1.7.2-for-nb-vagrant-plugin.jar -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/run_command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/run_command.png -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/resources/virtual_machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junichi11/netbeans-vagrant-plugin/HEAD/vagrant/src/org/netbeans/modules/vagrant/resources/virtual_machine.png -------------------------------------------------------------------------------- /vagrant/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | OpenIDE-Module: org.netbeans.modules.vagrant 3 | OpenIDE-Module-Install: org/netbeans/modules/vagrant/VagrantInstaller.class 4 | OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/vagrant/Bundle.properties 5 | OpenIDE-Module-Requires: org.openide.windows.WindowManager 6 | OpenIDE-Module-Specification-Version: 1.4.0 7 | 8 | -------------------------------------------------------------------------------- /nbproject/platform.properties: -------------------------------------------------------------------------------- 1 | cluster.path=\ 2 | ${nbplatform.active.dir}/nb:\ 3 | ${nbplatform.active.dir}/platform:\ 4 | ${nbplatform.active.dir}/apisupport:\ 5 | ${nbplatform.active.dir}/ide:\ 6 | ${nbplatform.active.dir}/java:\ 7 | ${nbplatform.active.dir}/profiler:\ 8 | ${nbplatform.active.dir}/harness 9 | nbplatform.active=default 10 | -------------------------------------------------------------------------------- /vagrant/nbproject/platform.properties: -------------------------------------------------------------------------------- 1 | cluster.path=\ 2 | ${nbplatform.active.dir}/nb:\ 3 | ${nbplatform.active.dir}/platform:\ 4 | ${nbplatform.active.dir}/apisupport:\ 5 | ${nbplatform.active.dir}/ide:\ 6 | ${nbplatform.active.dir}/java:\ 7 | ${nbplatform.active.dir}/profiler:\ 8 | ${nbplatform.active.dir}/harness 9 | nbplatform.active=default 10 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.apisupport.project.suite 4 | 5 | 6 | Vagrant 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /vagrant/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=cdcd8cfe 2 | build.xml.script.CRC32=ea9a32f2 3 | build.xml.stylesheet.CRC32=15ca8a54@2.75.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=cdcd8cfe 7 | nbproject/build-impl.xml.script.CRC32=72d7d7ca 8 | nbproject/build-impl.xml.stylesheet.CRC32=49aa68b0@2.75.1 9 | -------------------------------------------------------------------------------- /vagrant/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | file.reference.gson-2.2.4-for-vagrant.jar=release/modules/ext/gson-2.2.4-for-vagrant.jar 2 | file.reference.jsoup-1.7.2-for-nb-vagrant-plugin.jar=release/modules/ext/jsoup-1.7.2-for-nb-vagrant-plugin.jar 3 | javac.source=1.8 4 | javac.compilerargs=-Xlint -Xlint:-serial 5 | license.file=src/org/netbeans/modules/vagrant/resources/license.txt 6 | nbm.homepage=https://github.com/junichi11/netbeans-vagrant-plugin 7 | nbm.module.author=junichi11 8 | project.license=cddl-netbeans-sun 9 | keystore=nbproject/private/keystore 10 | nbm_alias=vagrant 11 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/customizers/Bundle.properties: -------------------------------------------------------------------------------- 1 | VagrantCustomizerPanel.vagrantRootPathLabel.text=Vagrant Root: 2 | VagrantCustomizerPanel.vagrantRootPathTextField.text= 3 | VagrantCustomizerPanel.browseButton.text=Browse... 4 | VagrantCustomizerPanel.projectClosedLabel.text=Action on close projects (when status is running): 5 | VagrantCustomizerPanel.projectClosedNoneRadioButton.text=none 6 | VagrantCustomizerPanel.projectClosedHaltRadioButton.text=halt 7 | VagrantCustomizerPanel.projectClosedHaltAskRadioButton.text=halt (ask) 8 | VagrantCustomizerPanel.saveRunCommandHistoriesCheckBox.text=Save histories of Vagrant Run Command Action on close 9 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=9cb1cc10 2 | build.xml.script.CRC32=9aa07999 3 | build.xml.stylesheet.CRC32=70ce5c94@2.74.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=9cb1cc10 7 | nbproject/build-impl.xml.script.CRC32=7ae856cd 8 | nbproject/build-impl.xml.stylesheet.CRC32=473dc988@2.74.1 9 | nbproject/platform.xml.data.CRC32=9cb1cc10 10 | nbproject/platform.xml.script.CRC32=6dcbd131 11 | nbproject/platform.xml.stylesheet.CRC32=ae64f0b6@2.74.1 12 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/Bundle.properties: -------------------------------------------------------------------------------- 1 | OpenIDE-Module-Display-Category=Tools 2 | OpenIDE-Module-Long-Description=\ 3 | Vagrant support : 1.6.0 or newer.\n\ 4 |

features

\n\n\nThis plugin action is vaild only on project node.\n\ 5 |

Available commands on context menu

\n 6 | OpenIDE-Module-Name=Vagrant 7 | OpenIDE-Module-Short-Description=Vagrant support 8 | -------------------------------------------------------------------------------- /vagrant/release/modules/ext/jsoup-License: -------------------------------------------------------------------------------- 1 | jsoup License 2 | The jsoup code-base (include source and compiled packages) are distributed under the open source MIT license as described below. 3 | 4 | The MIT License 5 | Copyright © 2009 - 2013 Jonathan Hedley (jonathan@hedley.net) 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vagrant/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.junichi11.netbeans.modules 5 | netbeans-vagrant 6 | 7 | 1.4.0 8 | nbm 9 | Vagrant Support 10 | https://github.com/junichi11/netbeans-vagrant-plugin 11 | This plugin provides support for Vagrant. 12 | 13 | 14 | junichi11 15 | Junichi Yamamoto 16 | https://github.com/junichi11 17 | 18 | 19 | 20 | scm:git:https://github.com/junichi11/netbeans-vagrant-plugin.git 21 | scm:git:https://github.com/junichi11/netbeans-vagrant-plugin.git 22 | https://github.com/junichi11/netbeans-vagrant-plugin 23 | HEAD 24 | 25 | 26 | 27 | Common Development and Distribution License (CDDL) v1.0 and GNU General Public License (GPL) v2 28 | http://netbeans.org/cddl-gplv2.html 29 | 30 | 31 | 32 | 33 | ossrh 34 | https://oss.sonatype.org/content/repositories/snapshots 35 | 36 | 37 | ossrh 38 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /vagrant/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 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/project/Bundle.properties: -------------------------------------------------------------------------------- 1 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 | # 3 | # Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 40 | 41 | NetBeansClosingDialog.cancelButton.text=Cancel 42 | NetBeansClosingDialog.haltButton.text=Halt 43 | NetBeansClosingDialog.haltAllButton.text=Halt all 44 | NetBeansClosingDialog.shutdownButton.text=Shutdown 45 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/AbstractVagrantNodeAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.openide.util.actions.NodeAction; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public abstract class AbstractVagrantNodeAction extends NodeAction { 49 | 50 | private static final long serialVersionUID = -3249625342994254823L; 51 | } 52 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/command/InvalidVagrantExecutableException.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.command; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public class InvalidVagrantExecutableException extends Exception { 49 | 50 | private static final long serialVersionUID = 696094096689505057L; 51 | 52 | public InvalidVagrantExecutableException(String message) { 53 | super(message); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/Versionable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 41 | */ 42 | package org.netbeans.modules.vagrant; 43 | 44 | import org.netbeans.api.annotations.common.CheckForNull; 45 | 46 | /** 47 | * 48 | * @author junichi11 49 | */ 50 | public interface Versionable { 51 | 52 | public String getVersion(); 53 | 54 | public int getMajor(); 55 | 56 | public int getMinor(); 57 | 58 | public int getRevision(); 59 | 60 | @CheckForNull 61 | public String getUnstable(); 62 | } 63 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/command/InvalidVirtualMachineExecutableException.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.command; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public class InvalidVirtualMachineExecutableException extends Exception { 49 | 50 | private static final long serialVersionUID = 3487733839176099600L; 51 | 52 | public InvalidVirtualMachineExecutableException(String message) { 53 | super(message); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantHaltAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | 44 | public class VagrantHaltAction extends AbstractVagrantNodeCommandAction { 45 | 46 | private static final long serialVersionUID = 2067093985077940642L; 47 | 48 | @Override 49 | protected String getCommand() { 50 | return Vagrant.HALT_COMMAND; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Halt"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantShareAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | 44 | public class VagrantShareAction extends AbstractVagrantNodeCommandAction { 45 | 46 | private static final long serialVersionUID = 9017370165411533579L; 47 | 48 | @Override 49 | protected String getCommand() { 50 | return Vagrant.SHARE_COMMAND; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Share"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantReloadAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | 44 | public class VagrantReloadAction extends AbstractVagrantNodeCommandAction { 45 | 46 | private static final long serialVersionUID = -5477056481851331043L; 47 | 48 | @Override 49 | protected String getCommand() { 50 | return Vagrant.RELOAD_COMMAND; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Reload"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantResumeAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | 44 | public class VagrantResumeAction extends AbstractVagrantNodeCommandAction { 45 | 46 | private static final long serialVersionUID = -4043642500439986193L; 47 | 48 | @Override 49 | protected String getCommand() { 50 | return Vagrant.RESUME_COMMAND; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Resume"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantSuspendAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | 44 | public class VagrantSuspendAction extends AbstractVagrantNodeCommandAction { 45 | 46 | private static final long serialVersionUID = -4837174146653937023L; 47 | 48 | @Override 49 | protected String getCommand() { 50 | return Vagrant.SUSPEND_COMMAND; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Suspend"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantProvisionAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | 44 | public class VagrantProvisionAction extends AbstractVagrantNodeCommandAction { 45 | 46 | private static final long serialVersionUID = 4845547315752095875L; 47 | 48 | @Override 49 | protected String getCommand() { 50 | return Vagrant.PROVISION_COMMAND; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Provision"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/options/VagrantCategoryPanel.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.options; 43 | 44 | import javax.swing.JPanel; 45 | 46 | /** 47 | * 48 | * @author junichi11 49 | */ 50 | public abstract class VagrantCategoryPanel extends JPanel { 51 | 52 | private static final long serialVersionUID = -5245086839231306585L; 53 | 54 | abstract void load(); 55 | 56 | abstract void store(); 57 | 58 | abstract void reload(); 59 | 60 | abstract boolean valid(); 61 | 62 | public abstract String getCategoryName(); 63 | } 64 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/api/VagrantProject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.api; 41 | 42 | import java.io.File; 43 | import org.netbeans.modules.vagrant.VagrantStatus; 44 | import org.openide.filesystems.FileObject; 45 | 46 | /** 47 | * 48 | * @author junichi11 49 | */ 50 | public interface VagrantProject { 51 | 52 | String getDisplayName(); 53 | 54 | FileObject getVagrantRoot(); 55 | 56 | String getVagrantRootPath(); 57 | 58 | File getWorkingDirecotry(); 59 | 60 | VagrantStatus getVagrantStatus(); 61 | 62 | boolean canUpdateStatus(String command); 63 | 64 | void updateStatus(); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /vagrant/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Builds, tests, and runs the project org.netbeans.modules.vagrant. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantUpAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.command.Vagrant; 43 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 44 | 45 | public class VagrantUpAction extends AbstractVagrantNodeCommandAction { 46 | 47 | private static final long serialVersionUID = -4848159261535977349L; 48 | 49 | public VagrantUpAction() { 50 | setIcon(VagrantUtils.getIcon(VagrantUtils.UP_ICON_16)); 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return "Vagrant Up"; 56 | } 57 | 58 | @Override 59 | protected String getCommand() { 60 | return Vagrant.UP_COMMAND; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/command/SshInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 41 | */ 42 | package org.netbeans.modules.vagrant.command; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public class SshInfo { 49 | 50 | private final String hostName; 51 | private final String user; 52 | private final int port; 53 | 54 | public SshInfo(String hostName, String user, int port) { 55 | this.hostName = hostName; 56 | this.user = user; 57 | this.port = port; 58 | } 59 | 60 | public String getUser() { 61 | return user; 62 | } 63 | 64 | public String getHostName() { 65 | return hostName; 66 | } 67 | 68 | public int getPort() { 69 | return port; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/plugins/VagrantPluginItem.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.plugins; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public final class VagrantPluginItem { 49 | 50 | private final String name; 51 | private final String url; 52 | private final String category; 53 | 54 | public VagrantPluginItem(String name, String url, String category) { 55 | this.name = name; 56 | this.url = url; 57 | this.category = category; 58 | } 59 | 60 | public String getName() { 61 | return name; 62 | } 63 | 64 | public String getUrl() { 65 | return url; 66 | } 67 | 68 | public String getCategory() { 69 | return category; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/boxes/VagrantBoxItem.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.boxes; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public final class VagrantBoxItem { 49 | 50 | private final String name; 51 | private final String provider; 52 | private final String url; 53 | private final String size; 54 | 55 | public VagrantBoxItem(String name, String provider, String url, String size) { 56 | this.name = name; 57 | this.provider = provider; 58 | this.url = url; 59 | this.size = size; 60 | } 61 | 62 | public String getName() { 63 | return name; 64 | } 65 | 66 | public String getProvider() { 67 | return provider; 68 | } 69 | 70 | public String getUrl() { 71 | return url; 72 | } 73 | 74 | public String getSize() { 75 | return size; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/VagrantfileMIMEResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 41 | */ 42 | package org.netbeans.modules.vagrant; 43 | 44 | import org.openide.filesystems.FileObject; 45 | import org.openide.filesystems.MIMEResolver; 46 | import org.openide.util.lookup.ServiceProvider; 47 | 48 | /** 49 | * 50 | * @author junichi11 51 | */ 52 | @ServiceProvider(service = MIMEResolver.class) 53 | public class VagrantfileMIMEResolver extends MIMEResolver { 54 | 55 | private static final String MIME_TYPE_RUBY = "text/x-ruby"; // NOI18N 56 | 57 | public VagrantfileMIMEResolver() { 58 | super(MIME_TYPE_RUBY); 59 | } 60 | 61 | @Override 62 | public String findMIMEType(FileObject fo) { 63 | if (fo != null) { 64 | String name = fo.getNameExt(); 65 | if (!fo.isFolder() && "vagrantfile".equals(name.toLowerCase())) { // NOI18N 66 | return MIME_TYPE_RUBY; 67 | } 68 | } 69 | return null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantOpenOptionsAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import javax.swing.SwingUtilities; 45 | import org.netbeans.api.project.Project; 46 | import org.netbeans.modules.vagrant.utils.UiUtils; 47 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 48 | import org.openide.util.NbBundle; 49 | 50 | /** 51 | * 52 | * @author junichi11 53 | */ 54 | @NbBundle.Messages("CTL_VagrantOpenOptionsAction=Vagrant Options") 55 | public class VagrantOpenOptionsAction extends VagrantAction { 56 | 57 | private static final long serialVersionUID = -3650342564105847958L; 58 | 59 | public VagrantOpenOptionsAction() { 60 | super(Bundle.CTL_VagrantOpenOptionsAction(), VagrantUtils.getIcon(VagrantUtils.OPTIONS_ICON_16)); 61 | } 62 | 63 | @Override 64 | public void actionPerformed(Project project) { 65 | SwingUtilities.invokeLater(() -> { 66 | UiUtils.showOptions(); 67 | }); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantBoxAddAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import javax.swing.SwingUtilities; 45 | import org.netbeans.api.project.Project; 46 | import org.netbeans.modules.vagrant.ui.options.AddBoxesPanel; 47 | import org.openide.DialogDescriptor; 48 | import org.openide.util.NbBundle; 49 | 50 | @NbBundle.Messages("CTL_VagrantBoxAddAction=Vagrant box add") 51 | public class VagrantBoxAddAction extends VagrantAction { 52 | 53 | private static final long serialVersionUID = 5947898137276211408L; 54 | 55 | public VagrantBoxAddAction() { 56 | super(Bundle.CTL_VagrantBoxAddAction()); 57 | } 58 | 59 | @Override 60 | public void actionPerformed(Project project) { 61 | SwingUtilities.invokeLater(() -> { 62 | AddBoxesPanel addPanel = AddBoxesPanel.getDefault(false); 63 | DialogDescriptor descriptor = addPanel.showDialog(); 64 | if (descriptor.getValue() == DialogDescriptor.OK_OPTION) { 65 | addPanel.runVagrantBoxAdd(); 66 | } 67 | }); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/VirtualMachine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node; 41 | 42 | import org.netbeans.modules.vagrant.StatusLine; 43 | 44 | /** 45 | * 46 | * @author junichi11 47 | */ 48 | public class VirtualMachine { 49 | 50 | private final StatusLine statusLine; 51 | private final boolean isDummy; 52 | 53 | public VirtualMachine(StatusLine statusLine) { 54 | this(statusLine, false); 55 | } 56 | 57 | public VirtualMachine(StatusLine statusLine, boolean isDummy) { 58 | this.statusLine = statusLine; 59 | this.isDummy = isDummy; 60 | } 61 | 62 | public String getName() { 63 | return statusLine.getName(); 64 | } 65 | 66 | public String getProvider() { 67 | return statusLine.getProvider(); 68 | } 69 | 70 | public String getStatus() { 71 | return statusLine.getStatus(); 72 | } 73 | 74 | public String getDisplayName() { 75 | if (isDummy) { 76 | return "Loading..."; 77 | } 78 | return String.format("%s %s(%s)", statusLine.getName(), statusLine.getStatus(), statusLine.getProvider()); // NOI18N 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantPluginInstallAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import javax.swing.SwingUtilities; 45 | import org.netbeans.api.project.Project; 46 | import org.netbeans.modules.vagrant.ui.options.AddPluginsPanel; 47 | import org.openide.DialogDescriptor; 48 | import org.openide.util.NbBundle; 49 | 50 | @NbBundle.Messages("CTL_VagrantPluginInstallAction=Vagrant plugin install") 51 | public class VagrantPluginInstallAction extends VagrantAction { 52 | 53 | private static final long serialVersionUID = -7099040972283882562L; 54 | 55 | public VagrantPluginInstallAction() { 56 | super(Bundle.CTL_VagrantPluginInstallAction()); 57 | } 58 | 59 | @Override 60 | public void actionPerformed(Project project) { 61 | SwingUtilities.invokeLater(() -> { 62 | AddPluginsPanel addPanel = AddPluginsPanel.getDefault(); 63 | DialogDescriptor descriptor = addPanel.showDialog(); 64 | if (descriptor.getValue() == DialogDescriptor.OK_OPTION) { 65 | addPanel.runVagrantPluginInstall(); 66 | } 67 | }); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantSshConfigAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.openide.util.NbBundle.Messages; 51 | 52 | @Messages("CTL_VagrantSshConfigAction=Vagrant ssh-config") 53 | public final class VagrantSshConfigAction extends VagrantAction { 54 | 55 | private static final long serialVersionUID = 4143538644669078262L; 56 | private static final Logger LOGGER = Logger.getLogger(VagrantSshConfigAction.class.getName()); 57 | 58 | public VagrantSshConfigAction() { 59 | super(Bundle.CTL_VagrantSshConfigAction()); 60 | } 61 | 62 | @Override 63 | public void actionPerformed(Project project) { 64 | try { 65 | Vagrant vagrant = Vagrant.getDefault(); 66 | vagrant.sshConfig(VagrantProjectImpl.create(project)); 67 | } catch (InvalidVagrantExecutableException ex) { 68 | LOGGER.log(Level.WARNING, ex.getMessage()); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/StripeListCellRenderer.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui; 43 | 44 | import java.awt.Color; 45 | import java.awt.Component; 46 | import javax.swing.DefaultListCellRenderer; 47 | import javax.swing.JLabel; 48 | import javax.swing.JList; 49 | 50 | /** 51 | * 52 | * @author junichi11 53 | */ 54 | public class StripeListCellRenderer extends DefaultListCellRenderer { 55 | 56 | private static final long serialVersionUID = 499508647770943737L; 57 | 58 | @Override 59 | public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 60 | JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 61 | Color background = list.getBackground(); 62 | Color backgroundDarker = new Color( 63 | Math.abs(background.getRed() - 10), 64 | Math.abs(background.getGreen() - 10), 65 | Math.abs(background.getBlue() - 10)); 66 | 67 | if (!isSelected) { 68 | if (index % 2 == 0) { 69 | label.setBackground(backgroundDarker); 70 | } else { 71 | label.setBackground(background); 72 | } 73 | } 74 | return label; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VirtualMachineStartAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.awt.event.ActionEvent; 45 | import java.awt.event.ActionListener; 46 | import org.netbeans.modules.vagrant.command.InvalidVirtualMachineExecutableException; 47 | import org.netbeans.modules.vagrant.command.VirtualMachine; 48 | import org.openide.DialogDisplayer; 49 | import org.openide.NotifyDescriptor; 50 | 51 | //@ActionID( 52 | // category = "Tools", 53 | // id = "org.netbeans.modules.vagrant.ui.actions.VirtualMachineStartAction") 54 | //@ActionRegistration( 55 | // displayName = "#CTL_VirtualMachineStartAction") 56 | //@ActionReference(path = "Menu/Tools", position = 1900) 57 | //@Messages("CTL_VirtualMachineStartAction=Start Virtual Machine") 58 | public final class VirtualMachineStartAction implements ActionListener { 59 | 60 | @Override 61 | public void actionPerformed(ActionEvent e) { 62 | try { 63 | VirtualMachine virtualMachine = VirtualMachine.getDefault(); 64 | virtualMachine.start(); 65 | } catch (InvalidVirtualMachineExecutableException ex) { 66 | NotifyDescriptor.Message message = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.WARNING_MESSAGE); 67 | DialogDisplayer.getDefault().notify(message); 68 | } 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/VagrantReloadStatusAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.VagrantStatusGlobal; 43 | import org.netbeans.modules.vagrant.api.VagrantProjectGlobal; 44 | import org.netbeans.modules.vagrant.command.Vagrant; 45 | import org.openide.nodes.Node; 46 | import org.openide.util.HelpCtx; 47 | import org.openide.util.Lookup; 48 | 49 | public class VagrantReloadStatusAction extends AbstractVagrantNodeAction { 50 | 51 | private static final long serialVersionUID = -133298803000955538L; 52 | 53 | @Override 54 | protected void performAction(Node[] nodes) { 55 | VagrantStatusGlobal globalStatus = Lookup.getDefault().lookup(VagrantStatusGlobal.class); 56 | if (globalStatus == null) { 57 | return; 58 | } 59 | for (Node node : nodes) { 60 | VagrantProjectGlobal project = node.getLookup().lookup(VagrantProjectGlobal.class); 61 | if (project != null) { 62 | globalStatus.update(project); 63 | } 64 | } 65 | } 66 | 67 | @Override 68 | protected boolean enable(Node[] nodes) { 69 | return !Vagrant.isRunning(); 70 | } 71 | 72 | @Override 73 | public String getName() { 74 | return "Reload Status"; 75 | } 76 | 77 | @Override 78 | public HelpCtx getHelpCtx() { 79 | return null; 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/VagrantProjectNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node; 41 | 42 | import javax.swing.Action; 43 | import org.netbeans.modules.vagrant.api.VagrantProjectGlobal; 44 | import org.netbeans.modules.vagrant.ui.node.actions.DeleteVagrantNodeAction; 45 | import org.netbeans.modules.vagrant.ui.node.actions.OpenVagrantfileAction; 46 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantReloadStatusAction; 47 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 48 | import org.openide.nodes.AbstractNode; 49 | import org.openide.nodes.Children; 50 | import org.openide.util.actions.SystemAction; 51 | import org.openide.util.lookup.Lookups; 52 | 53 | /** 54 | * 55 | * @author junichi11 56 | */ 57 | public class VagrantProjectNode extends AbstractNode { 58 | 59 | private final VagrantProjectGlobal project; 60 | 61 | public VagrantProjectNode(VagrantProjectGlobal project, VagrantProjectChildFactory factory) { 62 | super(Children.create(factory, true), Lookups.fixed(project)); 63 | this.project = project; 64 | setIconBaseWithExtension(VagrantUtils.VAGRANT_ICON_16); 65 | setShortDescription(project.getVagrantRootPath()); 66 | } 67 | 68 | @Override 69 | public String getDisplayName() { 70 | return project.getDisplayName(); 71 | } 72 | 73 | @Override 74 | public Action[] getActions(boolean context) { 75 | return new Action[]{ 76 | SystemAction.get(VagrantReloadStatusAction.class), 77 | SystemAction.get(OpenVagrantfileAction.class), 78 | SystemAction.get(DeleteVagrantNodeAction.class) 79 | }; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantUpAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle.Messages; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantUpAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantUpAction", lazy = false) 60 | @Messages("CTL_VagrantUpAction=Vagrant up") 61 | public final class VagrantUpAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = -8645641557698315175L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantUpAction.class.getName()); 65 | 66 | public VagrantUpAction() { 67 | super(Bundle.CTL_VagrantUpAction(), VagrantUtils.getIcon(VagrantUtils.UP_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(final Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.up(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantHaltAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle.Messages; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantHaltAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantHaltAction", lazy = false) 60 | @Messages("CTL_VagrantHaltAction=Vagrant halt") 61 | public final class VagrantHaltAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = 6077020111363620078L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantHaltAction.class.getName()); 65 | 66 | public VagrantHaltAction() { 67 | super(Bundle.CTL_VagrantHaltAction(), VagrantUtils.getIcon(VagrantUtils.HALT_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.halt(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantShareAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle.Messages; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantShareAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantShareAction", lazy = false) 60 | @Messages("CTL_VagrantShareAction=Vagrant share") 61 | public final class VagrantShareAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = 4370069033259406951L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantShareAction.class.getName()); 65 | 66 | public VagrantShareAction() { 67 | super(Bundle.CTL_VagrantShareAction(), VagrantUtils.getIcon(VagrantUtils.SHARE_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.share(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantResumeAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantResumeAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantResumeAction", lazy = false) 60 | @NbBundle.Messages("CTL_VagrantResumeAction=Vagrant resume") 61 | public class VagrantResumeAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = 7166256143861970176L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantResumeAction.class.getName()); 65 | 66 | public VagrantResumeAction() { 67 | super(Bundle.CTL_VagrantResumeAction(), VagrantUtils.getIcon(VagrantUtils.RESUME_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.resume(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantReloadAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle.Messages; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantReloadAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantReloadAction", lazy = false) 60 | @Messages("CTL_VagrantReloadAction=Vagrant reload") 61 | public final class VagrantReloadAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = 1802647122965661013L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantReloadAction.class.getName()); 65 | 66 | public VagrantReloadAction() { 67 | super(Bundle.CTL_VagrantReloadAction(), VagrantUtils.getIcon(VagrantUtils.RELOAD_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.reload(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantStatusAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle.Messages; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantStatusAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantStatusAction", lazy = false) 60 | @Messages("CTL_VagrantStatusAction=Vagrant status") 61 | public final class VagrantStatusAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = -4512495150010873213L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantStatusAction.class.getName()); 65 | 66 | public VagrantStatusAction() { 67 | super(Bundle.CTL_VagrantStatusAction(), VagrantUtils.getIcon(VagrantUtils.STATUS_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.status(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantRunCommandAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Logger; 45 | import javax.swing.SwingUtilities; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.ui.RunCommandPanel; 48 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 49 | import org.openide.DialogDescriptor; 50 | import org.openide.awt.ActionID; 51 | import org.openide.awt.ActionRegistration; 52 | import org.openide.util.NbBundle; 53 | 54 | @ActionID( 55 | category = "Vagrant", 56 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantRunCommandAction") 57 | @ActionRegistration( 58 | displayName = "#CTL_VagrantRunCommandAction", lazy = false) 59 | @NbBundle.Messages("CTL_VagrantRunCommandAction=Vagrant Run Command") 60 | public class VagrantRunCommandAction extends VagrantAction { 61 | 62 | private static final long serialVersionUID = -4918272973110792497L; 63 | private static final Logger LOGGER = Logger.getLogger(VagrantRunCommandAction.class.getName()); 64 | 65 | public VagrantRunCommandAction() { 66 | super(Bundle.CTL_VagrantRunCommandAction(), VagrantUtils.getIcon(VagrantUtils.RUN_COMMAND_ICON_16)); 67 | } 68 | 69 | @Override 70 | public void actionPerformed(final Project project) { 71 | SwingUtilities.invokeLater(() -> { 72 | RunCommandPanel panel = RunCommandPanel.getDefault(); 73 | DialogDescriptor descriptor = panel.showDialog(project); 74 | if (descriptor.getValue() == DialogDescriptor.OK_OPTION) { 75 | panel.runCommand(); 76 | } 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantSuspendAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle.Messages; 54 | 55 | @ActionID( 56 | category = "Vagrant", 57 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantSuspendAction") 58 | @ActionRegistration( 59 | displayName = "#CTL_VagrantSuspendAction", lazy = false) 60 | @Messages("CTL_VagrantSuspendAction=Vagrant suspend") 61 | public final class VagrantSuspendAction extends VagrantAction { 62 | 63 | private static final long serialVersionUID = 2342410256361644962L; 64 | private static final Logger LOGGER = Logger.getLogger(VagrantSuspendAction.class.getName()); 65 | 66 | public VagrantSuspendAction() { 67 | super(Bundle.CTL_VagrantSuspendAction(), VagrantUtils.getIcon(VagrantUtils.SUSPEND_ICON_16)); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(Project project) { 72 | try { 73 | Vagrant vagrant = Vagrant.getDefault(); 74 | vagrant.suspend(VagrantProjectImpl.create(project)); 75 | } catch (InvalidVagrantExecutableException ex) { 76 | LOGGER.log(Level.WARNING, ex.getMessage()); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/command/VirtualMachine.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.command; 43 | 44 | import java.io.IOException; 45 | import org.netbeans.modules.vagrant.utils.StringUtils; 46 | import org.netbeans.modules.vagrant.utils.UiUtils; 47 | import org.openide.util.NbBundle; 48 | 49 | /** 50 | * 51 | * @author junichi11 52 | */ 53 | public class VirtualMachine { 54 | 55 | private final String path; 56 | 57 | public VirtualMachine(String path) { 58 | this.path = path; 59 | } 60 | 61 | public static VirtualMachine getDefault() throws InvalidVirtualMachineExecutableException { 62 | // TODO get path 63 | String path = "/usr/bin/virtualbox"; 64 | String error = validate(path); 65 | if (error == null) { 66 | return new VirtualMachine(path); 67 | } 68 | UiUtils.showOptions(); 69 | throw new InvalidVirtualMachineExecutableException(error); 70 | } 71 | 72 | @NbBundle.Messages("VirtualMachine.invalid.empty=Please, set virtual machine path to Options.") 73 | private static String validate(String path) { 74 | if (StringUtils.isEmpty(path)) { 75 | return Bundle.VirtualMachine_invalid_empty(); 76 | } 77 | return null; 78 | } 79 | 80 | @NbBundle.Messages("VirtualMachine.invalid.path=Invalid virtual machine path.") 81 | public void start() throws InvalidVirtualMachineExecutableException { 82 | ProcessBuilder processBuilder = new ProcessBuilder(path); 83 | try { 84 | processBuilder.start(); 85 | } catch (IOException ex) { 86 | throw new InvalidVirtualMachineExecutableException(Bundle.VirtualMachine_invalid_path()); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.awt.event.ActionEvent; 45 | import javax.swing.AbstractAction; 46 | import javax.swing.Icon; 47 | import org.netbeans.api.project.Project; 48 | import org.netbeans.modules.vagrant.options.VagrantOptions; 49 | import org.netbeans.modules.vagrant.utils.FileUtils; 50 | import org.netbeans.modules.vagrant.utils.StringUtils; 51 | import org.netbeans.modules.vagrant.utils.UiUtils; 52 | 53 | /** 54 | * 55 | * @author junichi11 56 | */ 57 | public abstract class VagrantAction extends AbstractAction { 58 | 59 | private static final long serialVersionUID = -4974562366882013984L; 60 | private final String name; 61 | 62 | public VagrantAction(String name) { 63 | super(name); 64 | this.name = name; 65 | } 66 | 67 | public VagrantAction(String name, Icon icon) { 68 | super(name, icon); 69 | this.name = name; 70 | } 71 | 72 | @Override 73 | public void actionPerformed(ActionEvent e) { 74 | String vagrantPath = VagrantOptions.getInstance().getVagrantPath(); 75 | if (StringUtils.isEmpty(vagrantPath)) { 76 | UiUtils.showOptions(); 77 | return; 78 | } 79 | 80 | // get project 81 | Project project = FileUtils.getProject(); 82 | if (project == null) { 83 | if (!Bundle.CTL_VagrantBoxAddAction().equals(name) 84 | && !Bundle.CTL_VagrantPluginInstallAction().equals(name) 85 | && !Bundle.CTL_VagrantOpenOptionsAction().equals(name)) { 86 | return; 87 | } 88 | } 89 | actionPerformed(project); 90 | } 91 | 92 | public abstract void actionPerformed(Project project); 93 | } 94 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantProvisitonAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.awt.ActionID; 52 | import org.openide.awt.ActionRegistration; 53 | import org.openide.util.NbBundle; 54 | 55 | /** 56 | * Run provision command. 57 | * 58 | * @author junichi11 59 | */ 60 | @ActionID( 61 | category = "Vagrant", 62 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantProvisionAction") 63 | @ActionRegistration( 64 | displayName = "#CTL_VagrantProvisionAction", lazy = false) 65 | @NbBundle.Messages("CTL_VagrantProvisionAction=Vagrant provision") 66 | public final class VagrantProvisitonAction extends VagrantAction { 67 | 68 | private static final long serialVersionUID = -2875256721658664378L; 69 | private static final Logger LOGGER = Logger.getLogger(VagrantProvisitonAction.class.getName()); 70 | 71 | public VagrantProvisitonAction() { 72 | super(Bundle.CTL_VagrantProvisionAction(), VagrantUtils.getIcon(VagrantUtils.PROVISION_ICON_16)); 73 | } 74 | 75 | @Override 76 | public void actionPerformed(final Project project) { 77 | try { 78 | Vagrant vagrant = Vagrant.getDefault(); 79 | vagrant.provisiton(VagrantProjectImpl.create(project)); 80 | } catch (InvalidVagrantExecutableException ex) { 81 | LOGGER.log(Level.WARNING, ex.getMessage()); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vagrant/test/unit/src/org/netbeans/modules/vagrant/utils/StringUtilsTest.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.utils; 43 | 44 | import org.junit.Test; 45 | import org.netbeans.junit.NbTestCase; 46 | 47 | /** 48 | * 49 | * @author junichi11 50 | */ 51 | public class StringUtilsTest extends NbTestCase { 52 | 53 | public StringUtilsTest(String name) { 54 | super(name); 55 | } 56 | 57 | /** 58 | * Test of isEmpty method, of class StringUtils. 59 | */ 60 | @Test 61 | public void testIsEmpty() { 62 | assertTrue(StringUtils.isEmpty("")); 63 | assertTrue(StringUtils.isEmpty(null)); 64 | 65 | assertFalse(StringUtils.isEmpty("test")); 66 | } 67 | 68 | /** 69 | * Test of containsAll method, of class StringUtils. 70 | */ 71 | @Test 72 | public void testContainsAll() { 73 | assertTrue(StringUtils.containsAll("apple Orange banana", new String[]{""})); 74 | assertTrue(StringUtils.containsAll("apple Orange banana", new String[]{"apple"})); 75 | assertTrue(StringUtils.containsAll("apple Orange banana", new String[]{"e Orange banana"})); 76 | assertTrue(StringUtils.containsAll("apple Orange banana", new String[]{"apple Orange banana"})); 77 | assertTrue(StringUtils.containsAll("apple Orange banana", new String[]{"pp", "Oran", "nana"})); 78 | 79 | assertFalse(StringUtils.containsAll("apple Orange banana", new String[]{"orange"})); 80 | assertFalse(StringUtils.containsAll("apple Orange banana", new String[]{"strawberry"})); 81 | assertFalse(StringUtils.containsAll("apple Orange banana", new String[]{"apple", "strawberry"})); 82 | assertFalse(StringUtils.containsAll("apple Orange banana", new String[]{"melon", "strawberry"})); 83 | assertFalse(StringUtils.containsAll("apple Orange banana", null)); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/OpenVagrantfileAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import java.io.File; 43 | import org.netbeans.modules.vagrant.api.VagrantProjectGlobal; 44 | import org.netbeans.modules.vagrant.utils.UiUtils; 45 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 46 | import org.openide.filesystems.FileObject; 47 | import org.openide.filesystems.FileUtil; 48 | import org.openide.nodes.Node; 49 | import org.openide.util.HelpCtx; 50 | 51 | public class OpenVagrantfileAction extends AbstractVagrantNodeAction { 52 | 53 | private static final long serialVersionUID = 8940374836297096509L; 54 | 55 | @Override 56 | protected void performAction(Node[] nodes) { 57 | for (Node node : nodes) { 58 | VagrantProjectGlobal project = node.getLookup().lookup(VagrantProjectGlobal.class); 59 | if (project != null) { 60 | String vagrantFilePath = project.getVagrantRootPath(); 61 | File file = new File(vagrantFilePath); 62 | if (!file.exists()) { 63 | continue; 64 | } 65 | FileObject vagrantRootDir = FileUtil.toFileObject(file); 66 | if (vagrantRootDir == null) { 67 | continue; 68 | } 69 | FileObject vagrantfile = VagrantUtils.getVagrantfile(vagrantRootDir); 70 | if (vagrantfile != null) { 71 | UiUtils.open(vagrantfile); 72 | } 73 | } 74 | // only the first node 75 | break; 76 | } 77 | } 78 | 79 | @Override 80 | protected boolean enable(Node[] nodes) { 81 | return true; 82 | } 83 | 84 | @Override 85 | public String getName() { 86 | return "Open Vagrantfile"; 87 | } 88 | 89 | @Override 90 | public HelpCtx getHelpCtx() { 91 | return null; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/VagrantStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 41 | */ 42 | package org.netbeans.modules.vagrant; 43 | 44 | import java.util.List; 45 | import javax.swing.event.ChangeListener; 46 | import org.openide.util.Pair; 47 | 48 | /** 49 | * Manage vagrant status. Update status when Vagrant command is run. 50 | * 51 | * @author junichi11 52 | */ 53 | public interface VagrantStatus { 54 | 55 | /** 56 | * Get all status of projects. 57 | * 58 | * @return status 59 | */ 60 | public List> getAll(); 61 | 62 | /** 63 | * Get status of a project. 64 | * 65 | * @param project 66 | * @return status of a project. If status doesn't exist, empty list. 67 | */ 68 | public List get(T project); 69 | 70 | /** 71 | * Remove status of a project. 72 | * 73 | * @param project 74 | */ 75 | public void remove(T project); 76 | 77 | /** 78 | * Update status of a project. Please run on another thread (e.g. use 79 | * {@link RequestProcessor}) because it may take too many time while getting 80 | * status, 81 | * 82 | * @param project 83 | */ 84 | public void update(T project); 85 | 86 | /** 87 | * Add {@link ChangeListener}. 88 | * 89 | * @param listener 90 | */ 91 | public void addChangeListener(ChangeListener listener); 92 | 93 | /** 94 | * Remove {@link ChangeListener}. 95 | * 96 | * @param listener 97 | */ 98 | public void removeChangeListener(ChangeListener listener); 99 | 100 | /** 101 | * Refresh all status of opened projects. Please run on another thread (e.g. 102 | * use {@link RequestProcessor}) because it may take too many time while 103 | * getting status. 104 | */ 105 | public void refresh(); 106 | 107 | /** 108 | * Clear all items. 109 | */ 110 | public void clear(); 111 | } 112 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/command/CommandHistory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 41 | */ 42 | package org.netbeans.modules.vagrant.command; 43 | 44 | import java.util.ArrayList; 45 | import java.util.List; 46 | 47 | /** 48 | * 49 | * @author junichi11 50 | */ 51 | public interface CommandHistory { 52 | 53 | public void add(Command command); 54 | 55 | public List getCommands(); 56 | 57 | public static final class Command { 58 | 59 | private final String command; 60 | private final List parameters; 61 | 62 | public Command(String command, List parameters) { 63 | this.command = command; 64 | this.parameters = parameters; 65 | } 66 | 67 | public String getCommand() { 68 | return command; 69 | } 70 | 71 | public List getParameters() { 72 | return new ArrayList<>(parameters); 73 | } 74 | 75 | @Override 76 | public int hashCode() { 77 | int hash = 3; 78 | hash = 97 * hash + (this.command != null ? this.command.hashCode() : 0); 79 | hash = 97 * hash + (this.parameters != null ? this.parameters.hashCode() : 0); 80 | return hash; 81 | } 82 | 83 | @Override 84 | public boolean equals(Object obj) { 85 | if (obj == null) { 86 | return false; 87 | } 88 | if (getClass() != obj.getClass()) { 89 | return false; 90 | } 91 | final Command other = (Command) obj; 92 | if ((this.command == null) ? (other.command != null) : !this.command.equals(other.command)) { 93 | return false; 94 | } 95 | if (this.parameters != other.parameters && (this.parameters == null || !this.parameters.equals(other.parameters))) { 96 | return false; 97 | } 98 | return true; 99 | } 100 | 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/DeleteVagrantNodeAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import org.netbeans.modules.vagrant.VagrantStatus; 43 | import org.netbeans.modules.vagrant.api.VagrantProjectGlobal; 44 | import org.netbeans.modules.vagrant.api.VagrantProjectRegistry; 45 | import org.netbeans.modules.vagrant.preferences.VagrantPreferences; 46 | import org.openide.DialogDisplayer; 47 | import org.openide.NotifyDescriptor; 48 | import org.openide.nodes.Node; 49 | import org.openide.util.HelpCtx; 50 | import org.openide.util.NbBundle; 51 | 52 | public class DeleteVagrantNodeAction extends AbstractVagrantNodeAction { 53 | 54 | private static final long serialVersionUID = -1848450518913299742L; 55 | 56 | @Override 57 | @NbBundle.Messages({ 58 | "DeleteVagrantNodeAction.confirmation.message=Would you really like to delete this project node?" 59 | }) 60 | protected void performAction(Node[] nodes) { 61 | for (Node node : nodes) { 62 | NotifyDescriptor.Confirmation confirmation = new NotifyDescriptor.Confirmation( 63 | Bundle.DeleteVagrantNodeAction_confirmation_message(), 64 | NotifyDescriptor.OK_CANCEL_OPTION, 65 | NotifyDescriptor.QUESTION_MESSAGE 66 | ); 67 | if (DialogDisplayer.getDefault().notify(confirmation) == NotifyDescriptor.OK_OPTION) { 68 | VagrantProjectGlobal project = node.getLookup().lookup(VagrantProjectGlobal.class); 69 | VagrantStatus status = project.getVagrantStatus(); 70 | status.remove(project); 71 | VagrantPreferences.deleteVagrantProject(project); 72 | VagrantProjectRegistry.getDefault().removeProject(project); 73 | } 74 | } 75 | } 76 | 77 | @Override 78 | protected boolean enable(Node[] nodes) { 79 | return true; 80 | } 81 | 82 | @Override 83 | public String getName() { 84 | return "Delete Vagrant Project..."; 85 | } 86 | 87 | @Override 88 | public HelpCtx getHelpCtx() { 89 | return null; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/VagrantChildFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node; 41 | 42 | import java.util.ArrayList; 43 | import java.util.List; 44 | import javax.swing.event.ChangeEvent; 45 | import javax.swing.event.ChangeListener; 46 | import org.netbeans.modules.vagrant.api.VagrantProjectGlobal; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectRegistry; 48 | import org.openide.nodes.DestroyableNodesFactory; 49 | import org.openide.nodes.Node; 50 | import org.openide.util.RequestProcessor; 51 | import org.openide.util.WeakListeners; 52 | 53 | /** 54 | * 55 | * @author junichi11 56 | */ 57 | public class VagrantChildFactory extends DestroyableNodesFactory implements ChangeListener { 58 | 59 | private final VagrantProjectRegistry registry; 60 | private static final RequestProcessor RP = new RequestProcessor("Vagrant Project update or refresh", 5); 61 | 62 | public VagrantChildFactory(VagrantProjectRegistry registry) { 63 | this.registry = registry; 64 | } 65 | 66 | public void initialize() { 67 | RP.post(() -> { 68 | synchronized (VagrantChildFactory.this) { 69 | registry.addChangeListener(WeakListeners.create(ChangeListener.class, VagrantChildFactory.this, registry)); 70 | updateState(); 71 | } 72 | }); 73 | } 74 | 75 | private synchronized void updateState() { 76 | refresh(false); 77 | } 78 | 79 | @Override 80 | protected Node createNodeForKey(VagrantProjectGlobal key) { 81 | return new VagrantProjectNode(key, VagrantProjectChildFactory.create(key)); 82 | } 83 | 84 | @Override 85 | protected boolean createKeys(List list) { 86 | List projects = new ArrayList<>(registry.getProjects()); 87 | // TODO sort 88 | list.addAll(projects); 89 | return true; 90 | } 91 | 92 | @Override 93 | public void stateChanged(ChangeEvent e) { 94 | RP.post(() -> { 95 | updateState(); 96 | }); 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/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 [year] [name of copyright owner]" 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 | 41 | BoxesPanel.noteLabel.text=Note: 42 | BoxesPanel.learnMoreVagrantboxesLabel.text=learn more Vagrantbox.es 43 | BoxesPanel.learnMoreVagrantBoxLabel.text=learn more Vagrant Boxes 44 | AddBoxesPanel.nameLabel.text=Name: 45 | AddBoxesPanel.urlTextField.text= 46 | AddBoxesPanel.nameTextField.text= 47 | AddBoxesPanel.urlLabel.text=URL: 48 | BoxesPanel.boxesLabel.text=Boxes: 49 | BoxesPanel.addButton.text=add... 50 | BoxesPanel.removeButton.text=remove... 51 | GeneralPanel.noteLabel.text=Note: 52 | GeneralPanel.learnMoreVagranLabel.text=learn more Vagrant 53 | GeneralPanel.searchButton.text=Search... 54 | GeneralPanel.browseButton.text=Browse... 55 | GeneralPanel.vagrantPathLabel.text=Vagrant script: 56 | GeneralPanel.vagrantPathTextField.text= 57 | BoxesPanel.reloadButton.text=reload... 58 | GeneralPanel.versionLabel.text=VERSION 59 | GeneralPanel.applyButton.text=Apply 60 | AddBoxesPanel.vagrantboxesLabel.text=From: vagrantbox.ex 61 | AddBoxesPanel.reloadButton.text=Reload 62 | BoxesPanel.boxesUrlLabel.text=Boxes URL: 63 | BoxesPanel.boxesUrlTextField.text= 64 | AddBoxesPanel.filterTextField.text= 65 | AddBoxesPanel.filterLabel.text=Filter: 66 | AddPluginsPanel.reloadButton.text=Reload 67 | AddPluginsPanel.filterLabel.text=Filter: 68 | AddPluginsPanel.filterTextField.text= 69 | AddPluginsPanel.pluginLabel.text=Plugin: 70 | AddPluginsPanel.pluginTextField.text= 71 | AddPluginsPanel.availablePluginsLabel.text=Available plugins: 72 | PluginsPanel.pluginsLabel.text=Plugins: 73 | PluginsPanel.installButton.text=install... 74 | PluginsPanel.uninstallButton.text=uninstall... 75 | PluginsPanel.updateButton.text=update... 76 | PluginsPanel.reloadButton.text=reload... 77 | VagrantPanel.categoriesLabel.text=Categories: 78 | GeneralPanel.showStatusCheckBox.text=Show status on Statusbar 79 | CommandsPanel.shareLabel.text=share: 80 | CommandsPanel.shareOpenUrlCheckBox.text=Open vagrantshare URL when command is run 81 | CommandsPanel.shareCopyUrlCheckBox.text=Copy URL to clipboard 82 | GeneralPanel.useCachedStatusCheckBox.text=Use the cached status on close NetBeans 83 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/options/CommandsPanel.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 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/options/VagrantPanel.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 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantSshAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import javax.swing.SwingUtilities; 47 | import org.netbeans.api.project.Project; 48 | import org.netbeans.modules.dlight.api.terminal.TerminalSupport; 49 | import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; 50 | import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory; 51 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 52 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 53 | import org.netbeans.modules.vagrant.command.SshInfo; 54 | import org.netbeans.modules.vagrant.command.Vagrant; 55 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 56 | import org.openide.util.NbBundle.Messages; 57 | 58 | @Messages("CTL_VagrantSshAction=Vagrant ssh") 59 | public final class VagrantSshAction extends VagrantAction { 60 | 61 | private static final long serialVersionUID = -3351388651004111053L; 62 | private static final Logger LOGGER = Logger.getLogger(VagrantSshAction.class.getName()); 63 | 64 | public VagrantSshAction() { 65 | super(Bundle.CTL_VagrantSshAction(), VagrantUtils.getIcon(VagrantUtils.SSH_ICON_16)); 66 | } 67 | 68 | @Override 69 | public void actionPerformed(final Project project) { 70 | SwingUtilities.invokeLater(() -> { 71 | try { 72 | // vagrant ssh command is not run 73 | // instead, remote terminal is opened 74 | Vagrant vagrant = Vagrant.getDefault(); 75 | SshInfo sshInfo = vagrant.getSshInfo(VagrantProjectImpl.create(project)); 76 | if (sshInfo != null) { 77 | ExecutionEnvironment executionEnvironment = ExecutionEnvironmentFactory.createNew( 78 | sshInfo.getUser(), 79 | sshInfo.getHostName(), 80 | sshInfo.getPort()); 81 | TerminalSupport.openTerminal("Vagrant", executionEnvironment, null); // NOI18N 82 | } 83 | } catch (InvalidVagrantExecutableException ex) { 84 | LOGGER.log(Level.WARNING, ex.getMessage()); 85 | } 86 | }); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/VagrantNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node; 41 | 42 | import java.util.ArrayList; 43 | import java.util.List; 44 | import javax.swing.Action; 45 | import org.netbeans.api.core.ide.ServicesTabNodeRegistration; 46 | import org.netbeans.modules.vagrant.api.VagrantProjectRegistry; 47 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 48 | import org.openide.nodes.AbstractNode; 49 | import org.openide.nodes.Children; 50 | import org.openide.util.NbBundle; 51 | import org.openide.util.Utilities; 52 | 53 | /** 54 | * Register a Vagrant node to Services Tab. 55 | * 56 | * @author junichi11 57 | */ 58 | public final class VagrantNode extends AbstractNode { 59 | 60 | private static VagrantNode node; 61 | 62 | public VagrantNode(VagrantChildFactory factory, String displayName, String shortDescription, String iconBase) { 63 | super(Children.create(factory, true)); 64 | setName(""); // NOI18N 65 | setDisplayName(displayName); 66 | setShortDescription(shortDescription); 67 | setIconBaseWithExtension(iconBase); 68 | } 69 | 70 | @NbBundle.Messages({ 71 | "VagrantNode.displayName=Vagrant", 72 | "VagrantNode.shortDescription=Vagrant" 73 | }) 74 | @ServicesTabNodeRegistration( 75 | name = "vagrant", 76 | displayName = "#VagrantNode.displayName", 77 | shortDescription = "#VagrantNode.shortDescription", 78 | iconResource = VagrantUtils.VAGRANT_ICON_16, 79 | position = 2000 80 | ) 81 | public static synchronized VagrantNode getInstance() { 82 | if (node == null) { 83 | VagrantChildFactory factory = new VagrantChildFactory(VagrantProjectRegistry.getDefault()); 84 | factory.initialize(); 85 | node = new VagrantNode( 86 | factory, 87 | Bundle.VagrantNode_displayName(), 88 | Bundle.VagrantNode_shortDescription(), 89 | VagrantUtils.VAGRANT_ICON_16 90 | ); 91 | } 92 | return node; 93 | } 94 | 95 | @Override 96 | public Action[] getActions(boolean context) { 97 | List actions = new ArrayList<>(); 98 | actions.addAll(Utilities.actionsForPath("Vagrant/Wizard")); // NOI18N 99 | return actions.toArray(new Action[actions.size()]); 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/VirtualMachineNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node; 41 | 42 | import javax.swing.Action; 43 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantHaltAction; 44 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantProvisionAction; 45 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantReloadAction; 46 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantResumeAction; 47 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantShareAction; 48 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantSuspendAction; 49 | import org.netbeans.modules.vagrant.ui.node.actions.VagrantUpAction; 50 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 51 | import org.openide.nodes.AbstractNode; 52 | import org.openide.nodes.Children; 53 | import org.openide.util.actions.SystemAction; 54 | import org.openide.util.lookup.Lookups; 55 | 56 | /** 57 | * 58 | * @author junichi11 59 | */ 60 | public class VirtualMachineNode extends AbstractNode { 61 | 62 | private final VirtualMachine virtualMachine; 63 | private boolean runningCommand; 64 | 65 | public VirtualMachineNode(VirtualMachine virtualMachine) { 66 | super(Children.LEAF, Lookups.fixed(virtualMachine)); 67 | this.virtualMachine = virtualMachine; 68 | setName(""); // NOI18N 69 | setDisplayName(virtualMachine.getDisplayName()); 70 | setShortDescription(virtualMachine.getName()); 71 | setIconBaseWithExtension(VagrantUtils.VIRTUAL_MACHINE_ICON_16); 72 | } 73 | 74 | @Override 75 | public String getDisplayName() { 76 | return virtualMachine.getDisplayName(); 77 | } 78 | 79 | @Override 80 | public Action[] getActions(boolean context) { 81 | return new Action[]{ 82 | SystemAction.get(VagrantUpAction.class), 83 | SystemAction.get(VagrantReloadAction.class), 84 | SystemAction.get(VagrantSuspendAction.class), 85 | SystemAction.get(VagrantResumeAction.class), 86 | SystemAction.get(VagrantHaltAction.class), 87 | SystemAction.get(VagrantShareAction.class), 88 | SystemAction.get(VagrantProvisionAction.class) 89 | }; 90 | } 91 | 92 | public synchronized void setRunningCommand(boolean running) { 93 | runningCommand = running; 94 | } 95 | 96 | public synchronized boolean isRunningCommand() { 97 | return runningCommand; 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/VagrantVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright 2014 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 [year] [name of copyright owner]" 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 2014 Sun Microsystems, Inc. 41 | */ 42 | package org.netbeans.modules.vagrant; 43 | 44 | import org.netbeans.api.annotations.common.NonNull; 45 | 46 | public class VagrantVersion implements Versionable { 47 | 48 | private final String versionNumber; 49 | private final int major; 50 | private final int minor; 51 | private final int revision; 52 | private final String unstable; 53 | 54 | public VagrantVersion(@NonNull String versionNumber) { 55 | versionNumber = versionNumber.replace("Vagrant", "").trim(); // NOI18N 56 | this.versionNumber = versionNumber; 57 | String[] splitVersion = splitVersion(versionNumber); 58 | String unstableVersion = null; 59 | int revisionNumber = -1; 60 | int minorNumber = -1; 61 | int majorNumber = -1; 62 | if (splitVersion.length > 3) { 63 | unstableVersion = splitVersion[3]; 64 | } 65 | if (splitVersion.length > 2) { 66 | revisionNumber = Integer.parseInt(splitVersion[2]); 67 | } 68 | if (splitVersion.length > 1) { 69 | minorNumber = Integer.parseInt(splitVersion[1]); 70 | } 71 | if (splitVersion.length > 0) { 72 | majorNumber = Integer.parseInt(splitVersion[0]); 73 | } 74 | this.major = majorNumber; 75 | this.minor = minorNumber; 76 | this.revision = revisionNumber; 77 | this.unstable = unstableVersion; 78 | } 79 | 80 | public VagrantVersion(String versionNumber, int major, int minor, int revision, String unstable) { 81 | this.versionNumber = versionNumber; 82 | this.major = major; 83 | this.minor = minor; 84 | this.revision = revision; 85 | this.unstable = unstable; 86 | } 87 | 88 | @Override 89 | public String getVersion() { 90 | return versionNumber; 91 | } 92 | 93 | @Override 94 | public int getMajor() { 95 | return major; 96 | } 97 | 98 | @Override 99 | public int getMinor() { 100 | return minor; 101 | } 102 | 103 | @Override 104 | public int getRevision() { 105 | return revision; 106 | } 107 | 108 | @Override 109 | public String getUnstable() { 110 | return unstable; 111 | } 112 | 113 | private String[] splitVersion(String versionNumber) { 114 | return versionNumber.split("[\\. -]"); // NOI18N 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/actions/VagrantDestroyAction.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.ui.actions; 43 | 44 | import java.util.logging.Level; 45 | import java.util.logging.Logger; 46 | import org.netbeans.api.project.Project; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectImpl; 48 | import org.netbeans.modules.vagrant.command.InvalidVagrantExecutableException; 49 | import org.netbeans.modules.vagrant.command.Vagrant; 50 | import org.netbeans.modules.vagrant.preferences.VagrantPreferences; 51 | import org.netbeans.modules.vagrant.utils.VagrantUtils; 52 | import org.openide.DialogDisplayer; 53 | import org.openide.NotifyDescriptor; 54 | import org.openide.awt.ActionID; 55 | import org.openide.awt.ActionRegistration; 56 | import org.openide.util.NbBundle; 57 | import org.openide.util.NbBundle.Messages; 58 | 59 | @ActionID( 60 | category = "Vagrant", 61 | id = "org.netbeans.modules.vagrant.ui.actions.VagrantDestroyAction") 62 | @ActionRegistration( 63 | displayName = "#CTL_VagrantDestroyAction", lazy = false) 64 | @Messages("CTL_VagrantDestroyAction=Vagrant destroy") 65 | public final class VagrantDestroyAction extends VagrantAction { 66 | 67 | private static final long serialVersionUID = 1019938024932905534L; 68 | private static final Logger LOGGER = Logger.getLogger(VagrantDestroyAction.class.getName()); 69 | 70 | public VagrantDestroyAction() { 71 | super(Bundle.CTL_VagrantDestroyAction(), VagrantUtils.getIcon(VagrantUtils.DESTROY_ICON_16)); 72 | } 73 | 74 | @NbBundle.Messages("VagrantDestroyAction.confirmation.message=Do you really want to destroy?") 75 | @Override 76 | public void actionPerformed(Project project) { 77 | // ** require TTY ** 78 | // so, show comfirmation dialog in NetBeans side 79 | NotifyDescriptor.Confirmation confirmation = new NotifyDescriptor.Confirmation( 80 | Bundle.VagrantDestroyAction_confirmation_message(), 81 | NotifyDescriptor.OK_CANCEL_OPTION); 82 | if (DialogDisplayer.getDefault().notify(confirmation) != NotifyDescriptor.OK_OPTION) { 83 | return; 84 | } 85 | 86 | try { 87 | Vagrant vagrant = Vagrant.getDefault(); 88 | vagrant.destroy(VagrantProjectImpl.create(project)); 89 | } catch (InvalidVagrantExecutableException ex) { 90 | LOGGER.log(Level.WARNING, ex.getMessage()); 91 | } 92 | 93 | // clear settings 94 | VagrantPreferences.setVagrantPath(project, ""); // NOI18N 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/utils/StringUtils.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 [year] [name of copyright owner]" 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.netbeans.modules.vagrant.utils; 43 | 44 | import java.util.ArrayList; 45 | import java.util.Arrays; 46 | import java.util.Collections; 47 | import java.util.List; 48 | import org.netbeans.api.annotations.common.NonNull; 49 | 50 | /** 51 | * 52 | * @author junichi11 53 | */ 54 | public final class StringUtils { 55 | 56 | private StringUtils() { 57 | } 58 | 59 | /** 60 | * Check whether string is null or empty. 61 | * 62 | * @param string 63 | * @return true if null or empty, false otherwise. 64 | */ 65 | public static boolean isEmpty(String string) { 66 | return string == null || string.isEmpty(); 67 | } 68 | 69 | /** 70 | * Implode list. 71 | * 72 | * @param list list 73 | * @param delimiter delimiter 74 | * @return imploded string with delimiter 75 | */ 76 | public static String implode(@NonNull List list, @NonNull String delimiter) { 77 | StringBuilder sb = new StringBuilder(); 78 | boolean isFirst = true; 79 | for (String string : list) { 80 | if (!isFirst) { 81 | sb.append(delimiter); 82 | } 83 | sb.append(string); 84 | isFirst = false; 85 | } 86 | return sb.toString(); 87 | } 88 | 89 | /** 90 | * Explode string with delimiter. 91 | * 92 | * @param target string 93 | * @param delimiter delimiter 94 | * @return exploded list with delimiter 95 | */ 96 | public static List explode(@NonNull String target, String delimiter) { 97 | if (target.isEmpty()) { 98 | return Collections.emptyList(); 99 | } 100 | return new ArrayList<>(Arrays.asList(target.split(delimiter))); 101 | } 102 | 103 | /** 104 | * Check whether string contains all conditions. 105 | * 106 | * @param name target string 107 | * @param filters strings for filltering 108 | * @return true if target string pass all filters, false otherwise. 109 | */ 110 | public static boolean containsAll(String name, String[] filters) { 111 | if (filters == null) { 112 | return false; 113 | } 114 | for (String filter : filters) { 115 | if (!name.contains(filter)) { 116 | return false; 117 | } 118 | } 119 | return true; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /vagrant/src/org/netbeans/modules/vagrant/ui/node/actions/AddVagrantProjectAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2018 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 [year] [name of copyright owner]" 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 | package org.netbeans.modules.vagrant.ui.node.actions; 41 | 42 | import java.awt.Dialog; 43 | import java.awt.event.ActionEvent; 44 | import java.awt.event.ActionListener; 45 | import javax.swing.event.ChangeEvent; 46 | import javax.swing.event.ChangeListener; 47 | import org.netbeans.modules.vagrant.api.VagrantProjectGlobal; 48 | import org.netbeans.modules.vagrant.api.VagrantProjectRegistry; 49 | import org.netbeans.modules.vagrant.ui.AddVagrantProjcetPanel; 50 | import org.openide.DialogDescriptor; 51 | import org.openide.DialogDisplayer; 52 | import org.openide.awt.ActionID; 53 | import org.openide.awt.ActionReference; 54 | import org.openide.awt.ActionReferences; 55 | import org.openide.awt.ActionRegistration; 56 | import org.openide.util.NbBundle.Messages; 57 | 58 | @ActionID( 59 | category = "System", 60 | id = "org.netbeans.modules.vagrant.ui.node.actions.AddVagrantProjectAction" 61 | ) 62 | @ActionRegistration( 63 | displayName = "#CTL_AddVagrantProjectAction" 64 | ) 65 | @ActionReferences( 66 | @ActionReference(path = "Vagrant/Wizard", position = 100) 67 | ) 68 | @Messages("CTL_AddVagrantProjectAction=Add Vagrant Project...") 69 | public final class AddVagrantProjectAction implements ActionListener { 70 | 71 | @Override 72 | public void actionPerformed(ActionEvent event) { 73 | AddVagrantProjcetPanel panel = new AddVagrantProjcetPanel(); 74 | DialogDescriptor dialogDescriptor = new DialogDescriptor( 75 | panel, 76 | Bundle.CTL_AddVagrantProjectAction(), 77 | true, 78 | null 79 | ); 80 | dialogDescriptor.setValid(false); 81 | ChangeListener changeListener = (ChangeEvent e) -> { 82 | String errorMessage = panel.getErrorMessage(); 83 | dialogDescriptor.setValid(errorMessage.isEmpty()); 84 | }; 85 | panel.addChangeListener(changeListener); 86 | Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor); 87 | dialog.setVisible(true); 88 | if (dialogDescriptor.getValue() == DialogDescriptor.OK_OPTION) { 89 | // add project 90 | String displayName = panel.getDisplayName(); 91 | String vagrantRoot = panel.getVagrantRoot(); 92 | VagrantProjectGlobal project = VagrantProjectGlobal.create(displayName, vagrantRoot); 93 | assert project != null; 94 | VagrantProjectRegistry.getDefault().addProject(project); 95 | } 96 | panel.removeChangeListener(changeListener); 97 | } 98 | } 99 | --------------------------------------------------------------------------------