new Thread() {
@Override
public void run() {
- if (director.acquireBridge()) {
- director.startListenForDevices();
- director.populateDeviceSelectionModel();
- }
+ initDirector(director);
}
}.start();
}
new Thread() {
@Override
public void run() {
- HierarchyViewerDirector.getDirector().initDebugBridge();
- HierarchyViewerDirector.getDirector().startListenForDevices();
- HierarchyViewerDirector.getDirector().populateDeviceSelectionModel();
+ initDirector(HierarchyViewerDirector.getDirector());
}
}.start();
}
}
}
+ private static boolean initDirector(HierarchyViewerDirector director) {
+ if (director.acquireBridge()) {
+ director.startListenForDevices();
+ director.populateDeviceSelectionModel();
+ return true;
+ }
+
+ return false;
+ }
+
/**
* Prints a message, associated with a project to the specified stream
*