mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-22 08:30:35 +00:00
Made duplicate parts reuse code; changed launch to accept a Display
(which, in turn, makes Sleak work).
This commit is contained in:
parent
02b61f7321
commit
d83d8dfbd8
@ -64,17 +64,7 @@ public class SwtAppleCommander implements Listener {
|
||||
* Launch SwtAppleCommander.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
Display display = new Display();
|
||||
imageManager = new ImageManager(display);
|
||||
SwtAppleCommander application = new SwtAppleCommander();
|
||||
Shell shell = application.open(display);
|
||||
shell.forceActive();
|
||||
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch()) display.sleep();
|
||||
}
|
||||
|
||||
UserPreferences.getInstance().save();
|
||||
new SwtAppleCommander().launch();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,9 +72,18 @@ public class SwtAppleCommander implements Listener {
|
||||
*/
|
||||
public void launch() {
|
||||
Display display = new Display();
|
||||
launch(display);
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch SwtAppleCommander with a given display.
|
||||
* Primary motivation is getting S-Leak to work!
|
||||
*/
|
||||
public void launch(Display display) {
|
||||
imageManager = new ImageManager(display);
|
||||
SwtAppleCommander application = new SwtAppleCommander();
|
||||
Shell shell = application.open(display);
|
||||
shell.forceActive();
|
||||
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch()) display.sleep();
|
||||
|
Loading…
Reference in New Issue
Block a user