Adjusting the coding format as suggested in:
https://github.com/AppleCommander/AppleCommander/pull/19#pullrequestreview-82711570
This commit is contained in:
parent
5c77c57aa2
commit
ae66b88e0a
|
@ -288,12 +288,14 @@ public abstract class FormattedDisk extends Disk implements DirectoryEntry {
|
|||
if (files != null) {
|
||||
for (int i=0; i<files.size(); i++) {
|
||||
FileEntry entry = (FileEntry) files.get(i);
|
||||
if (entry.isDirectory()) try {
|
||||
if (entry.isDirectory()) {
|
||||
try {
|
||||
theFileEntry = getFile(
|
||||
((DirectoryEntry)entry).getFiles(), filename);
|
||||
if (theFileEntry != null) break;
|
||||
} catch (DiskException e) {
|
||||
// FIXME how to warn the User about this?
|
||||
}
|
||||
}
|
||||
String otherFilename = entry.getFilename();
|
||||
if (otherFilename != null) otherFilename = otherFilename.trim();
|
||||
|
|
|
@ -330,13 +330,15 @@ public class ac {
|
|||
directory = "."+File.separator;
|
||||
}
|
||||
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
|
||||
for (int i = 0; i < formattedDisks.length; i++) try {
|
||||
for (int i = 0; i < formattedDisks.length; i++) {
|
||||
try {
|
||||
FormattedDisk formattedDisk = formattedDisks[i];
|
||||
writeFiles(formattedDisk.getFiles(), directory);
|
||||
} catch (DiskException e) {
|
||||
// FIXME How to warn user about the problem?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive routine to write directory and file entries.
|
||||
|
@ -357,13 +359,15 @@ public class ac {
|
|||
OutputStream output = new FileOutputStream(file);
|
||||
output.write(buf, 0, buf.length);
|
||||
output.close();
|
||||
} else if (entry.isDirectory()) try {
|
||||
} else if (entry.isDirectory()) {
|
||||
try {
|
||||
writeFiles(((DirectoryEntry) entry).getFiles(),directory+entry.getFilename()+File.separator);
|
||||
} catch (DiskException e) {
|
||||
// FIXME How to warn user about the problem?
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive routine to locate a specific file by filename; In the instance
|
||||
|
@ -441,7 +445,8 @@ public class ac {
|
|||
}
|
||||
System.out.println();
|
||||
}
|
||||
if (entry.isDirectory()) try {
|
||||
if (entry.isDirectory()) {
|
||||
try {
|
||||
showFiles(((DirectoryEntry) entry).getFiles(),
|
||||
indent + " ", display); //$NON-NLS-1$
|
||||
} catch (DiskException e) {
|
||||
|
@ -449,6 +454,7 @@ public class ac {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display information about each disk in args.
|
||||
|
|
|
@ -258,7 +258,8 @@ public class DiskExplorerTab {
|
|||
diskItem.setData(disks[i]);
|
||||
directoryTree.setSelection(new TreeItem[] { diskItem });
|
||||
|
||||
if (disks[i].canHaveDirectories()) try {
|
||||
if (disks[i].canHaveDirectories()) {
|
||||
try {
|
||||
Iterator files = disks[i].getFiles().iterator();
|
||||
while (files.hasNext()) {
|
||||
FileEntry entry = (FileEntry) files.next();
|
||||
|
@ -273,6 +274,7 @@ public class DiskExplorerTab {
|
|||
// FIXME how to warn the User about this?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
computeColumnWidths(FormattedDisk.FILE_DISPLAY_STANDARD);
|
||||
computeColumnWidths(FormattedDisk.FILE_DISPLAY_NATIVE);
|
||||
|
@ -1368,12 +1370,14 @@ public class DiskExplorerTab {
|
|||
viewFileItem.setEnabled(false);
|
||||
viewFileItem.addSelectionListener(new SelectionAdapter () {
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (event.detail != SWT.ARROW) try {
|
||||
if (event.detail != SWT.ARROW) {
|
||||
try {
|
||||
viewFile(null);
|
||||
} catch (DiskException e) {
|
||||
// FIXME how to warn the User about this?
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
printToolItem = new ToolItem(toolBar, SWT.PUSH);
|
||||
printToolItem.setImage(imageManager.get(ImageManager.ICON_PRINT_FILE));
|
||||
|
@ -1682,7 +1686,8 @@ public class DiskExplorerTab {
|
|||
saveAs();
|
||||
break;
|
||||
}
|
||||
} else try {
|
||||
} else {
|
||||
try {
|
||||
switch (event.character) {
|
||||
case CTRL_I: // Import Wizard
|
||||
importFiles();
|
||||
|
@ -1699,9 +1704,11 @@ public class DiskExplorerTab {
|
|||
} catch (DiskException e) {
|
||||
// FIXME how to warn the User about this?
|
||||
}
|
||||
}
|
||||
} else { // No CTRL key
|
||||
if ((event.stateMask & SWT.ALT) != SWT.ALT) // Ignore ALT key combinations like alt-F4!
|
||||
try { switch (event.keyCode) {
|
||||
try {
|
||||
switch (event.keyCode) {
|
||||
case SWT.F2: // Standard file display
|
||||
changeCurrentFormat(FormattedDisk.FILE_DISPLAY_STANDARD);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue