Search in sources :

Example 1 with BrowserTab

use of net.heartsome.cat.ts.websearch.ui.browser.BrowserTab in project translationstudio8 by heartsome.

the class BrowserViewPart method dispose.

/**
	 * (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#dispose()
	 */
@Override
public void dispose() {
    if (browserTabs != null && browserTabs.length != 0) {
        for (BrowserTab tab : browserTabs) {
            tab.close();
        }
    }
    disposeCacheImage();
    if (null != font) {
        font.dispose();
    }
    WebSearchPreferencStore.getIns().removeProperChangeListener(urlChangelistener);
    if (null != refreshContentJob) {
        refreshContentJob.setStop(true);
    }
    super.dispose();
}
Also used : BrowserTab(net.heartsome.cat.ts.websearch.ui.browser.BrowserTab)

Example 2 with BrowserTab

use of net.heartsome.cat.ts.websearch.ui.browser.BrowserTab in project translationstudio8 by heartsome.

the class BrowserViewPart method refreshTabContent.

public void refreshTabContent() {
    if (browserTabs != null && browserTabs.length != 0) {
        for (BrowserTab tab : browserTabs) {
            tab.close();
        }
    }
    browserTabs = new BrowserTab[urls.size()];
    for (int i = 0; i < urls.size(); i++) {
        SearchEntry searchEntry = urls.get(i);
        browserTabs[i] = new BrowserTab(searchEntry);
        CTabItem item = new CTabItem(tabFolder, SWT.NONE);
        browserTabs[i].setItem(item);
        item.setText(searchEntry.getSearchName().replaceAll("&", "&&"));
        item.setControl(browserTabs[i].createTabFolderPage(tabFolder));
        item.setData(browserTabs[i]);
        Image image = getImage(searchEntry.getSearchUrl());
        if (null != image) {
            item.setImage(image);
        }
        browserTabs[i].searchKeyWord(keyWordForSearch.getText());
    }
    tabFolder.setSelection(0);
    tabFolder.layout();
}
Also used : Image(org.eclipse.swt.graphics.Image) CTabItem(org.eclipse.swt.custom.CTabItem) SearchEntry(net.heartsome.cat.ts.websearch.bean.SearchEntry) BrowserTab(net.heartsome.cat.ts.websearch.ui.browser.BrowserTab)

Aggregations

BrowserTab (net.heartsome.cat.ts.websearch.ui.browser.BrowserTab)2 SearchEntry (net.heartsome.cat.ts.websearch.bean.SearchEntry)1 CTabItem (org.eclipse.swt.custom.CTabItem)1 Image (org.eclipse.swt.graphics.Image)1