Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 28709 invoked from network); 27 Nov 2008 08:42:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2008 08:42:43 -0000 Received: (qmail 79875 invoked by uid 500); 27 Nov 2008 08:42:54 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 79820 invoked by uid 500); 27 Nov 2008 08:42:54 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 79811 invoked by uid 99); 27 Nov 2008 08:42:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Nov 2008 00:42:54 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Nov 2008 08:41:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 14CD2238899A; Thu, 27 Nov 2008 00:41:51 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r721120 [2/3] - in /directory/studio/trunk/schemaeditor/src/main: java/org/apache/directory/studio/schemaeditor/view/wizards/ resources/org/apache/directory/studio/schemaeditor/view/wizards/ Date: Thu, 27 Nov 2008 08:41:49 -0000 To: commits@directory.apache.org From: felixk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081127084151.14CD2238899A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java Thu Nov 27 00:41:48 2008 @@ -73,9 +73,9 @@ */ protected ImportProjectsWizardPage() { - super( "ImportProjectsWizardPage" ); - setTitle( "Import schema projects" ); - setDescription( "Please select the schema project to import." ); + super( "ImportProjectsWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "ImportProjectsWizardPage.ImportSchemaProjects" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "ImportProjectsWizardPage.SelechtSchemaProject" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_PROJECT_IMPORT_WIZARD ) ); } @@ -91,13 +91,13 @@ // From Directory Group Group fromDirectoryGroup = new Group( composite, SWT.NONE ); - fromDirectoryGroup.setText( "From directory" ); + fromDirectoryGroup.setText( Messages.getString( "ImportProjectsWizardPage.FromDirectory" ) ); //$NON-NLS-1$ fromDirectoryGroup.setLayout( new GridLayout( 3, false ) ); fromDirectoryGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // From Directory Label fromDirectoryLabel = new Label( fromDirectoryGroup, SWT.NONE ); - fromDirectoryLabel.setText( "From directory:" ); + fromDirectoryLabel.setText( Messages.getString( "ImportProjectsWizardPage.FromDirectoryColon" ) ); //$NON-NLS-1$ fromDirectoryText = new Text( fromDirectoryGroup, SWT.BORDER ); fromDirectoryText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); fromDirectoryText.addModifyListener( new ModifyListener() @@ -108,7 +108,7 @@ } } ); fromDirectoryButton = new Button( fromDirectoryGroup, SWT.PUSH ); - fromDirectoryButton.setText( "Browse..." ); + fromDirectoryButton.setText( Messages.getString( "ImportProjectsWizardPage.Browse" ) ); //$NON-NLS-1$ fromDirectoryButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) @@ -119,7 +119,7 @@ // Schema Files Group Group schemaFilesGroup = new Group( composite, SWT.NONE ); - schemaFilesGroup.setText( "Schema project files" ); + schemaFilesGroup.setText( Messages.getString( "ImportProjectsWizardPage.SchemaProjectFiles" ) ); //$NON-NLS-1$ schemaFilesGroup.setLayout( new GridLayout( 2, false ) ); schemaFilesGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); @@ -169,7 +169,7 @@ } } ); projectFilesTableSelectAllButton = new Button( schemaFilesGroup, SWT.PUSH ); - projectFilesTableSelectAllButton.setText( "Select All" ); + projectFilesTableSelectAllButton.setText( Messages.getString( "ImportProjectsWizardPage.SelectAll" ) ); //$NON-NLS-1$ projectFilesTableSelectAllButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) ); projectFilesTableSelectAllButton.addSelectionListener( new SelectionAdapter() { @@ -180,7 +180,7 @@ } } ); projectFilesTableDeselectAllButton = new Button( schemaFilesGroup, SWT.PUSH ); - projectFilesTableDeselectAllButton.setText( "Deselect All" ); + projectFilesTableDeselectAllButton.setText( Messages.getString( "ImportProjectsWizardPage.DeselectAll" ) ); //$NON-NLS-1$ projectFilesTableDeselectAllButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) ); projectFilesTableDeselectAllButton.addSelectionListener( new SelectionAdapter() { @@ -213,9 +213,9 @@ private void chooseFromDirectory() { DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); - dialog.setText( "Choose Folder" ); - dialog.setMessage( "Select the folder from which import the files." ); - if ( "".equals( fromDirectoryText.getText() ) ) + dialog.setText( Messages.getString( "ImportProjectsWizardPage.ChooseFolder" ) ); //$NON-NLS-1$ + dialog.setMessage( Messages.getString( "ImportProjectsWizardPage.SelectFoldertoImportFrom" ) ); //$NON-NLS-1$ + if ( "".equals( fromDirectoryText.getText() ) ) //$NON-NLS-1$ { dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString( PluginConstants.FILE_DIALOG_IMPORT_PROJECTS ) ); @@ -249,7 +249,7 @@ for ( File file : selectedDirectory.listFiles() ) { String fileName = file.getName(); - if ( fileName.endsWith( ".schemaproject" ) ) + if ( fileName.endsWith( ".schemaproject" ) ) //$NON-NLS-1$ { schemaFiles.add( file ); } @@ -267,9 +267,9 @@ { // Export Directory String directory = fromDirectoryText.getText(); - if ( ( directory == null ) || ( directory.equals( "" ) ) ) + if ( ( directory == null ) || ( directory.equals( "" ) ) ) //$NON-NLS-1$ { - displayErrorMessage( "A directory must be selected." ); + displayErrorMessage( Messages.getString( "ImportProjectsWizardPage.ErrorNoDirectorySelected" ) ); //$NON-NLS-1$ return; } else @@ -277,17 +277,17 @@ File directoryFile = new File( directory ); if ( !directoryFile.exists() ) { - displayErrorMessage( "The selected directory does not exist." ); + displayErrorMessage( Messages.getString( "ImportProjectsWizardPage.ErrorSelectedDirectoryNotExists" ) ); //$NON-NLS-1$ return; } else if ( !directoryFile.isDirectory() ) { - displayErrorMessage( "The selected directory is not a directory." ); + displayErrorMessage( Messages.getString( "ImportProjectsWizardPage.ErrorSelectedDirectoryNotDirectory" ) ); //$NON-NLS-1$ return; } else if ( !directoryFile.canRead() ) { - displayErrorMessage( "The selected directory is not readable." ); + displayErrorMessage( Messages.getString( "ImportProjectsWizardPage.ErrorSelectedDirectoryNotReadable" ) ); //$NON-NLS-1$ return; } } @@ -295,7 +295,7 @@ // Schemas table if ( projectFilesTableViewer.getCheckedElements().length == 0 ) { - displayErrorMessage( "One or several schema project files must be selected." ); + displayErrorMessage( Messages.getString( "ImportProjectsWizardPage.ErrorNoSchemaProjectSelected" ) ); //$NON-NLS-1$ return; } Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java Thu Nov 27 00:41:48 2008 @@ -37,6 +37,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.osgi.util.NLS; import org.eclipse.ui.IImportWizard; import org.eclipse.ui.IWorkbench; @@ -90,7 +91,9 @@ { public void run( IProgressMonitor monitor ) { - monitor.beginTask( "Importing schemas: ", selectedSchemasFiles.length ); + monitor + .beginTask( + Messages.getString( "ImportSchemasFromOpenLdapWizard.ImportingSchemas" ), selectedSchemasFiles.length ); //$NON-NLS-1$ for ( File schemaFile : selectedSchemasFiles ) { @@ -127,9 +130,16 @@ private void reportError( Exception e, File schemaFile ) { PluginUtils - .logError( "An error occured when importing the schema " + schemaFile.getName() + ".", e ); - ViewUtils.displayErrorMessageBox( "Error", "An error occured when importing the schema " - + schemaFile.getName() + "." + "\n\n" + e.getMessage() ); + .logError( + NLS + .bind( + Messages.getString( "ImportSchemasFromOpenLdapWizard.ErrorImportingSchema" ), new String[] { schemaFile.getName() } ), e ); //$NON-NLS-1$ + ViewUtils + .displayErrorMessageBox( + Messages.getString( "ImportSchemasFromOpenLdapWizard.Error" ), //$NON-NLS-1$ + NLS + .bind( + Messages.getString( "ImportSchemasFromOpenLdapWizard.ErrorImportingSchemaPlus" ), new String[] { schemaFile.getName(), e.getMessage() } ) ); //$NON-NLS-1$ } } ); } Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java Thu Nov 27 00:41:48 2008 @@ -73,9 +73,9 @@ */ protected ImportSchemasFromOpenLdapWizardPage() { - super( "ImportSchemasFromOpenLdapWizardPage" ); - setTitle( "Import schemas from OpenLdap files" ); - setDescription( "Please select the OpenLdap schema files to import." ); + super( "ImportSchemasFromOpenLdapWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.ImportSchemaFromOpenLDAP" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.SelectOpenLDAPSchema" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_SCHEMAS_IMPORT_WIZARD ) ); } @@ -91,13 +91,13 @@ // From Directory Group Group fromDirectoryGroup = new Group( composite, SWT.NONE ); - fromDirectoryGroup.setText( "From directory" ); + fromDirectoryGroup.setText( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.FromDirectory" ) ); //$NON-NLS-1$ fromDirectoryGroup.setLayout( new GridLayout( 3, false ) ); fromDirectoryGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // From Directory Label fromDirectoryLabel = new Label( fromDirectoryGroup, SWT.NONE ); - fromDirectoryLabel.setText( "From directory:" ); + fromDirectoryLabel.setText( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.FromDirectoryColon" ) ); //$NON-NLS-1$ fromDirectoryText = new Text( fromDirectoryGroup, SWT.BORDER ); fromDirectoryText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); fromDirectoryText.addModifyListener( new ModifyListener() @@ -108,7 +108,7 @@ } } ); fromDirectoryButton = new Button( fromDirectoryGroup, SWT.PUSH ); - fromDirectoryButton.setText( "Browse..." ); + fromDirectoryButton.setText( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.Browse" ) ); //$NON-NLS-1$ fromDirectoryButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) @@ -119,7 +119,7 @@ // Schema Files Group Group schemaFilesGroup = new Group( composite, SWT.NONE ); - schemaFilesGroup.setText( "Schema files" ); + schemaFilesGroup.setText( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.SchemaFiles" ) ); //$NON-NLS-1$ schemaFilesGroup.setLayout( new GridLayout( 2, false ) ); schemaFilesGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); @@ -169,7 +169,7 @@ } } ); schemaFilesTableSelectAllButton = new Button( schemaFilesGroup, SWT.PUSH ); - schemaFilesTableSelectAllButton.setText( "Select All" ); + schemaFilesTableSelectAllButton.setText( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.SelectAll" ) ); //$NON-NLS-1$ schemaFilesTableSelectAllButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) ); schemaFilesTableSelectAllButton.addSelectionListener( new SelectionAdapter() { @@ -180,7 +180,8 @@ } } ); schemaFilesTableDeselectAllButton = new Button( schemaFilesGroup, SWT.PUSH ); - schemaFilesTableDeselectAllButton.setText( "Deselect All" ); + schemaFilesTableDeselectAllButton.setText( Messages + .getString( "ImportSchemasFromOpenLdapWizardPage.DeselectAll" ) ); //$NON-NLS-1$ schemaFilesTableDeselectAllButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) ); schemaFilesTableDeselectAllButton.addSelectionListener( new SelectionAdapter() { @@ -214,9 +215,9 @@ private void chooseFromDirectory() { DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); - dialog.setText( "Choose Folder" ); - dialog.setMessage( "Select the folder from which import the files." ); - if ( "".equals( fromDirectoryText.getText() ) ) + dialog.setText( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.ChooseFolder" ) ); //$NON-NLS-1$ + dialog.setMessage( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.SelectFolderToImportFrom" ) ); //$NON-NLS-1$ + if ( "".equals( fromDirectoryText.getText() ) ) //$NON-NLS-1$ { dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP ) ); @@ -250,7 +251,7 @@ for ( File file : selectedDirectory.listFiles() ) { String fileName = file.getName(); - if ( fileName.endsWith( ".schema" ) ) + if ( fileName.endsWith( ".schema" ) ) //$NON-NLS-1$ { schemaFiles.add( file ); } @@ -269,15 +270,15 @@ // Checking if a Schema Project is open if ( Activator.getDefault().getSchemaHandler() == null ) { - displayErrorMessage( "A Schema Project must be open to import schemas from OpenLDAP files." ); + displayErrorMessage( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.ErrorNotSchemaProjectOpen" ) ); //$NON-NLS-1$ return; } // Import Directory String directory = fromDirectoryText.getText(); - if ( ( directory == null ) || ( directory.equals( "" ) ) ) + if ( ( directory == null ) || ( directory.equals( "" ) ) ) //$NON-NLS-1$ { - displayErrorMessage( "A directory must be selected." ); + displayErrorMessage( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.ErrorNoDirectorySelected" ) ); //$NON-NLS-1$ return; } else @@ -285,17 +286,20 @@ File directoryFile = new File( directory ); if ( !directoryFile.exists() ) { - displayErrorMessage( "The selected directory does not exist." ); + displayErrorMessage( Messages + .getString( "ImportSchemasFromOpenLdapWizardPage.ErrorSelectedDirectoryNotExists" ) ); //$NON-NLS-1$ return; } else if ( !directoryFile.isDirectory() ) { - displayErrorMessage( "The selected directory is not a directory." ); + displayErrorMessage( Messages + .getString( "ImportSchemasFromOpenLdapWizardPage.ErrorSelectedDirectoryNotDirectory" ) ); //$NON-NLS-1$ return; } else if ( !directoryFile.canRead() ) { - displayErrorMessage( "The selected directory is not readable." ); + displayErrorMessage( Messages + .getString( "ImportSchemasFromOpenLdapWizardPage.ErrorSelectedDirectoryNotReadable" ) ); //$NON-NLS-1$ return; } } @@ -303,7 +307,7 @@ // Schemas table if ( schemaFilesTableViewer.getCheckedElements().length == 0 ) { - displayErrorMessage( "One or several schema files must be selected." ); + displayErrorMessage( Messages.getString( "ImportSchemasFromOpenLdapWizardPage.ErrorNoSchemaSelected" ) ); //$NON-NLS-1$ return; } Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java Thu Nov 27 00:41:48 2008 @@ -38,6 +38,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.osgi.util.NLS; import org.eclipse.ui.IImportWizard; import org.eclipse.ui.IWorkbench; @@ -90,25 +91,27 @@ { public void run( IProgressMonitor monitor ) { - monitor.beginTask( "Importing schemas: ", selectedSchemasFiles.length ); + monitor + .beginTask( + Messages.getString( "ImportSchemasFromXmlWizard.ImportingSchemas" ), selectedSchemasFiles.length ); //$NON-NLS-1$ for ( File schemaFile : selectedSchemasFiles ) { monitor.subTask( schemaFile.getName() ); try { - SchemaFileType schemaFileType = XMLSchemaFileImporter.getSchemaFileType( new FileInputStream( schemaFile ), - schemaFile.getAbsolutePath() ); + SchemaFileType schemaFileType = XMLSchemaFileImporter.getSchemaFileType( + new FileInputStream( schemaFile ), schemaFile.getAbsolutePath() ); switch ( schemaFileType ) { case SINGLE: - Schema importedSchema = XMLSchemaFileImporter.getSchema( new FileInputStream( schemaFile ), - schemaFile.getAbsolutePath() ); + Schema importedSchema = XMLSchemaFileImporter.getSchema( new FileInputStream( + schemaFile ), schemaFile.getAbsolutePath() ); schemaHandler.addSchema( importedSchema ); break; case MULTIPLE: - Schema[] schemas = XMLSchemaFileImporter.getSchemas( new FileInputStream( schemaFile ), schemaFile - .getAbsolutePath() ); + Schema[] schemas = XMLSchemaFileImporter.getSchemas( new FileInputStream( + schemaFile ), schemaFile.getAbsolutePath() ); for ( Schema schema : schemas ) { schemaHandler.addSchema( schema ); @@ -118,15 +121,31 @@ } catch ( XMLSchemaFileImportException e ) { - PluginUtils.logError( "An error occured when importing the schema " + schemaFile + ".", e ); - ViewUtils.displayErrorMessageBox( "Error", "An error occured when saving the schema " - + schemaFile + "." ); + PluginUtils + .logError( + NLS + .bind( + Messages.getString( "ImportSchemasFromXmlWizard.ErrorImportingSchema" ), new File[] { schemaFile } ), e ); //$NON-NLS-1$ + ViewUtils + .displayErrorMessageBox( + Messages.getString( "ImportSchemasFromXmlWizard.Error" ), //$NON-NLS-1$ + NLS + .bind( + Messages.getString( "ImportSchemasFromXmlWizard.ErrorSavingSchema" ), new File[] { schemaFile } ) ); //$NON-NLS-1$ } catch ( FileNotFoundException e ) { - PluginUtils.logError( "An error occured when importing the schema " + schemaFile + ".", e ); - ViewUtils.displayErrorMessageBox( "Error", "An error occured when saving the schema " - + schemaFile + "." ); + PluginUtils + .logError( + NLS + .bind( + Messages.getString( "ImportSchemasFromXmlWizard.ErrorImportingSchema" ), new File[] { schemaFile } ), e ); //$NON-NLS-1$ + ViewUtils + .displayErrorMessageBox( + Messages.getString( "ImportSchemasFromXmlWizard.Error" ), //$NON-NLS-1$ + NLS + .bind( + Messages.getString( "ImportSchemasFromXmlWizard.ErrorSavingSchema" ), new File[] { schemaFile } ) ); //$NON-NLS-1$ } monitor.worked( 1 ); } Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java Thu Nov 27 00:41:48 2008 @@ -73,9 +73,9 @@ */ protected ImportSchemasFromXmlWizardPage() { - super( "ImportSchemasFromXmlWizardPage" ); - setTitle( "Import schemas from XML file(s)" ); - setDescription( "Please select the XML schema files to import." ); + super( "ImportSchemasFromXmlWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "ImportSchemasFromXmlWizardPage.ImportSchemasFromXML" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "ImportSchemasFromXmlWizardPage.SelectXMLSchemaToImport" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_SCHEMAS_IMPORT_WIZARD ) ); } @@ -91,13 +91,13 @@ // From Directory Group Group fromDirectoryGroup = new Group( composite, SWT.NONE ); - fromDirectoryGroup.setText( "From directory" ); + fromDirectoryGroup.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.FromDirectory" ) ); //$NON-NLS-1$ fromDirectoryGroup.setLayout( new GridLayout( 3, false ) ); fromDirectoryGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // From Directory Label fromDirectoryLabel = new Label( fromDirectoryGroup, SWT.NONE ); - fromDirectoryLabel.setText( "From directory:" ); + fromDirectoryLabel.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.FromDirectoryColon" ) ); //$NON-NLS-1$ fromDirectoryText = new Text( fromDirectoryGroup, SWT.BORDER ); fromDirectoryText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); fromDirectoryText.addModifyListener( new ModifyListener() @@ -108,7 +108,7 @@ } } ); fromDirectoryButton = new Button( fromDirectoryGroup, SWT.PUSH ); - fromDirectoryButton.setText( "Browse..." ); + fromDirectoryButton.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.Browse" ) ); //$NON-NLS-1$ fromDirectoryButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) @@ -119,7 +119,7 @@ // Schema Files Group Group schemaFilesGroup = new Group( composite, SWT.NONE ); - schemaFilesGroup.setText( "Schema files" ); + schemaFilesGroup.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.SchemaFiles" ) ); //$NON-NLS-1$ schemaFilesGroup.setLayout( new GridLayout( 2, false ) ); schemaFilesGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); @@ -169,7 +169,7 @@ } } ); schemaFilesTableSelectAllButton = new Button( schemaFilesGroup, SWT.PUSH ); - schemaFilesTableSelectAllButton.setText( "Select All" ); + schemaFilesTableSelectAllButton.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.SelectAll" ) ); //$NON-NLS-1$ schemaFilesTableSelectAllButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) ); schemaFilesTableSelectAllButton.addSelectionListener( new SelectionAdapter() { @@ -180,7 +180,7 @@ } } ); schemaFilesTableDeselectAllButton = new Button( schemaFilesGroup, SWT.PUSH ); - schemaFilesTableDeselectAllButton.setText( "Deselect All" ); + schemaFilesTableDeselectAllButton.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.DeselectAll" ) ); //$NON-NLS-1$ schemaFilesTableDeselectAllButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) ); schemaFilesTableDeselectAllButton.addSelectionListener( new SelectionAdapter() { @@ -214,9 +214,9 @@ private void chooseFromDirectory() { DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); - dialog.setText( "Choose Folder" ); - dialog.setMessage( "Select the folder from which import the files." ); - if ( "".equals( fromDirectoryText.getText() ) ) + dialog.setText( Messages.getString( "ImportSchemasFromXmlWizardPage.ChooseFolder" ) ); //$NON-NLS-1$ + dialog.setMessage( Messages.getString( "ImportSchemasFromXmlWizardPage.SelectFolderToImportFrom" ) ); //$NON-NLS-1$ + if ( "".equals( fromDirectoryText.getText() ) ) //$NON-NLS-1$ { dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML ) ); @@ -250,7 +250,7 @@ for ( File file : selectedDirectory.listFiles() ) { String fileName = file.getName(); - if ( fileName.endsWith( ".xml" ) ) + if ( fileName.endsWith( ".xml" ) ) //$NON-NLS-1$ { schemaFiles.add( file ); } @@ -269,15 +269,15 @@ // Checking if a Schema Project is open if ( Activator.getDefault().getSchemaHandler() == null ) { - displayErrorMessage( "A Schema Project must be open to import schemas from XML files." ); + displayErrorMessage( Messages.getString( "ImportSchemasFromXmlWizardPage.ErrorNoSchemaProjectOpen" ) ); //$NON-NLS-1$ return; } // Export Directory String directory = fromDirectoryText.getText(); - if ( ( directory == null ) || ( directory.equals( "" ) ) ) + if ( ( directory == null ) || ( directory.equals( "" ) ) ) //$NON-NLS-1$ { - displayErrorMessage( "A directory must be selected." ); + displayErrorMessage( Messages.getString( "ImportSchemasFromXmlWizardPage.ErrorNoDirectorySelected" ) ); //$NON-NLS-1$ return; } else @@ -285,17 +285,20 @@ File directoryFile = new File( directory ); if ( !directoryFile.exists() ) { - displayErrorMessage( "The selected directory does not exist." ); + displayErrorMessage( Messages + .getString( "ImportSchemasFromXmlWizardPage.ErrorSelectedDirectoryNotExists" ) ); //$NON-NLS-1$ return; } else if ( !directoryFile.isDirectory() ) { - displayErrorMessage( "The selected directory is not a directory." ); + displayErrorMessage( Messages + .getString( "ImportSchemasFromXmlWizardPage.ErrorSelectedDirectoryNotDirectory" ) ); //$NON-NLS-1$ return; } else if ( !directoryFile.canRead() ) { - displayErrorMessage( "The selected directory is not readable." ); + displayErrorMessage( Messages + .getString( "ImportSchemasFromXmlWizardPage.ErrorSelectedDirectoryNotReadable" ) ); //$NON-NLS-1$ return; } } @@ -303,7 +306,7 @@ // Schemas table if ( schemaFilesTableViewer.getCheckedElements().length == 0 ) { - displayErrorMessage( "One or several schema files must be selected." ); + displayErrorMessage( Messages.getString( "ImportSchemasFromXmlWizardPage.ErrorNoSchemaSelected" ) ); //$NON-NLS-1$ return; } Added: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/Messages.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/Messages.java?rev=721120&view=auto ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/Messages.java (added) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/Messages.java Thu Nov 27 00:41:48 2008 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.schemaeditor.view.wizards; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + + +public class Messages +{ + private static final String BUNDLE_NAME = "org.apache.directory.studio.schemaeditor.view.wizards.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); + + + private Messages() + { + } + + + public static String getString( String key ) + { + try + { + return RESOURCE_BUNDLE.getString( key ); + } + catch ( MissingResourceException e ) + { + return '!' + key + '!'; + } + } +} Propchange: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/Messages.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/Messages.java ------------------------------------------------------------------------------ svn:keywords = Id Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java Thu Nov 27 00:41:48 2008 @@ -37,6 +37,7 @@ import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; @@ -67,12 +68,6 @@ /** The SchemaHandler */ private SchemaHandler schemaHandler; - // The Usage values - private static final String DIRECTORY_OPERATION = "Directory Operation"; - private static final String DISTRIBUTED_OPERATION = "Distributed Operation"; - private static final String DSA_OPERATION = "DSA Operation"; - private static final String USER_APPLICATIONS = "User Applications"; - // UI Fields private Text superiorText; private Button superiorButton; @@ -90,9 +85,9 @@ */ protected NewAttributeTypeContentWizardPage() { - super( "NewAttributeTypeContentWizardPage" ); - setTitle( "Attribute Type Content" ); - setDescription( "Please enter the superior, usage, syntax and properties for the attribute type." ); + super( "NewAttributeTypeContentWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "NewAttributeTypeContentWizardPage.AttributTypeContent" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "NewAttributeTypeContentWizardPage.EnterAttributeTypeContent" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_ATTRIBUTE_TYPE_NEW_WIZARD ) ); schemaHandler = Activator.getDefault().getSchemaHandler(); } @@ -109,13 +104,13 @@ // Superior and Usage Group Group superiorUsageGroup = new Group( composite, SWT.NONE ); - superiorUsageGroup.setText( "Superior and Usage" ); + superiorUsageGroup.setText( Messages.getString( "NewAttributeTypeContentWizardPage.SuperiorAndUsage" ) ); //$NON-NLS-1$ superiorUsageGroup.setLayout( new GridLayout( 3, false ) ); superiorUsageGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Superior Label superiorLabel = new Label( superiorUsageGroup, SWT.NONE ); - superiorLabel.setText( "Superior:" ); + superiorLabel.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Superior" ) ); //$NON-NLS-1$ superiorText = new Text( superiorUsageGroup, SWT.BORDER ); superiorText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); superiorText.addModifyListener( new ModifyListener() @@ -126,7 +121,7 @@ } } ); superiorButton = new Button( superiorUsageGroup, SWT.PUSH ); - superiorButton.setText( "Choose..." ); + superiorButton.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Choose" ) ); //$NON-NLS-1$ superiorButton.setLayoutData( new GridData( SWT.NONE, SWT.NONE, false, false ) ); superiorButton.addSelectionListener( new SelectionAdapter() { @@ -151,25 +146,28 @@ // Usage Label usageLabel = new Label( superiorUsageGroup, SWT.NONE ); - usageLabel.setText( "Usage:" ); + usageLabel.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Usage" ) ); //$NON-NLS-1$ Combo usageCombo = new Combo( superiorUsageGroup, SWT.READ_ONLY ); usageCombo.setLayoutData( new GridData( SWT.NONE, SWT.NONE, false, false, 2, 1 ) ); usageComboViewer = new ComboViewer( usageCombo ); usageComboViewer.setLabelProvider( new LabelProvider() ); usageComboViewer.setContentProvider( new ArrayContentProvider() ); - usageComboViewer.setInput( new String[] - { DIRECTORY_OPERATION, DISTRIBUTED_OPERATION, DSA_OPERATION, USER_APPLICATIONS } ); - usageComboViewer.setSelection( new StructuredSelection( USER_APPLICATIONS ) ); + usageComboViewer + .setInput( new String[] + { + Messages.getString( "NewAttributeTypeContentWizardPage.DirectoryOperation" ), Messages.getString( "NewAttributeTypeContentWizardPage.DistributedOperation" ), Messages.getString( "NewAttributeTypeContentWizardPage.DSAOperation" ), Messages.getString( "NewAttributeTypeContentWizardPage.UserApplications" ) } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + usageComboViewer.setSelection( new StructuredSelection( Messages + .getString( "NewAttributeTypeContentWizardPage.UserApplications" ) ) ); //$NON-NLS-1$ // Syntax Group Group syntaxGroup = new Group( composite, SWT.NONE ); - syntaxGroup.setText( "Syntax" ); + syntaxGroup.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Syntax" ) ); //$NON-NLS-1$ syntaxGroup.setLayout( new GridLayout( 2, false ) ); syntaxGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Syntax Label syntaxLabel = new Label( syntaxGroup, SWT.NONE ); - syntaxLabel.setText( "Syntax:" ); + syntaxLabel.setText( Messages.getString( "NewAttributeTypeContentWizardPage.SyntaxColon" ) ); //$NON-NLS-1$ Combo syntaxCombo = new Combo( syntaxGroup, SWT.READ_ONLY ); syntaxCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); syntaxComboViewer = new ComboViewer( syntaxCombo ); @@ -185,11 +183,15 @@ String name = syntax.getName(); if ( name != null ) { - return name + " - (" + syntax.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewAttributeTypeContentWizardPage.NameOID" ), new String[] { name, syntax.getOid() } ); //$NON-NLS-1$ } else { - return "(None) - (" + syntax.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewAttributeTypeContentWizardPage.NoneOID" ), new String[] { syntax.getOid() } ); //$NON-NLS-1$ } } @@ -199,7 +201,7 @@ // Syntax Length Label lengthLabel = new Label( syntaxGroup, SWT.NONE ); - lengthLabel.setText( "Length:" ); + lengthLabel.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Length" ) ); //$NON-NLS-1$ lengthSpinner = new Spinner( syntaxGroup, SWT.BORDER ); lengthSpinner.setIncrement( 1 ); lengthSpinner.setMinimum( 0 ); @@ -210,29 +212,30 @@ // Properties Group Group propertiesGroup = new Group( composite, SWT.NONE ); - propertiesGroup.setText( "Properties" ); + propertiesGroup.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Properties" ) ); //$NON-NLS-1$ propertiesGroup.setLayout( new GridLayout() ); propertiesGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Obsolete new Label( composite, SWT.NONE ); obsoleteCheckbox = new Button( propertiesGroup, SWT.CHECK ); - obsoleteCheckbox.setText( "Obsolete" ); + obsoleteCheckbox.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Obsolete" ) ); //$NON-NLS-1$ // Single value new Label( composite, SWT.NONE ); singleValueCheckbox = new Button( propertiesGroup, SWT.CHECK ); - singleValueCheckbox.setText( "Single Value" ); + singleValueCheckbox.setText( Messages.getString( "NewAttributeTypeContentWizardPage.SingleValue" ) ); //$NON-NLS-1$ // Collective new Label( composite, SWT.NONE ); collectiveCheckbox = new Button( propertiesGroup, SWT.CHECK ); - collectiveCheckbox.setText( "Collective" ); + collectiveCheckbox.setText( Messages.getString( "NewAttributeTypeContentWizardPage.Collective" ) ); //$NON-NLS-1$ // No User Modification new Label( composite, SWT.NONE ); noUserModificationCheckbox = new Button( propertiesGroup, SWT.CHECK ); - noUserModificationCheckbox.setText( "No User Modification" ); + noUserModificationCheckbox + .setText( Messages.getString( "NewAttributeTypeContentWizardPage.NoUserModifcation" ) ); //$NON-NLS-1$ initFields(); @@ -251,7 +254,7 @@ // Getting the syntaxes List syntaxes = new ArrayList( schemaHandler.getSyntaxes() ); // Adding the (None) Syntax - String none = "(None)"; + String none = Messages.getString( "NewAttributeTypeContentWizardPage.None" ); //$NON-NLS-1$ syntaxes.add( none ); // Sorting the syntaxes @@ -273,11 +276,11 @@ } else if ( ( o1Names.length == 0 ) && ( o2Names.length > 0 ) ) { - return "".compareToIgnoreCase( o2Names[0] ); + return "".compareToIgnoreCase( o2Names[0] ); //$NON-NLS-1$ } else if ( ( o1Names.length > 0 ) && ( o2Names.length == 0 ) ) { - return o1Names[0].compareToIgnoreCase( "" ); + return o1Names[0].compareToIgnoreCase( "" ); //$NON-NLS-1$ } } } @@ -308,11 +311,12 @@ private void verifySuperior() { String superior = superiorText.getText(); - if ( ( superior != null ) && ( !superior.equals( "" ) ) ) + if ( ( superior != null ) && ( !superior.equals( "" ) ) ) //$NON-NLS-1$ { if ( schemaHandler.getAttributeType( superiorText.getText() ) == null ) { - displayErrorMessage( "The superior attribute type does not exist." ); + displayErrorMessage( Messages + .getString( "NewAttributeTypeContentWizardPage.ErrorSuperiorAttributeTypeNotExists" ) ); //$NON-NLS-1$ return; } } @@ -330,7 +334,7 @@ public String getSuperiorValue() { String superior = superiorText.getText(); - if ( ( superior != null ) && ( !superior.equals( "" ) ) ) + if ( ( superior != null ) && ( !superior.equals( "" ) ) ) //$NON-NLS-1$ { return superior; } @@ -353,19 +357,20 @@ if ( !selection.isEmpty() ) { String selectedUsage = ( String ) selection.getFirstElement(); - if ( selectedUsage.equals( DIRECTORY_OPERATION ) ) + if ( selectedUsage.equals( Messages.getString( "NewAttributeTypeContentWizardPage.DirectoryOperation" ) ) ) //$NON-NLS-1$ { return UsageEnum.DIRECTORY_OPERATION; } - else if ( selectedUsage.equals( DISTRIBUTED_OPERATION ) ) + else if ( selectedUsage.equals( Messages + .getString( "NewAttributeTypeContentWizardPage.DistributedOperation" ) ) ) //$NON-NLS-1$ { return UsageEnum.DISTRIBUTED_OPERATION; } - else if ( selectedUsage.equals( DSA_OPERATION ) ) + else if ( selectedUsage.equals( Messages.getString( "NewAttributeTypeContentWizardPage.DSAOperation" ) ) ) //$NON-NLS-1$ { return UsageEnum.DSA_OPERATION; } - else if ( selectedUsage.equals( USER_APPLICATIONS ) ) + else if ( selectedUsage.equals( Messages.getString( "NewAttributeTypeContentWizardPage.UserApplications" ) ) ) //$NON-NLS-1$ { return UsageEnum.USER_APPLICATIONS; } Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java Thu Nov 27 00:41:48 2008 @@ -43,6 +43,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; @@ -93,9 +94,9 @@ */ protected NewAttributeTypeGeneralWizardPage() { - super( "NewAttributeTypeGeneralWizardPage" ); - setTitle( "Attribute Type" ); - setDescription( "Create a new attribute type." ); + super( "NewAttributeTypeGeneralWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "NewAttributeTypeGeneralWizardPage.AttributeType" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "NewAttributeTypeGeneralWizardPage.CreateNewAttributeType" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_ATTRIBUTE_TYPE_NEW_WIZARD ) ); schemaHandler = Activator.getDefault().getSchemaHandler(); @@ -114,13 +115,13 @@ // Schema Group Group schemaGroup = new Group( composite, SWT.NONE ); - schemaGroup.setText( "Schema" ); + schemaGroup.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.Schema" ) ); //$NON-NLS-1$ schemaGroup.setLayout( new GridLayout( 2, false ) ); schemaGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Schema Label schemaLabel = new Label( schemaGroup, SWT.NONE ); - schemaLabel.setText( "Schema:" ); + schemaLabel.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.SchemaColon" ) ); //$NON-NLS-1$ Combo schemaCombo = new Combo( schemaGroup, SWT.READ_ONLY ); schemaCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); schemaComboViewer = new ComboViewer( schemaCombo ); @@ -154,13 +155,13 @@ // Naming and Description Group Group namingDescriptionGroup = new Group( composite, SWT.NONE ); - namingDescriptionGroup.setText( "Naming and Description" ); + namingDescriptionGroup.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.NamingAndDescription" ) ); //$NON-NLS-1$ namingDescriptionGroup.setLayout( new GridLayout( 3, false ) ); namingDescriptionGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // OID Label oidLabel = new Label( namingDescriptionGroup, SWT.NONE ); - oidLabel.setText( "OID:" ); + oidLabel.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.OID" ) ); //$NON-NLS-1$ oidCombo = new Combo( namingDescriptionGroup, SWT.DROP_DOWN | SWT.BORDER ); oidCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) ); oidCombo.addModifyListener( new ModifyListener() @@ -190,7 +191,7 @@ // Aliases Label aliasesLabel = new Label( namingDescriptionGroup, SWT.NONE ); - aliasesLabel.setText( "Aliases:" ); + aliasesLabel.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.Aliases" ) ); //$NON-NLS-1$ aliasesText = new Text( namingDescriptionGroup, SWT.BORDER ); aliasesText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); aliasesText.addModifyListener( new ModifyListener() @@ -210,7 +211,7 @@ } } ); aliasesButton = new Button( namingDescriptionGroup, SWT.PUSH ); - aliasesButton.setText( "Edit..." ); + aliasesButton.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.Edit" ) ); //$NON-NLS-1$ aliasesButton.addSelectionListener( new SelectionAdapter() { /* (non-Javadoc) @@ -228,7 +229,7 @@ for ( String newAlias : newAliases ) { sb.append( newAlias ); - sb.append( ", " ); + sb.append( ", " ); //$NON-NLS-1$ } sb.deleteCharAt( sb.length() - 1 ); sb.deleteCharAt( sb.length() - 1 ); @@ -250,7 +251,7 @@ // Description Label descriptionLabel = new Label( namingDescriptionGroup, SWT.NONE ); - descriptionLabel.setText( "Description:" ); + descriptionLabel.setText( Messages.getString( "NewAttributeTypeGeneralWizardPage.Description" ) ); //$NON-NLS-1$ descriptionText = new Text( namingDescriptionGroup, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL ); GridData descriptionGridData = new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ); descriptionGridData.heightHint = 67; @@ -285,7 +286,7 @@ aliasesButton.setEnabled( false ); descriptionText.setEnabled( false ); - displayErrorMessage( "A schema project must be opened before adding a new attribute type." ); + displayErrorMessage( Messages.getString( "NewAttributeTypeGeneralWizardPage.ErrorNoSchemaProjectOpen" ) ); //$NON-NLS-1$ } else { @@ -322,28 +323,28 @@ { if ( schemaComboViewer.getSelection().isEmpty() ) { - displayErrorMessage( "A Schema must be specified." ); + displayErrorMessage( Messages.getString( "NewAttributeTypeGeneralWizardPage.ErrorNoSchemaSpecified" ) ); //$NON-NLS-1$ return; } - if ( oidCombo.getText().equals( "" ) ) + if ( oidCombo.getText().equals( "" ) ) //$NON-NLS-1$ { - displayErrorMessage( "An OID must be specified." ); + displayErrorMessage( Messages.getString( "NewAttributeTypeGeneralWizardPage.ErrorNoOIDSpecified" ) ); //$NON-NLS-1$ return; } - if ( ( !oidCombo.getText().equals( "" ) ) && ( !OID.isOID( oidCombo.getText() ) ) ) + if ( ( !oidCombo.getText().equals( "" ) ) && ( !OID.isOID( oidCombo.getText() ) ) ) //$NON-NLS-1$ { - displayErrorMessage( "Incorrect OID." ); + displayErrorMessage( Messages.getString( "NewAttributeTypeGeneralWizardPage.ErrorIncorrectOID" ) ); //$NON-NLS-1$ return; } - if ( ( !oidCombo.getText().equals( "" ) ) && ( OID.isOID( oidCombo.getText() ) ) + if ( ( !oidCombo.getText().equals( "" ) ) && ( OID.isOID( oidCombo.getText() ) ) //$NON-NLS-1$ && ( schemaHandler.isAliasOrOidAlreadyTaken( oidCombo.getText() ) ) ) { - displayErrorMessage( "An object with this OID already exists." ); + displayErrorMessage( Messages.getString( "NewAttributeTypeGeneralWizardPage.ErrorObjectOIDExists" ) ); //$NON-NLS-1$ return; } if ( aliases.size() == 0 ) { - displayWarningMessage( "The attribute type does not have any name. It is recommanded to add at least one name." ); + displayWarningMessage( Messages.getString( "NewAttributeTypeGeneralWizardPage.ErrorAttributeTypeNoName" ) ); //$NON-NLS-1$ return; } else @@ -352,14 +353,16 @@ { if ( alias instanceof AliasWithStartError ) { - displayErrorMessage( "The alias '" + alias + "' is invalid. Character '" - + ( ( AliasWithStartError ) alias ).getErrorChar() + "' is not allowed to start an alias." ); + displayErrorMessage( NLS + .bind( + Messages.getString( "NewAttributeTypeGeneralWizardPage.AliasStartInvalid" ), new Object[] { alias, ( ( AliasWithStartError ) alias ).getErrorChar() } ) ); //$NON-NLS-1$ return; } else if ( alias instanceof AliasWithPartError ) { - displayErrorMessage( "The alias '" + alias + "' is invalid. Character '" - + ( ( AliasWithPartError ) alias ).getErrorChar() + "' is not allowed as part of an alias." ); + displayErrorMessage( NLS + .bind( + Messages.getString( "NewAttributeTypeGeneralWizardPage.AliasPartInvalid" ), new Object[] { alias, ( ( AliasWithPartError ) alias ).getErrorChar() } ) ); //$NON-NLS-1$ return; } } @@ -379,7 +382,7 @@ for ( Alias alias : aliases ) { sb.append( alias ); - sb.append( ", " ); + sb.append( ", " ); //$NON-NLS-1$ } sb.deleteCharAt( sb.length() - 1 ); Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeMatchingRulesWizardPage.java Thu Nov 27 00:41:48 2008 @@ -34,6 +34,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -72,11 +73,15 @@ String name = mr.getName(); if ( name != null ) { - return name + " - (" + mr.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.NameOID" ), new String[] { name, mr.getOid() } ); //$NON-NLS-1$ } else { - return "(None) - (" + mr.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.NoneOID" ), new String[] { mr.getOid() } ); //$NON-NLS-1$ } } @@ -95,9 +100,9 @@ */ public NewAttributeTypeMatchingRulesWizardPage() { - super( "NewAttributeTypeMatchingRulesWizardPage" ); - setTitle( "Matching Rules" ); - setDescription( "Please specify the matching rules (equality, ordering and substring) to use for the attribute type." ); + super( "NewAttributeTypeMatchingRulesWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.MatchingRules" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.PleaseSpecifiyMatchingRules" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_ATTRIBUTE_TYPE_NEW_WIZARD ) ); schemaHandler = Activator.getDefault().getSchemaHandler(); @@ -115,13 +120,13 @@ // Matching Rules Group Group matchingRulesGroup = new Group( composite, SWT.NONE ); - matchingRulesGroup.setText( "Matching Rules" ); + matchingRulesGroup.setText( Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.MatchingRules" ) ); //$NON-NLS-1$ matchingRulesGroup.setLayout( new GridLayout( 2, false ) ); matchingRulesGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 3, 1 ) ); // Equality Label equalityLabel = new Label( matchingRulesGroup, SWT.NONE ); - equalityLabel.setText( "Equality:" ); + equalityLabel.setText( Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.Equality" ) ); //$NON-NLS-1$ Combo equalityCombo = new Combo( matchingRulesGroup, SWT.READ_ONLY ); equalityCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); equalityComboViewer = new ComboViewer( equalityCombo ); @@ -130,7 +135,7 @@ // Ordering Label orderingLabel = new Label( matchingRulesGroup, SWT.NONE ); - orderingLabel.setText( "Ordering:" ); + orderingLabel.setText( Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.Ordering" ) ); //$NON-NLS-1$ Combo orderingCombo = new Combo( matchingRulesGroup, SWT.READ_ONLY ); orderingCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); orderingComboViewer = new ComboViewer( orderingCombo ); @@ -139,7 +144,7 @@ // Substring Label substringLabel = new Label( matchingRulesGroup, SWT.NONE ); - substringLabel.setText( "Substring:" ); + substringLabel.setText( Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.Substring" ) ); //$NON-NLS-1$ Combo substringCombo = new Combo( matchingRulesGroup, SWT.READ_ONLY ); substringCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); substringComboViewer = new ComboViewer( substringCombo ); @@ -163,7 +168,7 @@ // Getting the matching rules List matchingRules = new ArrayList( schemaHandler.getMatchingRules() ); // Adding the (None) matching rule - String none = "(None)"; + String none = Messages.getString( "NewAttributeTypeMatchingRulesWizardPage.None" ); //$NON-NLS-1$ matchingRules.add( none ); // Sorting the matching rules @@ -186,11 +191,11 @@ } else if ( ( o1Names.length == 0 ) && ( o2Names.length > 0 ) ) { - return "".compareToIgnoreCase( o2Names[0] ); + return "".compareToIgnoreCase( o2Names[0] ); //$NON-NLS-1$ } else if ( ( o1Names.length > 0 ) && ( o2Names.length == 0 ) ) { - return o1Names[0].compareToIgnoreCase( "" ); + return o1Names[0].compareToIgnoreCase( "" ); //$NON-NLS-1$ } } else if ( ( o1 instanceof String ) && ( o2 instanceof MatchingRuleImpl ) ) Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassContentWizardPage.java Thu Nov 27 00:41:48 2008 @@ -39,6 +39,7 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -84,9 +85,9 @@ */ protected NewObjectClassContentWizardPage() { - super( "NewObjectClassContentWizardPage" ); - setTitle( "Object Class Content" ); - setDescription( "Please enter the superiors, class type and properties for the object class." ); + super( "NewObjectClassContentWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "NewObjectClassContentWizardPage.ObjectClassContent" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "NewObjectClassContentWizardPage.EnterObjectClassContent" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_OBJECT_CLASS_NEW_WIZARD ) ); superiorsList = new ArrayList(); } @@ -103,7 +104,7 @@ // Superiors Group superiorsGroup = new Group( composite, SWT.NONE ); - superiorsGroup.setText( "Superiors" ); + superiorsGroup.setText( Messages.getString( "NewObjectClassContentWizardPage.3" ) ); //$NON-NLS-1$ superiorsGroup.setLayout( new GridLayout( 2, false ) ); superiorsGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); @@ -136,11 +137,15 @@ String[] names = oc.getNamesRef(); if ( ( names != null ) && ( names.length > 0 ) ) { - return ViewUtils.concateAliases( names ) + " - (" + oc.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewObjectClassContentWizardPage.AliasOID" ), new String[] { ViewUtils.concateAliases( names ), oc.getOid() } ); //$NON-NLS-1$ } else { - return "(None) - (" + oc.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewObjectClassContentWizardPage.NoneOID" ), new String[] { oc.getOid() } ); //$NON-NLS-1$ } } // Default @@ -157,7 +162,7 @@ } } ); superiorsAddButton = new Button( superiorsGroup, SWT.PUSH ); - superiorsAddButton.setText( "Add..." ); + superiorsAddButton.setText( Messages.getString( "NewObjectClassContentWizardPage.Add" ) ); //$NON-NLS-1$ superiorsAddButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) ); superiorsAddButton.addSelectionListener( new SelectionAdapter() { @@ -167,7 +172,7 @@ } } ); superiorsRemoveButton = new Button( superiorsGroup, SWT.PUSH ); - superiorsRemoveButton.setText( "Remove" ); + superiorsRemoveButton.setText( Messages.getString( "NewObjectClassContentWizardPage.Remove" ) ); //$NON-NLS-1$ superiorsRemoveButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) ); superiorsRemoveButton.setEnabled( false ); superiorsRemoveButton.addSelectionListener( new SelectionAdapter() @@ -180,16 +185,16 @@ // Class Type Group Group classTypeGroup = new Group( composite, SWT.NONE ); - classTypeGroup.setText( "Class Type" ); + classTypeGroup.setText( Messages.getString( "NewObjectClassContentWizardPage.ClassType" ) ); //$NON-NLS-1$ classTypeGroup.setLayout( new GridLayout( 5, false ) ); classTypeGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Class Type Label classTypeLable = new Label( classTypeGroup, SWT.NONE ); - classTypeLable.setText( "Class Type:" ); - new Label( classTypeGroup, SWT.NONE ).setText( " " ); + classTypeLable.setText( Messages.getString( "NewObjectClassContentWizardPage.ClassTypeColon" ) ); //$NON-NLS-1$ + new Label( classTypeGroup, SWT.NONE ).setText( " " ); //$NON-NLS-1$ structuralRadio = new Button( classTypeGroup, SWT.RADIO ); - structuralRadio.setText( "Structural" ); + structuralRadio.setText( Messages.getString( "NewObjectClassContentWizardPage.Structural" ) ); //$NON-NLS-1$ GridData structuralRadioGridData = new GridData( SWT.LEFT, SWT.NONE, false, false ); structuralRadioGridData.widthHint = 115; structuralRadio.setLayoutData( structuralRadioGridData ); @@ -202,7 +207,7 @@ } ); structuralRadio.setSelection( true ); abstractRadio = new Button( classTypeGroup, SWT.RADIO ); - abstractRadio.setText( "Abstract" ); + abstractRadio.setText( Messages.getString( "NewObjectClassContentWizardPage.Abstract" ) ); //$NON-NLS-1$ GridData abstractRadioGridData = new GridData( SWT.LEFT, SWT.NONE, false, false ); abstractRadioGridData.widthHint = 115; abstractRadio.setLayoutData( structuralRadioGridData ); @@ -214,7 +219,7 @@ } } ); auxiliaryRadio = new Button( classTypeGroup, SWT.RADIO ); - auxiliaryRadio.setText( "Auxiliary" ); + auxiliaryRadio.setText( Messages.getString( "NewObjectClassContentWizardPage.Auxiliary" ) ); //$NON-NLS-1$ GridData auxiliaryRadioGridData = new GridData( SWT.LEFT, SWT.NONE, false, false ); auxiliaryRadioGridData.widthHint = 115; auxiliaryRadio.setLayoutData( structuralRadioGridData ); @@ -228,13 +233,13 @@ // Properties Group Group propertiesGroup = new Group( composite, SWT.NONE ); - propertiesGroup.setText( "Properties" ); + propertiesGroup.setText( Messages.getString( "NewObjectClassContentWizardPage.Properties" ) ); //$NON-NLS-1$ propertiesGroup.setLayout( new GridLayout() ); propertiesGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Obsolete obsoleteCheckbox = new Button( propertiesGroup, SWT.CHECK ); - obsoleteCheckbox.setText( "Obsolete" ); + obsoleteCheckbox.setText( Messages.getString( "NewObjectClassContentWizardPage.Obsolete" ) ); //$NON-NLS-1$ setControl( composite ); } Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java Thu Nov 27 00:41:48 2008 @@ -43,6 +43,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; @@ -93,9 +94,9 @@ */ protected NewObjectClassGeneralPageWizardPage() { - super( "NewObjectClassGeneralPageWizardPage" ); - setTitle( "Object Class" ); - setDescription( "Create a new object class." ); + super( "NewObjectClassGeneralPageWizardPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "NewObjectClassGeneralPageWizardPage.ObjectClass" ) ); //$NON-NLS-1$ + setDescription( Messages.getString( "NewObjectClassGeneralPageWizardPage.CreateObjectClass" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_OBJECT_CLASS_NEW_WIZARD ) ); schemaHandler = Activator.getDefault().getSchemaHandler(); @@ -114,13 +115,13 @@ // Schema Group Group schemaGroup = new Group( composite, SWT.NONE ); - schemaGroup.setText( "Schema" ); + schemaGroup.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.Schema" ) ); //$NON-NLS-1$ schemaGroup.setLayout( new GridLayout( 2, false ) ); schemaGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // Schema Label schemaLabel = new Label( schemaGroup, SWT.NONE ); - schemaLabel.setText( "Schema:" ); + schemaLabel.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.SchemaColon" ) ); //$NON-NLS-1$ Combo schemaCombo = new Combo( schemaGroup, SWT.READ_ONLY ); schemaCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); schemaComboViewer = new ComboViewer( schemaCombo ); @@ -154,13 +155,14 @@ // Naming and Description Group Group namingDescriptionGroup = new Group( composite, SWT.NONE ); - namingDescriptionGroup.setText( "Naming and Description" ); + namingDescriptionGroup + .setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.NamingAndDescription" ) ); //$NON-NLS-1$ namingDescriptionGroup.setLayout( new GridLayout( 3, false ) ); namingDescriptionGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); // OID Label oidLabel = new Label( namingDescriptionGroup, SWT.NONE ); - oidLabel.setText( "OID:" ); + oidLabel.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.OID" ) ); //$NON-NLS-1$ oidCombo = new Combo( namingDescriptionGroup, SWT.DROP_DOWN | SWT.BORDER ); oidCombo.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) ); oidCombo.addModifyListener( new ModifyListener() @@ -190,7 +192,7 @@ // Aliases Label aliasesLabel = new Label( namingDescriptionGroup, SWT.NONE ); - aliasesLabel.setText( "Aliases:" ); + aliasesLabel.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.Aliases" ) ); //$NON-NLS-1$ aliasesText = new Text( namingDescriptionGroup, SWT.BORDER ); aliasesText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); aliasesText.addModifyListener( new ModifyListener() @@ -210,7 +212,7 @@ } } ); aliasesButton = new Button( namingDescriptionGroup, SWT.PUSH ); - aliasesButton.setText( "Edit..." ); + aliasesButton.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.Edit" ) ); //$NON-NLS-1$ aliasesButton.addSelectionListener( new SelectionAdapter() { /* (non-Javadoc) @@ -228,7 +230,7 @@ for ( String newAlias : newAliases ) { sb.append( newAlias ); - sb.append( ", " ); + sb.append( ", " ); //$NON-NLS-1$ } sb.deleteCharAt( sb.length() - 1 ); sb.deleteCharAt( sb.length() - 1 ); @@ -250,7 +252,7 @@ // Description Label descriptionLabel = new Label( namingDescriptionGroup, SWT.NONE ); - descriptionLabel.setText( "Description:" ); + descriptionLabel.setText( Messages.getString( "NewObjectClassGeneralPageWizardPage.Description" ) ); //$NON-NLS-1$ descriptionText = new Text( namingDescriptionGroup, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL ); GridData descriptionGridData = new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ); descriptionGridData.heightHint = 67; @@ -285,7 +287,7 @@ aliasesButton.setEnabled( false ); descriptionText.setEnabled( false ); - displayErrorMessage( "A schema project must be opened before adding a new object class." ); + displayErrorMessage( Messages.getString( "NewObjectClassGeneralPageWizardPage.ErrorNoSchemaProjectOpen" ) ); //$NON-NLS-1$ } else { @@ -322,28 +324,28 @@ { if ( schemaComboViewer.getSelection().isEmpty() ) { - displayErrorMessage( "A Schema must be specified." ); + displayErrorMessage( Messages.getString( "NewObjectClassGeneralPageWizardPage.ErrorNoSchemaSpecified" ) ); //$NON-NLS-1$ return; } - if ( oidCombo.getText().equals( "" ) ) + if ( oidCombo.getText().equals( "" ) ) //$NON-NLS-1$ { - displayErrorMessage( "An OID must be specified." ); + displayErrorMessage( Messages.getString( "NewObjectClassGeneralPageWizardPage.ErrorNoOIDSpecified" ) ); //$NON-NLS-1$ return; } - if ( ( !oidCombo.getText().equals( "" ) ) && ( !OID.isOID( oidCombo.getText() ) ) ) + if ( ( !oidCombo.getText().equals( "" ) ) && ( !OID.isOID( oidCombo.getText() ) ) ) //$NON-NLS-1$ { - displayErrorMessage( "Incorrect OID." ); + displayErrorMessage( Messages.getString( "NewObjectClassGeneralPageWizardPage.ErrorIncorrectOID" ) ); //$NON-NLS-1$ return; } - if ( ( !oidCombo.getText().equals( "" ) ) && ( OID.isOID( oidCombo.getText() ) ) + if ( ( !oidCombo.getText().equals( "" ) ) && ( OID.isOID( oidCombo.getText() ) ) //$NON-NLS-1$ && ( schemaHandler.isAliasOrOidAlreadyTaken( oidCombo.getText() ) ) ) { - displayErrorMessage( "An object with this OID already exists." ); + displayErrorMessage( Messages.getString( "NewObjectClassGeneralPageWizardPage.ErrorObjectOIDExists" ) ); //$NON-NLS-1$ return; } if ( aliases.size() == 0 ) { - displayWarningMessage( "The attribute type does not have any name. It is recommanded to add at least one name." ); + displayWarningMessage( Messages.getString( "NewObjectClassGeneralPageWizardPage.ErrorAttributeTypeNoName" ) ); //$NON-NLS-1$ return; } else @@ -352,14 +354,16 @@ { if ( alias instanceof AliasWithStartError ) { - displayErrorMessage( "The alias '" + alias + "' is invalid. Character '" - + ( ( AliasWithStartError ) alias ).getErrorChar() + "' is not allowed to start an alias." ); + displayErrorMessage( NLS + .bind( + Messages.getString( "NewObjectClassGeneralPageWizardPage.AliasStartInvalid" ), new Object[] { alias, ( ( AliasWithStartError ) alias ).getErrorChar() } ) ); //$NON-NLS-1$ return; } else if ( alias instanceof AliasWithPartError ) { - displayErrorMessage( "The alias '" + alias + "' is invalid. Character '" - + ( ( AliasWithPartError ) alias ).getErrorChar() + "' is not allowed as part of an alias." ); + displayErrorMessage( NLS + .bind( + Messages.getString( "NewObjectClassGeneralPageWizardPage.AliasPartInvalid" ), new Object[] { alias, ( ( AliasWithPartError ) alias ).getErrorChar() } ) ); //$NON-NLS-1$ return; } } @@ -379,7 +383,7 @@ for ( Alias alias : aliases ) { sb.append( alias ); - sb.append( ", " ); + sb.append( ", " ); //$NON-NLS-1$ } sb.deleteCharAt( sb.length() - 1 ); Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassMandatoryAttributesPage.java Thu Nov 27 00:41:48 2008 @@ -38,6 +38,7 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -74,9 +75,10 @@ */ protected NewObjectClassMandatoryAttributesPage() { - super( "NewObjectClassMandatoryAttributesPage" ); - setTitle( "Mandatory Attribute Types" ); - setDescription( "Please specify the mandatory attribute types for the object class." ); + super( "NewObjectClassMandatoryAttributesPage" ); //$NON-NLS-1$ + setTitle( Messages.getString( "NewObjectClassMandatoryAttributesPage.MandatoryAttributeTypes" ) ); //$NON-NLS-1$ + setDescription( Messages + .getString( "NewObjectClassMandatoryAttributesPage.SpecifiyMandatoryAttributeTypeForObjectClass" ) ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_OBJECT_CLASS_NEW_WIZARD ) ); mandatoryAttributeTypesList = new ArrayList(); } @@ -93,7 +95,8 @@ // Mandatory Attribute Types Group Group mandatoryAttributeTypesGroup = new Group( composite, SWT.NONE ); - mandatoryAttributeTypesGroup.setText( "Mandatory Attribute Types" ); + mandatoryAttributeTypesGroup.setText( Messages + .getString( "NewObjectClassMandatoryAttributesPage.MandatoryAttributeTypes" ) ); //$NON-NLS-1$ mandatoryAttributeTypesGroup.setLayout( new GridLayout( 2, false ) ); mandatoryAttributeTypesGroup.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) ); @@ -127,11 +130,15 @@ String[] names = at.getNamesRef(); if ( ( names != null ) && ( names.length > 0 ) ) { - return ViewUtils.concateAliases( names ) + " - (" + at.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewObjectClassMandatoryAttributesPage.AliasOID" ), new String[] { ViewUtils.concateAliases( names ), at.getOid() } ); //$NON-NLS-1$ } else { - return "(None) - (" + at.getOid() + ")"; + return NLS + .bind( + Messages.getString( "NewObjectClassMandatoryAttributesPage.NoneOID" ), new String[] { at.getOid() } ); //$NON-NLS-1$ } } // Default @@ -147,7 +154,7 @@ } } ); mandatoryAttributeTypesAddButton = new Button( mandatoryAttributeTypesGroup, SWT.PUSH ); - mandatoryAttributeTypesAddButton.setText( "Add..." ); + mandatoryAttributeTypesAddButton.setText( Messages.getString( "NewObjectClassMandatoryAttributesPage.Add" ) ); //$NON-NLS-1$ mandatoryAttributeTypesAddButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) ); mandatoryAttributeTypesAddButton.addSelectionListener( new SelectionAdapter() { @@ -157,7 +164,8 @@ } } ); mandatoryAttributeTypesRemoveButton = new Button( mandatoryAttributeTypesGroup, SWT.PUSH ); - mandatoryAttributeTypesRemoveButton.setText( "Remove" ); + mandatoryAttributeTypesRemoveButton.setText( Messages + .getString( "NewObjectClassMandatoryAttributesPage.Remove" ) ); //$NON-NLS-1$ mandatoryAttributeTypesRemoveButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) ); mandatoryAttributeTypesRemoveButton.addSelectionListener( new SelectionAdapter() { Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java?rev=721120&r1=721119&r2=721120&view=diff ============================================================================== --- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java (original) +++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassOptionalAttributesPage.java Thu Nov 27 00:41:48 2008 @@ -38,6 +38,7 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -74,9 +75,9 @@ */ protected NewObjectClassOptionalAttributesPage() { - super( "NewObjectClassOptionalAttributesPage" ); - setTitle( "Optional Attribute Types" ); - setDescription( "Please specify the optional attribute types for the object class." ); + super( "NewObjectClassOptionalAttributesPage" ); //$NON-NLS-1$ + setTitle( Messages.getString("NewObjectClassOptionalAttributesPage.OptionalAttributeTypes") ); //$NON-NLS-1$ + setDescription( Messages.getString("NewObjectClassOptionalAttributesPage.SpecifiyOptionalAttributeTypesForObjectClass") ); //$NON-NLS-1$ setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_OBJECT_CLASS_NEW_WIZARD ) ); optionalAttributeTypesList = new ArrayList(); } @@ -93,7 +94,7 @@ // Optional Attribute Types Group Group optionalAttributeTypesGroup = new Group( composite, SWT.NONE ); - optionalAttributeTypesGroup.setText( "Optional Attribute Types" ); + optionalAttributeTypesGroup.setText( Messages.getString("NewObjectClassOptionalAttributesPage.OptionalAttributeTypes") ); //$NON-NLS-1$ optionalAttributeTypesGroup.setLayout( new GridLayout( 2, false ) ); optionalAttributeTypesGroup.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) ); @@ -127,11 +128,11 @@ String[] names = at.getNamesRef(); if ( ( names != null ) && ( names.length > 0 ) ) { - return ViewUtils.concateAliases( names ) + " - (" + at.getOid() + ")"; + return NLS.bind( Messages.getString("NewObjectClassOptionalAttributesPage.AliasOID"), new String[]{ViewUtils.concateAliases( names ), at.getOid()}); //$NON-NLS-1$ } else { - return "(None) - (" + at.getOid() + ")"; + return NLS.bind( Messages.getString("NewObjectClassOptionalAttributesPage.NoneOID"), new String[]{ at.getOid()}); //$NON-NLS-1$ } } // Default @@ -147,7 +148,7 @@ } } ); optionalAttributeTypesAddButton = new Button( optionalAttributeTypesGroup, SWT.PUSH ); - optionalAttributeTypesAddButton.setText( "Add..." ); + optionalAttributeTypesAddButton.setText( Messages.getString("NewObjectClassOptionalAttributesPage.Add") ); //$NON-NLS-1$ optionalAttributeTypesAddButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) ); optionalAttributeTypesAddButton.addSelectionListener( new SelectionAdapter() { @@ -157,7 +158,7 @@ } } ); optionalAttributeTypesRemoveButton = new Button( optionalAttributeTypesGroup, SWT.PUSH ); - optionalAttributeTypesRemoveButton.setText( "Remove" ); + optionalAttributeTypesRemoveButton.setText( Messages.getString("NewObjectClassOptionalAttributesPage.Remove") ); //$NON-NLS-1$ optionalAttributeTypesRemoveButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) ); optionalAttributeTypesRemoveButton.addSelectionListener( new SelectionAdapter() {