134
134
fss.isMonitoring = false;
135
135
fss.initialize = function () {
136
136
this.monitorEl = document.createElement ("DIV");
137
+ this.monitorEl.id = "swt-font-monitor";
137
138
this.monitorEl.style.cssText = "position:absolute;top:-1000px;left:-1000px;font-family:Arial, sans-serif;font-size:10pt;overflow:visible;";
138
139
document.body.appendChild (this.monitorEl);
139
140
this.monitorEl.appendChild (document.createTextNode ("Java2Script"));
@@ -1798,7 +1799,7 @@ Shell getModalDialogShell () {
1798
1799
monitor .handle = document .body ;
1799
1800
monitor .clientWidth = OS .getFixedBodyClientWidth (); //document.body.clientWidth;
1800
1801
int parentWidth = OS .getContainerWidth (document .body .parentNode );
1801
- if (parentWidth > monitor .clientWidth && parentWidth <= window .screen .availWidth ) {
1802
+ if (parentWidth - 8 > monitor .clientWidth && parentWidth <= window .screen .availWidth ) {
1802
1803
monitor .clientWidth = parentWidth ;
1803
1804
}
1804
1805
monitor .width = window .screen .availWidth ;
@@ -2498,6 +2499,132 @@ void initializeDekstop() {
2498
2499
}
2499
2500
if (taskBar != null ) return ;
2500
2501
2502
+ /* initialize desktop panel */
2503
+ Element panel = document .getElementById ("swt-desktop-panel" );
2504
+ boolean needScrolling = false ;
2505
+ boolean injecting = false ;
2506
+ if (panel == null ) {
2507
+ boolean forceInsertingPanel = true ;
2508
+ /**
2509
+ * @j2sNative
2510
+ * forceInsertingPanel = (window["swt.desktop.panel"] != false);
2511
+ */ {}
2512
+ if (forceInsertingPanel ) {
2513
+ injecting = true ;
2514
+ panel = document .createElement ("DIV" );
2515
+ panel .id = "swt-desktop-panel" ;
2516
+ /**
2517
+ * @j2sNative
2518
+ * panel.style.overflowX = "hidden";
2519
+ */ {}
2520
+ Element [] childNodes = document .body .childNodes ;
2521
+ if (childNodes .length > 0 ) {
2522
+ document .body .insertBefore (panel , childNodes [0 ]);
2523
+ } else {
2524
+ document .body .appendChild (panel );
2525
+ }
2526
+ childNodes = document .body .childNodes ;
2527
+ Element [] removedChildren = new Element [0 ];
2528
+ for (int i = childNodes .length - 1 ; i >= 0 ; i --) {
2529
+ Element child = childNodes [i ];
2530
+ boolean okToMove = false ;
2531
+ if (child .nodeName == null ) {
2532
+ okToMove = true ;
2533
+ } else if (!"SCRIPT" .equalsIgnoreCase (child .nodeName )) {
2534
+ okToMove = true ;
2535
+ String id = child .id ;
2536
+ if (id != null ) {
2537
+ if ("swt-desktop-panel" .equalsIgnoreCase (id )) {
2538
+ okToMove = false ;
2539
+ } else if ("xss-cookie" .equalsIgnoreCase (id )) {
2540
+ okToMove = false ;
2541
+ } else if ("clazzloader-status" .equalsIgnoreCase (id )) {
2542
+ okToMove = false ;
2543
+ } else if ("swt-font-monitor" .equalsIgnoreCase (id )) {
2544
+ okToMove = false ;
2545
+ } else if ("swt-invisible-container" .equalsIgnoreCase (id )) {
2546
+ okToMove = false ;
2547
+ } else if ("_console_" .equalsIgnoreCase (id )) {
2548
+ okToMove = false ;
2549
+ } else if (id .startsWith ("alaa-" )) {
2550
+ okToMove = false ;
2551
+ }
2552
+ } else {
2553
+ String cssClass = child .className ;
2554
+ if (cssClass != null ) {
2555
+ String [] allSWTClasses = new String [] {
2556
+ "tray-cell" ,
2557
+ "tray-item" ,
2558
+ "tray-logo-item" ,
2559
+ "shell-manager" ,
2560
+ "shortcut-bar" ,
2561
+ "shell-default" ,
2562
+ "shell-trim"
2563
+ };
2564
+ for (int j = 0 ; j < allSWTClasses .length ; j ++) {
2565
+ if (cssClass .indexOf (allSWTClasses [j ]) != -1 ) {
2566
+ okToMove = false ;
2567
+ break ;
2568
+ }
2569
+ }
2570
+ }
2571
+ }
2572
+ }
2573
+ if (okToMove ) {
2574
+ removedChildren [removedChildren .length ] = child ;
2575
+ document .body .removeChild (child );
2576
+ }
2577
+ }
2578
+ for (int i = removedChildren .length - 1 ; i >= 0 ; i --) {
2579
+ panel .appendChild (removedChildren [i ]);
2580
+ }
2581
+ document .body .style .overflow = "hidden" ;
2582
+ document .body .style .padding = "0" ;
2583
+ document .body .style .margin = "0" ;
2584
+ needScrolling = true ;
2585
+ }
2586
+ }
2587
+ if (panel != null ) {
2588
+ document .body .style .overflow = "hidden" ;
2589
+ int height = OS .getFixedBodyClientHeight ();
2590
+ int width = OS .getFixedBodyClientWidth ();
2591
+ panel .style .position = "absolute" ;
2592
+ if (!injecting ) {
2593
+ panel .style .backgroundColor = "white" ;
2594
+ }
2595
+ /**
2596
+ * @j2sNative
2597
+ * var vsb = window["swt.desktop.vscrollbar"];
2598
+ * if (vsb != null && (vsb == true || vsb == "true" || vsb == "enable")) {
2599
+ * panel.style.overflowY = "auto";
2600
+ * }
2601
+ * var hsb = window["swt.desktop.hscrollbar"];
2602
+ * if (hsb != null && (hsb == true || hsb == "true" || hsb == "enable")) {
2603
+ * panel.style.overflowX = "auto";
2604
+ * }
2605
+ */ {}
2606
+ panel .style .paddingBottom = "80px" ;
2607
+ if (!OS .isIE || OS .isIE70 || OS .isIE80 || OS .isIE90 ) { // to ensure that it is at least 80px height?
2608
+ Element div = document .createElement ("DIV" );
2609
+ div .id = "page-bottom-end" ;
2610
+ /**
2611
+ * @j2sNative
2612
+ * div.style.cssFloat = "left";
2613
+ */ {}
2614
+ div .style .height = "80px" ;
2615
+ div .style .width = "1px" ;
2616
+ div .style .marginLeft = "-1px" ;
2617
+ panel .appendChild (div );
2618
+ }
2619
+ panel .style .left = "0" ;
2620
+ panel .style .top = "0" ;
2621
+ panel .style .width = width + "px" ;
2622
+ panel .style .height = (height - 80 ) + "px" ;
2623
+ if (needScrolling ) {
2624
+ panel .scrollTop = panel .scrollHeight ;
2625
+ }
2626
+ }
2627
+
2501
2628
taskBar = new TaskBar (this );
2502
2629
topBar = new MaximizedTitle (this );
2503
2630
if (QuickLaunch .defaultQuickLaunch != null ) {
@@ -2531,51 +2658,16 @@ void initializeDekstop() {
2531
2658
* this.taskBar.toggleAutoHide(); // by default, it is being hide automatically.
2532
2659
* }
2533
2660
*/ {}
2534
-
2535
- Element panel = document .getElementById ("swt-desktop-panel" );
2536
- if (panel != null ) {
2537
- int height = OS .getFixedBodyClientHeight ();
2538
- int width = OS .getFixedBodyClientWidth ();
2539
- panel .style .position = "absolute" ;
2540
- panel .style .backgroundColor = "white" ;
2541
- /**
2542
- * @j2sNative
2543
- * var vsb = window["swt.desktop.vscrollbar"];
2544
- * if (vsb != null && (vsb == true || vsb == "true" || vsb == "enable")) {
2545
- * panel.style.overflowY = "auto";
2546
- * }
2547
- * var hsb = window["swt.desktop.hscrollbar"];
2548
- * if (hsb != null && (hsb == true || hsb == "true" || hsb == "enable")) {
2549
- * panel.style.overflowX = "auto";
2550
- * }
2551
- */ {}
2552
- panel .style .paddingBottom = "80px" ;
2553
- if (!OS .isIE ) {
2554
- Element div = document .createElement ("DIV" );
2555
- /**
2556
- * @j2sNative
2557
- * div.style.cssFloat = "left";
2558
- */ {}
2559
- div .style .height = "80px" ;
2560
- div .style .width = "1px" ;
2561
- div .style .marginLeft = "-1px" ;
2562
- panel .appendChild (div );
2563
- }
2564
- panel .style .left = "0" ;
2565
- panel .style .top = "0" ;
2566
- panel .style .width = width + "px" ;
2567
- panel .style .height = (height - 80 ) + "px" ;
2568
- }
2569
2661
2570
2662
mouseMoveListener = new RunnableCompatibility (){
2571
2663
2572
2664
public void run () {
2573
2665
HTMLEvent e = (HTMLEvent ) getEvent ();
2574
- int height = OS . getFixedBodyClientHeight () ;
2666
+ int bottom = getPrimaryMonitor (). clientHeight - 128 ;
2575
2667
// Hacks: Return as quickly as possible to avoid CPU 100%
2576
2668
int x = e .clientX ;
2577
2669
int y = e .clientY ;
2578
- if (x > 264 && y >= 100 && y <= height - 128 ) {
2670
+ if (x > 264 && y >= 100 && y <= bottom ) {
2579
2671
return ;
2580
2672
}
2581
2673
@@ -2595,7 +2687,7 @@ public void run() {
2595
2687
}
2596
2688
}
2597
2689
2598
- if (y > height - 128 ) {
2690
+ if (y > bottom ) {
2599
2691
if (shortcutBar .isApproaching (now , x , y , ctrlKey )) {
2600
2692
shortcutBar .handleApproaching ();
2601
2693
} else if (!inDelay && shortcutBar .isLeaving (now , x , y , ctrlKey )) {
@@ -2665,7 +2757,12 @@ public void run() {
2665
2757
}
2666
2758
2667
2759
static void insertOpenConsoleLink () {
2668
- TrayItem item = new TrayItem (getTray (), SWT .NONE );
2760
+ Tray t = getTray ();
2761
+ if (t == null || t .isDisposed ()) {
2762
+ t = Default .getSystemTray ();
2763
+ }
2764
+
2765
+ TrayItem item = new TrayItem (t , SWT .NONE );
2669
2766
item .setText ("Console" );
2670
2767
item .handle .className = "tray-item tray-item-console" ;
2671
2768
item .setToolTipText ("Console" );
0 commit comments