Minor code cleanup.
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/AddDirectoryDialog.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/AddDirectoryDialog.java index 94dcc4b..cd4cd0d 100644 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/AddDirectoryDialog.java +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/AddDirectoryDialog.java
@@ -42,7 +42,7 @@ * @param project the project whose properties the user is modifying. */ public AddDirectoryDialog(Shell parent, IProject project) { - super(parent, includeDirectoryTitle); + super(parent, addDirectoryPath); } /** {@inheritDoc} */ @@ -54,7 +54,7 @@ Label label = new Label(cmpDialogArea, SWT.NONE); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); - label.setText(includeDirectoryPrompt); + label.setText(directory); txtPath = new Text(cmpDialogArea, SWT.BORDER); txtPath.setBackground(getColor(SWT.COLOR_WIDGET_BACKGROUND));
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/DirectorySelectionDialogs.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/DirectorySelectionDialogs.java index c8d3172..e978653 100644 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/DirectorySelectionDialogs.java +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/DirectorySelectionDialogs.java
@@ -9,14 +9,12 @@ package com.google.eclipse.protobuf.ui.preferences.paths; import static com.google.eclipse.protobuf.ui.ProtobufUiModule.PLUGIN_ID; -import static com.google.eclipse.protobuf.ui.swt.Messages.*; +import static com.google.eclipse.protobuf.ui.preferences.paths.Messages.*; import static org.eclipse.core.runtime.IStatus.ERROR; import static org.eclipse.core.runtime.Status.OK_STATUS; import static org.eclipse.jface.window.Window.OK; import static org.eclipse.ui.views.navigator.ResourceComparator.NAME; -import java.net.URI; - import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.swt.SWT; @@ -25,6 +23,8 @@ import org.eclipse.ui.model.*; import org.eclipse.ui.views.navigator.ResourceComparator; +import java.net.URI; + /** * Launchers for dialogs where users can select a directory (either in a workspace or the file system.) * @@ -56,8 +56,8 @@ return OK_STATUS; } }); - dialog.setTitle(browseWorkspaceFolderTitle); - dialog.setMessage(browseWorkspaceFolderPrompt); + dialog.setTitle(directorySelection); + dialog.setMessage(selectWorkspaceDirectory); if (dialog.open() != OK) return null; IResource resource = (IResource) dialog.getFirstResult(); if (resource == null) return null; @@ -67,7 +67,7 @@ static String showFileSystemFolderDialog(Shell shell, String filterPath) { DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN | SWT.APPLICATION_MODAL); if (filterPath != null && filterPath.trim().length() != 0) dialog.setFilterPath(filterPath); - dialog.setMessage(browseFileSystemFolderPrompt); + dialog.setMessage(selectFileSystemDirectory); return dialog.open(); }
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.java index db85828..3284f08 100644 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.java +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.java
@@ -16,20 +16,24 @@ public class Messages extends NLS { public static String add; + public static String addDirectoryPath; public static String browseFileSystem; public static String browseWorkspace; - public static String directoryNameInputMessage; - public static String directoryNameInputTitle; + public static String directory; + public static String directorySelection; public static String down; + public static String enterDirectoryName; + public static String errorElementIsNotDirectory; public static String errorEmptyDirectoryName; public static String errorNoDirectoryNames; public static String filesInMultipleDirectories; public static String filesInOneDirectoryOnly; public static String importedFilesPathResolution; - public static String includeDirectoryPrompt; - public static String includeDirectoryTitle; public static String isWorkspacePathCheck; + public static String pathResolution; public static String remove; + public static String selectFileSystemDirectory; + public static String selectWorkspaceDirectory; public static String up; static {
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.properties b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.properties index 841560d..450ed3d 100644 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.properties +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/paths/Messages.properties
@@ -1,16 +1,20 @@ add=&Add... +addDirectoryPath=Add directory path browseFileSystem=File system... browseWorkspace=Workspace... -directoryNameInputMessage=Enter directory name: -directoryNameInputTitle=Path Resolution +directory=Directory: +directorySelection=Directory selection down=Move Down +enterDirectoryName=Enter directory name: +errorElementIsNotDirectory=The selected element is not a directory. errorEmptyDirectoryName=The name of the directory should not be empty errorNoDirectoryNames=Enter the names of the directories filesInMultipleDirectories=Look for imported files in directories: filesInOneDirectoryOnly=One directory for all .proto files importedFilesPathResolution=Path resolution of imported files -includeDirectoryPrompt=Directory: -includeDirectoryTitle=Add directory path isWorkspacePathCheck=Is a workspace path +pathResolution=Path Resolution remove=&Remove +selectFileSystemDirectory=Select a directory from file system: +selectWorkspaceDirectory=Select a directory from workspace: up=Move Up
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/swt/Messages.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/swt/Messages.java deleted file mode 100644 index 19cfa69..0000000 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/swt/Messages.java +++ /dev/null
@@ -1,29 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse - * Public License v1.0 which accompanies this distribution, and is available at - * - * http://www.eclipse.org/legal/epl-v10.html - */ -package com.google.eclipse.protobuf.ui.swt; - -import org.eclipse.osgi.util.NLS; - -/** - * @author alruiz@google.com (Alex Ruiz) - */ -public class Messages extends NLS { - - public static String browseFileSystemFolderPrompt; - public static String browseWorkspaceFolderPrompt; - public static String browseWorkspaceFolderTitle; - public static String errorElementIsNotDirectory; - - static { - Class<Messages> targetType = Messages.class; - NLS.initializeMessages(targetType.getName(), targetType); - } - - private Messages() {} -}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/swt/Messages.properties b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/swt/Messages.properties deleted file mode 100644 index 5e80af3..0000000 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/swt/Messages.properties +++ /dev/null
@@ -1,4 +0,0 @@ -browseFileSystemFolderPrompt=Select a folder from file system: -browseWorkspaceFolderPrompt=Select a folder from workspace: -browseWorkspaceFolderTitle=Folder selection -errorElementIsNotDirectory=The selected element is not a directory.