Search in sources :

Example 1 with CTabItemWithHexViewer

use of com.wuntee.oter.view.widgets.CTabItemWithHexViewer 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();
    }
}
Also used : CTabItemWithStyledText(com.wuntee.oter.view.widgets.CTabItemWithStyledText) CTabItemWithDatabase(com.wuntee.oter.view.widgets.CTabItemWithDatabase) CTabItemWithHexViewer(com.wuntee.oter.view.widgets.CTabItemWithHexViewer) FileToStyledTextRunnable(com.wuntee.oter.view.widgets.runnable.FileToStyledTextRunnable) File(java.io.File)

Example 2 with CTabItemWithHexViewer

use of com.wuntee.oter.view.widgets.CTabItemWithHexViewer in project otertool by wuntee.

the class PackageManagerController method loadFileContentsToHexTab.

public void loadFileContentsToHexTab(FsNode node) throws Exception {
    gui.setStatus("Loading file " + node.getName());
    File f = AdbWorkshop.pullFile(node.getFullPath());
    CTabItemWithHexViewer hexTab = new CTabItemWithHexViewer(gui.getPackageManagerFilesTabs(), node.getName(), f, SWT.CLOSE);
    gui.clearStatus();
}
Also used : CTabItemWithHexViewer(com.wuntee.oter.view.widgets.CTabItemWithHexViewer) File(java.io.File)

Aggregations

CTabItemWithHexViewer (com.wuntee.oter.view.widgets.CTabItemWithHexViewer)2 File (java.io.File)2 CTabItemWithDatabase (com.wuntee.oter.view.widgets.CTabItemWithDatabase)1 CTabItemWithStyledText (com.wuntee.oter.view.widgets.CTabItemWithStyledText)1 FileToStyledTextRunnable (com.wuntee.oter.view.widgets.runnable.FileToStyledTextRunnable)1