Skip to content
Browse files

Merge pull request #42 from GordonSmith/SourceTidy

Source Tidy

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
  • Loading branch information...
2 parents 6cf06c1 + a1bfac5 commit e964639a195cdaefd8b44580968a30650c207508 @richardkchapman richardkchapman committed Apr 25, 2012
Showing with 3,167 additions and 2,913 deletions.
  1. +8 −8 org.hpccsystems.eclide/src/org/hpccsystems/eclide/Activator.java
  2. +6 −5 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/ECLBuilder.java
  3. +35 −28 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/ECLCompiler.java
  4. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/ECLProjectAction.java
  5. +17 −14 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/RelationshipHelper.java
  6. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLBase.java
  7. +2 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLDefinition.java
  8. +6 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLGlobalMeta.java
  9. +26 −13 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLMetaTree.java
  10. +4 −4 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLAnnotationHover.java
  11. +3 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLColorManager.java
  12. +31 −26 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLCompletionProcessor.java
  13. +38 −38 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLConfiguration.java
  14. +4 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLDocument.java
  15. +9 −9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLDocumentProvider.java
  16. +14 −7 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLDoubleClickStrategy.java
  17. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLEditor.java
  18. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLEditorActionContributor.java
  19. +12 −9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLTextHover.java
  20. +42 −40 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLWindow.java
  21. +9 −9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/importWizards/ImportWizard.java
  22. +8 −7 org.hpccsystems.eclide/src/org/hpccsystems/eclide/importWizards/ImportWizardPage.java
  23. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchConstants.java
  24. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchDelegate.java
  25. +28 −28 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchServerTab.java
  26. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchShortcutLocal.java
  27. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchTabGroup.java
  28. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/perspectives/ECLPerspective.java
  29. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/perspectives/ECLWatch.java
  30. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/preferences/ECLCompilerPreferencePage.java
  31. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/preferences/ECLPreferenceInitializer.java
  32. +3 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/problem/QuickFix.java
  33. +10 −10 org.hpccsystems.eclide/src/org/hpccsystems/eclide/problem/QuickFixer.java
  34. +75 −82 org.hpccsystems.eclide/src/org/hpccsystems/eclide/project/ECLProjectSupport.java
  35. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/text/ECLPartitionScanner.java
  36. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/text/ECLRule.java
  37. +7 −7 org.hpccsystems.eclide/src/org/hpccsystems/eclide/text/ECLScanner.java
  38. +3 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/text/ECLTagScanner.java
  39. +18 −10 org.hpccsystems.eclide/src/org/hpccsystems/eclide/text/ECLWordRule.java
  40. +35 −32 org.hpccsystems.eclide/src/org/hpccsystems/eclide/text/NonRuleBasedDamagerRepairer.java
  41. +1 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/navigator/CustomProjectWorkbenchRoot.java
  42. +3 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/navigator/ECLContentProvider.java
  43. +9 −9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/BrowserEx.java
  44. +6 −5 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/ECLContentOutlinePage.java
  45. +67 −65 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/HtmlViewer.java
  46. +3 −4 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/MetaSourceLabelProvider.java
  47. +7 −7 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/MetaSourceTreeItemContentProvider.java
  48. +3 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/ResultViewer.java
  49. +13 −11 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/TableEx.java
  50. +24 −19 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/AllItemView.java
  51. +8 −6 ...hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/FileSprayWorkunitFolderView.java
  52. +16 −10 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/FileSprayWorkunitView.java
  53. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/GraphView.java
  54. +11 −9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/PlatformActions.java
  55. +9 −9 ...systems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/PlatformTreeItemContentProvider.java
  56. +6 −3 ...ccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/PlatformTreeItemLabelProvider.java
  57. +5 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/PlatformView.java
  58. +46 −42 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/PlatformViewer.java
  59. +5 −4 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/ResultFolderView.java
  60. +5 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/ResultView.java
  61. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/TextItemView.java
  62. +8 −6 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/WorkunitFolderView.java
  63. +15 −15 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/WorkunitTabItem.java
  64. +3 −3 ...systems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/WorkunitTreeItemContentProvider.java
  65. +8 −7 org.hpccsystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/WorkunitView.java
  66. +11 −10 ...ystems.eclide/src/org/hpccsystems/eclide/ui/viewer/platform/WorkunitsTreeItemContentProvider.java
  67. +22 −20 org.hpccsystems.eclide/src/org/hpccsystems/eclide/wizards/ECLNewFileWizard.java
  68. +5 −3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/wizards/ECLNewFileWizardPage.java
  69. +16 −16 org.hpccsystems.eclide/src/org/hpccsystems/eclide/wizards/ECLNewProjectWizard.java
  70. +2 −1 org.hpccsystems.eclide/src/org/hpccsystems/eclide/wizards/ECLNewProjectWizardPage.java
  71. +9 −9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/wizards/ImportWizard.java
  72. +7 −6 org.hpccsystems.eclide/src/org/hpccsystems/eclide/wizards/ImportWizardPage.java
  73. +20 −15 org.hpccsystems.eclide/src/org/hpccsystems/internal/CmdArgs.java
  74. +8 −20 org.hpccsystems.eclide/src/org/hpccsystems/internal/CmdProcess.java
  75. +94 −88 org.hpccsystems.eclide/src/org/hpccsystems/internal/ConfigurationPreferenceStore.java
  76. +7 −6 org.hpccsystems.eclide/src/org/hpccsystems/internal/DatasetParser.java
  77. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/internal/ECLArchiveParser.java
  78. +3 −3 org.hpccsystems.eclide/src/org/hpccsystems/internal/ECLLaunchConfigurationTab.java
  79. +5 −4 org.hpccsystems.eclide/src/org/hpccsystems/internal/EclCCError.java
  80. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/internal/EclCCErrorParser.java
  81. +32 −24 org.hpccsystems.eclide/src/org/hpccsystems/internal/Eclipse.java
  82. +9 −8 org.hpccsystems.eclide/src/org/hpccsystems/internal/OS.java
  83. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/internal/StackHandler.java
  84. +8 −7 org.hpccsystems.eclide/src/org/hpccsystems/internal/autoc/ECLCompletion.java
  85. +28 −22 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/ClientTools.java
  86. +9 −7 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/Cluster.java
  87. +10 −10 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/CollectionDelta.java
  88. +21 −18 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/Data.java
  89. +10 −7 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/DataQuerySet.java
  90. +9 −7 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/DataSingleton.java
  91. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/DataSingletonCollection.java
  92. +17 −14 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/DropZone.java
  93. +2 −1 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/EqualsUtil.java
  94. +39 −28 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/FileSprayWorkunit.java
  95. +13 −10 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/Graph.java
  96. +28 −17 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/LogicalFile.java
  97. +53 −48 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/Platform.java
  98. +36 −28 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/Result.java
  99. +53 −39 org.hpccsystems.eclide/src/org/hpccsystems/internal/data/Workunit.java
  100. +2 −2 org.hpccsystems.eclide/src/org/hpccsystems/internal/ui/LabelFieldEditor.java
  101. +20 −17 org.hpccsystems.eclide/src/org/hpccsystems/internal/ui/tree/ItemView.java
  102. +11 −8 org.hpccsystems.eclide/src/org/hpccsystems/internal/ui/tree/LazyChildLoader.java
  103. +3 −3 org.hpccsystems.eclide/src/org/hpccsystems/internal/ui/tree/TreeItemContentProvider.java
  104. +176 −170 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/ArrayOfEspException.java
  105. +188 −182 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/AttributeType.java
  106. +188 −182 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CheckinAttributeRequest.java
  107. +123 −117 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CheckinAttributes.java
  108. +151 −145 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CheckoutAttributeRequest.java
  109. +123 −117 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CheckoutAttributes.java
  110. +188 −182 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CreateAttribute.java
  111. +151 −145 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CreateAttributeResponse.java
  112. +114 −108 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CreateLabel.java
  113. +114 −108 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CreateLabelResponse.java
  114. +114 −108 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CreateModule.java
  115. +151 −145 org.hpccsystems.eclide/src/org/hpccsystems/ws/WsAttributes/CreateModuleResponse.java
Sorry, we could not display the entire diff because too many files (452) changed.
View
16 org.hpccsystems.eclide/src/org/hpccsystems/eclide/Activator.java
@@ -25,7 +25,7 @@
// The shared instance
private static Activator plugin;
-
+
/**
* The constructor
*/
@@ -71,11 +71,11 @@ public static Activator getDefault() {
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
-
- public static Image getImage(String imagePath) {
- ImageDescriptor imageDescriptor = getImageDescriptor(imagePath);
- Image image = imageDescriptor.createImage();
- return image;
- }
-
+
+ public static Image getImage(String imagePath) {
+ ImageDescriptor imageDescriptor = getImageDescriptor(imagePath);
+ Image image = imageDescriptor.createImage();
+ return image;
+ }
+
}
View
11 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/ECLBuilder.java
@@ -31,17 +31,17 @@
public class ECLBuilder extends IncrementalProjectBuilder {
class ECLDeltaVisitor implements IResourceDeltaVisitor {
private IProgressMonitor monitor;
-
+
ECLDeltaVisitor(IProgressMonitor monitor) {
this.monitor = monitor;
}
-
+
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
if (monitor.isCanceled()) {
return false;
}
-
+
IResource resource = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
@@ -102,9 +102,10 @@ public boolean visit(IResource resource) {
void checkItem(IResource resource, IProgressMonitor monitor) {
if (resource instanceof IFile && resource.getName().endsWith(".ecl")) {
IFile file = (IFile) resource;
- if (checkedFiles.contains(file))
+ if (checkedFiles.contains(file)) {
return;
-
+ }
+
checkedFiles.add(file);
monitor.subTask(file.getName());
ClientTools ct = Data.get().GetClientTools(file);
View
63 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/ECLCompiler.java
@@ -44,9 +44,9 @@
IProject project;
IProject[] referencedProjects;
-
+
String version = null;
-
+
ConfigurationPreferenceStore launchConfiguration;
IPath binPath;
File eclccFile;
@@ -65,7 +65,7 @@
boolean monitorDependees = false;
boolean supressSubsequentErrors = false;
boolean enableMetaProcessing = true;
-
+
boolean executeRemotely = false;
String serverIP;
String serverCluster;
@@ -81,11 +81,11 @@
boolean hasError; //TODO Has Error notification is all wrong.
String QUOTE = "";
-
+
class BasicHandler implements IProcessOutput {
protected StringBuilder sbOut;
protected StringBuilder sbErr;
-
+
BasicHandler() {
sbOut = new StringBuilder();
sbErr = new StringBuilder();
@@ -145,13 +145,13 @@ public void ProcessErr(BufferedReader errReader) {
public ECLArchiveHandler() {
super();
}
-
+
Set<IFile> getAncestors(IFile file) {
ECLArchiveParser parser = new ECLArchiveParser(file, sbOut.toString());
assert(parser != null);
return parser.ancestors;
}
-
+
@Override
public void ProcessOut(BufferedReader reader) {
super.ProcessOut(reader);
@@ -189,8 +189,9 @@ public void ProcessOut(BufferedReader reader) {
eclccConsoleWriter.print("Out: ");
eclccConsoleWriter.println(stdIn);
int lastSpace = stdIn.lastIndexOf(' ');
- if (lastSpace != -1)
+ if (lastSpace != -1) {
wuid = stdIn.substring(lastSpace + 1, stdIn.length());
+ }
}
} catch (IOException e) {
e.printStackTrace();
@@ -204,7 +205,7 @@ public ECLCompiler(ConfigurationPreferenceStore launchConfiguration) {
binPath = new Path(launchConfiguration.getAttribute(ClientTools.P_TOOLSPATH, ClientTools.P_TOOLSPATH_DEFAULT));
eclccFile = binPath.append("eclcc").toFile();
eclplusFile = binPath.append("eclplus").toFile();
-
+
argsCommon = launchConfiguration.getAttribute(ClientTools.P_ARGSCOMMON, ClientTools.P_ARGSCOMMON_DEFAULT);
argsSyntaxCheck = launchConfiguration.getAttribute(ClientTools.P_ARGSSYNTAX, ClientTools.P_ARGSSYNTAX_DEFAULT);
argsCompile = launchConfiguration.getAttribute(ClientTools.P_ARGSCOMPILE, ClientTools.P_ARGSCOMPILE_DEFAULT);
@@ -229,35 +230,35 @@ public ECLCompiler(ConfigurationPreferenceStore launchConfiguration) {
eclccConsoleWriter = eclccConsole.newMessageStream();
//eclccConsoleWriter.setActivateOnWrite(true);
}
-
+
public ECLCompiler(ConfigurationPreferenceStore launchConfiguration, IProject project) {
this(launchConfiguration);
-
+
this.project = project;
try {
referencedProjects = project.getReferencedProjects();
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
projectPath = project.getLocation();
workingPath = project.getWorkingLocation(Activator.PLUGIN_ID);
rootFolder = project.getWorkspace().getRoot().getFullPath();
}
-
+
boolean HasCompiler() {
return !getVersion().isEmpty();
}
-
+
void GetIncludeArgs(CmdArgs cmdArgs) {
cmdArgs.Append("I", projectPath.toOSString());
for (int i = 0; i < referencedProjects.length; ++i) {
cmdArgs.Append("I", referencedProjects[i].getLocation().toOSString());
}
}
-
+
public String getVersion() {
if (version == null) {
version = new String();
@@ -271,26 +272,28 @@ public String getVersion() {
}
return version;
}
-
+
public String getBuildVersion() {
String version = getVersion();
String[] versions = version.split(" ");
- if (versions.length >= 2)
+ if (versions.length >= 2) {
return versions[1];
+ }
return "";
}
-
+
public String getLanguageVersion() {
String version = getVersion();
String[] versions = version.split(" ");
- if (versions.length >= 1)
+ if (versions.length >= 1) {
return versions[0];
+ }
return "";
}
-
+
public void checkSyntax(IFile file) {
Eclipse.deleteMarkers(file);
-
+
if (!HasCompiler()) {
Eclipse.addMarker(file, IMarker.SEVERITY_ERROR, badConfigurationCode, badConfiguration, 0, 0, true);
eclccConsoleWriter.println(noCompiler);
@@ -300,8 +303,9 @@ public void checkSyntax(IFile file) {
CmdArgs cmdArgs = new CmdArgs(eclccFile.getPath(), argsCommon, argsSyntaxCheck);
GetIncludeArgs(cmdArgs);
- if (monitorDependees)
+ if (monitorDependees) {
cmdArgs.Append("E");
+ }
ECLArchiveHandler handler = new ECLArchiveHandler();
CmdProcess process = new CmdProcess(workingPath, binPath, handler, eclccConsoleWriter);
process.exec(cmdArgs, file, false);
@@ -312,7 +316,7 @@ public void checkSyntax(IFile file) {
public String getArchive(IFile file) {
Eclipse.deleteMarkers(file);
-
+
if (!HasCompiler()) {
Eclipse.addMarker(file, IMarker.SEVERITY_ERROR, badConfigurationCode, badConfiguration, 0, 0, true);
eclccConsoleWriter.println(noCompiler);
@@ -326,8 +330,9 @@ public String getArchive(IFile file) {
IPath manifestPath = file.getLocation().removeLastSegments(1);
manifestPath = manifestPath.append("files");
manifestPath = manifestPath.append("manifest.xml");
- if (manifestPath.toFile().exists())
+ if (manifestPath.toFile().exists()) {
cmdArgs.Append("manifest=", manifestPath.toOSString());
+ }
}
hasError = false;
@@ -338,9 +343,10 @@ public String getArchive(IFile file) {
}
public String getMeta(IFile file) {
- if (!enableMetaProcessing)
+ if (!enableMetaProcessing) {
return "";
-
+ }
+
if (!HasCompiler()) {
eclccConsoleWriter.println(noCompiler);
return "";
@@ -382,10 +388,11 @@ public IFolder getLibraryFolder() {
IFolder retVal = project.getFolder("ECL Library (" + getLanguageVersion() + ")");
if (!retVal.exists()) {
try {
- if (OS.isWindowsPlatform())
+ if (OS.isWindowsPlatform()) {
retVal.createLink(binPath.append("ecllibrary"), IResource.HIDDEN, null);
- else
+ } else {
retVal.createLink(binPath.append("../share/ecllibrary"), IResource.HIDDEN, null);
+ }
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/ECLProjectAction.java
@@ -43,7 +43,7 @@ public void run(IAction action) {
} else if (element instanceof IAdaptable) {
project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
}
-
+
if (project != null) {
setNature(project);
}
View
31 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/RelationshipHelper.java
@@ -28,44 +28,47 @@
class FileBucket {
IProject project;
public Set<IFile> files;
-
+
FileBucket(IProject project) {
this.project = project;
- this.files = new HashSet<IFile>();
+ files = new HashSet<IFile>();
}
-
+
void load(String files) {
- if (files == null)
+ if (files == null) {
return;
-
+ }
+
String[] partialPaths = files.split(";");
for(int i = 0; i < partialPaths.length; ++i) {
IResource resource = project.findMember(partialPaths[i]);
if (resource instanceof IFile && resource.getName().endsWith(".ecl")) {
IFile file = (IFile) resource;
- if (file != null)
+ if (file != null) {
this.files.add(file);
+ }
}
}
}
-
+
String save() {
StringBuilder retVal = new StringBuilder();
for(Iterator<IFile> itr = files.iterator(); itr.hasNext();) {
IFile file = itr.next();
- if (retVal.length() > 0)
+ if (retVal.length() > 0) {
retVal.append(";");
+ }
retVal.append(file.getProjectRelativePath().toOSString());
}
return retVal.toString();
}
}
-
+
protected IFile file;
protected FileBucket ancestors;
protected FileBucket descendants;
private boolean closeCalled = false;
-
+
RelationshipHelper(IFile file) {
assert(file.exists());
this.file = file;
@@ -82,7 +85,7 @@ String save() {
e.printStackTrace();
}
}
-
+
@Override
protected void finalize() throws Throwable {
assert(closeCalled == true);
@@ -102,11 +105,11 @@ void close() {
e.printStackTrace();
}
}
-
+
boolean addDescendantNoPropigate(IFile decendant) {
return descendants.files.add(decendant);
}
-
+
boolean removeDescendantNoPropigate(IFile decendant) {
return descendants.files.remove(decendant);
}
@@ -123,7 +126,7 @@ void clearAncestors() {
}
}
}
-
+
void setAncestors(Set<IFile> ancestors2) {
clearAncestors();
Iterator<IFile> itr = ancestors2.iterator();
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLBase.java
@@ -23,7 +23,7 @@
HashMap<String, String> attributes;
public ECLBase() {
- this.attributes = new HashMap<String, String>();
+ attributes = new HashMap<String, String>();
}
public ECLBase(Attributes attributes) {
View
3 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLDefinition.java
@@ -75,8 +75,9 @@ public int getEndOffset() {
public int getLength() {
int retVal = getEndOffset() - getOffset();
- if (retVal >= 0)
+ if (retVal >= 0) {
return retVal;
+ }
return 0;
}
}
View
9 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLGlobalMeta.java
@@ -34,8 +34,9 @@
static ECLGlobalMeta self;
synchronized static public ECLMetaTree get() {
- if (self == null)
+ if (self == null) {
self = new ECLGlobalMeta();
+ }
return self.tree;
}
@@ -110,17 +111,19 @@ private ECLGlobalMeta() {
} catch (ClassCastException e) {
}
- if (tree == null)
+ if (tree == null) {
tree = new ECLMetaTree();
+ }
}
static public void clear() {
get().clear();
}
public static void parse(String xml) {
- if (xml.isEmpty())
+ if (xml.isEmpty()) {
return;
+ }
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
SAXParser parser = null;
View
39 org.hpccsystems.eclide/src/org/hpccsystems/eclide/builder/meta/ECLMetaTree.java
@@ -27,8 +27,9 @@ public ECLMetaNode getNode(String qualifiedName) {
ECLMetaNode node = root;
for (int i = 0; i < segments.length; ++i) {
node = node.getChild(segments[i]);
- if (node == null)
+ if (node == null) {
break;
+ }
}
return node;
}
@@ -39,8 +40,9 @@ public ECLMetaNode createNode(String qualifiedName, ECLDefinition data) {
ECLMetaNode parentNode = root;
for (int i = 0; i < segments.length - 1; ++i) {
parentNode = parentNode.getChild(segments[i]);
- if (parentNode == null)
+ if (parentNode == null) {
break;
+ }
}
if (parentNode != null) {
return parentNode.addChild(segments[segments.length - 1], data);
@@ -85,22 +87,25 @@ public ECLMetaNode createNode(String sourceQualifiedName, ECLSource source) {
ECLMetaNode walkTree(ECLMetaNode node, IVisitor visitor) {
ECLMetaNode retVal = visitor.processNode(node);
- if (retVal != null)
+ if (retVal != null) {
return retVal;
+ }
for (ECLMetaNode n : node.getChildren()) {
retVal = walkTree(n, visitor);
- if (retVal != null)
+ if (retVal != null) {
return retVal;
+ }
}
return null;
}
ECLMetaNode depthFirst(ECLMetaNode node, IVisitor visitor) {
for (ECLMetaNode n : node.getChildren()) {
ECLMetaNode retVal = walkTree(n, visitor);
- if (retVal != null)
+ if (retVal != null) {
return retVal;
+ }
}
return visitor.processNode(node);
}
@@ -126,8 +131,9 @@ public ECLMetaNode processNode(ECLMetaNode node) {
relPath = relPath.removeFileExtension();
String qualifiedName = "";
for (int i = 0; i < relPath.segmentCount(); ++i) {
- if (!qualifiedName.isEmpty())
+ if (!qualifiedName.isEmpty()) {
qualifiedName += ".";
+ }
qualifiedName += relPath.segment(i);
}
AttributesImpl attributes = new AttributesImpl();
@@ -181,17 +187,20 @@ public boolean hasChild(String name) {
}
public ECLMetaNode getChild(String name) {
- if (hasChild(name))
+ if (hasChild(name)) {
return children.get(name.toLowerCase());
+ }
return null;
}
public String getQualifiedName() {
String retVal = "";
- if (parent != null)
+ if (parent != null) {
retVal = parent.getQualifiedName();
- if (!retVal.isEmpty())
+ }
+ if (!retVal.isEmpty()) {
retVal += ".";
+ }
retVal += name;
return retVal;
}
@@ -218,24 +227,27 @@ public ECLMetaNode getContext(final int offset) {
ECLMetaNode retVal = null;
for (ECLMetaNode node : getChildren()) {
retVal = node.getContext(offset);
- if (retVal != null)
+ if (retVal != null) {
return retVal;
+ }
}
if (offset >= getData().getOffset() && offset <= getData().getEndOffset()) {
return this;
}
- if (getData() instanceof ECLSource)
+ if (getData() instanceof ECLSource) {
return this;
+ }
return null;
}
public ECLMetaNode findDefinition(String text, boolean downOnly) {
text = text.toLowerCase();
- if (getName().equalsIgnoreCase(text))
+ if (getName().equalsIgnoreCase(text)) {
return this;
+ }
for (ECLMetaNode node : getChildren()) {
if (node.getName().equalsIgnoreCase(text)) {
@@ -255,8 +267,9 @@ public ECLMetaNode findDefinition(String text, boolean downOnly) {
}
}
- if (downOnly)
+ if (downOnly) {
return null;
+ }
// Find stops walking up up at the source level ---
if (getData() instanceof ECLSource) {
View
8 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLAnnotationHover.java
@@ -21,10 +21,10 @@
@Override
public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
Iterator<Annotation> itr = sourceViewer.getAnnotationModel().getAnnotationIterator();
-// while(itr.hasNext()) {
-// Annotation annotation = itr.next();
-// int i = annotation.hashCode();
-// }
+ // while(itr.hasNext()) {
+ // Annotation annotation = itr.next();
+ // int i = annotation.hashCode();
+ // }
return "Nothing to see move along...";
}
View
5 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLColorManager.java
@@ -24,8 +24,9 @@
public void dispose() {
Iterator<Color> e = fColorTable.values().iterator();
- while (e.hasNext())
- e.next().dispose();
+ while (e.hasNext()) {
+ e.next().dispose();
+ }
}
public Color getColor(RGB rgb) {
Color color = fColorTable.get(rgb);
View
57 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLCompletionProcessor.java
@@ -28,28 +28,30 @@
import org.hpccsystems.eclide.text.ECLKeywords;
public class ECLCompletionProcessor implements IContentAssistProcessor {
- private final IContextInformation[] NO_CONTEXTS = { };
- private final char[] PROPOSAL_ACTIVATION_CHARS = { '.' };
-
- private int getFirstCharOffset(IDocument doc, int offset, boolean includePeriod) {
- try {
- for (int n = offset-1; n >= 0; n--) {
- char c = doc.getChar(n);
- if (!(Character.isJavaIdentifierPart(c) || (c == '.' && includePeriod) || c == '#'))
- return n + 1;
- }
- } catch (BadLocationException e) {
- // ... log the exception ...
- }
- return offset;
- }
+ private final IContextInformation[] NO_CONTEXTS = { };
+ private final char[] PROPOSAL_ACTIVATION_CHARS = { '.' };
+
+ private int getFirstCharOffset(IDocument doc, int offset, boolean includePeriod) {
+ try {
+ for (int n = offset-1; n >= 0; n--) {
+ char c = doc.getChar(n);
+ if (!(Character.isJavaIdentifierPart(c) || (c == '.' && includePeriod) || c == '#')) {
+ return n + 1;
+ }
+ }
+ } catch (BadLocationException e) {
+ // ... log the exception ...
+ }
+ return offset;
+ }
private int getLastCharOffset(IDocument doc, int offset) {
try {
for (int n = offset; n < doc.getLength(); ++n) {
char c = doc.getChar(n);
- if (!Character.isJavaIdentifierPart(c) && c != '.')
+ if (!Character.isJavaIdentifierPart(c) && c != '.') {
return n;
+ }
}
} catch (BadLocationException e) {
// ... log the exception ...
@@ -62,10 +64,11 @@ private String getAutoCKnownString(IDocument doc, int offset) {
int replacementPos = getFirstCharOffset(doc, offset, false);
try {
String retVal = doc.get(firstOffset, replacementPos - firstOffset);
- if (retVal.endsWith("."))
+ if (retVal.endsWith(".")) {
return retVal.substring(0, retVal.length() - 1);
+ }
return retVal;
-
+
} catch (BadLocationException e) {
// ... log the exception ...
}
@@ -76,13 +79,13 @@ private String getAutoCRemainingString(IDocument doc, int offset) {
int replacementPos = getFirstCharOffset(doc, offset, false);
try {
return doc.get(replacementPos, offset - replacementPos);
-
+
} catch (BadLocationException e) {
// ... log the exception ...
}
return "";
}
-
+
@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
ArrayList<CompletionProposal> result = new ArrayList<CompletionProposal>();
@@ -93,39 +96,41 @@ private String getAutoCRemainingString(IDocument doc, int offset) {
ECLMetaNode source = ECLGlobalMeta.get().getSource(file.getLocation());
if (source != null) {
ECLMetaNode context = source.getContext(offset);
-
+
String knownText = getAutoCKnownString(doc, offset);
String remainingText = getAutoCRemainingString(doc, offset);
int replacementPos = getFirstCharOffset(doc, offset, false);
int endReplacementPos = getLastCharOffset(doc, offset);
if (knownText.isEmpty()) {
for (int i = 0; i < 6; ++i) {
for (String s : ECLKeywords.getKeywords(i)) {
- if (s.toLowerCase().startsWith(remainingText.toLowerCase()))
+ if (s.toLowerCase().startsWith(remainingText.toLowerCase())) {
result.add(new CompletionProposal(s.toUpperCase(), replacementPos, endReplacementPos - replacementPos, s.length()));
+ }
}
}
-
+
} else {
ECLMetaNode def = context.findDefinition(knownText, false);
if (def != null) {
for (ECLMetaNode child_def : def.getChildren()) {
- if (child_def.getName().toLowerCase().startsWith(remainingText.toLowerCase()))
+ if (child_def.getName().toLowerCase().startsWith(remainingText.toLowerCase())) {
result.add(new CompletionProposal(child_def.getName(), replacementPos, endReplacementPos - replacementPos, child_def.getName().length()));
+ }
}
}
}
}
}
-
+
Collections.sort(result, new Comparator<CompletionProposal>() {
@Override
public int compare(CompletionProposal o1, CompletionProposal o2) {
return o1.getDisplayString().compareTo(o2.getDisplayString());
}
});
-
+
return result.toArray(new ICompletionProposal[result.size()]);
}
View
76 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLConfiguration.java
@@ -41,19 +41,19 @@
@Override
public IContentAssistant getContentAssistant(ISourceViewer sv) {
- ContentAssistant ca = new ContentAssistant();
- ca.enableAutoActivation(true);
-
- IContentAssistProcessor cap = new ECLCompletionProcessor();
- ca.setContentAssistProcessor(cap, IDocument.DEFAULT_CONTENT_TYPE);
- ca.setContentAssistProcessor(cap, ECLPartitionScanner.ECL_BODY);
- ca.setInformationControlCreator(getInformationControlCreator(sv));
- return ca;
- }
+ ContentAssistant ca = new ContentAssistant();
+ ca.enableAutoActivation(true);
+
+ IContentAssistProcessor cap = new ECLCompletionProcessor();
+ ca.setContentAssistProcessor(cap, IDocument.DEFAULT_CONTENT_TYPE);
+ ca.setContentAssistProcessor(cap, ECLPartitionScanner.ECL_BODY);
+ ca.setInformationControlCreator(getInformationControlCreator(sv));
+ return ca;
+ }
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
//if (contentType.equals(ECLPartitionScanner.ECL_BODY)) {
- return new ECLTextHover(sourceViewer, contentType);
+ return new ECLTextHover(sourceViewer, contentType);
//}
//return super.getTextHover(sourceViewer, contentType);
}
@@ -82,43 +82,43 @@ public ECLConfiguration(ECLColorManager colorManager) {
@Override
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] {
- IDocument.DEFAULT_CONTENT_TYPE,
- ECLPartitionScanner.ECL_JAVADOC,
- ECLPartitionScanner.ECL_COMMENT,
- ECLPartitionScanner.ECL_BODY };
+ IDocument.DEFAULT_CONTENT_TYPE,
+ ECLPartitionScanner.ECL_JAVADOC,
+ ECLPartitionScanner.ECL_COMMENT,
+ ECLPartitionScanner.ECL_BODY };
}
-
-// public ITextDoubleClickStrategy getDoubleClickStrategy(
-// ISourceViewer sourceViewer,
-// String contentType) {
-// if (doubleClickStrategy == null)
-// doubleClickStrategy = new ECLDoubleClickStrategy();
-// return doubleClickStrategy;
-// }
+
+ // public ITextDoubleClickStrategy getDoubleClickStrategy(
+ // ISourceViewer sourceViewer,
+ // String contentType) {
+ // if (doubleClickStrategy == null)
+ // doubleClickStrategy = new ECLDoubleClickStrategy();
+ // return doubleClickStrategy;
+ // }
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return super.getAnnotationHover(sourceViewer);
}
-
+
protected ECLScanner getECLScanner() {
if (scanner == null) {
scanner = new ECLScanner(colorManager);
scanner.setDefaultReturnToken(
- new Token(
- new TextAttribute(
- colorManager.getColor(IECLColorConstants.DEFAULT))));
+ new Token(
+ new TextAttribute(
+ colorManager.getColor(IECLColorConstants.DEFAULT))));
}
return scanner;
}
-
+
protected ECLTagScanner getECLTagScanner() {
if (tagScanner == null) {
tagScanner = new ECLTagScanner(colorManager);
tagScanner.setDefaultReturnToken(
- new Token(
- new TextAttribute(
- colorManager.getColor(IECLColorConstants.TAG))));
+ new Token(
+ new TextAttribute(
+ colorManager.getColor(IECLColorConstants.TAG))));
}
return tagScanner;
}
@@ -128,7 +128,7 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie
PresentationReconciler reconciler = new PresentationReconciler();
DefaultDamagerRepairer dr =
- new DefaultDamagerRepairer(getECLTagScanner());
+ new DefaultDamagerRepairer(getECLTagScanner());
reconciler.setDamager(dr, ECLPartitionScanner.ECL_BODY);
reconciler.setRepairer(dr, ECLPartitionScanner.ECL_BODY);
@@ -137,18 +137,18 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
NonRuleBasedDamagerRepairer ndr =
- new NonRuleBasedDamagerRepairer(
- new TextAttribute(
- colorManager.getColor(IECLColorConstants.ECL_COMMENT)));
+ new NonRuleBasedDamagerRepairer(
+ new TextAttribute(
+ colorManager.getColor(IECLColorConstants.ECL_COMMENT)));
reconciler.setDamager(ndr, ECLPartitionScanner.ECL_COMMENT);
reconciler.setRepairer(ndr, ECLPartitionScanner.ECL_COMMENT);
ndr =
new NonRuleBasedDamagerRepairer(
- new TextAttribute(
- colorManager.getColor(IECLColorConstants.ECL_JAVADOC)));
- reconciler.setDamager(ndr, ECLPartitionScanner.ECL_JAVADOC);
- reconciler.setRepairer(ndr, ECLPartitionScanner.ECL_JAVADOC);
+ new TextAttribute(
+ colorManager.getColor(IECLColorConstants.ECL_JAVADOC)));
+ reconciler.setDamager(ndr, ECLPartitionScanner.ECL_JAVADOC);
+ reconciler.setRepairer(ndr, ECLPartitionScanner.ECL_JAVADOC);
return reconciler;
}
View
7 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLDocument.java
@@ -19,12 +19,13 @@
public class ECLDocument extends Document {
FileEditorInput editorInput;
-
+
public void setEditorInput(IEditorInput editorInput) {
- if (editorInput instanceof FileEditorInput)
+ if (editorInput instanceof FileEditorInput) {
this.editorInput = (FileEditorInput)editorInput;
+ }
}
-
+
IFile getFile() {
return editorInput.getFile();
}
View
18 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLDocumentProvider.java
@@ -25,29 +25,29 @@ protected IDocument createDocument(Object element) throws CoreException {
IDocument document = super.createDocument(element);
if (document != null) {
IDocumentPartitioner partitioner =
- new FastPartitioner(
- new ECLPartitionScanner(),
- new String[] {
- ECLPartitionScanner.ECL_BODY,
- ECLPartitionScanner.ECL_COMMENT,
- ECLPartitionScanner.ECL_JAVADOC });
+ new FastPartitioner(
+ new ECLPartitionScanner(),
+ new String[] {
+ ECLPartitionScanner.ECL_BODY,
+ ECLPartitionScanner.ECL_COMMENT,
+ ECLPartitionScanner.ECL_JAVADOC });
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
-
+
@Override
protected IDocument createEmptyDocument() {
return new ECLDocument();
}
-
+
@Override
protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException {
if (document instanceof ECLDocument) {
((ECLDocument)document).setEditorInput(editorInput);
}
return super.setDocumentContent(document, editorInput, encoding);
}
-
+
}
View
21 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLDoubleClickStrategy.java
@@ -22,8 +22,9 @@
public void doubleClicked(ITextViewer part) {
int pos = part.getSelectedRange().x;
- if (pos < 0)
+ if (pos < 0) {
return;
+ }
fText = part;
@@ -45,13 +46,15 @@ protected boolean selectComment(int caretPos) {
pos -= 2;
continue;
}
- if (c == Character.LINE_SEPARATOR || c == '\"')
+ if (c == Character.LINE_SEPARATOR || c == '\"') {
break;
+ }
--pos;
}
- if (c != '\"')
+ if (c != '\"') {
return false;
+ }
startPos = pos;
@@ -61,12 +64,14 @@ protected boolean selectComment(int caretPos) {
while (pos < length) {
c = doc.getChar(pos);
- if (c == Character.LINE_SEPARATOR || c == '\"')
+ if (c == Character.LINE_SEPARATOR || c == '\"') {
break;
+ }
++pos;
}
- if (c != '\"')
+ if (c != '\"') {
return false;
+ }
endPos = pos;
@@ -91,8 +96,9 @@ protected boolean selectWord(int caretPos) {
while (pos >= 0) {
c = doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
+ if (!Character.isJavaIdentifierPart(c)) {
break;
+ }
--pos;
}
@@ -103,8 +109,9 @@ protected boolean selectWord(int caretPos) {
while (pos < length) {
c = doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
+ if (!Character.isJavaIdentifierPart(c)) {
break;
+ }
++pos;
}
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLEditor.java
@@ -22,7 +22,7 @@ public ECLEditor() {
setSourceViewerConfiguration(new ECLConfiguration(colorManager));
setDocumentProvider(new ECLDocumentProvider());
}
-
+
@Override
public void dispose() {
colorManager.dispose();
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLEditorActionContributor.java
@@ -13,7 +13,7 @@
import org.eclipse.ui.editors.text.TextEditorActionContributor;
public class ECLEditorActionContributor extends
- TextEditorActionContributor {
+TextEditorActionContributor {
public ECLEditorActionContributor() {
super();
View
21 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLTextHover.java
@@ -31,7 +31,7 @@
ECLTextHover(ISourceViewer sourceViewer, String contentType) {
this.sourceViewer = sourceViewer;
this.contentType = contentType;
- this.meta = ECLGlobalMeta.get();
+ meta = ECLGlobalMeta.get();
}
@Override
@@ -43,8 +43,9 @@ private int getFirstCharOffset(IDocument doc, int offset) {
try {
for (int n = offset-1; n >= 0; n--) {
char c = doc.getChar(n);
- if (!Character.isJavaIdentifierPart(c) && c != '.' && c != '#')
+ if (!Character.isJavaIdentifierPart(c) && c != '.' && c != '#') {
return n + 1;
+ }
}
} catch (BadLocationException e) {
// ... log the exception ...
@@ -56,8 +57,9 @@ private int getLastCharOffset(IDocument doc, int offset) {
try {
for (int n = offset; n < doc.getLength(); ++n) {
char c = doc.getChar(n);
- if (!Character.isJavaIdentifierPart(c) && c != '.')
+ if (!Character.isJavaIdentifierPart(c) && c != '.') {
return n;
+ }
}
} catch (BadLocationException e) {
// ... log the exception ...
@@ -70,7 +72,7 @@ private String getHoverWord(IDocument doc, int offset) {
int lastOffset = getLastCharOffset(doc, offset);
try {
return doc.get(firstOffset, lastOffset - firstOffset);
-
+
} catch (BadLocationException e) {
// ... log the exception ...
}
@@ -84,17 +86,18 @@ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
if (doc instanceof ECLDocument) {
IFile file = ((ECLDocument)doc).getFile();
source = meta.getSource(file.getLocation());
- if (source == null)
+ if (source == null) {
return "--- NO META ---";
+ }
}
String text = getHoverWord(doc, hoverRegion.getOffset());
StringBuilder hover = new StringBuilder("--- SEARCH INFO ---");
hover.append("\nSearch For: " + text);
-
+
ECLMetaNode context = source.getContext(hoverRegion.getOffset());
hover.append("\nContext: " + context.getName());
-
+
ECLMetaNode found = context.findDefinition(text, false);
if (found != null) {
hover.append("\n--- MATCH ---");
@@ -116,8 +119,8 @@ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
hover.append("\nDefinition: " + mdef.getName() + " (" + mdef.getOffset() + ", " + mdef.getLength() + ")");
}
}
- */
-
+ */
+
return hover.toString();
}
View
82 org.hpccsystems.eclide/src/org/hpccsystems/eclide/editors/ECLWindow.java
@@ -58,12 +58,12 @@
import org.hpccsystems.eclide.ui.viewer.ECLContentOutlinePage;
import org.hpccsystems.eclide.ui.viewer.platform.GraphView;
import org.hpccsystems.eclide.ui.viewer.platform.PlatformActions;
+import org.hpccsystems.eclide.ui.viewer.platform.PlatformActions.IPlatformUI;
import org.hpccsystems.eclide.ui.viewer.platform.ResultView;
import org.hpccsystems.eclide.ui.viewer.platform.TextItemView;
import org.hpccsystems.eclide.ui.viewer.platform.TreeItemOwner;
import org.hpccsystems.eclide.ui.viewer.platform.WorkunitTabItem;
import org.hpccsystems.eclide.ui.viewer.platform.WorkunitView;
-import org.hpccsystems.eclide.ui.viewer.platform.PlatformActions.IPlatformUI;
import org.hpccsystems.eclide.ui.viewer.platform.WorkunitsViewer;
import org.hpccsystems.internal.Eclipse;
import org.hpccsystems.internal.data.CollectionDelta;
@@ -78,15 +78,15 @@
public class ECLWindow extends MultiPageEditorPart implements IResourceChangeListener, Observer, TreeItemOwner {
ECLContentOutlinePage eclOutlinePage;
-
+
private ECLEditor editor;
Data data;
CTabFolder workunitFolder;
LazyChildLoader<ItemView> children;
boolean workunitsLoaded = false;
private ItemView delayedShowItemView;
-
+
Map<Workunit, WorkunitTabItem> workunitTabMap;
PlatformActions actions;
@@ -95,17 +95,17 @@
public ECLWindow() {
super();
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
- this.data = null;
- this.workunitFolder = null;
- this.children = new LazyChildLoader<ItemView>();
- this.workunitTabMap = new HashMap<Workunit, WorkunitTabItem>();
-
+ data = null;
+ workunitFolder = null;
+ children = new LazyChildLoader<ItemView>();
+ workunitTabMap = new HashMap<Workunit, WorkunitTabItem>();
+
actions = new PlatformActions(new IPlatformUI() {
-
+
@Override
public void refresh() {
}
-
+
@Override
public Vector<ItemView> getSelection() {
Vector<ItemView> retVal = new Vector<ItemView>();
@@ -128,12 +128,12 @@ WorkunitTabItem createItem(int index, Control control, WorkunitView wuView) {
WorkunitTabItem item = new WorkunitTabItem(workunitFolder, SWT.NONE, index, wuView);
return item;
}
-
+
void createEditorPage() {
try {
editor = new ECLEditor();
int index = addPage(editor, getEditorInput());
- this.setPartName(editor.getTitle());
+ setPartName(editor.getTitle());
setPageText(index, "ECL");
setPageImage(index, Activator.getImage("icons/doc.png"));
} catch (PartInitException e) {
@@ -144,34 +144,34 @@ void createEditorPage() {
e.getStatus());
}
}
-
+
WorkunitTabItem createWorkunitPage(WorkunitView wuti, boolean addToEnd) {
if (workunitTabMap.containsKey(wuti.getWorkunit())) {
return workunitTabMap.get(wuti.getWorkunit());
}
- return addToEnd ? createItem(getContainer(), wuti) : createItem(1, getContainer(), wuti);
+ return addToEnd ? createItem(getContainer(), wuti) : createItem(1, getContainer(), wuti);
}
-
+
WorkunitTabItem selectTab(Workunit workunit) {
if (workunitTabMap.containsKey(workunit)) {
WorkunitTabItem tabItem = workunitTabMap.get(workunit);
- Composite container = this.getContainer();
+ Composite container = getContainer();
if (container instanceof CTabFolder) {
}
workunitFolder.setSelection(tabItem);
return tabItem;
}
return null;
}
-
+
public void showItemView(ItemView item) {
if (!workunitsLoaded) {
delayedShowItemView = item;
return;
}
-
+
delayedShowItemView = null;
- if (item instanceof WorkunitView) {
+ if (item instanceof WorkunitView) {
showEclWatch((WorkunitView)item);
return;
} else if (item instanceof ResultView) {
@@ -190,7 +190,7 @@ public void showItemView(ItemView item) {
showEclWatch(wuView);
}
}
-
+
void showEclWatch(WorkunitView wuView) {
WorkunitTabItem tabItem = selectTab(wuView.getWorkunit());
if (tabItem != null) {
@@ -208,7 +208,7 @@ void showResult(ResultView resultView) {
tabItem.setResult(resultView.getResult());
}
}
-
+
void showGraph(GraphView graphView) {
WorkunitTabItem tabItem = selectTab(graphView.getGraph().getWorkunit());
if (tabItem != null) {
@@ -226,7 +226,7 @@ void showTextItem(TextItemView textItemView) {
tabItem.setQuery(textItemView.getQueryText());
}
}
-
+
void createWorkunitPages() {
data = Data.get();
workunitFolder = (CTabFolder)getContainer();
@@ -239,7 +239,7 @@ public void run() {
});
workunitFolder.addSelectionListener(new SelectionListener() {
-
+
@Override
public void widgetSelected(SelectionEvent e) {
if (e.item instanceof WorkunitTabItem) {
@@ -249,7 +249,7 @@ public void widgetSelected(SelectionEvent e) {
}
}
}
-
+
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
@@ -305,16 +305,17 @@ public void gotoMarker(IMarker marker) {
@Override
public void init(IEditorSite site, IEditorInput editorInput)
throws PartInitException {
- if (!(editorInput instanceof IFileEditorInput))
+ if (!(editorInput instanceof IFileEditorInput)) {
throw new PartInitException("Invalid Input: Must be IFileEditorInput");
+ }
super.init(site, editorInput);
}
@Override
public boolean isSaveAsAllowed() {
return true;
}
-
+
CTabItem getTabItem(int index){
CTabItem childItem = ((CTabFolder)getContainer()).getItem(index);
return childItem;
@@ -342,7 +343,7 @@ public void run(){
});
}
}
-
+
@Override
public Object getAdapter(Class required) {
if (IContentOutlinePage.class.equals(required)) {
@@ -363,7 +364,7 @@ public void selectionChanged(SelectionChangedEvent event) {
}
}
});
-
+
}
return eclOutlinePage;
}
@@ -372,14 +373,14 @@ public void selectionChanged(SelectionChangedEvent event) {
public void refreshChildren() {
Workunit.All.deleteObserver(this);
-
+
CollectionDelta delta = new CollectionDelta("primeChildren", getCurrentWorkunits());
delta.calcChanges(data.getWorkunits(null, "", "", ""));
mergeChanges(delta);
Workunit.All.addObserver(this);
}
-
+
public void reloadChildren() {
children.clear();
refreshChildren();
@@ -410,28 +411,29 @@ boolean mergeChanges(CollectionDelta delta) {
}
}
}
-
+
// Add new workunits ---
IFileEditorInput input = (IFileEditorInput) getEditorInput();
IFile file = input.getFile();
String filePath = file.getFullPath().toPortableString();
for (DataSingleton ds : delta.getAdded()) {
if (ds instanceof Workunit) {
Workunit wu = (Workunit)ds;
-
+
if (filePath.compareTo(wu.getApplicationValue("path")) == 0) {
children.add(new WorkunitView(this, null, wu));
changed = true;
}
}
}
-
- if (changed)
+
+ if (changed) {
children.sort(new WorkunitComparator());
+ }
return changed;
}
-
+
@Override
public void update(Observable o, Object arg) {
if (o instanceof DataSingletonCollection) {
@@ -454,7 +456,7 @@ public void refresh(Object element) {
@Override
public void refresh() {
Display.getDefault().asyncExec(new Runnable() {
-
+
@Override
public void run() {
int pos = 1;
@@ -471,11 +473,11 @@ public void run() {
if (delayedShowItemView != null) {
showItemView(delayedShowItemView);
}
-
+
}
});
}
-
+
protected void createContextMenu() {
// Create menu manager.
MenuManager menuMgr = new MenuManager();
@@ -486,11 +488,11 @@ public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
-
+
// Create menu.
Menu menu = menuMgr.createContextMenu(getContainer());
getContainer().setMenu(menu);
-
+
// Register menu for extension.
//getSite().registerContextMenu(menuMgr, getContainer());
}
View
18 org.hpccsystems.eclide/src/org/hpccsystems/eclide/importWizards/ImportWizard.java
@@ -16,7 +16,7 @@
import org.eclipse.ui.IWorkbench;
public class ImportWizard extends Wizard implements IImportWizard {
-
+
ImportWizardPage mainPage;
public ImportWizard() {
@@ -30,7 +30,7 @@ public ImportWizard() {
public boolean performFinish() {
return mainPage.doImport();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
@@ -40,13 +40,13 @@ public void init(IWorkbench workbench, IStructuredSelection selection) {
setNeedsProgressMonitor(true);
mainPage = new ImportWizardPage("Import Repository", selection); //NON-NLS-1
}
-
+
/* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- @Override
+ * @see org.eclipse.jface.wizard.IWizard#addPages()
+ */
+ @Override
public void addPages() {
- super.addPages();
- addPage(mainPage);
- }
+ super.addPages();
+ addPage(mainPage);
+ }
}
View
15 org.hpccsystems.eclide/src/org/hpccsystems/eclide/importWizards/ImportWizardPage.java
@@ -51,7 +51,7 @@
import org.hpccsystems.ws.WsAttributes.WsAttributesServiceSoap;
public class ImportWizardPage extends WizardResourceImportPage {
-
+
public class PasswordFieldEditor extends StringFieldEditor {
public PasswordFieldEditor(String name, String label, Composite parent) {
@@ -69,7 +69,7 @@ protected void doFillIntoGrid(Composite parent, int numColumns)
}
}
-
+
protected StringFieldEditor fIPText;
protected StringFieldEditor fUserText;
protected PasswordFieldEditor fPasswordText;
@@ -98,7 +98,7 @@ protected void createSourceGroup(Composite parent) {
fileSelectionLayout.marginWidth = 0;
fileSelectionLayout.marginHeight = 0;
fileSelectionArea.setLayout(fileSelectionLayout);
-
+
fIPText = new StringFieldEditor("IPSelect", "Server IP: ", fileSelectionArea);
fIPText.setStringValue("10.173.84.202");
fUserText = new StringFieldEditor("User", "User: ", fileSelectionArea);
@@ -118,10 +118,10 @@ protected ITreeContentProvider getFolderProvider() {
// TODO Auto-generated method stub
return null;
}
-
+
boolean doImport() {
final IFolder targetFolder = Eclipse.getWorkspaceRoot().getFolder(getContainerFullPath());
-
+
WsAttributesLocator locator = new WsAttributesLocator();
try {
final WsAttributesServiceSoap service = locator.getWsAttributesServiceSoap(new URL("http", fIPText.getStringValue(), 8145, "/WsAttributes"));
@@ -137,8 +137,9 @@ boolean doImport() {
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Importing", response.getOutModules().length);
for (final ECLModule module : response.getOutModules()) {
- if (module.getName().equalsIgnoreCase("Trash"))
+ if (module.getName().equalsIgnoreCase("Trash")) {
continue;
+ }
monitor.subTask(module.getName());
GetAttributes request2 = new GetAttributes();
@@ -155,7 +156,7 @@ protected IStatus run(IProgressMonitor monitor) {
IPath targetPath = targetFolder.getLocation();
IPath fullPath = targetPath.append(modPath + "/" + attrPath).makeAbsolute();
final File targetFile = new File(fullPath.toOSString());
-
+
try {
targetFile.getParentFile().mkdirs();
if (targetFile.createNewFile()) {
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchConstants.java
@@ -14,4 +14,4 @@
* Constant definitions for plug-in preferences
*/
public class ECLLaunchConstants {
- }
+}
View
4 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchDelegate.java
@@ -33,9 +33,9 @@ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, I
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
saveBeforeLaunch(configuration, mode, monitor);
-
+
final String cluster = configuration.getAttribute(Platform.P_CLUSTER, "");
-
+
IFile file = null;
IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
Object o = ss.getFirstElement();
View
56 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchServerTab.java
@@ -49,7 +49,7 @@ public void modifyText(ModifyEvent e) {
} else if (source == fAddressText) {
}
}
-
+
@Override
public void widgetSelected(SelectionEvent e) {
Object source= e.getSource();
@@ -60,10 +60,10 @@ public void widgetSelected(SelectionEvent e) {
}
}
}
-
+
private WidgetListener fListener = new WidgetListener();
-
- Image image;
+
+ Image image;
private Button disableButton;
protected Text fIPText;
@@ -99,7 +99,7 @@ protected void createServerEditor(Composite parent) {
fClusterText = SWTFactory.createSingleText(group, 1);
fClusterText.addModifyListener(fListener);
}
-
+
protected void createCredentialsEditor(Composite parent) {
Group group = SWTFactory.createGroup(parent, "Credentials:", 2, 1, GridData.FILL_HORIZONTAL);
SWTFactory.createLabel(group, "User: ", 1);
@@ -121,11 +121,11 @@ protected void createBrowser(Composite parent) {
browser = new Browser(group, SWT.BORDER);
browser.setUrl("about:blank");
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 3;
- browser.setLayoutData(gd);
- browser.addAuthenticationListener(new AuthenticationListener() {
-
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 3;
+ browser.setLayoutData(gd);
+ browser.addAuthenticationListener(new AuthenticationListener() {
+
@Override
public void authenticate(AuthenticationEvent event) {
// TODO Auto-generated method stub
@@ -139,20 +139,20 @@ public void authenticate(AuthenticationEvent event) {
public final void createControl(Composite parent) {
Composite projComp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH);
((GridLayout)projComp.getLayout()).verticalSpacing = 0;
-
+
createVerticalSpacer(projComp, 1);
createServerEditor(projComp);
createCredentialsEditor(projComp);
createVerticalSpacer(projComp, 1);
createBrowser(projComp);
setControl(projComp);
-
+
}
-
+
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
-// ip.setText("localhost");
-// cluster.setText("hthor");
+ // ip.setText("localhost");
+ // cluster.setText("hthor");
}
@Override
@@ -189,12 +189,12 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
}
protected void handleProjectButtonSelected() {
-// IJavaProject project = chooseJavaProject();
-// if (project == null) {
-// return;
-// }
-// String projectName = project.getElementName();
-// fProjText.setText(projectName);
+ // IJavaProject project = chooseJavaProject();
+ // if (project == null) {
+ // return;
+ // }
+ // String projectName = project.getElementName();
+ // fProjText.setText(projectName);
}
void refreshAddress() {
@@ -203,7 +203,7 @@ void refreshAddress() {
url.append(":" + fPortText.getText() + "/");
fAddressText.setText(url.toString());
}
-
+
void refreshBrowser() {
browser.addProgressListener(new ProgressAdapter() {
@Override
@@ -221,11 +221,11 @@ public String getName() {
return "HPCC Platform";
}
- @Override
+ @Override
public Image getImage() {
- if (image == null) {
- image = Activator.getImage("icons/releng_gears.gif"); //$NON-NLS-1$
- }
- return image;
- }
+ if (image == null) {
+ image = Activator.getImage("icons/releng_gears.gif"); //$NON-NLS-1$
+ }
+ return image;
+ }
}
View
4 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchShortcutLocal.java
@@ -25,7 +25,7 @@
import org.eclipse.ui.IFileEditorInput;
public class ECLLaunchShortcutLocal implements ILaunchShortcut2 {
-
+
@Override
public void launch(ISelection selection, String mode) {
}
@@ -40,7 +40,7 @@ public void launch(IEditorPart editor, String mode) {
ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
for(int i = 0; i < configs.length; ++i) {
//if (configs[i].getAttribute(Platform.P_ENABLED, true)) {
- retVal.add(configs[i]);
+ retVal.add(configs[i]);
//}
}
} catch (CoreException e) {
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/launchers/ECLLaunchTabGroup.java
@@ -15,7 +15,7 @@
import org.eclipse.debug.ui.ILaunchConfigurationTab;
public class ECLLaunchTabGroup extends AbstractLaunchConfigurationTabGroup {
-
+
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/perspectives/ECLPerspective.java
@@ -59,7 +59,7 @@ private void addViews() {
IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, 0.75f, editorArea);
right.addView(IPageLayout.ID_OUTLINE);
-}
+ }
private void addActionSets() {
layout.addActionSet("org.eclipse.debug.ui.launchActionSet");
View
2 org.hpccsystems.eclide/src/org/hpccsystems/eclide/perspectives/ECLWatch.java
@@ -53,7 +53,7 @@ private void addViews() {
right.addView("org.hpccsystems.eclide.resultView");
layout.getViewLayout("org.hpccsystems.eclide.resultView").setCloseable(false);
layout.getViewLayout("org.hpccsystems.eclide.resultView").setMoveable(false);
-}
+ }
private void addActionSets() {
}
View
4 org.hpccsystems.eclide/src/org/hpccsystems/eclide/preferences/ECLCompilerPreferencePage.java
@@ -41,7 +41,7 @@
public ECLCompilerPreferencePage() {
super(GRID);
}
-