use of com.biglybt.ui.mdi.MdiEntryOpenListener in project BiglyBT by BiglySoftware.
the class UIFunctionsImpl method showURL.
/**
* @param url
* @param target
*/
private void showURL(final String url, String target) {
if ("_blank".equalsIgnoreCase(target)) {
Utils.launch(url);
return;
}
if (target.startsWith("tab-")) {
target = target.substring(4);
}
MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI();
// by the caller
if (mdi == null || !mdi.showEntryByID(target)) {
Utils.launch(url);
return;
}
MdiEntry entry = mdi.getEntry(target);
entry.addListener(new MdiEntryOpenListener() {
@Override
public void mdiEntryOpen(MdiEntry entry) {
entry.removeListener(this);
mainWindow.setVisible(true, true);
if (!(entry instanceof SideBarEntrySWT)) {
return;
}
SideBarEntrySWT entrySWT = (SideBarEntrySWT) entry;
SWTSkinObjectBrowser soBrowser = SWTSkinUtils.findBrowserSO(entrySWT.getSkinObject());
if (soBrowser != null) {
// ((SWTSkinObjectBrowser) skinObject).getBrowser().setVisible(false);
if (url == null || url.length() == 0) {
soBrowser.restart();
} else {
soBrowser.setURL(url);
}
}
}
});
}
Aggregations