Search in sources :

Example 1 with CTabItemWithDatabase

use of com.wuntee.oter.view.widgets.CTabItemWithDatabase 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 CTabItemWithDatabase

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

the class PackageManagerController method loadFileContentsToSQLiteTab.

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

Aggregations

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