Browse Source

Revert "Fixes #232 Remove our custom Shortcut and Start Menu Panel and Logic."

This reverts commit 573dc39a4c18e112465a27ac2fd74677f7072c8e.
MeFisto94 5 years ago
parent
commit
64217e8836

+ 275 - 19
nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java

@@ -2,8 +2,12 @@ package org.mycompany;
 
 import java.util.List;
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.ArrayList;
+import java.io.InputStream;
+import java.util.Locale;
+import java.util.Map;
+import org.mycompany.wizard.panels.HelloWorldPanel;
 import org.mycompany.installer.utils.applications.NetBeansRCPUtils;
 import org.netbeans.installer.product.components.ProductConfigurationLogic;
 import org.netbeans.installer.product.components.Product;
@@ -13,22 +17,33 @@ import org.netbeans.installer.utils.exceptions.InitializationException;
 import org.netbeans.installer.utils.exceptions.InstallationException;
 import org.netbeans.installer.utils.exceptions.UninstallationException;
 import org.netbeans.installer.utils.progress.Progress;
+import org.netbeans.installer.utils.system.shortcut.FileShortcut;
+import org.netbeans.installer.utils.system.shortcut.LocationType;
+import org.netbeans.installer.utils.system.shortcut.Shortcut;
 import org.netbeans.installer.utils.SystemUtils;
 import org.netbeans.installer.utils.LogManager;
 import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StreamUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.exceptions.NativeException;
+import org.netbeans.installer.wizard.Wizard;
 import org.netbeans.installer.wizard.components.WizardComponent;
 //normen - JDK launchers
 import org.netbeans.installer.utils.system.launchers.LauncherResource;
 
 public class ConfigurationLogic extends ProductConfigurationLogic {
 
+    private List<WizardComponent> wizardComponents;
+
     // constructor //////////////////////////////////////////////////////////////////
     public ConfigurationLogic() throws InitializationException {
+        wizardComponents = Wizard.loadWizardComponents(
+                WIZARD_COMPONENTS_URI,
+                getClass().getClassLoader());
     }
 
-    @Override
     public List<WizardComponent> getWizardComponents() {
-        return new ArrayList<>();
+        return wizardComponents;
     }
 
     @Override
@@ -41,7 +56,7 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
         final Product product = getProduct();
         final File installLocation = product.getInstallationLocation();
         //final FilesList filesList = product.getInstalledFiles();
-        String appName = ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name");
+        String appName=ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name");
 
         if (SystemUtils.isMacOS()) {
             //normen: use parent folder of install dir for icon
@@ -59,10 +74,10 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
             }
 
             //normen: rename executable
-            File shortcut = new File(installLocation.getParentFile().getParent() + "/MacOS/executable");
+            File shortcut=new File(installLocation.getParentFile().getParent()+"/MacOS/executable");
             if(shortcut.exists()){
                 try {
-                    shortcut.renameTo(new File(installLocation.getParentFile().getParent() + "/MacOS/" + appName));
+                    shortcut.renameTo(new File(installLocation.getParentFile().getParent()+"/MacOS/"+appName));
                     getProduct().getInstalledFiles().add(shortcut.getAbsoluteFile());
                 } catch (IOException e) {
                     LogManager.log(
@@ -72,14 +87,105 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
 
             //normen: replace icon + app in Info.plist
             try {
-                File plist=new File(installLocation.getParentFile().getParentFile(), "Info.plist");
-                FileUtils.modifyFile(plist, "icon.icns", appName + ".icns");
+                File plist=new File(installLocation.getParentFile().getParentFile(),"Info.plist");
+                FileUtils.modifyFile(plist, "icon.icns", appName+".icns");
                 FileUtils.modifyFile(plist, "executable", appName);
-            } catch (IOException e) {
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
 
+
+        if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_DESKTOP_SHORTCUT_PROPERTY))) {
+            LogManager.logIndent(
+                    "creating the desktop shortcut for the application"); // NOI18N
+            if (!SystemUtils.isMacOS()) {
+                try {
+                    progress.setDetail(getString("CL.install.desktop")); // NOI18N
+
+                    if (SystemUtils.isCurrentUserAdmin()) {
+                        LogManager.log(
+                                "... current user is an administrator " + // NOI18N
+                                "-- creating the shortcut for all users"); // NOI18N
+
+                        SystemUtils.createShortcut(
+                                getDesktopShortcut(installLocation),
+                                LocationType.ALL_USERS_DESKTOP);
+
+                        product.setProperty(
+                                DESKTOP_SHORTCUT_LOCATION_PROPERTY,
+                                ALL_USERS_PROPERTY_VALUE);
+                    } else {
+                        LogManager.log(
+                                "... current user is an ordinary user " + // NOI18N
+                                "-- creating the shortcut for the current " + // NOI18N
+                                "user only"); // NOI18N
+
+                        SystemUtils.createShortcut(
+                                getDesktopShortcut(installLocation),
+                                LocationType.CURRENT_USER_DESKTOP);
+
+                        getProduct().setProperty(
+                                DESKTOP_SHORTCUT_LOCATION_PROPERTY,
+                                CURRENT_USER_PROPERTY_VALUE);
+                    }
+                } catch (NativeException e) {
+                    LogManager.unindent();
+
+                    LogManager.log(
+                            getString("CL.install.error.desktop"), // NOI18N
+                            e);
+                }
+            } else {
+                LogManager.log(
+                        "... skipping this step as we're on Mac OS"); // NOI18N
+            }
+        }
+        LogManager.logUnindent(
+                "... done"); // NOI18N
+
+        /////////////////////////////////////////////
+        // create start menu shortcut
+        if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_START_MENU_SHORTCUT_PROPERTY))) {
+            LogManager.logIndent(
+                    "creating the start menu shortcut for the application"); // NOI18N
+            try {
+                progress.setDetail(getString("CL.install.start.menu")); // NOI18N
+
+                if (SystemUtils.isCurrentUserAdmin()) {
+                    LogManager.log(
+                            "... current user is an administrator " + // NOI18N
+                            "-- creating the shortcut for all users"); // NOI18N
+
+                    SystemUtils.createShortcut(
+                            getStartMenuShortcut(installLocation),
+                            LocationType.ALL_USERS_START_MENU);
+
+                    getProduct().setProperty(
+                            START_MENU_SHORTCUT_LOCATION_PROPERTY,
+                            ALL_USERS_PROPERTY_VALUE);
+                } else {
+                    LogManager.log(
+                            "... current user is an ordinary user " + // NOI18N
+                            "-- creating the shortcut for the current " + // NOI18N
+                            "user only"); // NOI18N
+
+                    SystemUtils.createShortcut(
+                            getStartMenuShortcut(installLocation),
+                            LocationType.CURRENT_USER_START_MENU);
+
+                    getProduct().setProperty(
+                            START_MENU_SHORTCUT_LOCATION_PROPERTY,
+                            CURRENT_USER_PROPERTY_VALUE);
+                }
+            } catch (NativeException e) {
+                LogManager.log(
+                        getString("CL.install.error.start.menu"), // NOI18N
+                        e);
+            }
+            LogManager.logUnindent(
+                    "... done"); // NOI18N
+        }
         //normen - JDK install - uses package on OSX
         if (!SystemUtils.isMacOS()) {
             File javaHome = new File(System.getProperty("java.home"));
@@ -128,11 +234,66 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
 
         //NetBeansUtils.warnNetbeansRunning(installLocation);
         /////////////////////////////////////////////////////////////////////////////
-        
+        if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_START_MENU_SHORTCUT_PROPERTY))) {
+            try {
+                progress.setDetail(getString("CL.uninstall.start.menu")); // NOI18N
+
+                final String shortcutLocation =
+                        getProduct().getProperty(START_MENU_SHORTCUT_LOCATION_PROPERTY);
+
+                if ((shortcutLocation == null)
+                        || shortcutLocation.equals(CURRENT_USER_PROPERTY_VALUE)) {
+                    SystemUtils.removeShortcut(
+                            getStartMenuShortcut(installLocation),
+                            LocationType.CURRENT_USER_START_MENU,
+                            true);
+                } else {
+                    SystemUtils.removeShortcut(
+                            getStartMenuShortcut(installLocation),
+                            LocationType.ALL_USERS_START_MENU,
+                            true);
+                }
+            } catch (NativeException e) {
+                LogManager.log(
+                        getString("CL.uninstall.error.start.menu"), // NOI18N
+                        e);
+            }
+        }
+
+        /////////////////////////////////////////////////////////////////////////////
+        if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_DESKTOP_SHORTCUT_PROPERTY))) {
+            if (!SystemUtils.isMacOS()) {
+                try {
+                    progress.setDetail(getString("CL.uninstall.desktop")); // NOI18N
+
+                    final String shortcutLocation = getProduct().getProperty(
+                            DESKTOP_SHORTCUT_LOCATION_PROPERTY);
+
+                    if ((shortcutLocation == null)
+                            || shortcutLocation.equals(CURRENT_USER_PROPERTY_VALUE)) {
+                        SystemUtils.removeShortcut(
+                                getDesktopShortcut(installLocation),
+                                LocationType.CURRENT_USER_DESKTOP,
+                                false);
+                    } else {
+                        SystemUtils.removeShortcut(
+                                getDesktopShortcut(installLocation),
+                                LocationType.ALL_USERS_DESKTOP,
+                                false);
+                    }
+                } catch (NativeException e) {
+                    LogManager.log(
+                            getString("CL.uninstall.error.desktop"), // NOI18N
+                            e);
+                }
+            }
+        }
+
+
         if (Boolean.getBoolean("remove.app.userdir")) {
             try {
                 progress.setDetail(getString("CL.uninstall.remove.userdir")); // NOI18N
-                LogManager.logIndent("Removing application's userdir... ");
+                LogManager.logIndent("Removing application`s userdir... ");
                 File userDir = NetBeansRCPUtils.getApplicationUserDirFile(installLocation);
                 LogManager.log("... application userdir location : " + userDir);
                 if (FileUtils.exists(userDir) && FileUtils.canWrite(userDir)) {
@@ -141,7 +302,7 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
                 }
                 LogManager.log("... application userdir totally removed");
             } catch (IOException e) {
-                LogManager.log("Can't remove application userdir", e);
+                LogManager.log("Can`t remove application userdir", e);
             } finally {
                 LogManager.unindent();
             }
@@ -152,7 +313,7 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
             File jre = new File(installLocation, "jdk");
             if (jre.exists()) {
                 try {
-                    for (File file: FileUtils.listFiles(jre).toList()) {
+                    for (File file : FileUtils.listFiles(jre).toList()) {
                         FileUtils.deleteOnExit(file);
                     }
                     FileUtils.deleteOnExit(installLocation);
@@ -160,13 +321,13 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
                     //ignore
                 }
             }        
-        } else {
-            String appName = ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name");
-            File exeLink = new File(installLocation.getParentFile().getParent() + "/MacOS/" + appName);
+        } else{
+            String appName=ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name");
+            File exeLink = new File(installLocation.getParentFile().getParent()+"/MacOS/"+appName);
             try {
                 FileUtils.deleteWithEmptyParents(exeLink);
             } catch (IOException ex) {
-                LogManager.log("Error removing app Link: ", ex);
+                LogManager.log("Error removing app Link: " + ex);
             }
         }
         /////////////////////////////////////////////////////////////////////////////
@@ -210,7 +371,6 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
         }
     }
 
-    @Override
     public RemovalMode getRemovalMode() {
         return RemovalMode.LIST;
     }
@@ -234,7 +394,92 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
     public boolean wrapForMacOs() {
         return true;
     }
-    
+
+
+
+    private Shortcut getDesktopShortcut(final File directory) {
+        return getShortcut(
+                getStrings("CL.desktop.shortcut.name"), // NOI18N
+                getStrings("CL.desktop.shortcut.description"), // NOI18N
+                getString("CL.desktop.shortcut.path"), // NOI18N
+                directory);
+    }
+
+    private Shortcut getStartMenuShortcut(final File directory) {
+        if (SystemUtils.isMacOS()) {
+            return getShortcut(
+                    getStrings("CL.start.menu.shortcut.name.macosx"), // NOI18N
+                    getStrings("CL.start.menu.shortcut.description"), // NOI18N
+                    getString("CL.start.menu.shortcut.path"), // NOI18N
+                    directory);
+        } else {
+            return getShortcut(
+                    getStrings("CL.start.menu.shortcut.name"), // NOI18N
+                    getStrings("CL.start.menu.shortcut.description"), // NOI18N
+                    getString("CL.start.menu.shortcut.path"), // NOI18N
+                    directory);
+        }
+    }
+
+    private Shortcut getShortcut(
+            final Map<Locale, String> names,
+            final Map<Locale, String> descriptions,
+            final String relativePath,
+            final File location) {
+        final File icon;
+        final File executable;
+
+        if (SystemUtils.isWindows()) {
+            icon = new File(location, ICON_WINDOWS);
+        } else if (SystemUtils.isMacOS()) {
+            icon = new File(location, ICON_MACOSX);
+        } else {
+            icon = new File(location, ICON_UNIX);
+            LogManager.log("... icon file: " + icon);
+            if(!FileUtils.exists(icon)) {
+                LogManager.log("... icon file does not exist: " + icon);
+                InputStream is = null;
+                is = ResourceUtils.getResource(ICON_UNIX_RESOURCE, this.getClass().getClassLoader());
+                if(is!=null) {
+                    FileOutputStream fos =null;
+                    try {
+                        fos = new FileOutputStream(icon);
+                        StreamUtils.transferData(is, fos);
+                        is.close();
+                        fos.close();
+                        getProduct().getInstalledFiles().add(icon);
+                    } catch (IOException e) {
+                        LogManager.log(e);
+                    } finally {
+                        if(fos!=null) {
+                            try {
+                                fos.close();
+                            } catch (IOException e) {
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if (SystemUtils.isWindows()) {
+            executable = new File(location, EXECUTABLE_WINDOWS);
+        } else {
+            executable = new File(location, EXECUTABLE_UNIX);
+        }
+        final String name = names.get(new Locale(StringUtils.EMPTY_STRING));
+        final FileShortcut shortcut = new FileShortcut(name, executable);
+        shortcut.setNames(names);
+        shortcut.setDescriptions(descriptions);
+        shortcut.setCategories(SHORTCUT_CATEGORIES);
+        shortcut.setFileName(SHORTCUT_FILENAME);
+        shortcut.setIcon(icon);
+        shortcut.setRelativePath(relativePath);
+        shortcut.setWorkingDirectory(location);
+        shortcut.setModifyPath(true);
+
+        return shortcut;
+    }
     public static final String SHORTCUT_FILENAME =
             ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".desktop"; // NOI18N
     public static final String[] SHORTCUT_CATEGORIES = 
@@ -259,4 +504,15 @@ public class ConfigurationLogic extends ProductConfigurationLogic {
             ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".icns"; // NOI18N
     public static final String ICON_MACOSX_RESOURCE =
             "org/mycompany/" + ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".icns"; // NOI18N
+    public static final String WIZARD_COMPONENTS_URI =
+            "resource:" + // NOI18N
+            "org/mycompany/wizard.xml"; // NOI18N
+    private static final String DESKTOP_SHORTCUT_LOCATION_PROPERTY =
+            "desktop.shortcut.location"; // NOI18N
+    private static final String START_MENU_SHORTCUT_LOCATION_PROPERTY =
+            "start.menu.shortcut.location"; // NOI18N
+    private static final String ALL_USERS_PROPERTY_VALUE =
+            "all.users"; // NOI18N
+    private static final String CURRENT_USER_PROPERTY_VALUE =
+            "current.user"; // NOI18N
 }

+ 43 - 0
nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+  Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+  Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+  Other names may be trademarks of their respective owners.
+
+  The contents of this file are subject to the terms of either the GNU General Public
+  License Version 2 only ("GPL") or the Common Development and Distribution
+  License("CDDL") (collectively, the "License"). You may not use this file except in
+  compliance with the License. You can obtain a copy of the License at
+  http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
+  License for the specific language governing permissions and limitations under the
+  License.  When distributing the software, include this License Header Notice in
+  each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP.  Oracle
+  designates this particular file as subject to the "Classpath" exception as provided
+  by Oracle in the GPL Version 2 section of the License file that accompanied this code.
+  If applicable, add the following below the License Header, with the fields enclosed
+  by brackets [] replaced by your own identifying information:
+  "Portions Copyrighted [year] [name of copyright owner]"
+  
+  Contributor(s):
+  
+  The Original Software is NetBeans. The Initial Developer of the Original Software
+  is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
+  Rights Reserved.
+  
+  If you wish your version of this file to be governed by only the CDDL or only the
+  GPL Version 2, indicate your decision by adding "[Contributor] elects to include
+  this software in this distribution under the [CDDL or GPL Version 2] license." If
+  you do not indicate a single choice of license, a recipient has the option to
+  distribute your version of this file under either the CDDL, the GPL Version 2 or
+  to extend the choice of license to its licensees as provided above. However, if you
+  add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the
+  option applies only if the new code is made subject to such option by the copyright
+  holder.
+-->
+
+<wizard xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wizard-components.xsd">
+    <component class="org.mycompany.wizard.panels.HelloWorldPanel"/>    
+</wizard>

+ 51 - 0
nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/Bundle.properties

@@ -0,0 +1,51 @@
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+#
+# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+# Other names may be trademarks of their respective owners.
+#
+# The contents of this file are subject to the terms of either the GNU General Public
+# License Version 2 only ("GPL") or the Common Development and Distribution
+# License("CDDL") (collectively, the "License"). You may not use this file except in
+# compliance with the License. You can obtain a copy of the License at
+# http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
+# License for the specific language governing permissions and limitations under the
+# License.  When distributing the software, include this License Header Notice in
+# each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP.  Oracle
+# designates this particular file as subject to the "Classpath" exception as provided
+# by Oracle in the GPL Version 2 section of the License file that accompanied this code.
+# If applicable, add the following below the License Header, with the fields enclosed
+# by brackets [] replaced by your own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+# 
+# Contributor(s):
+# 
+# The Original Software is NetBeans. The Initial Developer of the Original Software
+# is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
+# Rights Reserved.
+# 
+# If you wish your version of this file to be governed by only the CDDL or only the
+# GPL Version 2, indicate your decision by adding "[Contributor] elects to include
+# this software in this distribution under the [CDDL or GPL Version 2] license." If
+# you do not indicate a single choice of license, a recipient has the option to
+# distribute your version of this file under either the CDDL, the GPL Version 2 or
+# to extend the choice of license to its licensees as provided above. However, if you
+# add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the
+# option applies only if the new code is made subject to such option by the copyright
+# holder.
+# 
+
+################################################################################
+# HelloWorldPanel.java
+P.title={product-name} Installation
+P.description=Choose destination folder.
+P.destination.label.text=&Install {product-name} to:
+P.destination.button.text=B&rowse.....
+
+P.create.desktop.shortcut=Create Desktop icon
+P.create.start.menu.shortcut.windows=Create Start menu entry
+P.create.start.menu.shortcut.unix=Create shortcut in Applications menu
+P.create.start.menu.shortcut.macosx=Create icon in Dock
+

+ 184 - 0
nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/HelloWorldPanel.java

@@ -0,0 +1,184 @@
+package org.mycompany.wizard.panels;
+
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.SystemUtils;
+import org.netbeans.installer.utils.helper.swing.NbiCheckBox;
+import org.netbeans.installer.wizard.components.panels.DestinationPanel;
+import org.netbeans.installer.wizard.containers.SwingContainer;
+import org.netbeans.installer.wizard.ui.SwingUi;
+import org.netbeans.installer.wizard.ui.WizardUi;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class HelloWorldPanel extends DestinationPanel {
+
+    public HelloWorldPanel() {
+        setProperty(TITLE_PROPERTY,
+                DEFAULT_TITLE);
+        setProperty(DESCRIPTION_PROPERTY,
+                DEFAULT_DESCRIPTION);
+
+        setProperty(DESTINATION_LABEL_TEXT_PROPERTY,
+                DEFAULT_DESTINATION_LABEL_TEXT);
+        setProperty(DESTINATION_BUTTON_TEXT_PROPERTY,
+                DEFAULT_DESTINATION_BUTTON_TEXT);
+    }
+
+    @Override
+    public WizardUi getWizardUi() {
+        if (wizardUi == null) {
+            wizardUi = new HelloWorldPanelUi(this);
+        }
+
+        return wizardUi;
+    }
+
+    @Override
+    public void initialize() {
+        super.initialize();
+        if(getWizard().getProperty(CREATE_DESKTOP_SHORTCUT_PROPERTY) == null) {
+            getWizard().setProperty(CREATE_DESKTOP_SHORTCUT_PROPERTY, "" + true);
+        }
+        if(getWizard().getProperty(CREATE_START_MENU_SHORTCUT_PROPERTY) == null) {
+            getWizard().setProperty(CREATE_START_MENU_SHORTCUT_PROPERTY, "" + true);
+        }
+    }
+
+
+    public static class HelloWorldPanelUi extends DestinationPanelUi {
+
+        protected HelloWorldPanel panel;
+
+        public HelloWorldPanelUi(HelloWorldPanel panel) {
+            super(panel);
+
+
+            this.panel = panel;
+        }
+
+        public SwingUi getSwingUi(SwingContainer container) {
+            if (swingUi == null) {
+                swingUi = new HelloWorldPanelSwingUi(panel, container);
+            }
+
+            return super.getSwingUi(container);
+        }
+    }
+
+    public static class HelloWorldPanelSwingUi extends DestinationPanelSwingUi {
+
+        protected HelloWorldPanel panel;
+        private NbiCheckBox desktopShortcutComboBox;
+        private NbiCheckBox startMenuShortcutComboBox;
+
+        public HelloWorldPanelSwingUi(
+                final HelloWorldPanel panel,
+                final SwingContainer container) {
+            super(panel, container);
+
+            this.panel = panel;
+
+            initComponents();
+        }
+
+        // protected ////////////////////////////////////////////////////////////////
+        @Override
+        protected void initialize() {
+            desktopShortcutComboBox.setText(CREATE_DESKTOP_SHORTCUT_NAME);            
+            desktopShortcutComboBox.setSelected(false);
+            if(Boolean.parseBoolean(panel.getWizard().getProperty(CREATE_DESKTOP_SHORTCUT_PROPERTY))) {
+                desktopShortcutComboBox.doClick();
+            }
+
+            startMenuShortcutComboBox.setText(
+                    SystemUtils.isWindows() ? CREATE_START_MENU_SHORTCUT_NAME_WINDOWS :
+                        (SystemUtils.isMacOS() ? CREATE_START_MENU_SHORTCUT_NAME_MAC :
+                            CREATE_START_MENU_SHORTCUT_NAME_UNIX));
+            startMenuShortcutComboBox.setSelected(false);
+            if(Boolean.parseBoolean(panel.getWizard().getProperty(CREATE_START_MENU_SHORTCUT_PROPERTY))) {
+                startMenuShortcutComboBox.doClick();
+            }
+
+            super.initialize();
+        }
+
+        @Override
+        protected void saveInput() {
+            super.saveInput();
+            panel.getWizard().setProperty(
+                    CREATE_DESKTOP_SHORTCUT_PROPERTY,
+                    StringUtils.EMPTY_STRING + desktopShortcutComboBox.isSelected());
+            
+            panel.getWizard().setProperty(
+                    CREATE_START_MENU_SHORTCUT_PROPERTY,
+                    StringUtils.EMPTY_STRING + startMenuShortcutComboBox.isSelected());
+        }
+
+        @Override
+        protected String validateInput() {
+            String errorMessage = super.validateInput();
+            return errorMessage;
+        }
+
+        // private //////////////////////////////////////////////////////////////////
+        private void initComponents() {
+            // selectedLocationField ////////////////////////////////////////////////
+            desktopShortcutComboBox = new NbiCheckBox();
+            startMenuShortcutComboBox = new NbiCheckBox();
+
+            // this /////////////////////////////////////////////////////////////////
+            add(desktopShortcutComboBox, new GridBagConstraints(
+                    0, 2, // x, y
+                    2, 1, // width, height
+                    1.0, 0.0, // weight-x, weight-y
+                    GridBagConstraints.LINE_START, // anchor
+                    GridBagConstraints.HORIZONTAL, // fill
+                    new Insets(15, 11, 0, 11), // padding
+                    0, 0));                           // padx, pady - ???
+            add(startMenuShortcutComboBox, new GridBagConstraints(
+                    0, 3, // x, y
+                    2, 1, // width, height
+                    1.0, 0.0, // weight-x, weight-y
+                    GridBagConstraints.LINE_START, // anchor
+                    GridBagConstraints.HORIZONTAL, // fill
+                    new Insets(7, 11, 0, 11), // padding
+                    0, 0));                           // padx, pady - ???
+
+        }
+    }
+    /////////////////////////////////////////////////////////////////////////////////
+    // Constants
+    public static final String DEFAULT_TITLE =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.title"); // NOI18N
+    public static final String DEFAULT_DESCRIPTION =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.description"); // NOI18N
+    public static final String DEFAULT_DESTINATION_LABEL_TEXT =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.destination.label.text"); // NOI18N
+    public static final String DEFAULT_DESTINATION_BUTTON_TEXT =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.destination.button.text"); // NOI18N
+    public static final String CREATE_DESKTOP_SHORTCUT_NAME =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.create.desktop.shortcut"); // NOI18N
+    public static final String CREATE_START_MENU_SHORTCUT_NAME_WINDOWS =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.create.start.menu.shortcut.windows"); // NOI18N
+    public static final String CREATE_START_MENU_SHORTCUT_NAME_UNIX =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.create.start.menu.shortcut.unix"); // NOI18N
+    public static final String CREATE_START_MENU_SHORTCUT_NAME_MAC =
+            ResourceUtils.getString(HelloWorldPanel.class,
+            "P.create.start.menu.shortcut.macosx"); // NOI18N
+    public static final String CREATE_DESKTOP_SHORTCUT_PROPERTY =
+            "create.desktop.shortcut";
+    public static final String CREATE_START_MENU_SHORTCUT_PROPERTY =
+            "create.start.menu.shortcut";
+}