directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r477266 - in /directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main: java/org/apache/directory/ldapstudio/view/WelcomeView.java resources/org/apache/directory/ldapstudio/messages.properties
Date Mon, 20 Nov 2006 17:36:20 GMT
Author: pamarcelot
Date: Mon Nov 20 09:36:18 2006
New Revision: 477266

URL: http://svn.apache.org/viewvc?view=rev&rev=477266
Log:
Updating WelcomeView. String Externalization and better error handling when opening apache.org
in browser.

Modified:
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/java/org/apache/directory/ldapstudio/view/WelcomeView.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/resources/org/apache/directory/ldapstudio/messages.properties

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/java/org/apache/directory/ldapstudio/view/WelcomeView.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/java/org/apache/directory/ldapstudio/view/WelcomeView.java?view=diff&rev=477266&r1=477265&r2=477266
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/java/org/apache/directory/ldapstudio/view/WelcomeView.java
(original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/java/org/apache/directory/ldapstudio/view/WelcomeView.java
Mon Nov 20 09:36:18 2006
@@ -25,6 +25,7 @@
 import java.net.URL;
 
 import org.apache.directory.ldapstudio.Messages;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -43,22 +44,12 @@
 /**
  * This class defines the Welcome View.
  */
-
 public class WelcomeView extends ViewPart
 {
     public static final String ID = "org.apache.directory.ldapstudio.view.WelcomeView"; //$NON-NLS-1$
 
 
     /**
-     * The constructor.
-     */
-    public WelcomeView()
-    {
-        // Does Nothing
-    }
-
-
-    /**
      * This is a callback that will allow us
      * to create the viewer and initialize it.
      */
@@ -76,7 +67,7 @@
 
         // LDAP Browser Plugin Image & Button
         Image ldapBrowserImage = new Image( PlatformUI.getWorkbench().getDisplay(), getClass().getResourceAsStream(
-            "ldapstudio_ldap-browser-plugin.png" ) );
+            "ldapstudio_ldap-browser-plugin.png" ) ); //$NON-NLS-1$
         Button ldapBrowserButton = new Button( container, SWT.PUSH );
         ldapBrowserButton.setImage( ldapBrowserImage );
         ldapBrowserButton.setLayoutData( new GridData( SWT.CENTER, SWT.NONE, false, false
) );
@@ -86,13 +77,13 @@
             {
                 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
                     PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(
-                        "org.apache.directory.ldapstudio.browser.perspective" ) );
+                        "org.apache.directory.ldapstudio.browser.perspective" ) ); //$NON-NLS-1$
             }
         } );
 
         // Schemas Editor Plugin Image & Button
         Image schemasEditorImage = new Image( PlatformUI.getWorkbench().getDisplay(), getClass().getResourceAsStream(
-            "ldapstudio_schemas-editor-plugin.png" ) );
+            "ldapstudio_schemas-editor-plugin.png" ) ); //$NON-NLS-1$
         Button schemasEditorButton = new Button( container, SWT.PUSH );
         schemasEditorButton.setImage( schemasEditorImage );
         schemasEditorButton.setLayoutData( new GridData( SWT.CENTER, SWT.NONE, false, false
) );
@@ -102,25 +93,25 @@
             {
                 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
                     PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(
-                        "org.apache.directory.ldapstudio.schemas.perspective" ) );
+                        "org.apache.directory.ldapstudio.schemas.perspective" ) ); //$NON-NLS-1$
             }
         } );
 
         // LDAP Browser Plugin Label
         Label ldapBrowserLabel = new Label( container, SWT.NONE );
-        ldapBrowserLabel.setFont( new Font( null, "Georgia", 13, SWT.BOLD ) );
-        ldapBrowserLabel.setText( "LDAP Browser Plugin" );
+        ldapBrowserLabel.setFont( new Font( null, "Georgia", 13, SWT.BOLD ) ); //$NON-NLS-1$
+        ldapBrowserLabel.setText( Messages.getString("WelcomeView.LDAP_Browser_Plugin") );
//$NON-NLS-1$
         ldapBrowserLabel.setLayoutData( new GridData( SWT.CENTER, SWT.NONE, true, true )
);
 
         // Schemas Editor Plugin Label
         Label schemasEditorLabel = new Label( container, SWT.NONE );
-        schemasEditorLabel.setFont( new Font( null, "Georgia", 13, SWT.BOLD ) );
-        schemasEditorLabel.setText( "Schemas Editor Plugin" );
+        schemasEditorLabel.setFont( new Font( null, "Georgia", 13, SWT.BOLD ) ); //$NON-NLS-1$
+        schemasEditorLabel.setText( Messages.getString("WelcomeView.Schemas_Editor_Plugin")
); //$NON-NLS-1$
         schemasEditorLabel.setLayoutData( new GridData( SWT.CENTER, SWT.NONE, true, true
) );
 
         // Apache Software Foundation Image
         Image asfLogoImange = new Image( PlatformUI.getWorkbench().getDisplay(), getClass().getResourceAsStream(
-            "asf-logo.gif" ) );
+            "asf-logo.gif" ) ); //$NON-NLS-1$
         Button asfLogoButton = new Button( container, SWT.PUSH );
         asfLogoButton.setImage( asfLogoImange );
         asfLogoButton.setLayoutData( new GridData( SWT.CENTER, SWT.NONE, false, false, 2,
1 ) );
@@ -131,24 +122,24 @@
                 try
                 {
                     PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(
-                        new URL( "http://www.apache.org/" ) );
+                        new URL( Messages.getString("WelcomeView.Apache.org_url") ) ); //$NON-NLS-1$
                 }
                 catch ( PartInitException e1 )
                 {
-                    // TODO Auto-generated catch block
-                    e1.printStackTrace();
+                    // Displaying an error
+                    MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                        Messages.getString("WelcomeView.Error"), Messages.getString("WelcomeView.LDAP_Studio_was_unable_to_open_www.apache.org")
); //$NON-NLS-1$ //$NON-NLS-2$
                 }
                 catch ( MalformedURLException e1 )
                 {
-                    // TODO Auto-generated catch block
-                    e1.printStackTrace();
+                    // Will never be thrown
                 }
             }
         } );
 
         // Copyright Label
         Label copyrightLabel = new Label( container, SWT.NONE );
-        copyrightLabel.setText( "© Copyright 2006 - Apache Software Foundation" );
+        copyrightLabel.setText( Messages.getString("WelcomeView.Copyright") ); //$NON-NLS-1$
         copyrightLabel.setLayoutData( new GridData( SWT.CENTER, SWT.NONE, false, false, 2,
1 ) );
     }
 

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/resources/org/apache/directory/ldapstudio/messages.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/resources/org/apache/directory/ldapstudio/messages.properties?view=diff&rev=477266&r1=477265&r2=477266
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/resources/org/apache/directory/ldapstudio/messages.properties
(original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-rcp/src/main/resources/org/apache/directory/ldapstudio/messages.properties
Mon Nov 20 09:36:18 2006
@@ -44,3 +44,9 @@
 
 # Strings used by WelcomeView Class
 WelcomeView.Welcome_message=Welcome to LDAP Studio.\n\nPlease select a perspective above...
+WelcomeView.LDAP_Browser_Plugin=LDAP Browser Plugin
+WelcomeView.Schemas_Editor_Plugin=Schemas Editor Plugin
+WelcomeView.Apache.org_url=http://www.apache.org/
+WelcomeView.Error=Error \!
+WelcomeView.LDAP_Studio_was_unable_to_open_www.apache.org=LDAP Studio was unable to open
http://www.apache.org in your default browser.
+WelcomeView.Copyright=\u00A9 Copyright 2006 - Apache Software Foundation



Mime
View raw message