Search in sources :

Example 1 with CTabItemWithStyledText

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

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

Aggregations

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