Project

General

Profile

3075_8.txt

Sergey Ivanovskiy, 06/15/2016 03:07 AM

Download (6.19 KB)

 
1
=== modified file 'src/com/goldencode/p2j/ui/client/UiUtils.java'
2
--- src/com/goldencode/p2j/ui/client/UiUtils.java	2016-06-14 16:44:41 +0000
3
+++ src/com/goldencode/p2j/ui/client/UiUtils.java	2016-06-15 06:49:50 +0000
4
@@ -62,7 +62,6 @@
5
 ** 036 HC  20160406 Fixed lookupWidgetId() implementation to conform with the method's contract.
6
 ** 037 HC  20160421 Added locateRootFrame() method.
7
 ** 038 HC  20160607 GUI menus reworked to be displayed in dedicated top-level windows.
8
-** 039 SBI 20160614 Added EMPTY_STRING.
9
 */
10
 
11
 package com.goldencode.p2j.ui.client;
12
@@ -81,9 +80,6 @@
13
  */
14
 public class UiUtils
15
 {
16
-   /** Empty string */
17
-   public static final String EMPTY_STRING = "";
18
-   
19
    /** Logger. */
20
    protected static final Logger LOG = LogHelper.getLogger(UiUtils.class.getName());
21
 
22

    
23
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/WebClientMessageTypes.java'
24
--- src/com/goldencode/p2j/ui/client/driver/web/WebClientMessageTypes.java	2016-04-21 17:01:43 +0000
25
+++ src/com/goldencode/p2j/ui/client/driver/web/WebClientMessageTypes.java	2016-06-15 06:54:20 +0000
26
@@ -28,6 +28,7 @@
27
 **                  into the converted code (i.e. invoke external programs, procedures or 
28
 **                  functions).  Can be used only when the P2J client runs embedded in a 
29
 **                  customer-specific application.
30
+** 009 SBI 20160615 Added MSG_INVALIDATE_SELECTION.
31
 */
32
 
33
 package com.goldencode.p2j.ui.client.driver.web;
34
@@ -238,6 +239,9 @@
35
    /** Open the new page or resource in the browser. */
36
    public static final byte MSG_OPEN_URL = (byte) 0xF3;
37
 
38
+   /** Notify that the current selection is invalidated. */
39
+   public static final byte MSG_INVALIDATE_SELECTION = (byte) 0xF4;
40
+
41
    /** Wraps the large message from the client to the sequence of this partial type messages. */
42
    public static final byte MSG_PARTIAL = (byte) 0xFE;
43
    
44

    
45
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/res/p2j.clipboard.js'
46
--- src/com/goldencode/p2j/ui/client/driver/web/res/p2j.clipboard.js	2016-06-14 16:44:41 +0000
47
+++ src/com/goldencode/p2j/ui/client/driver/web/res/p2j.clipboard.js	2016-06-15 06:58:52 +0000
48
@@ -127,7 +127,7 @@
49
       if (p2j.isGui)
50
       {
51
          // consume copy/cut events if the current selection is invalid
52
-         if (getSelection() === "")
53
+         if (getSelection() === null)
54
          {
55
             p2j.consumeEvent(e);
56
             return;
57
@@ -218,8 +218,8 @@
58
          console.debug("getSelectedText() " + text);
59
 
60
          // copy the current selection to the input hidden field to save this value
61
-         // to the system clipboard if the current selection is not empty
62
-         if (text !== "")
63
+         // to the system clipboard if the current selection is valid
64
+         if (text !== null)
65
          {
66
             setClipboardValue(text);
67
          }
68

    
69
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/res/p2j.socket.js'
70
--- src/com/goldencode/p2j/ui/client/driver/web/res/p2j.socket.js	2016-05-19 13:48:01 +0000
71
+++ src/com/goldencode/p2j/ui/client/driver/web/res/p2j.socket.js	2016-06-15 06:57:29 +0000
72
@@ -58,6 +58,7 @@
73
 **                  functions).  Can be used only when the P2J client runs embedded in a 
74
 **                  customer-specific application.
75
 ** 019 SBI 20160519 Safari doesn't support "const" constants declarations in JS.
76
+**     SBI 20160615 Added MSG_INVALIDATE_SELECTION.
77
 */
78
 
79
 "use strict";
80
@@ -273,6 +274,9 @@
81
                   /** Open the new page or resource in the browser. */
82
                   MSG_OPEN_URL : 0xF3,
83
                   
84
+                  /** Notify that the current selection is invalidated. */
85
+                  MSG_INVALIDATE_SELECTION : 0xF4,
86
+                  
87
                   /** Wraps the large message from the client to the sequence of this partial type messages. */
88
                   MSG_PARTIAL : 0xFE,
89
                   
90
@@ -1863,6 +1867,10 @@
91
             var text = me.readStringBinaryMessage(message, 1);
92
             p2j.clipboard.setSelection(text);
93
             break;
94
+         case types.MSG_INVALIDATE_SELECTION:
95
+            // invalidate the current selection
96
+            p2j.clipboard.setSelection(null);
97
+            break;
98
          case types.MSG_MOVE_TO_TOP:
99
             var id = me.readInt32BinaryMessage(message, 1);
100
             p2j.screen.moveToTop(id);
101

    
102
=== modified file 'src/com/goldencode/p2j/ui/client/gui/EditorGuiImpl.java'
103
--- src/com/goldencode/p2j/ui/client/gui/EditorGuiImpl.java	2016-06-14 16:44:41 +0000
104
+++ src/com/goldencode/p2j/ui/client/gui/EditorGuiImpl.java	2016-06-15 06:49:06 +0000
105
@@ -2800,7 +2800,7 @@
106
       config.selectionEnd = -1;
107
       config.selectionText = null;
108
       // notify the client the selection is invalid
109
-      gd.setCurrentSelection(UiUtils.EMPTY_STRING);
110
+      gd.setCurrentSelection(null);
111
    }
112
    
113
    /**
114

    
115
=== modified file 'src/com/goldencode/p2j/ui/client/gui/FillInGuiImpl.java'
116
--- src/com/goldencode/p2j/ui/client/gui/FillInGuiImpl.java	2016-06-14 16:44:41 +0000
117
+++ src/com/goldencode/p2j/ui/client/gui/FillInGuiImpl.java	2016-06-15 06:50:01 +0000
118
@@ -1008,7 +1008,7 @@
119
    protected void invalidateSelection()
120
    {
121
       super.invalidateSelection();
122
-      gd.setCurrentSelection(UiUtils.EMPTY_STRING);
123
+      gd.setCurrentSelection(null);
124
    }
125
    
126
    /**
127

    
128
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java'
129
--- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java	2016-06-02 18:08:34 +0000
130
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java	2016-06-15 06:53:10 +0000
131
@@ -54,6 +54,7 @@
132
 **                  business logic might rely on them, if explicitly raised.
133
 ** 016 SBI 20160427 Added graphicsCached parameter to turn off the graphics cache for testing.
134
 **     SBI 20160523 Fixed to handle clipboard messages without contents.
135
+**     SBI 20160615 Added MSG_INVALIDATE_SELECTION.
136
 */
137
 
138
 package com.goldencode.p2j.ui.client.gui.driver.web;
139
@@ -2919,7 +2920,14 @@
140
     */
141
    public void setSelection(String text)
142
    {
143
-      sendBinaryMessage(MSG_CURRENT_SELECTION, (text == null) ? "" : text);
144
+      if (text != null)
145
+      {
146
+         sendBinaryMessage(MSG_CURRENT_SELECTION, text);
147
+      }
148
+      else
149
+      {
150
+         sendBinaryMessage(MSG_INVALIDATE_SELECTION);
151
+      }
152
    }
153
 
154
    /**
155