In progress: [ Issue 40 ] Add support for import resolution across multiple folders
https://code.google.com/p/protobuf-dt/issues/detail?id=40
Code cleanup.
diff --git a/com.google.eclipse.protobuf.ui/plugin.xml b/com.google.eclipse.protobuf.ui/plugin.xml
index 18843bf..dc50779 100644
--- a/com.google.eclipse.protobuf.ui/plugin.xml
+++ b/com.google.eclipse.protobuf.ui/plugin.xml
@@ -63,8 +63,8 @@
<keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" />
</page>
<page category="com.google.eclipse.protobuf.Protobuf"
- class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferencePage"
- id="com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferencePage" name="%page.name.2">
+ class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.compiler.PreferencePage"
+ id="com.google.eclipse.protobuf.ui.preferences.compiler.PreferencePage" name="%page.name.2">
<keywordReference id="com.google.eclipse.protobuf.ui.keyword_Protobuf" />
</page>
</extension>
@@ -161,8 +161,8 @@
</extension>
<extension point="org.eclipse.ui.propertyPages">
<page
- class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferencePage"
- id="com.google.eclipse.protobuf.ui.properties.compiler.CompilerPropertyPage" name="%page.name.3" selectionFilter="single">
+ class="com.google.eclipse.protobuf.ui.ProtobufExecutableExtensionFactory:com.google.eclipse.protobuf.ui.preferences.compiler.PreferencePage"
+ id="com.google.eclipse.protobuf.ui.properties.compiler.PropertyPage" name="%page.name.3" selectionFilter="single">
</page>
</extension>
<extension point="org.eclipse.xtext.builder.participant">
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/ProtobufUiModule.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/ProtobufUiModule.java
index 130f949..9c70ae4 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/ProtobufUiModule.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/ProtobufUiModule.java
@@ -17,7 +17,7 @@
import com.google.eclipse.protobuf.ui.builder.AutoAddNatureEditorCallback;
import com.google.eclipse.protobuf.ui.outline.LinkWithEditor;
import com.google.eclipse.protobuf.ui.outline.ProtobufOutlinePage;
-import com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferencesInitializer;
+import com.google.eclipse.protobuf.ui.preferences.compiler.PreferencesInitializer;
import com.google.inject.Binder;
import com.google.inject.name.Names;
@@ -50,7 +50,7 @@
public void configureCompilerPreferencesInitializer(Binder binder) {
binder.bind(IPreferenceStoreInitializer.class)
.annotatedWith(Names.named("compilerPreferences"))
- .to(CompilerPreferencesInitializer.class);
+ .to(PreferencesInitializer.class);
}
}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java
index 8b3d8e5..b14ce96 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.ui.builder;
-import static com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferences.loadPreferences;
+import static com.google.eclipse.protobuf.ui.preferences.compiler.Preferences.loadPreferences;
import static com.google.eclipse.protobuf.ui.preferences.compiler.RefreshTarget.PROJECT;
import static org.eclipse.core.resources.IResource.DEPTH_INFINITE;
@@ -24,8 +24,8 @@
import org.eclipse.xtext.resource.IResourceDescription.Delta;
import org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreAccess;
-import com.google.eclipse.protobuf.ui.preferences.*;
import com.google.eclipse.protobuf.ui.preferences.compiler.*;
+import com.google.eclipse.protobuf.ui.preferences.compiler.Preferences;
import com.google.inject.Inject;
/**
@@ -45,7 +45,7 @@
public void build(IBuildContext context, IProgressMonitor monitor) throws CoreException {
IProject project = context.getBuiltProject();
- CompilerPreferences preferences = loadPreferences(preferenceStoreAccess, project);
+ Preferences preferences = loadPreferences(preferenceStoreAccess, project);
if (!preferences.compileProtoFiles) return;
List<Delta> deltas = context.getDeltas();
if (deltas.isEmpty()) return;
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.java
index d471ac8..79f3b24 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.java
@@ -15,13 +15,13 @@
*/
public class Messages extends NLS {
+ public static String configureWorkspaceSettings;
+ public static String enableProjectSettings;
+
static {
Class<Messages> targetType = Messages.class;
NLS.initializeMessages(targetType.getName(), targetType);
}
-
+
private Messages() {}
-
- public static String BasePreferencePage_enableProjectSettings;
- public static String BasePreferencePage_configureWorkspaceSettings;
}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.properties b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.properties
index ac4b1f0..738c7e0 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.properties
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/Messages.properties
@@ -1,2 +1,2 @@
-BasePreferencePage_enableProjectSettings=Enable project specific settings
-BasePreferencePage_configureWorkspaceSettings=Configure Workspace Settings...
+configureWorkspaceSettings=Configure Workspace Settings...
+enableProjectSettings=Enable project specific settings
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/PreferenceAndPropertyPage.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/PreferenceAndPropertyPage.java
index 04481f4..ebae962 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/PreferenceAndPropertyPage.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/PreferenceAndPropertyPage.java
@@ -60,11 +60,11 @@
contents.setLayout(new GridLayout(3, false));
if (isPropertyPage()) {
btnEnableProjectSettings = new Button(contents, SWT.CHECK);
- btnEnableProjectSettings.setText(BasePreferencePage_enableProjectSettings);
+ btnEnableProjectSettings.setText(enableProjectSettings);
lnkEnableWorkspaceSettings = new Link(contents, SWT.NONE);
lnkEnableWorkspaceSettings.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
- lnkEnableWorkspaceSettings.setText("<a>" + BasePreferencePage_configureWorkspaceSettings + "</a>");
+ lnkEnableWorkspaceSettings.setText("<a>" + configureWorkspaceSettings + "</a>");
Label label = new Label(contents, SWT.SEPARATOR | SWT.HORIZONTAL);
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.java
index f3bbc98..e6dd638 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.java
@@ -15,31 +15,31 @@
*/
public class Messages extends NLS {
+ public static String browseCustomPath;
+ public static String compileOnSave;
+ public static String errorInvalidProtoc;
+ public static String errorNoOutputFolderName;
+ public static String errorNoSelection;
+ public static String generateCpp;
+ public static String generateCode;
+ public static String generateJava;
+ public static String generatePython;
+ public static String outputFolderChildOfProjectFolder;
+ public static String outputFolderName;
+ public static String protocInCustomPath;
+ public static String protocInSystemPath;
+ public static String protocLocation;
+ public static String refreshOutputProject;
+ public static String refreshProject;
+ public static String refreshResources;
+ public static String tabMain;
+ public static String tabRefresh;
+ public static String targetLanguage;
+
static {
Class<Messages> targetType = Messages.class;
NLS.initializeMessages(targetType.getName(), targetType);
}
-
- private Messages() {}
- public static String CompilerPreferencePage_mainTab;
- public static String CompilerPreferencePage_refreshTab;
- public static String CompilerPreferencePage_browseCustomPath;
- public static String CompilerPreferencePage_compileOnSave;
- public static String CompilerPreferencePage_customPath;
- public static String CompilerPreferencePage_location;
- public static String CompilerPreferencePage_systemPath;
- public static String CompilerPreferencePage_targetLanguage;
- public static String CompilerPreferencePage_generateJava;
- public static String CompilerPreferencePage_generateCpp;
- public static String CompilerPreferencePage_generatePython;
- public static String CompilerPreferencePage_generatedCode;
- public static String CompilerPreferencePage_outputFolderName;
- public static String CompilerPreferencePage_directChildOfProjectFolder;
- public static String CompilerPreferencePage_refreshResources;
- public static String CompilerPreferencePage_refreshProject;
- public static String CompilerPreferencePage_refreshOutputProject;
- public static String CompilerPreferencePage_error_noSelection;
- public static String CompilerPreferencePage_error_invalidProtoc;
- public static String CompilerPreferencePage_error_noOutputFolderName;
+ private Messages() {}
}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.properties b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.properties
index 55c47b6..59972f5 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.properties
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Messages.properties
@@ -1,21 +1,21 @@
-CompilerPreferencePage_mainTab=&Main
-CompilerPreferencePage_refreshTab=&Refresh
-CompilerPreferencePage_browseCustomPath=&Browse...
-CompilerPreferencePage_compileOnSave=Compile .proto files on &save
-CompilerPreferencePage_customPath=Use protoc &in:
-CompilerPreferencePage_location=Compiler location (protoc)
-CompilerPreferencePage_systemPath=Use protoc in &PATH
-CompilerPreferencePage_targetLanguage=Target Language
-CompilerPreferencePage_generateJava=&Java
-CompilerPreferencePage_generateCpp=&C++
-CompilerPreferencePage_generatePython=&Python
-CompilerPreferencePage_generatedCode=Generated Code
-CompilerPreferencePage_outputFolderName=Folder Name: *
-CompilerPreferencePage_directChildOfProjectFolder=* Direct child of project folder
-CompilerPreferencePage_refreshResources=Refresh resources upon completion.
-CompilerPreferencePage_refreshProject=Project
-CompilerPreferencePage_refreshOutputProject=Folder containing generated code
-CompilerPreferencePage_error_noSelection=Select the path of protoc
-CompilerPreferencePage_error_invalidProtoc=The selected file is not protoc
-CompilerPreferencePage_error_noOutputFolderName=Enter the name of the output folder
+browseCustomPath=&Browse...
+compileOnSave=Compile .proto files on &save
+errorInvalidProtoc=The selected file is not protoc
+errorNoSelection=Select the path of protoc
+errorNoOutputFolderName=Enter the name of the output folder
+generateCode=Generated Code
+generateCpp=&C++
+generateJava=&Java
+generatePython=&Python
+outputFolderChildOfProjectFolder=* Direct child of project folder
+outputFolderName=Folder Name: *
+protocInCustomPath=Use protoc &in:
+protocInSystemPath=Use protoc in &PATH
+protocLocation=Compiler location (protoc)
+refreshOutputProject=Folder containing generated code
+refreshProject=Project
+refreshResources=Refresh resources upon completion.
+tabMain=&Main
+tabRefresh=&Refresh
+targetLanguage=Target Language
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferenceNames.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferenceNames.java
similarity index 94%
rename from com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferenceNames.java
rename to com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferenceNames.java
index d6f6501..b18a066 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferenceNames.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferenceNames.java
@@ -11,7 +11,7 @@
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-final class CompilerPreferenceNames {
+final class PreferenceNames {
static final String ENABLE_PROJECT_SETTINGS = "compiler.enableProjectSettings";
static final String COMPILE_PROTO_FILES = "compiler.compileProtoFiles";
@@ -26,5 +26,5 @@
static final String REFRESH_PROJECT = "compiler.refreshProject";
static final String REFRESH_OUTPUT_FOLDER = "compiler.refreshOutputProject";
- private CompilerPreferenceNames() {}
+ private PreferenceNames() {}
}
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferencePage.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferencePage.java
similarity index 88%
rename from com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferencePage.java
rename to com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferencePage.java
index f629c4b..78dbdf7 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferencePage.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferencePage.java
@@ -8,8 +8,8 @@
*/
package com.google.eclipse.protobuf.ui.preferences.compiler;
-import static com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferenceNames.*;
import static com.google.eclipse.protobuf.ui.preferences.compiler.Messages.*;
+import static com.google.eclipse.protobuf.ui.preferences.compiler.PreferenceNames.*;
import static org.eclipse.core.resources.IResource.FOLDER;
import static org.eclipse.core.runtime.IStatus.OK;
@@ -35,9 +35,9 @@
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class CompilerPreferencePage extends PreferenceAndPropertyPage {
+public class PreferencePage extends PreferenceAndPropertyPage {
- private static final String PREFERENCE_PAGE_ID = CompilerPreferencePage.class.getName();
+ private static final String PREFERENCE_PAGE_ID = PreferencePage.class.getName();
private Button btnCompileProtoFiles;
private TabFolder tabFolder;
@@ -61,7 +61,7 @@
private Button btnRefreshOutputFolder;
private Label lblOutputFolderRelative;
- @Inject public CompilerPreferencePage(IPreferenceStoreAccess preferenceStoreAccess) {
+ @Inject public PreferencePage(IPreferenceStoreAccess preferenceStoreAccess) {
super(preferenceStoreAccess);
}
@@ -73,13 +73,13 @@
btnCompileProtoFiles = new Button(contents, SWT.CHECK);
btnCompileProtoFiles.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
- btnCompileProtoFiles.setText(CompilerPreferencePage_compileOnSave);
+ btnCompileProtoFiles.setText(compileOnSave);
tabFolder = new TabFolder(contents, SWT.NONE);
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
tbtmMain = new TabItem(tabFolder, SWT.NONE);
- tbtmMain.setText(CompilerPreferencePage_mainTab);
+ tbtmMain.setText(tabMain);
Composite cmpMain = new Composite(tabFolder, SWT.NONE);
tbtmMain.setControl(cmpMain);
@@ -88,58 +88,58 @@
grpCompilerLocation = new Group(cmpMain, SWT.NONE);
grpCompilerLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
grpCompilerLocation.setLayout(new GridLayout(4, false));
- grpCompilerLocation.setText(CompilerPreferencePage_location);
+ grpCompilerLocation.setText(protocLocation);
btnUseProtocInSystemPath = new Button(grpCompilerLocation, SWT.RADIO);
btnUseProtocInSystemPath.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));
- btnUseProtocInSystemPath.setText(CompilerPreferencePage_systemPath);
+ btnUseProtocInSystemPath.setText(protocInSystemPath);
btnUseProtocInCustomPath = new Button(grpCompilerLocation, SWT.RADIO);
btnUseProtocInCustomPath.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));
- btnUseProtocInCustomPath.setText(CompilerPreferencePage_customPath);
+ btnUseProtocInCustomPath.setText(protocInCustomPath);
txtProtocFilePath = new Text(grpCompilerLocation, SWT.BORDER);
txtProtocFilePath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
txtProtocFilePath.setEditable(false);
btnProtocPathBrowse = new Button(grpCompilerLocation, SWT.NONE);
- btnProtocPathBrowse.setText(CompilerPreferencePage_browseCustomPath);
+ btnProtocPathBrowse.setText(browseCustomPath);
new Label(grpCompilerLocation, SWT.NONE);
new Label(grpCompilerLocation, SWT.NONE);
grpTargetLanguage = new Group(cmpMain, SWT.NONE);
grpTargetLanguage.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
grpTargetLanguage.setLayout(new GridLayout(1, false));
- grpTargetLanguage.setText(CompilerPreferencePage_targetLanguage);
+ grpTargetLanguage.setText(targetLanguage);
btnJava = new Button(grpTargetLanguage, SWT.RADIO);
btnJava.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
- btnJava.setText(CompilerPreferencePage_generateJava);
+ btnJava.setText(generateJava);
btnCpp = new Button(grpTargetLanguage, SWT.RADIO);
btnCpp.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
- btnCpp.setText(CompilerPreferencePage_generateCpp);
+ btnCpp.setText(generateCpp);
btnPython = new Button(grpTargetLanguage, SWT.RADIO);
- btnPython.setText(CompilerPreferencePage_generatePython);
+ btnPython.setText(generatePython);
grpOutput = new Group(cmpMain, SWT.NONE);
grpOutput.setLayout(new GridLayout(2, false));
grpOutput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- grpOutput.setText(CompilerPreferencePage_generatedCode);
+ grpOutput.setText(generateCode);
lblOutputFolderName = new Label(grpOutput, SWT.NONE);
- lblOutputFolderName.setText(CompilerPreferencePage_outputFolderName);
+ lblOutputFolderName.setText(outputFolderName);
txtOutputFolderName = new Text(grpOutput, SWT.BORDER);
txtOutputFolderName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
lblOutputFolderRelative = new Label(grpOutput, SWT.NONE);
lblOutputFolderRelative.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
- lblOutputFolderRelative.setText(CompilerPreferencePage_directChildOfProjectFolder);
+ lblOutputFolderRelative.setText(outputFolderChildOfProjectFolder);
tbtmRefresh = new TabItem(tabFolder, SWT.NONE);
- tbtmRefresh.setText(CompilerPreferencePage_refreshTab);
+ tbtmRefresh.setText(tabRefresh);
Composite cmpRefresh = new Composite(tabFolder, SWT.NONE);
tbtmRefresh.setControl(cmpRefresh);
@@ -147,7 +147,7 @@
btnRefreshResources = new Button(cmpRefresh, SWT.CHECK);
btnRefreshResources.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- btnRefreshResources.setText(CompilerPreferencePage_refreshResources);
+ btnRefreshResources.setText(refreshResources);
grpRefresh = new Group(cmpRefresh, SWT.NONE);
grpRefresh.setLayout(new GridLayout(1, false));
@@ -155,11 +155,11 @@
btnRefreshProject = new Button(grpRefresh, SWT.RADIO);
btnRefreshProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- btnRefreshProject.setText(CompilerPreferencePage_refreshProject);
+ btnRefreshProject.setText(refreshProject);
btnRefreshOutputFolder = new Button(grpRefresh, SWT.RADIO);
btnRefreshOutputFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- btnRefreshOutputFolder.setText(CompilerPreferencePage_refreshOutputProject);
+ btnRefreshOutputFolder.setText(refreshOutputProject);
new Label(contents, SWT.NONE);
updateFromPreferenceStore();
@@ -236,13 +236,13 @@
}
private void checkState() {
- String outputFolderName = txtOutputFolderName.getText();
- if (outputFolderName == null || outputFolderName.length() == 0) {
- pageIsNowInvalid(CompilerPreferencePage_error_noOutputFolderName);
+ String folderName = txtOutputFolderName.getText();
+ if (folderName == null || folderName.length() == 0) {
+ pageIsNowInvalid(errorNoOutputFolderName);
return;
}
IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus validFolderName = workspace.validateName(outputFolderName, FOLDER);
+ IStatus validFolderName = workspace.validateName(folderName, FOLDER);
if (validFolderName.getCode() != OK) {
pageIsNowInvalid(validFolderName.getMessage());
return;
@@ -253,12 +253,12 @@
}
String text = txtProtocFilePath.getText();
if (text == null || text.length() == 0) {
- pageIsNowInvalid(CompilerPreferencePage_error_noSelection);
+ pageIsNowInvalid(errorNoSelection);
return;
}
File file = new File(text);
if (!file.isFile() || !"protoc".equals(file.getName())) {
- pageIsNowInvalid(CompilerPreferencePage_error_invalidProtoc);
+ pageIsNowInvalid(errorInvalidProtoc);
return;
}
pageIsNowValid();
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferences.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Preferences.java
similarity index 86%
rename from com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferences.java
rename to com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Preferences.java
index 46a6f3e..7aef536 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferences.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/Preferences.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.ui.preferences.compiler;
-import static com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferenceNames.*;
+import static com.google.eclipse.protobuf.ui.preferences.compiler.PreferenceNames.*;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -19,7 +19,7 @@
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class CompilerPreferences {
+public class Preferences {
public final boolean compileProtoFiles;
public final String protocPath;
@@ -28,14 +28,14 @@
public final boolean refreshResources;
public final RefreshTarget refreshTarget;
- public static CompilerPreferences loadPreferences(IPreferenceStoreAccess access, IProject project) {
+ public static Preferences loadPreferences(IPreferenceStoreAccess access, IProject project) {
IPreferenceStore store = access.getWritablePreferenceStore(project);
boolean useProjectPreferences = store.getBoolean(ENABLE_PROJECT_SETTINGS);
if (!useProjectPreferences) store = access.getWritablePreferenceStore();
- return new CompilerPreferences(store);
+ return new Preferences(store);
}
- private CompilerPreferences(IPreferenceStore store) {
+ private Preferences(IPreferenceStore store) {
compileProtoFiles = store.getBoolean(COMPILE_PROTO_FILES);
boolean useProtocInSystemPath = store.getBoolean(USE_PROTOC_IN_SYSTEM_PATH);
protocPath = (useProtocInSystemPath) ? "protoc" : store.getString(PROTOC_FILE_PATH);
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferencesInitializer.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferencesInitializer.java
similarity index 91%
rename from com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferencesInitializer.java
rename to com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferencesInitializer.java
index 0b23cd6..878aef0 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/CompilerPreferencesInitializer.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/PreferencesInitializer.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.ui.preferences.compiler;
-import static com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferenceNames.*;
+import static com.google.eclipse.protobuf.ui.preferences.compiler.PreferenceNames.*;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreAccess;
@@ -19,7 +19,7 @@
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class CompilerPreferencesInitializer implements IPreferenceStoreInitializer {
+public class PreferencesInitializer implements IPreferenceStoreInitializer {
/** {@inheritDoc} */
public void initialize(IPreferenceStoreAccess access) {
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/RefreshTarget.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/RefreshTarget.java
index 7f360e7..cbd7964 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/RefreshTarget.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/RefreshTarget.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.ui.preferences.compiler;
-import static com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferenceNames.REFRESH_PROJECT;
+import static com.google.eclipse.protobuf.ui.preferences.compiler.PreferenceNames.REFRESH_PROJECT;
import org.eclipse.jface.preference.IPreferenceStore;
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/TargetLanguage.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/TargetLanguage.java
index e71f964..d081eb1 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/TargetLanguage.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/compiler/TargetLanguage.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.ui.preferences.compiler;
-import static com.google.eclipse.protobuf.ui.preferences.compiler.CompilerPreferenceNames.*;
+import static com.google.eclipse.protobuf.ui.preferences.compiler.PreferenceNames.*;
import org.eclipse.jface.preference.IPreferenceStore;