use of com.wuntee.oter.view.widgets.runnable.FileToStyledTextRunnable in project otertool by wuntee.
the class PackageManagerController method loadFileContentsToTab.
public void loadFileContentsToTab(FsNode node) throws Exception {
logger.debug("Node selected: " + node.getFullPath());
if (!node.isDirectory()) {
gui.setStatus("Loading file " + node.getName());
File f = AdbWorkshop.pullFile(node.getFullPath());
// Try to load a database
if (node.getName().endsWith(".db")) {
CTabItemWithDatabase item = new CTabItemWithDatabase(gui.getPackageManagerFilesTabs(), node.getName(), f, SWT.CLOSE);
} else if (node.getName().endsWith(".xml") || node.getName().endsWith(".txt")) {
CTabItemWithStyledText a = new CTabItemWithStyledText(gui.getPackageManagerFilesTabs(), node.getName(), SWT.CLOSE);
gui.runRunnableAsync(new FileToStyledTextRunnable(f, a.getStyledText()));
} else {
CTabItemWithHexViewer hexTab = new CTabItemWithHexViewer(gui.getPackageManagerFilesTabs(), node.getName(), f, SWT.CLOSE);
}
gui.clearStatus();
}
}
use of com.wuntee.oter.view.widgets.runnable.FileToStyledTextRunnable in project otertool by wuntee.
the class PackageManagerController method loadFileContentsToTextTab.
public void loadFileContentsToTextTab(FsNode node) throws Exception {
gui.setStatus("Loading file " + node.getName());
File f = AdbWorkshop.pullFile(node.getFullPath());
CTabItemWithStyledText a = new CTabItemWithStyledText(gui.getPackageManagerFilesTabs(), node.getName(), SWT.CLOSE);
gui.runRunnableAsync(new FileToStyledTextRunnable(f, a.getStyledText()));
gui.clearStatus();
}
Aggregations