? ide/branding/autoupdate/libsrc/org/netbeans/updater/resources/.xvpics ? ide/branding/autoupdate/libsrc/org/netbeans/updater/resources/myupdatersplash_nb.gif ? autoupdate/libsrc/org/netbeans/updater/resources/.xvpics Index: ide/branding/build.xml =================================================================== RCS file: /cvs/ide/branding/build.xml,v retrieving revision 1.15 diff -u -r1.15 build.xml --- ide/branding/build.xml 18 Apr 2005 22:16:46 -0000 1.15 +++ ide/branding/build.xml 10 May 2005 08:23:13 -0000 @@ -121,6 +121,12 @@ basedir="core/windows/src" jarfile="${netbeans.dest.dir}/${cluster.dir}/modules/org-netbeans-core-windows.jar" /> + + + Index: ide/branding/autoupdate/libsrc/org/netbeans/updater/Bundle_nb.properties =================================================================== RCS file: ide/branding/autoupdate/libsrc/org/netbeans/updater/Bundle_nb.properties diff -N ide/branding/autoupdate/libsrc/org/netbeans/updater/Bundle_nb.properties --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ide/branding/autoupdate/libsrc/org/netbeans/updater/Bundle_nb.properties 10 May 2005 08:23:13 -0000 @@ -0,0 +1,35 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun +# Microsystems, Inc. All Rights Reserved. + +CTL_PreparingUnpack=Preparing to Unpack +CTL_UnpackingFile=Unpacking File: +UpdaterFrame.jTextArea1.text=The Update Center is now updating the IDE.\n\nPlease wait ... +UpdaterFrame.textLabel.text=Preparing to Unpack +UpdaterFrame.Form.title=IDE - UPDATER + +# In case you are branding your distribution you might want to +# add some of following keys into your branded Bundle + +#UpdaterFrame.TextBackground_R=255 +#UpdaterFrame.TextBackground_G=255 +#UpdaterFrame.TextBackground_B=255 + +#UpdaterFrame.TextForeground_R=0 +#UpdaterFrame.TextForeground_G=0 +#UpdaterFrame.TextForeground_B=0 + +#UpdaterFrame.hasBorder=true + +#Netbeans defaults +#UpdaterFrame.ProgressBar.PreferredSize_X=300 +#UpdaterFrame.ProgressBar.PreferredSize_Y=20 + +#UpdaterFrame.isGradient=false // set true to make gradient Index: ide/branding/autoupdate/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif =================================================================== RCS file: ide/branding/autoupdate/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif diff -N ide/branding/autoupdate/libsrc/org/netbeans/updater/resources/updatersplash_nb.gif Binary files /dev/null and updatersplash_nb.gif differ Index: ide/golden/files-layout.txt =================================================================== RCS file: /cvs/ide/golden/files-layout.txt,v retrieving revision 1.45 diff -u -r1.45 files-layout.txt --- ide/golden/files-layout.txt 4 May 2005 02:06:16 -0000 1.45 +++ ide/golden/files-layout.txt 10 May 2005 08:23:14 -0000 @@ -844,6 +844,7 @@ nb4.1/config/Modules/org-netbeans-modules-updatecenters.xml nb4.1/config/Modules/org-netbeans-modules-welcome.xml nb4.1/core/locale/core_nb.jar +nb4.1/core/locale/updater_nb.jar nb4.1/core/org-netbeans-upgrader.jar nb4.1/docs/CustomerDetail.java nb4.1/docs/CustomerFacadeBean.java Index: autoupdate/libsrc/org/netbeans/updater/Localization.java =================================================================== RCS file: /cvs/autoupdate/libsrc/org/netbeans/updater/Localization.java,v retrieving revision 1.6 diff -u -r1.6 Localization.java --- autoupdate/libsrc/org/netbeans/updater/Localization.java 10 Nov 2004 14:45:55 -0000 1.6 +++ autoupdate/libsrc/org/netbeans/updater/Localization.java 10 May 2005 08:23:14 -0000 @@ -35,7 +35,9 @@ private static HashMap bundleCache = new HashMap(); public static String getBranding() { - init(); + if (brandingToken != null) { + init(); + } return brandingToken; } @@ -123,12 +125,17 @@ return null; } - // Private methods --------------------------------------------------------- + public static void setBranding (String branding) { + brandingToken = branding; + } + // Private methods --------------------------------------------------------- private static synchronized void init() { - if ( brandedLoader == null ) { + if (brandingToken == null) { // Initialize the branding token brandingToken = initBranding(); + } + if (brandedLoader == null) { // Fallback to default class loader brandedLoader = Localization.class.getClassLoader(); @@ -176,6 +183,7 @@ "lib" + FILE_SEPARATOR + "branding"); // NOI18N in = new BufferedReader(new FileReader(brandf)); if (in.ready()) { + System.out.println("Warning - It's obsolete. Use --branding instead 'branding' file."); s = in.readLine(); } } Index: autoupdate/libsrc/org/netbeans/updater/UpdaterFrame.java =================================================================== RCS file: /cvs/autoupdate/libsrc/org/netbeans/updater/UpdaterFrame.java,v retrieving revision 1.27 diff -u -r1.27 UpdaterFrame.java --- autoupdate/libsrc/org/netbeans/updater/UpdaterFrame.java 7 Feb 2005 16:52:30 -0000 1.27 +++ autoupdate/libsrc/org/netbeans/updater/UpdaterFrame.java 10 May 2005 08:23:14 -0000 @@ -14,6 +14,7 @@ package org.netbeans.updater; import java.awt.*; +import java.util.Locale; import javax.swing.*; import java.io.*; import java.beans.PropertyChangeListener; @@ -56,7 +57,7 @@ private static Window splashWindow; /** For external running Updater without GUI */ - private static boolean nongui = false; + private static boolean noSplash = false; /** Creates new form UpdaterFrame */ public UpdaterFrame() { @@ -181,11 +182,13 @@ * @param args the command line arguments */ public static void main (String args[]) { - if ( args.length > 0 && args[0].equals( "-nodisplay" ) ) // NOI18N - nongui = true; - else { + if (args.length > 0) { + cli (args); + } + + if (!noSplash) { panel = new UpdaterFrame (); - showSplash(); + showSplash (); } mu = new ModuleUpdater(); @@ -239,7 +242,7 @@ static void setLabel( final String text ) { - if ( nongui ) return; + if (noSplash) return; final javax.swing.JLabel label = panel.textLabel; @@ -254,7 +257,7 @@ static void setProgressRange( final long min, final long max ) { - if ( nongui ) return; + if (noSplash) return; bigBounds = max > 0xFFFF; @@ -272,7 +275,7 @@ static void setProgressValue( final long value ) { - if ( nongui ) return; + if (noSplash) return; final javax.swing.JProgressBar progressBar = panel.progressBar; final boolean bb = bigBounds; @@ -393,6 +396,67 @@ public java.awt.Dimension getPreferredSize () { return stringToDimension("UpdaterFrame.Splash.PreferredSize", new Dimension (400, 280)); } + } + + // copied from core/CLIOptions + + private static boolean isOption (String value, String optionName) { + if (value == null) return false; + + if (value.startsWith ("--")) { + return value.substring (2).equals (optionName); + } else if (value.startsWith ("-")) { + return value.substring (1).equals (optionName); + } + return false; + } + + private static int cli(String[] args) { + // let's go through the command line + for (int i = 0; i < args.length; i++) { + if (args[i] == null) { + continue; + } + if (isOption (args[i], "nosplash")) { // NOI18N + UpdaterFrame.noSplash = true; + } else if (isOption (args[i], "locale")) { // NOI18N + args[i] = null; + String localeParam = args[++i]; + String language; + String country = ""; // NOI18N + String variant = ""; // NOI18N + int index1 = localeParam.indexOf(":"); // NOI18N + if (index1 == -1) + language = localeParam; + else { + language = localeParam.substring(0, index1); + int index2 = localeParam.indexOf(":", index1+1); // NOI18N + if (index2 != -1) { + country = localeParam.substring(index1+1, index2); + variant = localeParam.substring(index2+1); + } + else + country = localeParam.substring(index1+1); + } + Locale.setDefault(new Locale(language, country, variant)); + } else if (isOption (args[i], "branding")) { // NOI18N + args[i] = null; + if (++i == args.length) { + System.err.println("Option --branding requires one argument."); + return 2; + } + String branding = args[i]; + if (branding.equals("-")) branding = null; // NOI18N + try { + Localization.setBranding(branding); + } catch (IllegalArgumentException iae) { + iae.printStackTrace(); + return 1; + } + } + } + + return 0; } } Index: autoupdate/libsrc/org/netbeans/updater/resources/updatersplash.gif =================================================================== RCS file: /cvs/autoupdate/libsrc/org/netbeans/updater/resources/updatersplash.gif,v retrieving revision 1.4 diff -u -r1.4 updatersplash.gif Binary files /tmp/cvsQFa4lq and updatersplash.gif differ