Skip to content

Commit

Permalink
i18n and license header updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgbutler committed Aug 14, 2016
1 parent 2fa3eb0 commit 6a77034
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2006-2016 the original author or authors.
*
* Licensed 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.mybatis.generator.eclipse.ui.ant;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

public class Messages extends NLS {


public static String FILE_PICKER_BROWSE_FILE_SYSTEM;
public static String FILE_PICKER_BROWSE_WORKSPACE;
public static String FILE_PICKER_FILE_DOESNT_EXIST;
Expand All @@ -42,11 +41,16 @@ public class Messages extends NLS {
public static String SQL_SCRIPT_TAB_PASSWORD_LABEL;
public static String SQL_SCRIPT_TAB_JDBC_DRIVER_REQUIRED;
public static String SQL_SCRIPT_TAB_JDBC_URL_REQUIRED;
public static String SQL_SCRIPT_TAB_SECURE_STORAGE;

public static String LAUNCH_CONFIGURATION_SELECTOR_TITLE;
public static String LAUNCH_CONFIGURATION_SELECTOR_MESSAGE;
public static String LAUNCH_ERROR_ERROR_GENERATING_ANT_FILE;

public static String SECURE_STORAGE_ERROR_DIALOG_TITLE;
public static String SECURE_STORAGE_ERROR_DIALOG_MESSAGE;
public static String SECURE_STORAGE_ERROR_LOG_MESSAGE;

static {
NLS.initializeMessages("org.mybatis.generator.eclipse.ui.messages", Messages.class); //$NON-NLS-1$
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.mybatis.generator.eclipse.ui.Activator;
import org.mybatis.generator.eclipse.ui.Messages;
import org.mybatis.generator.eclipse.ui.launcher.GeneratorLaunchConstants;

public class LauncherUtils {
Expand Down Expand Up @@ -119,9 +120,10 @@ public static String getUserId(ILaunchConfiguration configuration) {

private static void logException(Shell shell, StorageException e) {
MessageDialog.openError(shell,
"Secure Storage Error",
"Error writing to secure storage. See error log for more details.");
Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, "Error writing to secure storage", e);
Messages.SECURE_STORAGE_ERROR_DIALOG_TITLE,
Messages.SECURE_STORAGE_ERROR_DIALOG_MESSAGE);
Status status = new Status(Status.ERROR, Activator.PLUGIN_ID,
Messages.SECURE_STORAGE_ERROR_LOG_MESSAGE, e);
Activator.getDefault().getLog().log(status);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void modifyText(ModifyEvent e) {
new Label(group, SWT.NONE);

btnSecureStorage = new Button(group, SWT.CHECK);
btnSecureStorage.setText("Store Credentials in Secure Storage");
btnSecureStorage.setText(Messages.SQL_SCRIPT_TAB_SECURE_STORAGE);
btnSecureStorage.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ SQL_SCRIPT_TAB_USERID_LABEL=User ID
SQL_SCRIPT_TAB_PASSWORD_LABEL=Password
SQL_SCRIPT_TAB_JDBC_DRIVER_REQUIRED=JDBC Driver Class is required if you specify a file name
SQL_SCRIPT_TAB_JDBC_URL_REQUIRED=JDBC connection URL is required if you specify a file name
SQL_SCRIPT_TAB_SECURE_STORAGE=Store Credentials in Secure Storage

LAUNCH_CONFIGURATION_SELECTOR_TITLE=Select a Launch Configuration
LAUNCH_CONFIGURATION_SELECTOR_MESSAGE=Select existing configuration:
LAUNCH_ERROR_ERROR_GENERATING_ANT_FILE=Exception generating Ant file

SECURE_STORAGE_ERROR_DIALOG_TITLE=Secure Storage Error
SECURE_STORAGE_ERROR_DIALOG_MESSAGE=Error writing to secure storage. See error log for more details.
SECURE_STORAGE_ERROR_LOG_MESSAGE=Error writing to secure storage
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@
import org.mybatis.generator.codegen.XmlConstants;
import org.mybatis.generator.eclipse.ui.Activator;

/**
* This is a sample new wizard. Its role is to create a new file resource in the
* provided container. If the container resource (a folder or a project) is
* selected in the workspace when the wizard is opened, it will accept it as the
* target container. The wizard creates one file with the extension "mpe". If a
* sample multi-page editor (also available as a template) is registered for the
* same extension, it will be able to open it.
*/

public class NewConfigFileWizard extends Wizard implements INewWizard {
private NewConfigFileWizardPage1 page;
private ISelection selection;
Expand All @@ -71,7 +62,6 @@ public NewConfigFileWizard() {
/**
* Adding the page to the wizard.
*/

public void addPages() {
page = new NewConfigFileWizardPage1(selection);
addPage(page);
Expand Down Expand Up @@ -114,7 +104,6 @@ public void run(IProgressMonitor monitor)
* or just replace its contents, and open the editor on the newly created
* file.
*/

private void doFinish(String containerName, String fileName,
IProgressMonitor monitor) throws CoreException {
// create a sample file
Expand Down Expand Up @@ -155,7 +144,6 @@ public void run() {
/**
* We will initialize file contents with a sample text.
*/

private InputStream openContentStream() {

Document document = new Document(XmlConstants.MYBATIS_GENERATOR_CONFIG_PUBLIC_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void initialize() {
locationText.setText(container.getFullPath().toString());
}
}
fileText.setText("generatorConfig.xml");
fileText.setText("generatorConfig.xml"); //$NON-NLS-1$
}

/**
Expand Down

0 comments on commit 6a77034

Please sign in to comment.