Reformat source

This commit is contained in:
peterdell 2021-09-18 01:09:46 +02:00
parent 25a4d82719
commit 62030ab828
34 changed files with 3498 additions and 3577 deletions

View File

@ -108,15 +108,16 @@ public final class CompilerRegistry {
}
supportedCPUs = Collections.unmodifiableList(supportedCPUs);
compilerDefinition.setSupportedCPUs(supportedCPUs);
compilerDefinition.setDefaultHardware(Hardware.valueOf(configurationElement
.getAttribute("defaultHardware")));
compilerDefinition
.setDefaultHardware(Hardware.valueOf(configurationElement.getAttribute("defaultHardware")));
compilerDefinitionList.add(compilerDefinition);
addCompiler(configurationElement, compilerDefinition);
} catch (RuntimeException ex) {
throw new RuntimeException("Error during registration of compiler '"
+ configurationElement.getAttribute("id") + "'.", ex);
throw new RuntimeException(
"Error during registration of compiler '" + configurationElement.getAttribute("id") + "'.",
ex);
}
}
}
@ -130,12 +131,10 @@ public final class CompilerRegistry {
/**
* Adds a new compiler.
*
* @param configurationElement
* The configuration element used as class instance factory, not
* <code>null</code>.
* @param configurationElement The configuration element used as class instance
* factory, not <code>null</code>.
*
* @param compilerDefinition
* The compiler definition, not <code>null</code>.
* @param compilerDefinition The compiler definition, not <code>null</code>.
*/
private void addCompiler(IConfigurationElement configurationElement, CompilerDefinition compilerDefinition) {
if (configurationElement == null) {
@ -170,8 +169,8 @@ public final class CompilerRegistry {
compiler = compilerMap.put(id, compiler);
if (compiler != null) {
throw new RuntimeException("Compiler id '" + id + "' is already registered to class '"
+ compiler.getClass().getName() + "'.");
throw new RuntimeException(
"Compiler id '" + id + "' is already registered to class '" + compiler.getClass().getName() + "'.");
}
}
@ -180,8 +179,8 @@ public final class CompilerRegistry {
* Gets the unmodifiable list of compiler definitions, sorted by their id.
*
*
* @return The unmodifiable list of compiler definitions, sorted by their
* id, may be empty, not <code>null</code>
* @return The unmodifiable list of compiler definitions, sorted by their id,
* may be empty, not <code>null</code>
*
* @since 1.6.1
*/
@ -193,8 +192,7 @@ public final class CompilerRegistry {
* Gets the compiler for a given id. Instances of compiler are stateless
* singletons within the plugin.
*
* @param compilerId
* The compiler id, not <code>null</code>.
* @param compilerId The compiler id, not <code>null</code>.
*
* @return The compiler, not <code>null</code>.
*/

View File

@ -39,8 +39,7 @@ public final class CompilerSyntaxUtility {
/**
* Gets the image path for an instruction type image.
*
* @param instruction
* The instruction, not <code>null</code>.
* @param instruction The instruction, not <code>null</code>.
* @return The image path for the instruction type image, not empty and not
* <code>null</code>.
*/
@ -75,8 +74,7 @@ public final class CompilerSyntaxUtility {
/**
* Gets the text for an instruction type.
*
* @param instruction
* The instruction, not <code>null</code>.
* @param instruction The instruction, not <code>null</code>.
* @return The text for the instruction type image, may be empty, not
* <code>null</code>.
*/

View File

@ -181,8 +181,8 @@ public final class AppleFileWriter extends CompilerFileWriter {
outputFileContent = FileUtility.readBytes(files.outputFile, 65536, true);
} catch (CoreException ex) {
// ERROR: Cannot read output file.
MarkerUtility.createMarker(files.mainSourceFile.iFile, 0, ex.getStatus().getSeverity(), "{0}", ex
.getStatus().getMessage());
MarkerUtility.createMarker(files.mainSourceFile.iFile, 0, ex.getStatus().getSeverity(), "{0}",
ex.getStatus().getMessage());
return false;
}
@ -235,7 +235,7 @@ public final class AppleFileWriter extends CompilerFileWriter {
// Method setAddress must be called after method setFileData!
entry.setFileData(content);
entry.setAddress(address);
// Update HELLO with acual start address.
// Update HELLO with actual start address.
createHello(formattedDisk, outputImageEntryName, outputImageEntryTitle, address);
} else {
entry.setFileData(outputFileContent);

View File

@ -86,10 +86,9 @@ public abstract class AssemblerEditor extends TextEditor {
private Hardware hardware;
/**
* Creates a new instance. Constructor parameters are not useful, because
* the super constructor inverts the flow of control, so
* {@link #initializeEditor} is called before the code in this constructor
* is executed.
* Creates a new instance. Constructor parameters are not useful, because the
* super constructor inverts the flow of control, so {@link #initializeEditor}
* is called before the code in this constructor is executed.
*/
protected AssemblerEditor() {
filesLogic = AssemblerEditorFilesLogic.createInstance(this);
@ -121,8 +120,7 @@ public abstract class AssemblerEditor extends TextEditor {
/**
* Gets the compiler id for this editor.
*
* @return The compiler id for this editor, not empty and not
* <code>null</code>.
* @return The compiler id for this editor, not empty and not <code>null</code>.
*/
protected abstract String getCompilerId();
@ -140,8 +138,7 @@ public abstract class AssemblerEditor extends TextEditor {
/**
* Gets the plugin this compiler instance belongs to.
*
* @return The plugin this compiler instance belongs to, not
* <code>null</code>.
* @return The plugin this compiler instance belongs to, not <code>null</code>.
*/
public final AssemblerPlugin getPlugin() {
if (plugin == null) {
@ -186,11 +183,10 @@ public abstract class AssemblerEditor extends TextEditor {
}
/**
* Gets the compiler source parser for this editor and the currently
* selected instruction set.
* Gets the compiler source parser for this editor and the currently selected
* instruction set.
*
* @return The compiler source parser for this editor, not <code>null</code>
* .
* @return The compiler source parser for this editor, not <code>null</code> .
*/
public final CompilerSourceParser createCompilerSourceParser() {
CPU cpu;
@ -208,8 +204,7 @@ public abstract class AssemblerEditor extends TextEditor {
* This method is called whenever the input changes, i.e. after loading and
* after saving as new file.
*
* @param input
* The new input, may be <code>null</code>
* @param input The new input, may be <code>null</code>
*/
@Override
protected final void doSetInput(IEditorInput input) throws CoreException {
@ -219,8 +214,8 @@ public abstract class AssemblerEditor extends TextEditor {
if (input != null) {
IDocument document = getDocumentProvider().getDocument(getEditorInput());
CompilerSourcePartitionScanner partitionScanner = new CompilerSourcePartitionScanner(compiler
.getDefinition().getSyntax());
CompilerSourcePartitionScanner partitionScanner = new CompilerSourcePartitionScanner(
compiler.getDefinition().getSyntax());
partitionScanner.createDocumentPartitioner(document);
AssemblerProperties properties = CompilerSourceParser.getDocumentProperties(document);
@ -314,7 +309,7 @@ public abstract class AssemblerEditor extends TextEditor {
// currently.
updateContentOutlinePage();
}
return (T)contentOutlinePage;
return (T) contentOutlinePage;
}
return super.getAdapter(adapter);
}
@ -375,7 +370,8 @@ public abstract class AssemblerEditor extends TextEditor {
if (ruler == null) {
throw new IllegalArgumentException("Parameter 'ruler' must not be null.");
}
ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(),
styles);
// Ensure decoration support has been created and configured.
getSourceViewerDecorationSupport(viewer);
@ -393,8 +389,7 @@ public abstract class AssemblerEditor extends TextEditor {
/**
* Update the identifiers to be highlighted
*
* @param compilerSourceFile
* The compiler source file or <code>null</code>.
* @param compilerSourceFile The compiler source file or <code>null</code>.
*/
final void updateIdentifiers(CompilerSourceFile compilerSourceFile) {
Profiler profiler = new Profiler(this.getClass());
@ -418,11 +413,10 @@ public abstract class AssemblerEditor extends TextEditor {
}
/**
* Update the folding structure with a given list of foldingPositions. Used
* by the editor updater of {@link AssemblerReconcilingStategy}.
* Update the folding structure with a given list of foldingPositions. Used by
* the editor updater of {@link AssemblerReconcilingStategy}.
*
* @param foldingPositions
* The list of foldingPositions, may be empty, not
* @param foldingPositions The list of foldingPositions, may be empty, not
* <code>null</code>.
*/
final void updateFoldingStructure(List<Position> foldingPositions) {
@ -529,8 +523,7 @@ public abstract class AssemblerEditor extends TextEditor {
/**
* Position the cursor to the specified line in the document.
*
* @param line
* The line number, a positive integer.
* @param line The line number, a positive integer.
*
* @return <code>true</code> if the positioning was successful.
*/

View File

@ -61,11 +61,10 @@ public abstract class AssemblerEditorFilesCommandHandler extends AbstractHandler
execute(event, assemblerEditor, files);
} else {
try {
AssemblerPlugin.getInstance().showError(
assemblerEditor.getSite().getShell(),
AssemblerPlugin.getInstance().showError(assemblerEditor.getSite().getShell(),
"Operation '" + event.getCommand().getName()
+ "' is not possible because the file in the editor is not located in the workspace.",
new Exception());
new Exception("Cannot resolve compiler files of " + assemblerEditor.getEditorInput()));
} catch (NotDefinedException ignore) {
// Ignore
}
@ -76,16 +75,12 @@ public abstract class AssemblerEditorFilesCommandHandler extends AbstractHandler
/**
* Perform the action on the current editor and file.
*
* @param event
* The event, not <code>null</code>.
* @param assemblerEditor
* The assembler editor, not <code>null</code> and with current
* files which are not <code>null</code>.
* @param files
* The current compiler files of the editor, not
* @param event The event, not <code>null</code>.
* @param assemblerEditor The assembler editor, not <code>null</code> and with
* current files which are not <code>null</code>.
* @param files The current compiler files of the editor, not
* <code>null</code> .
* @throws ExecutionException
* if an exception occurred during execution.
* @throws ExecutionException if an exception occurred during execution.
*/
protected abstract void execute(ExecutionEvent event, AssemblerEditor assemblerEditor, CompilerFiles files)
throws ExecutionException;

View File

@ -60,8 +60,7 @@ public final class AssemblerEditorFilesLogic {
/**
* Create a new instance of the logic.
*
* @param assemblerEditor
* The assembler editor, not <code>null</code>.
* @param assemblerEditor The assembler editor, not <code>null</code>.
*
* @return The new instance, not <code>null</code>.
*/
@ -113,8 +112,8 @@ public final class AssemblerEditorFilesLogic {
} catch (CoreException ex) {
AssemblerPlugin plugin = AssemblerPlugin.getInstance();
plugin.logError("Cannot read main source file '{0'}",
new Object[] { mainSourceFile.getPath() }, ex);
plugin.logError("Cannot read main source file '{0'}", new Object[] { mainSourceFile.getPath() },
ex);
mainSourceFileProperties = new AssemblerProperties();
}
@ -167,17 +166,15 @@ public final class AssemblerEditorFilesLogic {
* Determine the hardware defined by the property
* {@link AssemblerProperties#HARDWARE}.
*
* @param iFile
* The iFIle to which error message will be associated, not
* @param iFile The iFIle to which error message will be associated, not
* <code>null</code>.
* @param properties
* The assembler properties, not <code>null</code>.
* @param properties The assembler properties, not <code>null</code>.
*
* @return The hardware or <code>null</code> if is the not defined in the
* properties.
* @throws InvalidAssemblerPropertyException
* If the hardware is specified but invalid. Error message will
* be assigned to the iFile in this case.
* @throws InvalidAssemblerPropertyException If the hardware is specified but
* invalid. Error message will be
* assigned to the iFile in this case.
*
* @since 1.6.1
*/
@ -237,8 +234,7 @@ public final class AssemblerEditorFilesLogic {
* Determine the hardware of the main source file and makes sure that the
* include file uses the same hardware.
*
* @param files
* The compiler files, not <code>null</code>.
* @param files The compiler files, not <code>null</code>.
* @return The hardware to be used, or <code>null</code> if errors have
* occurred.
*
@ -275,7 +271,8 @@ public final class AssemblerEditorFilesLogic {
mainSourceFileHardware = defaultHardware;
mainSourceFileLineNumber = 0;
} else {
mainSourceFileLineNumber = files.mainSourceFile.assemblerProperties.get(AssemblerProperties.HARDWARE).lineNumber;
mainSourceFileLineNumber = files.mainSourceFile.assemblerProperties
.get(AssemblerProperties.HARDWARE).lineNumber;
}
if (!sourceFileHardware.equals(mainSourceFileHardware)) {
@ -293,8 +290,7 @@ public final class AssemblerEditorFilesLogic {
/**
* Validates the output file related settings of the compiler files.
*
* @param files
* The compiler files, not <code>null</code>.
* @param files The compiler files, not <code>null</code>.
* @return <code>true</code> if all settings are correct, <code>false</code>
* otherwise.
*/
@ -340,22 +336,18 @@ public final class AssemblerEditorFilesLogic {
/**
* Creates a message associated with the main source file of an
* {@link AssemblerEditorFilesLogic} instance. The message is is bound to
* the line number number of the property (if available). Also the editor is
* {@link AssemblerEditorFilesLogic} instance. The message is is bound to the
* line number number of the property (if available). Also the editor is
* position to the marker.
*
* @param files
* The {@link AssemblerEditorFilesLogic} not <code>null</code>.
* @param property
* The assembler editor property to which the message belongs or
* @param files The {@link AssemblerEditorFilesLogic} not
* <code>null</code>.
* @param severity
* The message severity, see {@link IMarker#SEVERITY}
* @param message
* The message, may contain parameter "{0}" to "{9}". May be
* @param property The assembler editor property to which the message belongs
* or <code>null</code>.
* @param severity The message severity, see {@link IMarker#SEVERITY}
* @param message The message, may contain parameter "{0}" to "{9}". May be
* empty, not <code>null</code>.
* @param parameters
* The format parameters for the message, may be empty, not
* @param parameters The format parameters for the message, may be empty, not
* <code>null</code>.
*/
private void createMainSourceFileMessage(CompilerFiles files, AssemblerProperty property, int severity,
@ -363,8 +355,8 @@ public final class AssemblerEditorFilesLogic {
if (files == null) {
throw new IllegalArgumentException("Parameter 'files' must not be null.");
}
IMarker marker = MarkerUtility.createMarker(files.mainSourceFile.iFile, (property == null ? 0
: property.lineNumber), severity, message, parameters);
IMarker marker = MarkerUtility.createMarker(files.mainSourceFile.iFile,
(property == null ? 0 : property.lineNumber), severity, message, parameters);
MarkerUtility.gotoMarker(assemblerEditor, marker);
}

View File

@ -41,7 +41,6 @@ public final class CompilerPreferences {
if (assemblerPreferences == null) {
throw new IllegalArgumentException("Parameter 'assemblerPreferences' must not be null.");
}
if (compilerId == null) {
throw new IllegalArgumentException("Parameter 'compilerId' must not be null.");
}
@ -59,8 +58,7 @@ public final class CompilerPreferences {
/**
* Gets the compiler id of the compiler.
*
* @return The compiler id of the compiler, not empty and not
* <code>null</code>.
* @return The compiler id of the compiler, not empty and not <code>null</code>.
*/
public String getCompilerId() {
return compilerId;
@ -86,8 +84,8 @@ public final class CompilerPreferences {
*/
public CPU getCPU() {
CPU result;
String cpuString = assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerCPUName(compilerId,
hardware));
String cpuString = assemblerPreferences
.getString(AssemblerPreferencesConstants.getCompilerCPUName(compilerId, hardware));
if (StringUtility.isEmpty(cpuString)) {
result = CPU.MOS6502;
@ -124,8 +122,8 @@ public final class CompilerPreferences {
* <code>null</code>.
*/
public String getParameters() {
return assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerParametersName(compilerId,
hardware));
return assemblerPreferences
.getString(AssemblerPreferencesConstants.getCompilerParametersName(compilerId, hardware));
}
/**
@ -137,8 +135,8 @@ public final class CompilerPreferences {
*/
public String getOutputFolderMode() {
return assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerOutputFolderModeName(compilerId,
hardware));
return assemblerPreferences
.getString(AssemblerPreferencesConstants.getCompilerOutputFolderModeName(compilerId, hardware));
}
/**
@ -151,8 +149,8 @@ public final class CompilerPreferences {
*/
public String getOutputFolderPath() {
return assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerOutputFolderPathName(compilerId,
hardware));
return assemblerPreferences
.getString(AssemblerPreferencesConstants.getCompilerOutputFolderPathName(compilerId, hardware));
}
/**
@ -162,8 +160,8 @@ public final class CompilerPreferences {
*/
public String getOutputFileExtension() {
return assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerOutputFileExtensionName(
compilerId, hardware));
return assemblerPreferences
.getString(AssemblerPreferencesConstants.getCompilerOutputFileExtensionName(compilerId, hardware));
}
/**
@ -173,8 +171,8 @@ public final class CompilerPreferences {
* <code>null</code>.
*/
public String getRunnerId() {
String result = assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerRunnerIdName(
compilerId, hardware));
String result = assemblerPreferences
.getString(AssemblerPreferencesConstants.getCompilerRunnerIdName(compilerId, hardware));
if (StringUtility.isEmpty(result)) {
result = RunnerId.DEFAULT_APPLICATION;
}
@ -184,8 +182,7 @@ public final class CompilerPreferences {
/**
* Gets the executable path for the runner.
*
* @param runnerId
* The runner id, not empty and not <code>null</code>.
* @param runnerId The runner id, not empty and not <code>null</code>.
*
* @return The executable path for the runner, may be empty, not
* <code>null</code>.
@ -197,18 +194,16 @@ public final class CompilerPreferences {
if (StringUtility.isEmpty(runnerId)) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerRunnerExecutablePathName(
compilerId, hardware, runnerId));
return assemblerPreferences.getString(
AssemblerPreferencesConstants.getCompilerRunnerExecutablePathName(compilerId, hardware, runnerId));
}
/**
* Gets the parameters for the runner.
*
* @param runnerId
* The runner id, not empty and not <code>null</code>.
* @param runnerId The runner id, not empty and not <code>null</code>.
*
* @return The parameters for the runner, may be empty, not
* <code>null</code>.
* @return The parameters for the runner, may be empty, not <code>null</code>.
*/
public String getRunnerCommandLine(String runnerId) {
if (runnerId == null) {
@ -217,15 +212,14 @@ public final class CompilerPreferences {
if (StringUtility.isEmpty(runnerId)) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return assemblerPreferences.getString(AssemblerPreferencesConstants.getCompilerRunnerCommandLineName(
compilerId, hardware, runnerId));
return assemblerPreferences.getString(
AssemblerPreferencesConstants.getCompilerRunnerCommandLineName(compilerId, hardware, runnerId));
}
/**
* Gets the wait for completion indicator for the runner.
*
* @param runnerId
* The runner id, not empty and not <code>null</code>.
* @param runnerId The runner id, not empty and not <code>null</code>.
*
* @return <code>true</code>if waiting for completion is requested,
* <code>false</code> otherwise.
@ -239,8 +233,8 @@ public final class CompilerPreferences {
if (StringUtility.isEmpty(runnerId)) {
throw new IllegalArgumentException("Parameter 'runnerId' must not be empty.");
}
return assemblerPreferences.getBoolean(AssemblerPreferencesConstants.getCompilerRunnerWaitForCompletionName(
compilerId, hardware, runnerId));
return assemblerPreferences.getBoolean(
AssemblerPreferencesConstants.getCompilerRunnerWaitForCompletionName(compilerId, hardware, runnerId));
}
}

View File

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.wudsn.ide.base"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins" />
<classpathentry kind="src" path="src" />
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER" />
<classpathentry combineaccessrules="false" kind="src"
path="/com.wudsn.ide.base" />
<classpathentry kind="output" path="bin" />
</classpath>

View File

@ -12,8 +12,7 @@ public interface FileContent {
/**
* Gets a byte (8 bit) from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The byte from the file content.
*/
public int getByte(long offset);
@ -21,8 +20,7 @@ public interface FileContent {
/**
* Gets a word (16 bit) in little endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The word from the file content.
*/
public int getWord(long offset);
@ -30,8 +28,7 @@ public interface FileContent {
/**
* Gets a word (16 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The word from the file content.
*/
public int getWordBigEndian(long offset);
@ -39,8 +36,7 @@ public interface FileContent {
/**
* Gets a double word (32 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The word from the file content.
*/
public long getDoubleWordBigEndian(long offset);

View File

@ -1,6 +1,6 @@
package com.wudsn.ide.hex;
public class FileContentImpl implements FileContent{
public class FileContentImpl implements FileContent {
private byte[] fileContent;
@ -24,8 +24,7 @@ public class FileContentImpl implements FileContent{
/**
* Gets a byte (8 bit) from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The byte from the file content.
*/
@Override
@ -43,8 +42,7 @@ public class FileContentImpl implements FileContent{
/**
* Gets a word (16 bit) in little endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The word from the file content.
*/
@Override
@ -55,8 +53,7 @@ public class FileContentImpl implements FileContent{
/**
* Gets a word (16 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The word from the file content.
*/
@Override
@ -67,8 +64,7 @@ public class FileContentImpl implements FileContent{
/**
* Gets a double word (32 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @param offset The offset, a non-negative integer.
* @return The word from the file content.
*/
@Override

View File

@ -37,8 +37,7 @@ public final class HexEditorContentOutlineTreeObject {
/**
* Create a new instance.
*
* @param styledString
* The styled string of the instance, may be empty not
* @param styledString The styled string of the instance, may be empty not
* <code>null</code>.
*/
public HexEditorContentOutlineTreeObject(StyledString styledString) {
@ -69,9 +68,8 @@ public final class HexEditorContentOutlineTreeObject {
/**
* Sets the start offset of the tree object in the file.
*
* @param fileOffset
* The start offset, a non-negative integer or <code>-1</code> if
* the offset is not defined.
* @param fileOffset The start offset, a non-negative integer or <code>-1</code>
* if the offset is not defined.
*/
public void setFileStartOffset(long fileOffset) {
@ -89,12 +87,11 @@ public final class HexEditorContentOutlineTreeObject {
}
/**
* Sets the end offset of the tree object in the file or <code>-1</code> if
* the offset is not defined.
* Sets the end offset of the tree object in the file or <code>-1</code> if the
* offset is not defined.
*
* @param fileOffset
* The end offset, a non-negative integer or <code>-1</code> if
* the offset is not defined.
* @param fileOffset The end offset, a non-negative integer or <code>-1</code>
* if the offset is not defined.
*/
public void setFileEndOffset(long fileOffset) {
@ -113,8 +110,7 @@ public final class HexEditorContentOutlineTreeObject {
/**
* Sets text start offset of the tree object in the text
*
* @param textOffset
* The offset, a non-negative integer.
* @param textOffset The offset, a non-negative integer.
*/
public void setTextStartOffset(long textOffset) {
if (textOffset < 0) {
@ -136,8 +132,7 @@ public final class HexEditorContentOutlineTreeObject {
/**
* Sets text end offset of the tree object in the text
*
* @param textOffset
* The offset, a non-negative integer.
* @param textOffset The offset, a non-negative integer.
*/
public void setTextEndOffset(int textOffset) {
if (textOffset < 0) {

View File

@ -43,12 +43,9 @@ public abstract class HexEditorParser {
/**
* Initialized by owner.
*
* @param owner
* The owner, not <code>null</code>.
* @param offsetStyler
* The offset styler, not <code>null</code>.
* @param addressStyler
* The address styler, not <code>null</code>.
* @param owner The owner, not <code>null</code>.
* @param offsetStyler The offset styler, not <code>null</code>.
* @param addressStyler The address styler, not <code>null</code>.
*/
void init(HexEditorParserComponent owner, Styler offsetStyler, Styler addressStyler) {
if (owner == null) {
@ -69,32 +66,23 @@ public abstract class HexEditorParser {
/**
* Public API for parsing.
*
* @param contentBuilder
* The content builder, not <code>null</code>.
* @param contentBuilder The content builder, not <code>null</code>.
* @return <code>true</code> if parsing was OK, <code>false</code>otherwise.
*/
public abstract boolean parse(StyledString contentBuilder);
/**
* Prints a block header in the context area and adds a block to the
* outline.
* Prints a block header in the context area and adds a block to the outline.
*
* @param contentBuilder
* The content builder, not <code>null</code>.
* @param blockHeaderText
* The header text for the block, may be empty, not
* <code>null</code>.
* @param blockHeaderNumber
* The block count or <code>-1</code> if count shall not be
* displayed.
* @param blockHeaderParameterText
* The pattern text of the form "{0}-{1} ({2})"
* @param offset
* The start offset, a non-negative integer.
* @param startAddress
* The start address, a non-negative integer.
* @param endAddress
* The end address, a non-negative integer.
* @param contentBuilder The content builder, not <code>null</code>.
* @param blockHeaderText The header text for the block, may be empty,
* not <code>null</code>.
* @param blockHeaderNumber The block count or <code>-1</code> if count
* shall not be displayed.
* @param blockHeaderParameterText The pattern text of the form "{0}-{1} ({2})"
* @param offset The start offset, a non-negative integer.
* @param startAddress The start address, a non-negative integer.
* @param endAddress The end address, a non-negative integer.
*
* @return The tree object representing the block.
*/
@ -150,13 +138,10 @@ public abstract class HexEditorParser {
/**
* Adds a block to the outline.
*
* @param contentBuilder
* The content builder, not <code>null</code>.
* @param headerStyledString
* The style string for the block header in the outline, not
* <code>null</code>.
* @param offset
* The start offset, a non-negative integer.
* @param contentBuilder The content builder, not <code>null</code>.
* @param headerStyledString The style string for the block header in the
* outline, not <code>null</code>.
* @param offset The start offset, a non-negative integer.
*
* @return The tree object representing the block.
*/
@ -166,17 +151,13 @@ public abstract class HexEditorParser {
}
/**
* Prints the last block in case if contains an error like the wrong number
* of bytes.
* Prints the last block in case if contains an error like the wrong number of
* bytes.
*
* @param contentBuilder
* The content builder, not <code>null</code>.
* @param errorText
* The error text, not empty and not <code>null</code>.
* @param length
* The length of the last block, a non-negative integer.
* @param offset
* The offset of the last block, a non-negative integer.
* @param contentBuilder The content builder, not <code>null</code>.
* @param errorText The error text, not empty and not <code>null</code>.
* @param length The length of the last block, a non-negative integer.
* @param offset The offset of the last block, a non-negative integer.
*/
protected final void printBlockWithError(StyledString contentBuilder, String errorText, long length, long offset) {
owner.printBlockWithError(contentBuilder, errorText, length, offset);

View File

@ -274,8 +274,7 @@ final class HexEditorParserComponent {
/**
* Sets the file content for {@link #parseFileContent()}.
*
* @param fileContentMode
* The file content mode, not <code>null</code>.
* @param fileContentMode The file content mode, not <code>null</code>.
*/
public void setFileContentMode(HexEditorFileContentMode fileContentMode) {
if (fileContentMode == null) {
@ -296,8 +295,7 @@ final class HexEditorParserComponent {
/**
* Sets the character set type.
*
* @param characterSet
* The character set type, not <code>null</code>.
* @param characterSet The character set type, not <code>null</code>.
*/
public void setCharacterSet(HardwareCharacterSet characterSet) {
if (characterSet == null) {
@ -319,8 +317,7 @@ final class HexEditorParserComponent {
/**
* Sets the number of bytes per row for {@link #parseFileContent()}.
*
* @param bytesPerRow
* The number of bytes per row, a positive integer.
* @param bytesPerRow The number of bytes per row, a positive integer.
*/
public void setBytesPerRow(int bytesPerRow) {
if (bytesPerRow < 1) {
@ -352,8 +349,8 @@ final class HexEditorParserComponent {
}
/**
* Parse the file content set with {@link #setFileContent(byte[])} according
* to the parameters set with
* Parse the file content set with {@link #setFileContent(byte[])} according to
* the parameters set with
* {@link #setFileContentMode(HexEditorFileContentMode)},
* {@link #setBytesPerRow(int)} and
* {@link #setCharacterSet(HardwareCharacterSet)}.
@ -431,16 +428,12 @@ final class HexEditorParserComponent {
}
/**
* Prints a block header in the context area and adds a block to the
* outline.
* Prints a block header in the context area and adds a block to the outline.
*
* @param contentBuilder
* The content builder, not <code>null</code>.
* @param headerStyledString
* The style string for the block header in the outline, not
* <code>null</code>.
* @param offset
* The start offset, a non-negative integer.
* @param contentBuilder The content builder, not <code>null</code>.
* @param headerStyledString The style string for the block header in the
* outline, not <code>null</code>.
* @param offset The start offset, a non-negative integer.
*
* @return The tree object representing the block.
*/
@ -463,17 +456,13 @@ final class HexEditorParserComponent {
}
/**
* Prints the last block in case if contains an error like the wrong number
* of bytes.
* Prints the last block in case if contains an error like the wrong number of
* bytes.
*
* @param contentBuilder
* The content builder, not <code>null</code>.
* @param errorText
* The error text, not empty and not <code>null</code>.
* @param length
* The length of the last block, a non-negative integer.
* @param offset
* The offset of the last block, a non-negative integer.
* @param contentBuilder The content builder, not <code>null</code>.
* @param errorText The error text, not empty and not <code>null</code>.
* @param length The length of the last block, a non-negative integer.
* @param offset The offset of the last block, a non-negative integer.
*/
final void printBlockWithError(StyledString contentBuilder, String errorText, long length, long offset) {
if (contentBuilder == null) {
@ -560,8 +549,7 @@ final class HexEditorParserComponent {
}
/**
* Gets the list of outline blocks determined by {@link #parseFileContent()}
* .
* Gets the list of outline blocks determined by {@link #parseFileContent()} .
*
* @return The list of outline blocks, may be empty, not <code>null</code>.
*/
@ -570,13 +558,10 @@ final class HexEditorParserComponent {
}
/**
* Gets the selection represented by the start and end offset in the text
* field.
* Gets the selection represented by the start and end offset in the text field.
*
* @param x
* is the offset of the first selected character
* @param y
* is the offset after the last selected character.
* @param x is the offset of the first selected character
* @param y is the offset after the last selected character.
* @return The selection or <code>null</code>.
*/
public HexEditorSelection getSelection(int x, int y) {
@ -611,7 +596,7 @@ final class HexEditorParserComponent {
// String.valueOf(nextTextOffset),
// String.valueOf(startOffset), String.valueOf(endOffset) });
if (getByteTextOffset(i) >= y ) {
if (getByteTextOffset(i) >= y) {
endOffset = i;
break;
}
@ -658,8 +643,7 @@ final class HexEditorParserComponent {
/**
* Gets the text offset for a byte offset.
*
* @param byteOffset
* The byte offset in the original byte array.
* @param byteOffset The byte offset in the original byte array.
* @return The text offset where the byte is represented or
* <code>UNDEFINED_OFFSET</code> if there is no such text offset.
*/

View File

@ -36,20 +36,18 @@ final class HexEditorSelection implements ISelection {
/**
* Creates a new selection.
*
* @param startOffset
* The start offset in the original array, a non-negative number.
* @param endOffset
* The end offset in the original array, a non-negative number
* greater or equal to the start offset.
* @param bytes
* The content of the selection, may be empty, not
* @param startOffset The start offset in the original array, a non-negative
* number.
* @param endOffset The end offset in the original array, a non-negative
* number greater or equal to the start offset.
* @param bytes The content of the selection, may be empty, not
* <code>null</code>.
*/
public HexEditorSelection(long startOffset, long endOffset, byte[] bytes) {
if (startOffset < 0) {
throw new IllegalArgumentException("Parameter 'startOffset' must not be negative, specified value is "
+ startOffset + ".");
throw new IllegalArgumentException(
"Parameter 'startOffset' must not be negative, specified value is " + startOffset + ".");
}
if (endOffset < startOffset) {
throw new IllegalArgumentException("Parameter 'endOffset' must not be smaller than startOffset "
@ -81,8 +79,8 @@ final class HexEditorSelection implements ISelection {
/**
* Gets the end offset in the original array.
*
* @return The end offset in the original array, a non-negative number
* greater or equal to the start offset.
* @return The end offset in the original array, a non-negative number greater
* or equal to the start offset.
*/
public long getEndOffset() {
return endOffset;
@ -91,8 +89,7 @@ final class HexEditorSelection implements ISelection {
/**
* Gets the content of the selection.
*
* @return The content of the selection, may be empty, not <code>null</code>
* .
* @return The content of the selection, may be empty, not <code>null</code> .
*/
public byte[] getBytes() {
return bytes;

View File

@ -38,8 +38,8 @@ public final class AtariDiskImageKFileParser extends AtariDiskImageParser {
// as well.
if (!error) {
// The length of the k-file is stored in $709/$70a.
int length = ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET + fileContent.getByte(0x19) + 256
* fileContent.getByte(0x1a);
int length = ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET + fileContent.getByte(0x19)
+ 256 * fileContent.getByte(0x1a);
error = parseAtariCOMFile(contentBuilder, ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET, length);
}
return error;

View File

@ -155,8 +155,7 @@ public class AtariSDXParser extends HexEditorParser {
/**
* Gets end offset for UPDATE_RELOC_HEADER and UPDATE_SYMBOLS_HEADER.
*
* @param offset
* The start offset, a non-negative integer.
* @param offset The start offset, a non-negative integer.
* @return The end offset, a non-negative integer.
*/
private long getBlockEnd(long offset) {