use of com.biglybt.plugin.net.buddy.BuddyPluginAZ2 in project BiglyBT by BiglySoftware.
the class BuddyPluginView method init.
private void init(BuddyPlugin _plugin, UIInstance _ui_instance, String _VIEW_ID, boolean _main_view) {
plugin = _plugin;
ui_instance = (UISWTInstance) _ui_instance;
VIEW_ID = _VIEW_ID;
if (_main_view) {
buddyPluginAZ2Listener = new BuddyPluginAZ2Listener() {
@Override
public void chatCreated(final BuddyPluginAZ2.chatInstance chat) {
final Display display = ui_instance.getDisplay();
if (!display.isDisposed()) {
display.asyncExec(new Runnable() {
@Override
public void run() {
if (!display.isDisposed()) {
new BuddyPluginViewChat(plugin, display, chat);
}
}
});
}
}
@Override
public void chatDestroyed(BuddyPluginAZ2.chatInstance chat) {
}
};
plugin.getAZ2Handler().addListener(buddyPluginAZ2Listener);
buddyStatusInit = SimpleTimer.addEvent("BuddyStatusInit", SystemTime.getOffsetTime(1000), new TimerEventPerformer() {
@Override
public void perform(TimerEvent event) {
// UISWTStatusEntry label = ui_instance.createStatusEntry();
// label.setText(MessageText.getString("azbuddy.tracker.bbb.status.title"));
statusUpdater = new statusUpdater(ui_instance);
}
});
Utils.execSWTThread(new AERunnable() {
@Override
public void runSupport() {
ImageLoader imageLoader = ImageLoader.getInstance();
iconNLI = imageLoader.getImage("bbb_nli");
iconIDLE = imageLoader.getImage("bbb_idle");
iconIN = imageLoader.getImage("bbb_in");
iconOUT = imageLoader.getImage("bbb_out");
iconINOUT = imageLoader.getImage("bbb_inout");
}
});
}
ui_instance.addView(UISWTInstance.VIEW_MAIN, VIEW_ID, this);
if (_main_view) {
checkBetaInit();
}
}
Aggregations