Converted to use message bundles
diff --git a/org.eclipse.photran.ui.vpg/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.photran.ui.vpg/.settings/org.eclipse.jdt.core.prefs
index a9d3a0f..f258858 100644
--- a/org.eclipse.photran.ui.vpg/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.photran.ui.vpg/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu May 27 08:59:21 CDT 2010
+#Thu May 27 13:41:49 CDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -38,7 +38,7 @@
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/org.eclipse.photran.ui.vpg/OSGI-INF/l10n/bundle.properties b/org.eclipse.photran.ui.vpg/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..8f39672
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,56 @@
+#Properties file for org.eclipse.photran.ui.vpg
+category.name = Fortran Refactoring Commands
+command.name = Rename...
+command.name.0 = Extract Procedure...
+command.name.1 = Extract Local Variable...
+actionSet.description = Fortran Refactorings
+actionSet.label = Fortran Refactorings
+action.label = Re&name...
+action.label.0 = E&xtract Procedure...
+action.label.1 = Extract &Local Variable...
+page.name = Analysis/Refactoring
+category.description = Navigation
+category.name.0 = Navigation
+command.description = Open Declaration
+command.name.2 = Open Declaration
+actionSet.description.0 = Fortran Analysis Actions
+actionSet.label.0 = Fortran Analysis Actions
+action.label.2 = &Open Declaration
+action.label.3 = &Open Declaration
+extension.name = Fortran Search
+page.label = Fortran Search
+category.description.0 = Fortran Search
+category.name.1 = Fortran Search
+command.description.0 = Searches the workspace for all references to a Fortran identifier
+command.name.3 = Find All References in Workspace
+command.description.1 = Searches the project for all references to a Fortran identifier
+command.name.4 = Find All References in Project
+command.description.2 = Searches the file for all references to a Fortran identifier
+command.name.5 = Find All References in File
+actionSet.description.1 = Fortran Search Actions
+actionSet.label.1 = Fortran Search Actions
+menu.label = R&eferences
+action.label.4 = File
+action.label.5 = Project
+action.label.6 = Workspace
+action.label.7 = F&ortran...
+menu.label.0 = Re&ferences
+action.label.8 = File
+action.label.9 = Project
+action.label.10 = Workspace
+actionSet.description.2 = Fortran Debug Actions
+actionSet.label.2 = Fortran Debug Actions
+menu.label.1 = Refac&tor
+menu.label.2 = (&Debugging)
+action.label.11 = Find Matching &Interface Declarations
+action.label.12 = Resolve &Interface Binding
+action.label.13 = Select &Enclosing Scope
+action.label.14 = &Find All Declarations in Scope
+action.label.15 = Display Symbol &Table for Current File
+action.label.16 = &Reset Binder Statistics
+action.label.17 = Display Binder &Statistics
+action.label.18 =
+command.name.6 = Easter Egg
+category.name.2 = Fortran Views
+view.name = Fortran Declaration
+view.name.0 = Fortran Analysis/Refactoring Problems
\ No newline at end of file
diff --git a/org.eclipse.photran.ui.vpg/build.properties b/org.eclipse.photran.ui.vpg/build.properties
index e5d435d..ab0c234 100644
--- a/org.eclipse.photran.ui.vpg/build.properties
+++ b/org.eclipse.photran.ui.vpg/build.properties
@@ -3,6 +3,7 @@
bin.includes = META-INF/,\
.,\
plugin.xml,\
- icons/
+ icons/,\
+ OSGI-INF/l10n/bundle.properties
jre.compilation.profile=J2SE-1.5
src.includes = icons/
diff --git a/org.eclipse.photran.ui.vpg/plugin.xml b/org.eclipse.photran.ui.vpg/plugin.xml
index 4778b84..dfb716b 100644
--- a/org.eclipse.photran.ui.vpg/plugin.xml
+++ b/org.eclipse.photran.ui.vpg/plugin.xml
@@ -91,22 +91,22 @@
<extension
point="org.eclipse.ui.commands">
<category
- name="Fortran Refactoring Commands"
+ name="%category.name"
id="org.eclipse.photran.ui.RefactoringCategory">
</category>
<command
- name="Rename..."
+ name="%command.name"
categoryId="org.eclipse.photran.ui.RefactoringCategory"
id="org.eclipse.photran.ui.RenameRefactoringCommand">
</command>
<command
- name="Extract Procedure..."
+ name="%command.name.0"
categoryId="org.eclipse.photran.ui.RefactoringCategory"
id="org.eclipse.photran.ui.ExtractProcedureRefactoringCommand">
</command>
<command
- name="Extract Local Variable..."
+ name="%command.name.1"
categoryId="org.eclipse.photran.ui.RefactoringCategory"
id="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand">
</command>
@@ -138,23 +138,23 @@
<!-- 3. Add the command to Photran's Refactoring action set -->
<extension point="org.eclipse.ui.actionSets">
<actionSet
- label="Fortran Refactorings"
- description="Fortran Refactorings"
+ label="%actionSet.label"
+ description="%actionSet.description"
visible="false"
id="org.eclipse.photran.ui.RefactoringActionSet">
<action
- label="Re&name..."
+ label="%action.label"
definitionId="org.eclipse.photran.ui.RenameRefactoringCommand"
class="org.eclipse.photran.internal.ui.refactoring.RenameAction"
id="org.eclipse.photran.ui.RenameRefactoringAction"/>
<action
- label="E&xtract Procedure..."
+ label="%action.label.0"
definitionId="org.eclipse.photran.ui.ExtractProcedureRefactoringCommand"
class="org.eclipse.photran.internal.ui.refactoring.ExtractProcedureAction"
id="org.eclipse.photran.ui.ExtractProcedureRefactoringAction"/>
<action
- label="Extract &Local Variable..."
+ label="%action.label.1"
definitionId="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand"
class="org.eclipse.photran.internal.ui.refactoring.ExtractLocalVariableAction"
id="org.eclipse.photran.ui.ExtractLocalVariableRefactoringAction"/>
@@ -183,7 +183,7 @@
<page
objectClass="org.eclipse.core.resources.IProject"
adaptable="true"
- name="Analysis/Refactoring"
+ name="%page.name"
class="org.eclipse.photran.internal.ui.properties.SearchPathsPropertyPage"
id="org.eclipse.photran.ui.SearchPathsPropertyPage"
category="org.eclipse.photran.ui.newui.Page_head_general">
@@ -216,15 +216,15 @@
<extension
point="org.eclipse.ui.commands">
<category
- name="Navigation"
- description="Navigation"
+ name="%category.name.0"
+ description="%category.description"
id="org.eclipse.photran.ui.NavigationCategory">
</category>
<command
categoryId="org.eclipse.photran.ui.NavigationCategory"
- description="Open Declaration"
+ description="%command.description"
id="org.eclipse.photran.ui.OpenDeclarationCommand"
- name="Open Declaration">
+ name="%command.name.2">
</command>
</extension>
<extension
@@ -244,12 +244,12 @@
</extension>
<extension point="org.eclipse.ui.actionSets">
<actionSet
- label="Fortran Analysis Actions"
- description="Fortran Analysis Actions"
+ label="%actionSet.label.0"
+ description="%actionSet.description.0"
visible="false"
id="org.eclipse.photran.ui.AnalysisActionSet">
<action
- label="&Open Declaration"
+ label="%action.label.2"
definitionId="org.eclipse.photran.ui.OpenDeclarationCommand"
class="org.eclipse.photran.internal.ui.actions.OpenDeclaration"
menubarPath="navigate/additions"
@@ -270,7 +270,7 @@
class="org.eclipse.photran.internal.ui.actions.OpenDeclaration"
definitionId="org.eclipse.photran.ui.OpenDeclarationCommand"
id="org.eclipse.photran.ui.OpenDeclarationMenuAction"
- label="&Open Declaration"
+ label="%action.label.3"
menubarPath="group.open"/>
</viewerContribution>
</extension>
@@ -280,14 +280,14 @@
<!--====================================-->
<extension
id="vpgSearchPage"
- name="vpg search name"
+ name="%extension.name"
point="org.eclipse.search.searchPages">
<page
canSearchEnclosingProjects="true"
class="org.eclipse.photran.internal.ui.search.FortranSearchPage"
icon="icons/full/obj16/fsearch_obj.gif"
id="org.eclipse.photran.ui.vpgSearchPage"
- label="Fortran Search"
+ label="%page.label"
showScopeSection="true"
sizeHint="460, 160"/>
</extension>
@@ -296,25 +296,25 @@
<extension
point="org.eclipse.ui.commands">
<category
- name="Fortran Search"
- description="Fortran Search"
+ name="%category.name.1"
+ description="%category.description.0"
id="org.eclipse.photran.ui.SearchCategory">
</category>
<command
categoryId="org.eclipse.photran.ui.SearchCategory"
- description="Searches the workspace for all references to a Fortran identifier"
+ description="%command.description.0"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesWorkspaceCommand"
- name="Find All References in Workspace" />
+ name="%command.name.3" />
<command
categoryId="org.eclipse.photran.ui.SearchCategory"
- description="Searches the project for all references to a Fortran identifier"
+ description="%command.description.1"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesProjectCommand"
- name="Find All References in Project" />
+ name="%command.name.4" />
<command
categoryId="org.eclipse.photran.ui.SearchCategory"
- description="Searches the file for all references to a Fortran identifier"
+ description="%command.description.2"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesFileCommand"
- name="Find All References in File" />
+ name="%command.name.5" />
</extension>
<!-- 2. Optionally associate the command with an accelerator key -->
<extension
@@ -331,13 +331,13 @@
<!-- 3. Add the command to an action set -->
<extension point="org.eclipse.ui.actionSets">
<actionSet
- label="Fortran Search Actions"
- description="Fortran Search Actions"
+ label="%actionSet.label.1"
+ description="%actionSet.description.1"
visible="false"
id="org.eclipse.photran.ui.SearchActionSet">
<menu
id="org.eclipse.photran.ui.vpg.FortranFindReferencesMenu"
- label="R&eferences"
+ label="%menu.label"
path="org.eclipse.search.menu/occurencesActionsGroup"><!-- See plugin.xml for org.eclipse.search -->
<separator
name="FindAllReferencesGroup">
@@ -348,7 +348,7 @@
definitionId="org.eclipse.photran.ui.vpg.FortranFindReferencesFileCommand"
icon="icons/full/obj16/search_ref_obj.gif"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesFileAction"
- label="File"
+ label="%action.label.4"
menubarPath="org.eclipse.search.menu/org.eclipse.photran.ui.vpg.FortranFindReferencesMenu/FindAllReferencesGroup">
</action>
<action
@@ -356,7 +356,7 @@
definitionId="org.eclipse.photran.ui.vpg.FortranFindReferencesProjectCommand"
icon="icons/full/obj16/search_ref_obj.gif"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesProjectAction"
- label="Project"
+ label="%action.label.5"
menubarPath="org.eclipse.search.menu/org.eclipse.photran.ui.vpg.FortranFindReferencesMenu/FindAllReferencesGroup">
</action>
<action
@@ -364,14 +364,14 @@
definitionId="org.eclipse.photran.ui.vpg.FortranFindReferencesWorkspaceCommand"
icon="icons/full/obj16/search_ref_obj.gif"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesWorkspaceAction"
- label="Workspace"
+ label="%action.label.6"
menubarPath="org.eclipse.search.menu/org.eclipse.photran.ui.vpg.FortranFindReferencesMenu/FindAllReferencesGroup">
</action>
<action
class="org.eclipse.photran.internal.ui.search.FortranSearchPage$OpenAction"
icon="icons/full/obj16/fsearch_obj.gif"
id="org.eclipse.photran.ui.vpg.actions.OpenFortranSearchPage"
- label="F&ortran..."
+ label="%action.label.7"
menubarPath="org.eclipse.search.menu/dialogGroup">
</action>
</actionSet>
@@ -396,7 +396,7 @@
targetID="#FortranEditorContextMenu">
<menu
id="org.eclipse.photran.ui.vpg.FortranFindReferencesMenu"
- label="Re&ferences"
+ label="%menu.label.0"
path="group.find"><!-- See ITextEditorActionConstants - was originally group.search according to IContextMenuConstants -->
<separator
name="FindAllReferencesGroup">
@@ -407,7 +407,7 @@
definitionId="org.eclipse.photran.ui.vpg.FortranFindReferencesFileCommand"
icon="icons/full/obj16/search_ref_obj.gif"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesFileAction"
- label="File"
+ label="%action.label.8"
menubarPath="org.eclipse.photran.ui.vpg.FortranFindReferencesMenu/FindAllReferencesGroup">
</action>
<action
@@ -415,7 +415,7 @@
definitionId="org.eclipse.photran.ui.vpg.FortranFindReferencesProjectCommand"
icon="icons/full/obj16/search_ref_obj.gif"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesProjectAction"
- label="Project"
+ label="%action.label.9"
menubarPath="org.eclipse.photran.ui.vpg.FortranFindReferencesMenu/FindAllReferencesGroup">
</action>
<action
@@ -423,7 +423,7 @@
definitionId="org.eclipse.photran.ui.vpg.FortranFindReferencesWorkspaceCommand"
icon="icons/full/obj16/search_ref_obj.gif"
id="org.eclipse.photran.ui.vpg.FortranFindReferencesWorkspaceAction"
- label="Workspace"
+ label="%action.label.10"
menubarPath="org.eclipse.photran.ui.vpg.FortranFindReferencesMenu/FindAllReferencesGroup">
</action>
</viewerContribution>
@@ -451,19 +451,19 @@
<!-- menu. -->
<extension point="org.eclipse.ui.actionSets">
<actionSet
- label="Fortran Debug Actions"
- description="Fortran Debug Actions"
+ label="%actionSet.label.2"
+ description="%actionSet.description.2"
visible="false"
id="org.eclipse.photran.ui.DebugActionSet">
<menu
- label="Refac&tor"
+ label="%menu.label.1"
path="edit"
id="org.eclipse.jdt.ui.refactoring.menu">
<separator name="scriptGroup"/>
</menu>
<menu
- label="(&Debugging)"
+ label="%menu.label.2"
path="org.eclipse.jdt.ui.refactoring.menu/scriptGroup"
id="debugging">
<separator name="debugging"/>
@@ -472,45 +472,45 @@
<separator name="vpgdb"/>
</menu>
<action
- label="Find Matching &Interface Declarations"
+ label="%action.label.11"
class="org.eclipse.photran.internal.ui.actions.FindMatchingInterfaceDeclarations"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/debugginginterfaces"
id="org.eclipse.photran.ui.FindMatchingInterfaceDeclarationsAction"/>
<action
- label="Resolve &Interface Binding"
+ label="%action.label.12"
class="org.eclipse.photran.internal.ui.actions.ResolveInterfaceBinding"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/debugginginterfaces"
id="org.eclipse.photran.ui.ResolveInterfaceBindingAction"/>
<!-- -->
<action
- label="Select &Enclosing Scope"
+ label="%action.label.13"
class="org.eclipse.photran.internal.ui.actions.SelectEnclosingScope"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/debugging"
id="org.eclipse.photran.ui.FindEnclosingScopeAction"/>
<action
- label="&Find All Declarations in Scope"
+ label="%action.label.14"
class="org.eclipse.photran.internal.ui.actions.FindAllDeclarationsInScope"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/debugging"
id="org.eclipse.photran.ui.FindAllDeclarationsInScopeAction"/>
<action
class="org.eclipse.photran.internal.ui.actions.DisplaySymbolTable"
id="org.eclipse.photran.ui.DisplaySymbolTableAction"
- label="Display Symbol &Table for Current File"
+ label="%action.label.15"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/debugging"/>
<!-- -->
<action
class="org.eclipse.photran.internal.ui.actions.ResetBinderStatistics"
id="org.eclipse.photran.ui.ResetBinderStatisticsAction"
- label="&Reset Binder Statistics"
+ label="%action.label.16"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/vpgstats"/>
<action
class="org.eclipse.photran.internal.ui.actions.DisplayBinderStatistics"
id="org.eclipse.photran.ui.DisplayBinderStatisticsAction"
- label="Display Binder &Statistics"
+ label="%action.label.17"
menubarPath="org.eclipse.jdt.ui.refactoring.menu/debugging/vpgstats"/>
<!-- -->
<action
- label=""
+ label="%action.label.18"
definitionId="org.eclipse.photran.ui.EasterEggCommand"
class="org.eclipse.photran.internal.ui.actions.EasterEggAction"
id="org.eclipse.photran.ui.EasterEggAction"/>
@@ -519,7 +519,7 @@
<extension
point="org.eclipse.ui.commands">
<command
- name="Easter Egg"
+ name="%command.name.6"
categoryId="org.eclipse.photran.ui.RefactoringCategory"
id="org.eclipse.photran.ui.EasterEggCommand">
</command>
@@ -559,7 +559,7 @@
<extension point="org.eclipse.ui.views">
<category
id="org.eclipse.photran.ui.views"
- name="Fortran Views">
+ name="%category.name.2">
</category>
<!-- Declaration View -->
@@ -568,7 +568,7 @@
class="org.eclipse.photran.internal.ui.views.declaration.DeclarationView"
icon="icons/full/eview16/source.gif"
id="org.eclipse.photran.ui.DeclarationView"
- name="Fortran Declaration">
+ name="%view.name">
</view>
<!-- Analysis/Refactoring Problems View -->
@@ -577,7 +577,7 @@
class="org.eclipse.photran.internal.ui.views.vpgproblems.VPGProblemView"
icon="icons/full/eview16/problems_view.gif"
id="org.eclipse.photran.ui.VPGProblemView"
- name="Fortran Analysis/Refactoring Problems">
+ name="%view.name.0">
</view>
</extension>
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplayBinderStatistics.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplayBinderStatistics.java
index a3fe5b4..a600315 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplayBinderStatistics.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplayBinderStatistics.java
@@ -23,7 +23,7 @@
*/
public class DisplayBinderStatistics extends VPGOutputWindowAction
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
@Override
protected void writeOutput(EclipseVPG vpg, PrintStream ps)
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplaySymbolTable.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplaySymbolTable.java
index d2bec2c..a8eef1d 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplaySymbolTable.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/DisplaySymbolTable.java
@@ -36,12 +36,12 @@
{
try
{
- progressMonitor.beginTask("Waiting for background work to complete (Photran indexer)", IProgressMonitor.UNKNOWN);
+ progressMonitor.beginTask(Messages.DisplaySymbolTable_WaitingForBackgroundWorkToComplete, IProgressMonitor.UNKNOWN);
File temp = UIUtil.createTempFile();
final PrintStream ps = UIUtil.createPrintStream(temp);
- ps.println("SYMBOL TABLE - Derived from Virtual Program Graph");
+ ps.println("SYMBOL TABLE - Derived from Virtual Program Graph"); //$NON-NLS-1$
getAST().accept(new GenericASTVisitor()
{
@@ -66,7 +66,7 @@
}
catch (Exception e)
{
- println("EXCEPTION: " + e.getClass().getName() + ": " + e.getMessage());
+ println("EXCEPTION: " + e.getClass().getName() + ": " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
e.printStackTrace(ps);
}
@@ -80,19 +80,19 @@
PhotranTokenRef representativeToken = scope.getRepresentativeToken();
if (representativeToken.getOffset() < 0)
- print("(Global Scope)");
+ print("(Global Scope)"); //$NON-NLS-1$
else
- print("Scope: " + representativeToken.getText());
+ print("Scope: " + representativeToken.getText()); //$NON-NLS-1$
- if (scope.isInternal()) ps.print(" (Internal Subprogram)");
+ if (scope.isInternal()) ps.print(" (Internal Subprogram)"); //$NON-NLS-1$
- if (scope.isDefaultVisibilityPrivate()) ps.print(" - Default Visibility is PRIVATE");
+ if (scope.isDefaultVisibilityPrivate()) ps.print(" - Default Visibility is PRIVATE"); //$NON-NLS-1$
ImplicitSpec implicitSpec = scope.getImplicitSpec();
if (implicitSpec == null)
- ps.print(" - Implicit None");
+ ps.print(" - Implicit None"); //$NON-NLS-1$
else
- ps.print(" - " + implicitSpec.toString());
+ ps.print(" - " + implicitSpec.toString()); //$NON-NLS-1$
ps.println();
}
@@ -112,13 +112,13 @@
});
ps.close();
- UIUtil.openHtmlViewerOn("Symbol Table", temp);
+ UIUtil.openHtmlViewerOn("Symbol Table", temp); //$NON-NLS-1$
}
catch (Exception e)
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(getFortranEditor().getShell(), "Error", message);
+ MessageDialog.openError(getFortranEditor().getShell(), "Error", message); //$NON-NLS-1$
}
finally
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEgg.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEgg.java
index 2db4a23..b0cbccd 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEgg.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEgg.java
@@ -55,22 +55,21 @@
@Override
public String getName()
{
- return "Easter Egg";
+ return "Easter Egg"; //$NON-NLS-1$
}
@Override
protected void doCheckInitialConditions(RefactoringStatus status, IProgressMonitor pm) throws PreconditionFailure
{
if (!canRunEasterEgg())
- status.addFatalError("The selected operation is not available."); // Bogus but common error message
+ status.addFatalError("The selected operation is not available."); // Bogus but common error message //$NON-NLS-1$
}
- @SuppressWarnings("unchecked")
private boolean canRunEasterEgg()
{
if (!PhotranVPG.getInstance().doesProjectHaveRefactoringEnabled(fileInEditor)) return false;
- Token token = this.findEnclosingToken(this.astOfFileInEditor, this.selectedRegionInEditor);
+ Token token = findEnclosingToken(this.astOfFileInEditor, this.selectedRegionInEditor);
if (token == null) return false;
printStmt = token.findNearestAncestor(ASTPrintStmtNode.class);
@@ -94,8 +93,8 @@
private String removeQuotes(String string)
{
string = string.substring(1, string.length()-1);
- string = string.replaceAll("''", "'");
- string = string.replaceAll("\"\"", "\"");
+ string = string.replaceAll("''", "'"); //$NON-NLS-1$ //$NON-NLS-2$
+ string = string.replaceAll("\"\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$
return string;
}
@@ -104,7 +103,7 @@
{
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void doCreateChange(IProgressMonitor pm) throws CoreException, OperationCanceledException
{
@@ -115,7 +114,7 @@
{
newStmts[i] = (ASTPrintStmtNode)printStmt.clone();
ASTStringConstNode stringConst = (ASTStringConstNode)newStmts[i].getOutputItemList().getSingleExpr();
- stringConst.getStringConst().setText("\"" + rasterize(i, string) + "\"");
+ stringConst.getStringConst().setText("\"" + rasterize(i, string) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
if (i != 0)
removeAllWhitetextExceptIndentation(newStmts[i].findFirstToken());
@@ -146,13 +145,13 @@
private static String[] font = new String[]
{
//12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678 12345678",
- " AAAA BBBBBBB CCCCC DDDDDD EEEEEEEE FFFFFFFF GGGGG HH HH IIIIIIII JJJ KK KK LL MM MM NNN NN OOOO PPPPPPP QQQQ RRRRRRR SSSSSSS TTTTTTTT UU UU VV VV WW WW XX XX YY YY ZZZZZZZZ 11 222222 333333 444 55555555 6666 77777777 888888 9999 0000 !! ???? ",
- " AA AA BB BB CC C DD DD EE FF GG G HH HH II JJ KK KK LL MMM MMM NNNN NN OO OO PP PP QQ QQ RR RR SS TT UU UU VV VV WW WW XX XX YY YY ZZ 1111 22 22 33 33 4444 55 66 77 88 88 99 99 00 00 !!!! ?? ?? ",
- " AA AA BB BB CC DD DD EE FF GG HH HH II JJ KK KK LL MM MM MM NN NN NN OO OO PP PP QQ QQ RR RR SS TT UU UU VV VV WW WW XXXX YYYY ZZ 11 22 33 44 44 55 555 66 77 88 88 99 999 00 00 !!!! ?? ",
- " AAAAAAAA BBBBBB CC DD DD EEEEE FFFFF GG GGGG HHHHHHHH II JJ KKKK LL MM MM MM NN NN NN OO OO PPPPPPP QQ QQ RRRRRRR SSSSSS TT UU UU VV VV WW WW WW XX YY ZZ 11 222 333 44 44 555 55 66 6666 77 888888 9999 99 00 00 !! ?? ",
- " AA AA BB BB CC DD DD EE FF GG GG HH HH II JJ JJ KK KK LL MM MM NN NN NN OO OO PP QQ Q QQ RR RR SS TT UU UU VV VV WW WW WW XXXX YY ZZ 11 22 33 4444444 55 666 66 77 88 88 99 00 00 !! ?? ",
- " AA AA BB BB CC C DD DD EE FF GG GG HH HH II JJ JJ KK KK LL MM MM NN NNNN OO OO PP QQ QQ RR RR SS TT UU UU VVVV WWW WWW XX XX YY ZZ 11 22 33 33 44 5 55 66 66 77 88 88 99 00 00 ... ",
- " AA AA BBBBBBB CCCCC DDDDDD EEEEEEEE FF GGGGG HH HH IIIIIIII JJJJJ KK KK LLLLLLLL MM MM NN NNN OOOO PP QQQQ Q RR RR SSSSSSS TT UUUUUU VV WW WW XX XX YY ZZZZZZZZ 11111111 22222222 333333 44 555555 6666 77 888888 9999 0000 ... !! ?? ",
+ " AAAA BBBBBBB CCCCC DDDDDD EEEEEEEE FFFFFFFF GGGGG HH HH IIIIIIII JJJ KK KK LL MM MM NNN NN OOOO PPPPPPP QQQQ RRRRRRR SSSSSSS TTTTTTTT UU UU VV VV WW WW XX XX YY YY ZZZZZZZZ 11 222222 333333 444 55555555 6666 77777777 888888 9999 0000 !! ???? ", //$NON-NLS-1$
+ " AA AA BB BB CC C DD DD EE FF GG G HH HH II JJ KK KK LL MMM MMM NNNN NN OO OO PP PP QQ QQ RR RR SS TT UU UU VV VV WW WW XX XX YY YY ZZ 1111 22 22 33 33 4444 55 66 77 88 88 99 99 00 00 !!!! ?? ?? ", //$NON-NLS-1$
+ " AA AA BB BB CC DD DD EE FF GG HH HH II JJ KK KK LL MM MM MM NN NN NN OO OO PP PP QQ QQ RR RR SS TT UU UU VV VV WW WW XXXX YYYY ZZ 11 22 33 44 44 55 555 66 77 88 88 99 999 00 00 !!!! ?? ", //$NON-NLS-1$
+ " AAAAAAAA BBBBBB CC DD DD EEEEE FFFFF GG GGGG HHHHHHHH II JJ KKKK LL MM MM MM NN NN NN OO OO PPPPPPP QQ QQ RRRRRRR SSSSSS TT UU UU VV VV WW WW WW XX YY ZZ 11 222 333 44 44 555 55 66 6666 77 888888 9999 99 00 00 !! ?? ", //$NON-NLS-1$
+ " AA AA BB BB CC DD DD EE FF GG GG HH HH II JJ JJ KK KK LL MM MM NN NN NN OO OO PP QQ Q QQ RR RR SS TT UU UU VV VV WW WW WW XXXX YY ZZ 11 22 33 4444444 55 666 66 77 88 88 99 00 00 !! ?? ", //$NON-NLS-1$
+ " AA AA BB BB CC C DD DD EE FF GG GG HH HH II JJ JJ KK KK LL MM MM NN NNNN OO OO PP QQ QQ RR RR SS TT UU UU VVVV WWW WWW XX XX YY ZZ 11 22 33 33 44 5 55 66 66 77 88 88 99 00 00 ... ", //$NON-NLS-1$
+ " AA AA BBBBBBB CCCCC DDDDDD EEEEEEEE FF GGGGG HH HH IIIIIIII JJJJJ KK KK LLLLLLLL MM MM NN NNN OOOO PP QQQQ Q RR RR SSSSSSS TT UUUUUU VV WW WW XX XX YY ZZZZZZZZ 11111111 22222222 333333 44 555555 6666 77 888888 9999 0000 ... !! ?? ", //$NON-NLS-1$
};
private static int index(char ch)
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEggAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEggAction.java
index 1467de7..76ac573 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEggAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/EasterEggAction.java
@@ -72,7 +72,7 @@
top.setLayout(new GridLayout(1, false));
Label lbl = new Label(top, SWT.NONE);
- lbl.setText("Congratulations! You found an Easter Egg.");
+ lbl.setText("Congratulations! You found an Easter Egg."); //$NON-NLS-1$
}
});
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindAllDeclarationsInScope.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindAllDeclarationsInScope.java
index 68a82ab..c367b70 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindAllDeclarationsInScope.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindAllDeclarationsInScope.java
@@ -28,13 +28,13 @@
{
try
{
- progressMonitor.beginTask("Waiting for background work to complete (Photran indexer)", IProgressMonitor.UNKNOWN);
+ progressMonitor.beginTask(Messages.FindAllDeclarationsInScope_WaitingForBackgroundWorkToComplete, IProgressMonitor.UNKNOWN);
Token token = findEnclosingToken(getAST(), getFortranEditor().getSelection());
- if (token == null) throw new Exception("Please select a token.");
+ if (token == null) throw new Exception(Messages.FindAllDeclarationsInScope_PleaseSelectAToken);
ScopingNode scope = token.getEnclosingScope();
- if (scope == null) throw new Exception("No enclosing scope.");
+ if (scope == null) throw new Exception(Messages.FindAllDeclarationsInScope_NoEnclosingScope);
openSelectionDialog(scope.getAllDefinitions());
}
@@ -42,7 +42,7 @@
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(getFortranEditor().getShell(), "Error", message);
+ MessageDialog.openError(getFortranEditor().getShell(), Messages.FindAllDeclarationsInScope_ErrorTitle, message);
}
finally
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindMatchingInterfaceDeclarations.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindMatchingInterfaceDeclarations.java
index e8cacd8..f4c819b 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindMatchingInterfaceDeclarations.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FindMatchingInterfaceDeclarations.java
@@ -29,13 +29,13 @@
{
try
{
- progressMonitor.beginTask("Waiting for background work to complete (Photran indexer)", IProgressMonitor.UNKNOWN);
+ progressMonitor.beginTask(Messages.FindMatchingInterfaceDeclarations_WaitingForBackgroundWorkToComplete, IProgressMonitor.UNKNOWN);
Token token = findEnclosingToken(getAST(), getFortranEditor().getSelection());
- if (token == null) throw new Exception("Please select a token.");
+ if (token == null) throw new Exception(Messages.FindMatchingInterfaceDeclarations_PleaseSelectAToken);
Definition def = PhotranVPG.getInstance().getDefinitionFor(token.getTokenRef());
- if (def == null) throw new Exception("Please select the identifier in a subprogram declaration.");
+ if (def == null) throw new Exception(Messages.FindMatchingInterfaceDeclarations_PleaseSelectIdentifierInASubprogram);
openSelectionDialog(def.findMatchingDeclarationsInInterfaces());
}
@@ -43,7 +43,7 @@
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(getFortranEditor().getShell(), "Error", message);
+ MessageDialog.openError(getFortranEditor().getShell(), Messages.FindMatchingInterfaceDeclarations_ErrorTitle, message);
}
finally
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FortranEditorASTActionDelegate.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FortranEditorASTActionDelegate.java
index ab84d37..c2d2cea 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FortranEditorASTActionDelegate.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/FortranEditorASTActionDelegate.java
@@ -70,7 +70,7 @@
catch (InvocationTargetException e)
{
e.printStackTrace();
- MessageDialog.openError(fEditor.getShell(), "Unhandled Exception", e.getMessage());
+ MessageDialog.openError(fEditor.getShell(), Messages.FortranEditorASTActionDelegate_UnhandledExceptionTitle, e.getMessage());
}
catch (InterruptedException e)
{
@@ -90,7 +90,7 @@
// ModuleLoaderCallback.IGNORE,
// editor.isFixedForm(),
// progressMonitor);
- if (ast == null) throw new Exception("Unable to parse file in editor");
+ if (ast == null) throw new Exception(Messages.FortranEditorASTActionDelegate_UnableToParseFileInEditor);
return ast;
}
@@ -115,10 +115,10 @@
dlg.setBlockOnOpen(true);
dlg.setHelpAvailable(false);
dlg.setIgnoreCase(true);
- dlg.setMessage("Select a declaration to open (? = any character, * = any string):");
+ dlg.setMessage(Messages.FortranEditorASTActionDelegate_SelectADeclarationToOpen);
dlg.setMultipleSelection(false);
dlg.setSize(100, 10);
- dlg.setTitle("Multiple Declarations Found");
+ dlg.setTitle(Messages.FortranEditorASTActionDelegate_MultipleDeclarationsFoundTitle);
dlg.setElements(defs.toArray());
dlg.open();
if (dlg.getResult() != null)
@@ -133,14 +133,22 @@
{
final IDocument document = getFortranEditor().getDocumentProvider().getDocument(getFortranEditor().getEditorInput());
- return def.getCanonicalizedName()
- + " - "
- + def.describeClassification()
- + (def.isSubprogramArgument() ? " (Subprogram Argument)" : "")
- + " - Line "
- + (document.getLineOfOffset(def.getTokenRef().findToken().getFileOffset()) + 1)
- + " - "
- + def.getTokenRef().getFilename();
+ Object[] args = new Object[]
+ {
+ def.getCanonicalizedName(),
+ def.describeClassification(),
+ (document.getLineOfOffset(def.getTokenRef().findToken().getFileOffset()) + 1),
+ def.getTokenRef().getFilename()
+ };
+
+ if (def.isSubprogramArgument())
+ return Messages.bind(
+ Messages.FortranEditorASTActionDelegate_DeclDescriptionSubprogramArgument,
+ args);
+ else
+ return Messages.bind(
+ Messages.FortranEditorASTActionDelegate_DeclDescriptionOther,
+ args);
}
catch (Throwable e)
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/Messages.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/Messages.java
new file mode 100644
index 0000000..71cdc2d
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/Messages.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others.
+ * 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
+ *
+ * Contributors:
+ * UIUC - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.photran.internal.ui.actions;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings.
+ *
+ * @author Jeff Overbey
+ */
+class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.photran.internal.ui.actions.messages"; //$NON-NLS-1$
+
+ public static String DisplaySymbolTable_WaitingForBackgroundWorkToComplete;
+
+ public static String FindAllDeclarationsInScope_ErrorTitle;
+
+ public static String FindAllDeclarationsInScope_NoEnclosingScope;
+
+ public static String FindAllDeclarationsInScope_PleaseSelectAToken;
+
+ public static String FindAllDeclarationsInScope_WaitingForBackgroundWorkToComplete;
+
+ public static String FindMatchingInterfaceDeclarations_ErrorTitle;
+
+ public static String FindMatchingInterfaceDeclarations_PleaseSelectAToken;
+
+ public static String FindMatchingInterfaceDeclarations_PleaseSelectIdentifierInASubprogram;
+
+ public static String FindMatchingInterfaceDeclarations_WaitingForBackgroundWorkToComplete;
+
+ public static String FortranEditorASTActionDelegate_DeclDescriptionOther;
+
+ public static String FortranEditorASTActionDelegate_DeclDescriptionSubprogramArgument;
+
+ public static String FortranEditorASTActionDelegate_MultipleDeclarationsFoundTitle;
+
+ public static String FortranEditorASTActionDelegate_SelectADeclarationToOpen;
+
+ public static String FortranEditorASTActionDelegate_UnableToParseFileInEditor;
+
+ public static String FortranEditorASTActionDelegate_UnhandledExceptionTitle;
+
+ public static String OpenDeclaration_AnalysisRefactoringNotEnabled;
+
+ public static String OpenDeclaration_ErrorTitle;
+
+ public static String OpenDeclaration_ErrorX;
+
+ public static String OpenDeclaration_UnableToCreateMarker;
+
+ public static String OpenDeclaration_UnableToLocateDeclaration;
+
+ public static String ResolveInterfaceBinding_ErrorTitle;
+
+ public static String ResolveInterfaceBinding_PleaseSelectAToken;
+
+ public static String ResolveInterfaceBinding_PleaseSelectIdentifierInASubprogram;
+
+ public static String ResolveInterfaceBinding_WaitingForBackgroundWorkToComplete;
+
+ public static String SelectEnclosingScope_ErrorTitle;
+ public static String SelectEnclosingScope_NoEnclosingScope;
+ public static String SelectEnclosingScope_NoTokensInScope;
+ public static String SelectEnclosingScope_Parsing;
+ public static String SelectEnclosingScope_PleaseSelectAKeywordOrIdentifier;
+ public static String SelectEnclosingScope_WaitingForBackgroundWorkToComplete;
+
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ }
+}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/OpenDeclaration.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/OpenDeclaration.java
index b32ae6a..f41b3fe 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/OpenDeclaration.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/OpenDeclaration.java
@@ -62,8 +62,8 @@
}
else
{
- MessageDialog.openError(shell, "Error",
- "Please enable analysis and refactoring in the project properties.");
+ MessageDialog.openError(shell, Messages.OpenDeclaration_ErrorTitle,
+ Messages.OpenDeclaration_AnalysisRefactoringNotEnabled);
}
}
@@ -132,7 +132,7 @@
public void run()
{
if (def == null)
- MessageDialog.openError(shell, "Error", "Unable to locate declaration");
+ MessageDialog.openError(shell, Messages.OpenDeclaration_ErrorTitle, Messages.OpenDeclaration_UnableToLocateDeclaration);
else
openEditorOn(def);
}
@@ -147,7 +147,7 @@
{
IMarker marker = def.createMarker();
if (marker == null)
- MessageDialog.openError(shell, "Error (" + def.getTokenRef() + ")", "Unable to create marker");
+ MessageDialog.openError(shell, Messages.bind(Messages.OpenDeclaration_ErrorX, def.getTokenRef()), Messages.OpenDeclaration_UnableToCreateMarker);
else
IDE.openEditor(page, marker, true);
}
@@ -155,7 +155,7 @@
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(shell, "Error", message);
+ MessageDialog.openError(shell, Messages.OpenDeclaration_ErrorTitle, message);
}
}
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResetBinderStatistics.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResetBinderStatistics.java
index cc489a1..79527b3 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResetBinderStatistics.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResetBinderStatistics.java
@@ -22,7 +22,7 @@
*/
public class ResetBinderStatistics extends VPGWindowActionDelegate
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
@Override
protected void run(EclipseVPG vpg, IProgressMonitor progressMonitor) throws Exception
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResolveInterfaceBinding.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResolveInterfaceBinding.java
index 58fc599..fe9f238 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResolveInterfaceBinding.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/ResolveInterfaceBinding.java
@@ -29,13 +29,13 @@
{
try
{
- progressMonitor.beginTask("Waiting for background work to complete (Photran indexer)", IProgressMonitor.UNKNOWN);
+ progressMonitor.beginTask(Messages.ResolveInterfaceBinding_WaitingForBackgroundWorkToComplete, IProgressMonitor.UNKNOWN);
Token token = findEnclosingToken(getAST(), getFortranEditor().getSelection());
- if (token == null) throw new Exception("Please select a token.");
+ if (token == null) throw new Exception(Messages.ResolveInterfaceBinding_PleaseSelectAToken);
Definition def = PhotranVPG.getInstance().getDefinitionFor(token.getTokenRef());
- if (def == null) throw new Exception("Please select the identifier in a subprogram declaration.");
+ if (def == null) throw new Exception(Messages.ResolveInterfaceBinding_PleaseSelectIdentifierInASubprogram);
openSelectionDialog(def.resolveInterfaceBinding());
}
@@ -43,7 +43,7 @@
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(getFortranEditor().getShell(), "Error", message);
+ MessageDialog.openError(getFortranEditor().getShell(), Messages.ResolveInterfaceBinding_ErrorTitle, message);
}
finally
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/SelectEnclosingScope.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/SelectEnclosingScope.java
index 9bd49dc..f528c18 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/SelectEnclosingScope.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/SelectEnclosingScope.java
@@ -30,18 +30,18 @@
{
try
{
- progressMonitor.beginTask("Waiting for background work to complete (Photran indexer)", IProgressMonitor.UNKNOWN);
+ progressMonitor.beginTask(Messages.SelectEnclosingScope_WaitingForBackgroundWorkToComplete, IProgressMonitor.UNKNOWN);
- progressMonitor.subTask("Parsing...");
+ progressMonitor.subTask(Messages.SelectEnclosingScope_Parsing);
Token token = findEnclosingToken(getAST(), getFortranEditor().getSelection());
- if (token == null) throw new Exception("Please select a keyword or an identifier.");
+ if (token == null) throw new Exception(Messages.SelectEnclosingScope_PleaseSelectAKeywordOrIdentifier);
ScopingNode scope = token.getEnclosingScope();
- if (scope == null) throw new Exception("No enclosing scope.");
+ if (scope == null) throw new Exception(Messages.SelectEnclosingScope_NoEnclosingScope);
IMarker marker = scope.createMarker();
- if (marker == null) throw new Exception("No tokens in scope.");
+ if (marker == null) throw new Exception(Messages.SelectEnclosingScope_NoTokensInScope);
IDE.openEditor(getFortranEditor().getEditorSite().getPage(), marker, true);
}
@@ -49,7 +49,7 @@
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(getFortranEditor().getShell(), "Error", message);
+ MessageDialog.openError(getFortranEditor().getShell(), Messages.SelectEnclosingScope_ErrorTitle, message);
}
finally
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/messages.properties b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/messages.properties
new file mode 100644
index 0000000..423e374
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/actions/messages.properties
@@ -0,0 +1,32 @@
+DisplaySymbolTable_WaitingForBackgroundWorkToComplete=Waiting for background work to complete (Photran indexer)
+FindAllDeclarationsInScope_ErrorTitle=Error
+FindAllDeclarationsInScope_NoEnclosingScope=No enclosing scope.
+FindAllDeclarationsInScope_PleaseSelectAToken=Please select a token.
+FindAllDeclarationsInScope_WaitingForBackgroundWorkToComplete=Waiting for background work to complete (Photran indexer)
+FindMatchingInterfaceDeclarations_PleaseSelectAToken=Please select a token.
+FindMatchingInterfaceDeclarations_PleaseSelectIdentifierInASubprogram=Please select the identifier in a subprogram declaration.
+FindMatchingInterfaceDeclarations_WaitingForBackgroundWorkToComplete=Waiting for background work to complete (Photran indexer)
+# MYVARIABLE - Local Variable - Line 3 - /src/whatever.f90
+FindMatchingInterfaceDeclarations_ErrorTitle=Error
+FortranEditorASTActionDelegate_DeclDescriptionOther={0} - {1} - Line {2} - {3}
+# MYVARIABLE - Local Variable (Subprogram Argument) - Line 3 - /src/whatever.f90
+FortranEditorASTActionDelegate_DeclDescriptionSubprogramArgument={0} - {1} (Subprogram Argument) - Line {2} - {3}
+FortranEditorASTActionDelegate_MultipleDeclarationsFoundTitle=Multiple Declarations Found
+FortranEditorASTActionDelegate_SelectADeclarationToOpen=Select a declaration to open (? = any character, * = any string):
+FortranEditorASTActionDelegate_UnableToParseFileInEditor=Unable to parse file in editor
+FortranEditorASTActionDelegate_UnhandledExceptionTitle=Unhandled Exception
+OpenDeclaration_AnalysisRefactoringNotEnabled=Please enable analysis and refactoring in the project properties.
+OpenDeclaration_ErrorTitle=Error
+OpenDeclaration_ErrorX=Error ({0})
+OpenDeclaration_UnableToCreateMarker=Unable to create marker
+OpenDeclaration_UnableToLocateDeclaration=Unable to locate declaration
+ResolveInterfaceBinding_ErrorTitle=Error
+ResolveInterfaceBinding_PleaseSelectAToken=Please select a token.
+ResolveInterfaceBinding_PleaseSelectIdentifierInASubprogram=Please select the identifier in a subprogram declaration.
+ResolveInterfaceBinding_WaitingForBackgroundWorkToComplete=Waiting for background work to complete (Photran indexer)
+SelectEnclosingScope_ErrorTitle=Error
+SelectEnclosingScope_NoEnclosingScope=No enclosing scope.
+SelectEnclosingScope_NoTokensInScope=No tokens in scope.
+SelectEnclosingScope_Parsing=Parsing...
+SelectEnclosingScope_PleaseSelectAKeywordOrIdentifier=Please select a keyword or an identifier.
+SelectEnclosingScope_WaitingForBackgroundWorkToComplete=Waiting for background work to complete (Photran indexer)
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/DefinitionMap.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/DefinitionMap.java
index 8d09711..4879102 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/DefinitionMap.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/DefinitionMap.java
@@ -170,7 +170,7 @@
{
class GetScopeVisitor extends ASTVisitor
{
- private String name = "";
+ private String name = ""; //$NON-NLS-1$
@Override public void visitASTMainProgramNode(ASTMainProgramNode node)
{
@@ -216,6 +216,6 @@
GetScopeVisitor visitor = new GetScopeVisitor();
node.accept(visitor);
- return node.getClass().getName() + "/" + visitor.name.toLowerCase() + ":";
+ return node.getClass().getName() + "/" + visitor.name.toLowerCase() + ":"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/FortranEditorTasks.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/FortranEditorTasks.java
index 73b340d..2e3207a 100755
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/FortranEditorTasks.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/FortranEditorTasks.java
@@ -130,7 +130,7 @@
String vpgEnabledProperty = new SearchPathProperties().getProperty(editor.getIFile(),
SearchPathProperties.ENABLE_VPG_PROPERTY_NAME);
- if (vpgEnabledProperty != null && vpgEnabledProperty.equals("true"))
+ if (vpgEnabledProperty != null && vpgEnabledProperty.equals("true")) //$NON-NLS-1$
{
runASTTasks();
if (runVPGTasks) runVPGTasks();
@@ -165,7 +165,7 @@
{
private DispatchASTTasksJob()
{
- super("Updating Fortran editor with new parse information");
+ super(Messages.FortranEditorTasks_UpdatingFortranEditorWithNewParseInfo);
}
private ISourceForm determineSourceForm()
@@ -191,7 +191,7 @@
{
if (editor.getDocumentProvider() != null)
{
- debug("DispatchASTTasksJob#parseThenRunASTTasks():");
+ debug("DispatchASTTasksJob#parseThenRunASTTasks():"); //$NON-NLS-1$
String editorContents = editor.getDocumentProvider().getDocument(editor.getEditorInput()).get();
@@ -201,10 +201,10 @@
editor.getIFile(),
editor.getIFile().getName(),
sourceForm);
- debug(" createLexer:\t" + (System.currentTimeMillis()-start) + " ms");
+ debug(" createLexer:\t" + (System.currentTimeMillis()-start) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
start = System.currentTimeMillis();
ASTExecutableProgramNode astRootNode = parser.parse(lexer);
- debug(" parse:\t" + (System.currentTimeMillis()-start) + " ms");
+ debug(" parse:\t" + (System.currentTimeMillis()-start) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
if (astRootNode == null) return;
HashSet<IFortranEditorASTTask> tasksToRemove = new HashSet<IFortranEditorASTTask>();
@@ -216,15 +216,15 @@
long start2 = System.currentTimeMillis();
if (!task.handle(astRootNode, lexer.getTokenList(), defMap))
tasksToRemove.add(task);
- debug(" Task " + task.getClass().getSimpleName() + ":\t" + (System.currentTimeMillis()-start2) + " ms");
+ debug(" Task " + task.getClass().getSimpleName() + ":\t" + (System.currentTimeMillis()-start2) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- debug(" Total Running Tasks:\t" + (System.currentTimeMillis()-start) + " ms");
+ debug(" Total Running Tasks:\t" + (System.currentTimeMillis()-start) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
}
FortranEditorTasks.instance(editor).astTasks.removeAll(tasksToRemove);
}
}
catch (SyntaxException e) { /* Ignore syntax errors */ }
- catch (Throwable e) { FortranUIPlugin.log("Error running AST tasks", e); }
+ catch (Throwable e) { FortranUIPlugin.log(Messages.FortranEditorTasks_ErrorRunningASTTasks, e); }
}
private void debug(String string)
@@ -237,7 +237,7 @@
{
private UpdateVPGJob()
{
- super("Updating Fortran editor with new analysis information");
+ super(Messages.FortranEditorTasks_UpdatingFortranEditorWithNewAnalysisInfo);
}
@Override
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/Messages.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/Messages.java
new file mode 100644
index 0000000..a6c38d8
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/Messages.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others.
+ * 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
+ *
+ * Contributors:
+ * UIUC - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.photran.internal.ui.editor_vpg;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings.
+ *
+ * @author Jeff Overbey
+ */
+class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.photran.internal.ui.editor_vpg.messages"; //$NON-NLS-1$
+
+ public static String FortranEditorTasks_ErrorRunningASTTasks;
+
+ public static String FortranEditorTasks_UpdatingFortranEditorWithNewAnalysisInfo;
+
+ public static String FortranEditorTasks_UpdatingFortranEditorWithNewParseInfo;
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ }
+}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProcessor.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProcessor.java
index 4451091..9417aef 100755
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProcessor.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProcessor.java
@@ -45,7 +45,7 @@
String contentAssistEnabledProperty = new SearchPathProperties().getProperty(
editor.getIFile(),
SearchPathProperties.ENABLE_CONTENT_ASSIST_PROPERTY_NAME);
- if (contentAssistEnabledProperty != null && contentAssistEnabledProperty.equals("true"))
+ if (contentAssistEnabledProperty != null && contentAssistEnabledProperty.equals("true")) //$NON-NLS-1$
{
final Color LIGHT_YELLOW = new Color(null, new RGB(255, 255, 191));
@@ -93,7 +93,7 @@
}
catch (Exception e)
{
- errorMessage = e.getClass().getName() + " - " + e.getMessage();
+ errorMessage = e.getClass().getName() + " - " + e.getMessage(); //$NON-NLS-1$
return null;
}
}
@@ -134,7 +134,7 @@
* Therefore, populate the list of completion proposals based on
* the *preceding* scope.
*/
- while (scopeName.equals("") && line >= 0)
+ while (scopeName.equals("") && line >= 0) //$NON-NLS-1$
scopeName = scopes.get(--line);
return scopeName;
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProposalComputer.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProposalComputer.java
index 10831a9..a86a086 100755
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProposalComputer.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/contentassist/FortranCompletionProposalComputer.java
@@ -86,10 +86,10 @@
public ICompletionProposal[] compute() throws BadLocationException
{
- PhotranVPG.getInstance().debug("FortranCompletionProposalComputer#compute()", null);
- PhotranVPG.getInstance().debug(" Scope: " + scope, null);
+ PhotranVPG.getInstance().debug("FortranCompletionProposalComputer#compute()", null); //$NON-NLS-1$
+ PhotranVPG.getInstance().debug(" Scope: " + scope, null); //$NON-NLS-1$
if (defs != null && defs.get(scope) != null)
- PhotranVPG.getInstance().debug(" Definitions in scope: " + defs.get(scope).size(), null);
+ PhotranVPG.getInstance().debug(" Definitions in scope: " + defs.get(scope).size(), null); //$NON-NLS-1$
TreeSet<FortranCompletionProposal> proposals1 = new TreeSet<FortranCompletionProposal>();
addProposalsFromDefs(proposals1);
@@ -233,7 +233,7 @@
if (description == null)
return identifier;
else
- return identifier + " - " + description;
+ return identifier + " - " + description; //$NON-NLS-1$
}
/**
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/FortranDeclarationHover.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/FortranDeclarationHover.java
index 8081c19..43cbba7 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/FortranDeclarationHover.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/FortranDeclarationHover.java
@@ -72,7 +72,7 @@
if (editor == null) return;
hoverTipEnabled = new SearchPathProperties().getProperty(editor.getIFile(),
- SearchPathProperties.ENABLE_HOVER_TIP_PROPERTY_NAME).equals("true");
+ SearchPathProperties.ENABLE_HOVER_TIP_PROPERTY_NAME).equals("true"); //$NON-NLS-1$
FortranEditorTasks instance = FortranEditorTasks.instance(editor);
@@ -84,7 +84,7 @@
*/
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
{
- String str = "";
+ String str = ""; //$NON-NLS-1$
if (activeTokenList != null && activeDefinitionMap != null)
{
try
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/SourceViewerInformationControl.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/SourceViewerInformationControl.java
index 653c8a1..64515c8 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/SourceViewerInformationControl.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/hover/SourceViewerInformationControl.java
@@ -186,7 +186,7 @@
});
fDocument = new Document();
- fDocument.set("");
+ fDocument.set(""); //$NON-NLS-1$
fViewer.setDocument(fDocument);
IDocumentPartitioner partitioner = new FastPartitioner(new RuleBasedPartitionScanner(), FortranEditor.PARTITION_TYPES);
partitioner.connect(fDocument);
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/messages.properties b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/messages.properties
new file mode 100644
index 0000000..534568b
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/editor_vpg/messages.properties
@@ -0,0 +1,3 @@
+FortranEditorTasks_ErrorRunningASTTasks=Error running AST tasks
+FortranEditorTasks_UpdatingFortranEditorWithNewAnalysisInfo=Updating Fortran editor with new analysis information
+FortranEditorTasks_UpdatingFortranEditorWithNewParseInfo=Updating Fortran editor with new parse information
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/Messages.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/Messages.java
new file mode 100644
index 0000000..1d68205
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/Messages.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others.
+ * 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
+ *
+ * Contributors:
+ * UIUC - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.photran.internal.ui.properties;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings.
+ *
+ * @author Jeff Overbey
+ */
+class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.photran.internal.ui.properties.messages"; //$NON-NLS-1$
+
+ public static String SearchPathsPropertyPage_EnableAnalysisRefactoring;
+
+ public static String SearchPathsPropertyPage_EnableButtonsDescription;
+
+ public static String SearchPathsPropertyPage_EnableContentAssist;
+
+ public static String SearchPathsPropertyPage_EnableDeclarationView;
+
+ public static String SearchPathsPropertyPage_EnableHoverTips;
+
+ public static String SearchPathsPropertyPage_ErrorSavingProperties;
+
+ public static String SearchPathsPropertyPage_FoldersToBeSearchedForIncludes;
+
+ public static String SearchPathsPropertyPage_FoldersToBeSearchedForModules;
+
+ public static String SearchPathsPropertyPage_PathsDescription;
+
+ public static String SearchPathsPropertyPage_PropertiesCouldNotBeSaved;
+
+ public static String SearchPathsPropertyPage_SelectAFolderToBeSearchedForIncludes;
+
+ public static String SearchPathsPropertyPage_SelectAFolderToBeSearchedForModules;
+
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ }
+}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java
index 722d9ac..f7f684e 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/SearchPathsPropertyPage.java
@@ -70,14 +70,11 @@
Label l = new Label(composite, SWT.WRAP);
- l.setText("To enable Open Declaration, Find All References, the Fortran Declaration\n"
- + "view, content assist, and refactoring in Fortran programs, check the\n"
- + "following box. A program database (index) will be updated every time\n"
- + "a Fortran file is created or saved.");
+ l.setText(Messages.SearchPathsPropertyPage_EnableButtonsDescription);
l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
enableVPG = new FortranBooleanFieldEditor(SearchPathProperties.ENABLE_VPG_PROPERTY_NAME,
- "Enable Fortran analysis/refactoring",
+ Messages.SearchPathsPropertyPage_EnableAnalysisRefactoring,
composite)
{
@Override protected void valueChanged(boolean oldValue, boolean newValue)
@@ -98,21 +95,21 @@
String.valueOf(enableVPG.getBooleanValue()));
enableDeclView = new FortranBooleanFieldEditor(SearchPathProperties.ENABLE_DECL_VIEW_PROPERTY_NAME,
- "Enable Fortran Declaration view",
+ Messages.SearchPathsPropertyPage_EnableDeclarationView,
composite);
enableDeclView.setPreferenceStore(scopedStore);
enableDeclView.load();
enableContentAssist = new FortranBooleanFieldEditor(SearchPathProperties.ENABLE_CONTENT_ASSIST_PROPERTY_NAME,
- "Enable Fortran content assist (Ctrl+Space)",
+ Messages.SearchPathsPropertyPage_EnableContentAssist,
composite);
enableContentAssist.setPreferenceStore(scopedStore);
enableContentAssist.load();
enableHoverTip = new FortranBooleanFieldEditor(SearchPathProperties.ENABLE_HOVER_TIP_PROPERTY_NAME,
- "Enable Fortran Hover tips",
+ Messages.SearchPathsPropertyPage_EnableHoverTips,
composite);
enableHoverTip.setPreferenceStore(scopedStore);
@@ -129,24 +126,21 @@
l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
l = new Label(composite, SWT.WRAP);
- l.setText("The following specify the paths searched for modules\n"
- + "and INCLUDE files during analysis and refactoring.\n"
- + "These MAY BE DIFFERENT from the settings used by\n"
- + "your compiler to build your project.");
+ l.setText(Messages.SearchPathsPropertyPage_PathsDescription);
l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
modulePathEditor = new WorkspacePathEditor((IProject)getElement(),
SearchPathProperties.MODULE_PATHS_PROPERTY_NAME,
- "Folders to be searched for &modules, in order of preference:",
- "Select a folder to be searched for Fortran modules:",
+ Messages.SearchPathsPropertyPage_FoldersToBeSearchedForModules,
+ Messages.SearchPathsPropertyPage_SelectAFolderToBeSearchedForModules,
composite);
modulePathEditor.setPreferenceStore(scopedStore);
modulePathEditor.load();
includePathEditor = new WorkspacePathEditor((IProject)getElement(),
SearchPathProperties.INCLUDE_PATHS_PROPERTY_NAME,
- "Folders to be searched for &INCLUDE files, in order of preference:",
- "Select a folder to be searched for INCLUDE files:",
+ Messages.SearchPathsPropertyPage_FoldersToBeSearchedForIncludes,
+ Messages.SearchPathsPropertyPage_SelectAFolderToBeSearchedForIncludes,
composite);
includePathEditor.setPreferenceStore(scopedStore);
@@ -182,9 +176,9 @@
{
FortranUIPlugin.log(e);
MessageDialog.openError(getShell(),
- "Error Saving Project Properties",
- "The project properties could not be saved.\n" +
- e.getClass().getName() + ": " +
+ Messages.SearchPathsPropertyPage_ErrorSavingProperties,
+ Messages.SearchPathsPropertyPage_PropertiesCouldNotBeSaved +
+ "\n" + e.getClass().getName() + ": " + //$NON-NLS-1$ //$NON-NLS-2$
e.getMessage());
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/messages.properties b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/messages.properties
new file mode 100644
index 0000000..ffde409
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/properties/messages.properties
@@ -0,0 +1,12 @@
+SearchPathsPropertyPage_EnableAnalysisRefactoring=Enable Fortran analysis/refactoring
+SearchPathsPropertyPage_EnableButtonsDescription=To enable Open Declaration, Find All References, the Fortran Declaration\nview, content assist, and refactoring in Fortran programs, check the\nfollowing box. A program database (index) will be updated every time\na Fortran file is created or saved.
+SearchPathsPropertyPage_EnableContentAssist=Enable Fortran content assist (Ctrl+Space)
+SearchPathsPropertyPage_EnableDeclarationView=Enable Fortran Declaration view
+SearchPathsPropertyPage_EnableHoverTips=Enable Fortran Hover tips
+SearchPathsPropertyPage_ErrorSavingProperties=Error Saving Project Properties
+SearchPathsPropertyPage_FoldersToBeSearchedForIncludes=Folders to be searched for &INCLUDE files, in order of preference:
+SearchPathsPropertyPage_FoldersToBeSearchedForModules=Folders to be searched for &modules, in order of preference:
+SearchPathsPropertyPage_PathsDescription=The following specify the paths searched for modules\nand INCLUDE files during analysis and refactoring.\nThese MAY BE DIFFERENT from the settings used by\nyour compiler to build your project.
+SearchPathsPropertyPage_PropertiesCouldNotBeSaved=The project properties could not be saved.
+SearchPathsPropertyPage_SelectAFolderToBeSearchedForIncludes=Select a folder to be searched for INCLUDE files:
+SearchPathsPropertyPage_SelectAFolderToBeSearchedForModules=Select a folder to be searched for Fortran modules:
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AbstractFortranRefactoringActionDelegate.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AbstractFortranRefactoringActionDelegate.java
index 7ea6faf..2df5cfa 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AbstractFortranRefactoringActionDelegate.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AbstractFortranRefactoringActionDelegate.java
@@ -77,10 +77,10 @@
else
{
throw new IllegalStateException(
- "refactoringClass " +
+ "refactoringClass " + //$NON-NLS-1$
refactoringClass.getName() +
- " passed to AbstractFortranRefactoringActionDelegate constructor " +
- " is not an instance of IResourceRefactoring or IEditorRefactoring");
+ " passed to AbstractFortranRefactoringActionDelegate constructor " + //$NON-NLS-1$
+ " is not an instance of IResourceRefactoring or IEditorRefactoring"); //$NON-NLS-1$
}
}
@@ -141,9 +141,8 @@
{
if (getFortranEditor().getIFile() == null)
{
- MessageDialog.openError(getFortranEditor().getShell(), "Error",
- "The file in the editor cannot be refactored.\n\nFortran files can only be refactored if they " +
- "are located inside a Fortran project in your workspace.");
+ MessageDialog.openError(getFortranEditor().getShell(), Messages.AbstractFortranRefactoringActionDelegate_ErrorTitle,
+ Messages.AbstractFortranRefactoringActionDelegate_FileInEditorCannotBeRefactored);
}
else
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AddOnlyToUseStmtInputPage.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AddOnlyToUseStmtInputPage.java
index b770514..8a3b8b5 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AddOnlyToUseStmtInputPage.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/AddOnlyToUseStmtInputPage.java
@@ -48,7 +48,7 @@
Composite group = top;
Label lbl = new Label(group, SWT.NONE);
- lbl.setText("Select the module entities to add to the ONLY clause.");
+ lbl.setText(Messages.AddOnlyToUseStmtInputPage_SelectModuleEntitiesLabel);
for(int i=0; i<getRefactoring().getNumEntitiesInModule(); i++)
{
@@ -91,7 +91,6 @@
}
Label instruct = new Label(top, SWT.NONE);
- instruct.setText("Click OK to add the ONLY clause to the selected USE statement." +
- "To see what changes will be made, click Preview.");
+ instruct.setText(Messages.AddOnlyToUseStmtInputPage_ClickOKMessage);
}
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/CommonVarNamesInputPage.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/CommonVarNamesInputPage.java
index 5fa8c5c..5965680 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/CommonVarNamesInputPage.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/CommonVarNamesInputPage.java
@@ -53,10 +53,10 @@
Composite group = top;
Label headerLeft = new Label(group, SWT.NONE);
- headerLeft.setText("Original Name");
+ headerLeft.setText(Messages.CommonVarNamesInputPage_OriginalNameLabel);
Label headerRight = new Label(group, SWT.NONE);
- headerRight.setText("New Name");
+ headerRight.setText(Messages.CommonVarNamesInputPage_NewNameLabel);
for(int i=0; i<getRefactoring().getNumCommonVars(); i++)
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractLocalVariableAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractLocalVariableAction.java
index 0361824..c4845ca 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractLocalVariableAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractLocalVariableAction.java
@@ -82,7 +82,7 @@
twoCol.horizontalSpan = 2;
Label lbl = new Label(group, SWT.NONE);
- lbl.setText("Declaration:");
+ lbl.setText(Messages.ExtractLocalVariableAction_DeclarationLabel);
declField = new Text(group, SWT.BORDER);
declField.setText(extractRefactoring.getDecl());
@@ -99,8 +99,8 @@
// Call once for sure, just in case the user doesn't modify the text
extractRefactoring.setDecl(declField.getText());
- int offset = declField.getText().indexOf(":: ");
- if (offset < 0) offset = 0; else offset = offset + ":: ".length();
+ int offset = declField.getText().indexOf(":: "); //$NON-NLS-1$
+ if (offset < 0) offset = 0; else offset = offset + ":: ".length(); //$NON-NLS-1$
declField.setSelection(offset, declField.getText().length());
declField.setFocus();
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractProcedureAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractProcedureAction.java
index 9a8ef0b..d5e55d4 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractProcedureAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/ExtractProcedureAction.java
@@ -81,10 +81,10 @@
Composite group = top;
Label lbl = new Label(group, SWT.NONE);
- lbl.setText("Extract selected code to a subroutine named ");
+ lbl.setText(Messages.ExtractProcedureAction_SubroutineNameLabel);
newNameField = new Text(group, SWT.BORDER);
- newNameField.setText("");
+ newNameField.setText(""); //$NON-NLS-1$
newNameField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
newNameField.selectAll();
newNameField.addModifyListener(new ModifyListener()
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/KeywordCaseInputPage.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/KeywordCaseInputPage.java
index 962c5b2..07015bf 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/KeywordCaseInputPage.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/KeywordCaseInputPage.java
@@ -41,10 +41,10 @@
Composite group = top;
Label instr = new Label(group, SWT.NONE);
- instr.setText("Change keywords to:");
+ instr.setText(Messages.KeywordCaseInputPage_ChangeKeywordsToLabel);
radioLowerCase = new Button(group, SWT.RADIO);
- radioLowerCase.setText("Lower Case");
+ radioLowerCase.setText(Messages.KeywordCaseInputPage_LowerCaseLabel);
radioLowerCase.setSelection(true);
radioLowerCase.addSelectionListener(new SelectionListener()
{
@@ -61,10 +61,9 @@
});
radioUpperCase = new Button(group, SWT.RADIO);
- radioUpperCase.setText("Upper Case");
+ radioUpperCase.setText(Messages.KeywordCaseInputPage_UpperCaseLabel);
Label lbl = new Label(group, SWT.NONE);
- lbl.setText("Click OK to change the case of all keywords in the selected files. " +
- "To see what changes will be made, click Preview.");
+ lbl.setText(Messages.KeywordCaseInputPage_ClickOKMessage);
}
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/Messages.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/Messages.java
new file mode 100644
index 0000000..160d4a9
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/Messages.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others.
+ * 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
+ *
+ * Contributors:
+ * UIUC - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.photran.internal.ui.refactoring;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings.
+ *
+ * @author Jeff Overbey
+ */
+class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.photran.internal.ui.refactoring.messages"; //$NON-NLS-1$
+
+ public static String AbstractFortranRefactoringActionDelegate_ErrorTitle;
+
+ public static String AbstractFortranRefactoringActionDelegate_FileInEditorCannotBeRefactored;
+
+ public static String AddOnlyToUseStmtInputPage_ClickOKMessage;
+
+ public static String AddOnlyToUseStmtInputPage_SelectModuleEntitiesLabel;
+
+ public static String CommonVarNamesInputPage_NewNameLabel;
+
+ public static String CommonVarNamesInputPage_OriginalNameLabel;
+
+ public static String ExtractLocalVariableAction_DeclarationLabel;
+
+ public static String ExtractProcedureAction_SubroutineNameLabel;
+
+ public static String KeywordCaseInputPage_ChangeKeywordsToLabel;
+
+ public static String KeywordCaseInputPage_ClickOKMessage;
+
+ public static String KeywordCaseInputPage_LowerCaseLabel;
+
+ public static String KeywordCaseInputPage_UpperCaseLabel;
+
+ public static String RenameAction_MatchExternalSubprograms;
+
+ public static String RenameAction_RenameAtoB;
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ }
+}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/RenameAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/RenameAction.java
index b187c7a..a16a558 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/RenameAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/RenameAction.java
@@ -85,7 +85,10 @@
Composite group = top;
Label lbl = new Label(group, SWT.NONE);
- lbl.setText("Rename " + renameRefactoring.getOldNameOfIdentifier() + " to ");
+ lbl.setText(
+ Messages.bind(
+ Messages.RenameAction_RenameAtoB,
+ renameRefactoring.getOldNameOfIdentifier()));
newNameField = new Text(group, SWT.BORDER);
newNameField.setText(renameRefactoring.getOldNameOfIdentifier());
@@ -101,10 +104,10 @@
// Call once for sure, just in case the user doesn't modify the text
renameRefactoring.setNewNameForIdentifier(newNameField.getText());
- new Label(group, SWT.NONE).setText("");
+ new Label(group, SWT.NONE).setText(""); //$NON-NLS-1$
shouldBindInterfacesAndExternals = new Button(group, SWT.CHECK);
- shouldBindInterfacesAndExternals.setText("Match external subprograms with interfaces and external declarations");
+ shouldBindInterfacesAndExternals.setText(Messages.RenameAction_MatchExternalSubprograms);
shouldBindInterfacesAndExternals.setSelection(true);
shouldBindInterfacesAndExternals.addSelectionListener(new SelectionListener()
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/messages.properties b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/messages.properties
new file mode 100644
index 0000000..ca25024
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/refactoring/messages.properties
@@ -0,0 +1,14 @@
+AbstractFortranRefactoringActionDelegate_ErrorTitle=Error
+AbstractFortranRefactoringActionDelegate_FileInEditorCannotBeRefactored=The file in the editor cannot be refactored.\n\nFortran files can only be refactored if they are located inside a Fortran project in your workspace.
+AddOnlyToUseStmtInputPage_ClickOKMessage=Click OK to add the ONLY clause to the selected USE statement. To see what changes will be made, click Preview.
+AddOnlyToUseStmtInputPage_SelectModuleEntitiesLabel=Select the module entities to add to the ONLY clause.
+CommonVarNamesInputPage_NewNameLabel=New Name
+CommonVarNamesInputPage_OriginalNameLabel=Original Name
+ExtractLocalVariableAction_DeclarationLabel=Declaration:
+ExtractProcedureAction_SubroutineNameLabel=Extract selected code to a subroutine named
+KeywordCaseInputPage_ChangeKeywordsToLabel=Change keywords to:
+KeywordCaseInputPage_ClickOKMessage=Click OK to change the case of all keywords in the selected files. To see what changes will be made, click Preview.
+KeywordCaseInputPage_LowerCaseLabel=Lower Case
+KeywordCaseInputPage_UpperCaseLabel=Upper Case
+RenameAction_MatchExternalSubprograms=Match external subprograms with interfaces and external declarations
+RenameAction_RenameAtoB=Rename {0} to
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesActionDelegate.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesActionDelegate.java
index a31b1f6..7fb5588 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesActionDelegate.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesActionDelegate.java
@@ -60,7 +60,7 @@
try
{
if (!PhotranVPG.getInstance().doesProjectHaveRefactoringEnabled(getFortranEditor().getIFile()))
- throw new Exception("Please enable analysis and refactoring in the project properties.");
+ throw new Exception(Messages.FortranFindReferencesActionDelegate_PleaseEnableAnalysisAndRefactoring);
//progressMonitor.beginTask("Waiting for background work to complete (Photran indexer)", IProgressMonitor.UNKNOWN);
@@ -68,11 +68,11 @@
Token token = findEnclosingToken(getAST(), getFortranEditor().getSelection());
if (token == null || token.getTerminal() != Terminal.T_IDENT)
- throw new Exception("Please select an identifier.");
+ throw new Exception(Messages.FortranFindReferencesActionDelegate_PleaseSelectAnIdentifier);
List<Definition> defs = token.resolveBinding();
if (defs.isEmpty())
- throw new Exception("No definition could be found for the selected token.");
+ throw new Exception(Messages.FortranFindReferencesActionDelegate_DefinitionCouldNotBeFound);
Definition selectedDef =
defs.size() > 1 ? openSelectionDialog(defs)
@@ -86,7 +86,7 @@
{
String message = e.getMessage();
if (message == null) message = e.getClass().getName();
- MessageDialog.openError(getFortranEditor().getShell(), "Error", message);
+ MessageDialog.openError(getFortranEditor().getShell(), Messages.FortranFindReferencesActionDelegate_ErrorTitle, message);
}
finally
{
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesSearchQuery.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesSearchQuery.java
index ef7d797..264be46 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesSearchQuery.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranFindReferencesSearchQuery.java
@@ -56,9 +56,11 @@
public String getLabel()
{
int count = ((AbstractTextSearchResult)getSearchResult()).getMatchCount();
- return "'" + getDef().getCanonicalizedName() + "' - " + count
- + (count == 1 ? " match in " : " matches in ")
- + searchScope;
+ String description = "'" + getDef().getCanonicalizedName() + "' - "; //$NON-NLS-1$ //$NON-NLS-2$
+ if (count == 1)
+ return description + Messages.bind(Messages.FortranFindReferencesSearchQuery_OneMatch, searchScope);
+ else
+ return description + Messages.bind(Messages.FortranFindReferencesSearchQuery_nMatches, count, searchScope);
}
public ISearchResult getSearchResult()
@@ -88,7 +90,7 @@
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, message);
}
- return new Status(IStatus.OK, Activator.PLUGIN_ID, "Search Successful");
+ return new Status(IStatus.OK, Activator.PLUGIN_ID, Messages.FortranFindReferencesSearchQuery_SearchSuccessful);
}
private void filterAndAddSearchResult(PhotranTokenRef ref)
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchPage.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchPage.java
index df65a9c..4a3f78c 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchPage.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchPage.java
@@ -49,29 +49,29 @@
}
}
- public static final String EXTENSION_ID = "org.eclipse.photran.ui.vpgSearchPage";
+ public static final String EXTENSION_ID = "org.eclipse.photran.ui.vpgSearchPage"; //$NON-NLS-1$
// Dialog store id constants
- @Override protected String PAGE_NAME() { return "VPGSearchPage"; }
+ @Override protected String PAGE_NAME() { return "VPGSearchPage"; } //$NON-NLS-1$
@Override protected List<Pair<String, Integer>> searchFor()
{
List<Pair<String, Integer>> searchFor = new ArrayList<Pair<String, Integer>>(6);
- searchFor.add(Pair.of("Common block", FortranSearchQuery.FIND_COMMON_BLOCK));
- searchFor.add(Pair.of("Function", FortranSearchQuery.FIND_FUNCTION));
- searchFor.add(Pair.of("Subroutine", FortranSearchQuery.FIND_SUBROUTINE));
- searchFor.add(Pair.of("Module", FortranSearchQuery.FIND_MODULE));
- searchFor.add(Pair.of("Variable", FortranSearchQuery.FIND_VARIABLE));
- searchFor.add(Pair.of("Program", FortranSearchQuery.FIND_PROGRAM));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_CommonBlock, FortranSearchQuery.FIND_COMMON_BLOCK));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_Function, FortranSearchQuery.FIND_FUNCTION));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_Subroutine, FortranSearchQuery.FIND_SUBROUTINE));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_Module, FortranSearchQuery.FIND_MODULE));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_Variable, FortranSearchQuery.FIND_VARIABLE));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_Program, FortranSearchQuery.FIND_PROGRAM));
return searchFor;
}
@Override protected List<Pair<String, Integer>> limitTo()
{
List<Pair<String, Integer>> searchFor = new ArrayList<Pair<String, Integer>>(3);
- searchFor.add(Pair.of("All occurrences", FortranSearchQuery.FIND_ALL_OCCURANCES));
- searchFor.add(Pair.of("Declarations", FortranSearchQuery.FIND_DECLARATIONS));
- searchFor.add(Pair.of("References", FortranSearchQuery.FIND_REFERENCES));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_AllOccurrences, FortranSearchQuery.FIND_ALL_OCCURANCES));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_Declarations, FortranSearchQuery.FIND_DECLARATIONS));
+ searchFor.add(Pair.of(Messages.FortranSearchPage_References, FortranSearchQuery.FIND_REFERENCES));
return searchFor;
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchQuery.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchQuery.java
index 7b15000..60c949f 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchQuery.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/FortranSearchQuery.java
@@ -218,13 +218,13 @@
*/
@Override protected void runAdditionalSearchPass(int passNum, IProgressMonitor pm)
{
- pm.beginTask("Adding references", matchesToAddLater.size());
+ pm.beginTask(Messages.FortranSearchQuery_AddingReferences, matchesToAddLater.size());
String lastFilename = null;
for (PhotranTokenRef tokenRef : matchesToAddLater) {
if (!tokenRef.getFilename().equals(lastFilename)) {
lastFilename = tokenRef.getFilename();
- pm.subTask("Adding references in " + lastFilename.substring(lastFilename.lastIndexOf('/')+1));
+ pm.subTask(Messages.bind(Messages.FortranSearchQuery_AddingReferencesIn, lastFilename.substring(lastFilename.lastIndexOf('/')+1)));
}
pm.worked(1);
@@ -267,11 +267,10 @@
MessageDialog.openWarning(
Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Warning",
- "References in the following projects have been excluded from the search" +
- " results because Fortran analysis/refactoring is disabled:\n\n" + projects +
- "\nPlease enable Fortran analysis/refactoring for these projects if you wish" +
- " for their references to show in search results.");
+ Messages.FortranSearchQuery_WarningTitle,
+ Messages.bind(
+ Messages.FortranSearchQuery_AnalysisRefactoringDisabled,
+ projects));
}
});
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/Messages.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/Messages.java
new file mode 100644
index 0000000..444b5b9
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/Messages.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others.
+ * 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
+ *
+ * Contributors:
+ * UIUC - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.photran.internal.ui.search;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings.
+ *
+ * @author Jeff Overbey
+ */
+class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.photran.internal.ui.search.messages"; //$NON-NLS-1$
+
+ public static String FortranFindReferencesActionDelegate_DefinitionCouldNotBeFound;
+
+ public static String FortranFindReferencesActionDelegate_ErrorTitle;
+
+ public static String FortranFindReferencesActionDelegate_PleaseEnableAnalysisAndRefactoring;
+
+ public static String FortranFindReferencesActionDelegate_PleaseSelectAnIdentifier;
+
+ public static String FortranFindReferencesSearchQuery_nMatches;
+
+ public static String FortranFindReferencesSearchQuery_OneMatch;
+
+ public static String FortranFindReferencesSearchQuery_SearchSuccessful;
+
+ public static String FortranSearchPage_AllOccurrences;
+
+ public static String FortranSearchPage_CommonBlock;
+
+ public static String FortranSearchPage_Declarations;
+
+ public static String FortranSearchPage_Function;
+
+ public static String FortranSearchPage_Module;
+
+ public static String FortranSearchPage_Program;
+
+ public static String FortranSearchPage_References;
+
+ public static String FortranSearchPage_Subroutine;
+
+ public static String FortranSearchPage_Variable;
+
+ public static String FortranSearchQuery_AddingReferences;
+
+ public static String FortranSearchQuery_AddingReferencesIn;
+
+ public static String FortranSearchQuery_AnalysisRefactoringDisabled;
+
+ public static String FortranSearchQuery_WarningTitle;
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ }
+}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/messages.properties b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/messages.properties
new file mode 100644
index 0000000..6297668
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/search/messages.properties
@@ -0,0 +1,20 @@
+FortranFindReferencesActionDelegate_DefinitionCouldNotBeFound=No definition could be found for the selected token.
+FortranFindReferencesActionDelegate_ErrorTitle=Error
+FortranFindReferencesActionDelegate_PleaseEnableAnalysisAndRefactoring=Please enable analysis and refactoring in the project properties.
+FortranFindReferencesActionDelegate_PleaseSelectAnIdentifier=Please select an identifier.
+FortranFindReferencesSearchQuery_nMatches={0} matches in {1}
+FortranFindReferencesSearchQuery_OneMatch=1 match in {0}
+FortranFindReferencesSearchQuery_SearchSuccessful=Search Successful
+FortranSearchPage_AllOccurrences=All occurrences
+FortranSearchPage_CommonBlock=Common block
+FortranSearchPage_Declarations=Declarations
+FortranSearchPage_Function=Function
+FortranSearchPage_Module=Module
+FortranSearchPage_Program=Program
+FortranSearchPage_References=References
+FortranSearchPage_Subroutine=Subroutine
+FortranSearchPage_Variable=Variable
+FortranSearchQuery_AddingReferences=Adding references
+FortranSearchQuery_AddingReferencesIn=Adding references in {0}
+FortranSearchQuery_AnalysisRefactoringDisabled=References in the following projects have been excluded from the search results because Fortran analysis/refactoring is disabled:\n\n{0}\nPlease enable Fortran analysis/refactoring for these projects if you wish for their references to show in search results.
+FortranSearchQuery_WarningTitle=Warning
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/declaration/DeclarationView.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/declaration/DeclarationView.java
index 33805ee..d7cd439 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/declaration/DeclarationView.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/declaration/DeclarationView.java
@@ -135,7 +135,7 @@
viewer.refresh();
}
- private static Pattern blankLine = Pattern.compile("(([ \\t]*[\\r\\n]+)+)[^\\00]*");
+ private static Pattern blankLine = Pattern.compile("(([ \\t]*[\\r\\n]+)+)[^\\00]*"); //$NON-NLS-1$
private String trimBlankLines(String str)
{
Matcher m = blankLine.matcher(str);
@@ -193,7 +193,7 @@
String declViewEnabledProperty = new SearchPathProperties().getProperty(
editor.getIFile(),
SearchPathProperties.ENABLE_DECL_VIEW_PROPERTY_NAME);
- if (declViewEnabledProperty != null && declViewEnabledProperty.equals("true"))
+ if (declViewEnabledProperty != null && declViewEnabledProperty.equals("true")) //$NON-NLS-1$
{
addCaretMovementListenerTo(editor);
FortranEditorTasks tasks = FortranEditorTasks.instance(editor);
@@ -271,7 +271,7 @@
*/
private void stopObserving(FortranEditor editor)
{
- update("");
+ update(""); //$NON-NLS-1$
if (editor != null)
removeCaretMovementListenerFrom(editor);
}
@@ -306,7 +306,7 @@
activeDefinitions.put(file.getFullPath().toPortableString(), newDefMap);
}
- PhotranVPG.getInstance().debug(" Decl view IEditorVPGTask handler:\t" + (System.currentTimeMillis()-start) + " ms", PhotranVPG.getFilenameForIFile(file));
+ PhotranVPG.getInstance().debug(" Decl view IEditorVPGTask handler:\t" + (System.currentTimeMillis()-start) + " ms", PhotranVPG.getFilenameForIFile(file)); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -324,7 +324,7 @@
activeAST.put(path, ast);
activeTokenList.put(path, tokenList);
- PhotranVPG.getInstance().debug(" Decl view IEditorASTTask handler:\t" + (System.currentTimeMillis()-start) + " ms", null);
+ PhotranVPG.getInstance().debug(" Decl view IEditorASTTask handler:\t" + (System.currentTimeMillis()-start) + " ms", null); //$NON-NLS-1$ //$NON-NLS-2$
}
return true;
}
@@ -343,12 +343,12 @@
{
String description = defMap.lookup((TextSelection)event.getSelection(), tokenList);
update(description == null
- ? ""
+ ? "" //$NON-NLS-1$
: description);
}
else
{
- update("");
+ update(""); //$NON-NLS-1$
}
}
}
\ No newline at end of file
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/CopyMarkedFileAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/CopyMarkedFileAction.java
index 81457bb..b670016 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/CopyMarkedFileAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/CopyMarkedFileAction.java
@@ -36,15 +36,15 @@
*/
public class CopyMarkedFileAction extends Action
{
- private static final String SEPARATOR = " ";
+ private static final String SEPARATOR = " "; //$NON-NLS-1$
VPGProblemView myView = null;
/**
* @param site
*/
- public CopyMarkedFileAction(VPGProblemView view, String text)
+ public CopyMarkedFileAction(VPGProblemView view)
{
- super(text);
+ super(Messages.CopyMarkedFileAction_Copy);
myView = view;
}
@@ -71,7 +71,7 @@
protected String asText(ISelection sel)
{
IStructuredSelection selection = (IStructuredSelection)sel;
- String result = "";
+ String result = ""; //$NON-NLS-1$
for (Iterator<?> iter= selection.iterator(); iter.hasNext();)
{
Object element= iter.next();
@@ -79,7 +79,7 @@
{
IMarker marker = (IMarker)element;
result = result.concat(asText(marker));
- result = result.concat("\n");
+ result = result.concat("\n"); //$NON-NLS-1$
}
}
return result;
@@ -89,10 +89,10 @@
// get the message associated with the marker
protected String asText(IMarker marker)
{
- String markerMsg = "Description: " + MarkerUtilities.getMessage(marker);
- String markerRes = "Resource: " + marker.getResource().getName().toString();
- String markerPath = "Path: " + marker.getResource().getProjectRelativePath().toString();
- String markerLoc = "Location: line " + String.valueOf(MarkerUtilities.getLineNumber(marker));
+ String markerMsg = Messages.CopyMarkedFileAction_DescriptionLabel + MarkerUtilities.getMessage(marker);
+ String markerRes = Messages.CopyMarkedFileAction_ResourceLabel + marker.getResource().getName().toString();
+ String markerPath = Messages.CopyMarkedFileAction_PathLabel + marker.getResource().getProjectRelativePath().toString();
+ String markerLoc = Messages.CopyMarkedFileAction_LocationLineLabel + String.valueOf(MarkerUtilities.getLineNumber(marker));
String result = markerMsg + SEPARATOR +
markerRes + SEPARATOR +
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ErrorWarningFilterAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ErrorWarningFilterAction.java
index 397b10c..04f4740 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ErrorWarningFilterAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ErrorWarningFilterAction.java
@@ -43,8 +43,8 @@
{
switch (severity)
{
- case IMarker.SEVERITY_ERROR: return "Errors";
- case IMarker.SEVERITY_WARNING: return "Warnings";
+ case IMarker.SEVERITY_ERROR: return Messages.ErrorWarningFilterAction_Errors;
+ case IMarker.SEVERITY_WARNING: return Messages.ErrorWarningFilterAction_Warnings;
default: throw new IllegalStateException();
}
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/Messages.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/Messages.java
new file mode 100644
index 0000000..d866964
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/Messages.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2010 University of Illinois at Urbana-Champaign and others.
+ * 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
+ *
+ * Contributors:
+ * UIUC - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.photran.internal.ui.views.vpgproblems;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized strings.
+ *
+ * @author Jeff Overbey
+ */
+class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.photran.internal.ui.views.vpgproblems.messages"; //$NON-NLS-1$
+
+ public static String CopyMarkedFileAction_Copy;
+
+ public static String CopyMarkedFileAction_DescriptionLabel;
+
+ public static String CopyMarkedFileAction_LocationLineLabel;
+
+ public static String CopyMarkedFileAction_PathLabel;
+
+ public static String CopyMarkedFileAction_ResourceLabel;
+
+ public static String ErrorWarningFilterAction_Errors;
+
+ public static String ErrorWarningFilterAction_Warnings;
+
+ public static String OpenMarkedFileAction_GoTo;
+
+ public static String OpenMarkedFileAction_GoToTooltip;
+
+ public static String RemoveMarkerAction_Delete;
+
+ public static String RemoveMarkerAction_DeleteTooltip;
+
+ public static String SelectedResourceFilterAction_FilterBySelection;
+
+ public static String SelectedResourceFilterAction_FilterBySelectionTooltip;
+
+ public static String ShowFullMessageAction_EventDetails;
+
+ public static String ShowFullMessageAction_ShowDetailsTooltip;
+
+ public static String VPGProblemContextMenu_Problems;
+
+ public static String VPGProblemLabelProvider_LineN;
+
+ public static String VPGProblemView_DescriptionColumnHeader;
+
+ public static String VPGProblemView_Errors;
+
+ public static String VPGProblemView_nErrors;
+
+ public static String VPGProblemView_nWarnings;
+
+ public static String VPGProblemView_PathColumnHeader;
+
+ public static String VPGProblemView_ResourceColumnHeader;
+
+ public static String VPGProblemView_UpdatingProblemsViewMessage;
+
+ public static String VPGProblemView_Warnings;
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ }
+}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/OpenMarkedFileAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/OpenMarkedFileAction.java
index 1cb2c7c..06a870f 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/OpenMarkedFileAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/OpenMarkedFileAction.java
@@ -45,8 +45,8 @@
public OpenMarkedFileAction(IWorkbenchSite site)
{
super(site);
- setText("Go to");
- setToolTipText("Go to the line in file");
+ setText(Messages.OpenMarkedFileAction_GoTo);
+ setToolTipText(Messages.OpenMarkedFileAction_GoToTooltip);
}
@SuppressWarnings("deprecation")
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/RemoveMarkerAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/RemoveMarkerAction.java
index 9ebb685..8d6dfeb 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/RemoveMarkerAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/RemoveMarkerAction.java
@@ -36,9 +36,8 @@
public RemoveMarkerAction(IWorkbenchSite site)
{
super(site);
- setText("Delete");
- setToolTipText("Delete selected marker(s) from list");
- // TODO Auto-generated constructor stub
+ setText(Messages.RemoveMarkerAction_Delete);
+ setToolTipText(Messages.RemoveMarkerAction_DeleteTooltip);
}
public RemoveMarkerAction(IWorkbenchSite site, String text, String toolTipText)
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/SelectedResourceFilterAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/SelectedResourceFilterAction.java
index 5c0d914..9c886cb 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/SelectedResourceFilterAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/SelectedResourceFilterAction.java
@@ -42,11 +42,11 @@
public SelectedResourceFilterAction(VPGProblemView vpgView)
{
- super("Filter by Selection", AS_CHECK_BOX);
+ super(Messages.SelectedResourceFilterAction_FilterBySelection, AS_CHECK_BOX);
this.vpgView = vpgView;
- setToolTipText("Displays only problems that occur in the files/projects that are currently selected (e.g., in the Fortran Projects view or in the active editor)");
+ setToolTipText(Messages.SelectedResourceFilterAction_FilterBySelectionTooltip);
setChecked(false);
vpgView.getTableViewer().addFilter(new MarkerResourceFilter());
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ShowFullMessageAction.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ShowFullMessageAction.java
index 00574cc..9679f84 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ShowFullMessageAction.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/ShowFullMessageAction.java
@@ -37,7 +37,6 @@
* Action to display the entire message for a marker in a separate dialog.
*
* @author Timofey Yuvashev
- *
* @author Esfar Huq
* @author Rui Wang
*/
@@ -52,8 +51,8 @@
public ShowFullMessageAction(IWorkbenchSite site)
{
super(site);
- setText("Event Details");
- setToolTipText("Show the entire message for selected event(s)");
+ setText(Messages.ShowFullMessageAction_EventDetails);
+ setToolTipText(Messages.ShowFullMessageAction_ShowDetailsTooltip);
}
public ShowFullMessageAction(IWorkbenchSite site, String text, String toolTipText)
@@ -77,7 +76,7 @@
protected void configureShell(Shell shell)
{
super.configureShell(shell);
- shell.setText("Event Details");
+ shell.setText(Messages.ShowFullMessageAction_EventDetails);
shell.setSize(500, 300);
}
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemContextMenu.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemContextMenu.java
index 6b395ac..3d3a7b6 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemContextMenu.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemContextMenu.java
@@ -26,14 +26,14 @@
*/
public class VPGProblemContextMenu extends MenuManager
{
- public VPGProblemContextMenu(IViewSite site, String title)
+ public VPGProblemContextMenu(IViewSite site)
{
- super(title);
+ super(Messages.VPGProblemContextMenu_Problems);
OpenMarkedFileAction openAct = new OpenMarkedFileAction(site);
add(openAct);
- CopyMarkedFileAction copyAct = new CopyMarkedFileAction((VPGProblemView)site.getPart(), "Copy");
+ CopyMarkedFileAction copyAct = new CopyMarkedFileAction((VPGProblemView)site.getPart());
add(copyAct);
/* RemoveMarkerAction remAct = new RemoveMarkerAction(site);
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemLabelProvider.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemLabelProvider.java
index c7d8dfa..4f4d6f9 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemLabelProvider.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemLabelProvider.java
@@ -79,8 +79,8 @@
{
int lineNum = MarkerUtilities.getLineNumber(marker);
if(lineNum >= 0)
- return "line " + String.valueOf(lineNum);
- return "";
+ return Messages.bind(Messages.VPGProblemLabelProvider_LineN, lineNum);
+ return ""; //$NON-NLS-1$
}
private static String getFirstMessageSentense(IMarker marker)
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemView.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemView.java
index 86fa993..2d1099f 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemView.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/VPGProblemView.java
@@ -71,9 +71,9 @@
static enum VPGViewColumn
{
// Column Label Width (in pixels)
- DESCRIPTION("Description", 44),
- RESOURCE ("Resource", 10),
- PATH ("Path", 20);
+ DESCRIPTION(Messages.VPGProblemView_DescriptionColumnHeader, 44),
+ RESOURCE (Messages.VPGProblemView_ResourceColumnHeader, 10),
+ PATH (Messages.VPGProblemView_PathColumnHeader, 20);
public final String name;
public final int width;
@@ -137,7 +137,7 @@
private MenuManager createMenuManager()
{
- MenuManager manager = new VPGProblemContextMenu(getViewSite(), "Problems View Menu");
+ MenuManager manager = new VPGProblemContextMenu(getViewSite());
tableViewer.getTable().setMenu(manager.createContextMenu(tableViewer.getTable()));
return manager;
}
@@ -161,7 +161,7 @@
{
private RecreateMarkers()
{
- super("Updating Fortran Analysis/Refactoring Problems view");
+ super(Messages.VPGProblemView_UpdatingProblemsViewMessage);
}
@Override public IStatus runInWorkspace(final IProgressMonitor monitor)
@@ -196,13 +196,13 @@
//only print out counts when looking at an unfiltered view
if(!selectionFilterAction.isChecked())
{
- warningsFilterAction.setText(String.valueOf(markerCount[IMarker.SEVERITY_WARNING]) + " Warnings");
- errorsFilterAction.setText(String.valueOf(markerCount[IMarker.SEVERITY_ERROR]) + " Errors");
+ warningsFilterAction.setText(Messages.bind(Messages.VPGProblemView_nWarnings, markerCount[IMarker.SEVERITY_WARNING]));
+ errorsFilterAction.setText(Messages.bind(Messages.VPGProblemView_nErrors, markerCount[IMarker.SEVERITY_ERROR]));
}
else //FILTERED
{
- warningsFilterAction.setText("Warnings");
- errorsFilterAction.setText("Errors");
+ warningsFilterAction.setText(Messages.VPGProblemView_Warnings);
+ errorsFilterAction.setText(Messages.VPGProblemView_Errors);
}
}
}
@@ -247,7 +247,7 @@
public void createActions()
{
- copyAction = new CopyMarkedFileAction(this, "Copy");
+ copyAction = new CopyMarkedFileAction(this);
openAction = new OpenMarkedFileAction(getSite());
showAction = new ShowFullMessageAction(getSite());
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/messages.properties b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/messages.properties
new file mode 100644
index 0000000..6ce6c79
--- /dev/null
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/views/vpgproblems/messages.properties
@@ -0,0 +1,25 @@
+CopyMarkedFileAction_Copy=Copy
+CopyMarkedFileAction_DescriptionLabel=Description:
+CopyMarkedFileAction_LocationLineLabel=Location: line
+CopyMarkedFileAction_PathLabel=Path:
+CopyMarkedFileAction_ResourceLabel=Resource:
+ErrorWarningFilterAction_Errors=Errors
+ErrorWarningFilterAction_Warnings=Warnings
+OpenMarkedFileAction_GoTo=Go to
+OpenMarkedFileAction_GoToTooltip=Go to the line in file
+RemoveMarkerAction_Delete=Delete
+RemoveMarkerAction_DeleteTooltip=Delete selected marker(s) from list
+SelectedResourceFilterAction_FilterBySelection=Filter by Selection
+SelectedResourceFilterAction_FilterBySelectionTooltip=Displays only problems that occur in the files/projects that are currently selected (e.g., in the Fortran Projects view or in the active editor)
+ShowFullMessageAction_EventDetails=Event Details
+ShowFullMessageAction_ShowDetailsTooltip=Show the entire message for selected event(s)
+VPGProblemContextMenu_Problems=Problems
+VPGProblemLabelProvider_LineN=line {0}
+VPGProblemView_DescriptionColumnHeader=Description
+VPGProblemView_Errors=Errors
+VPGProblemView_nErrors={0} Errors
+VPGProblemView_nWarnings={0} Warnings
+VPGProblemView_PathColumnHeader=Path
+VPGProblemView_ResourceColumnHeader=Resource
+VPGProblemView_UpdatingProblemsViewMessage=Updating Fortran Analysis/Refactoring Problems view
+VPGProblemView_Warnings=Warnings
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/Activator.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/Activator.java
index 185ca99..fb0aa91 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/Activator.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/Activator.java
@@ -9,7 +9,7 @@
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.photran.ui.vpg";
+ public static final String PLUGIN_ID = "org.eclipse.photran.ui.vpg"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
diff --git a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/PhotranVPGContribution.java b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/PhotranVPGContribution.java
index c329c96..80afc35 100644
--- a/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/PhotranVPGContribution.java
+++ b/org.eclipse.photran.ui.vpg/src/org/eclipse/photran/internal/ui/vpg/PhotranVPGContribution.java
@@ -22,7 +22,7 @@
*/
public class PhotranVPGContribution implements IEclipseVPGFactory
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public EclipseVPG getVPG()
{
return PhotranVPG.getInstance();