Search in sources :

Example 1 with TabInfo

use of org.loboevolution.info.TabInfo in project LoboEvolution by LoboEvolution.

the class TabbedPanePopupMenu method closeTab.

private void closeTab(int index, DnDTabbedPane tabbedPane, IBrowserPanel panel) {
    List<TabInfo> tabs = TabStore.getTabs();
    for (int i = 0; i < tabs.size(); i++) {
        if (i == index) {
            WebStore.deleteStorage(1, index);
            TabStore.deleteTab(index);
        }
        if (i > index) {
            WebStore.deleteStorage(1, index);
            TabInfo tabInfo = tabs.get(i);
            TabStore.deleteTab(i);
            TabStore.insertTab(i - 1, tabInfo.getUrl());
            IBrowserFrame browserFrame = panel.getBrowserFrame();
            browserFrame.getToolbar().getAddressBar().setText(tabInfo.getUrl());
        }
    }
    panel.getScroll().getViewport().add(tabbedPane);
}
Also used : IBrowserFrame(org.loboevolution.component.IBrowserFrame) TabInfo(org.loboevolution.info.TabInfo)

Example 2 with TabInfo

use of org.loboevolution.info.TabInfo in project LoboEvolution by LoboEvolution.

the class TabbedPanePopupMenu method closeOtherTab.

private void closeOtherTab(int index, DnDTabbedPane tabbedPane, IBrowserPanel panel) {
    List<TabInfo> tabs = TabStore.getTabs();
    for (int i = 0; i < tabs.size(); i++) {
        if (i != index) {
            WebStore.deleteStorage(1, i);
            TabStore.deleteTab(i);
        } else {
            WebStore.deleteStorage(1, index);
            TabInfo tabInfo = tabs.get(index);
            TabStore.deleteTab(index);
            TabStore.insertTab(0, tabInfo.getUrl());
            IBrowserFrame browserFrame = panel.getBrowserFrame();
            browserFrame.getToolbar().getAddressBar().setText(tabInfo.getUrl());
        }
    }
    panel.getScroll().getViewport().add(tabbedPane);
}
Also used : IBrowserFrame(org.loboevolution.component.IBrowserFrame) TabInfo(org.loboevolution.info.TabInfo)

Aggregations

IBrowserFrame (org.loboevolution.component.IBrowserFrame)2 TabInfo (org.loboevolution.info.TabInfo)2