Feature #1806
implement UNLESS-HIDDEN
100%
History
#1 Updated by Greg Shah over 11 years ago
- Target version set to Milestone 12
#2 Updated by Greg Shah almost 10 years ago
- Assignee set to Eugenie Lyzenko
The UNLESS-HIDDEN option should be fully implemented for the following language statements:
DISABLE
DISPLAY
ENABLE
PROMPT-FOR
SET
UPDATE
I believe that in all of these cases, when UNLESS-HIDDEN is specified, any widget that has its HIDDEN attribute set to TRUE is removed from the widget list being processed. I believe that this can probably be implemented completely on the server (assuming that the HIDDEN attribute state is correctly kept on the server). The idea is that any hidden widgets can be removed from the widget list before the client-side worker is called.
Please write some testcases to prove how this works (for each of the statements above). Then make sure we convert this properly. Finally, fix the runtime widget list preparation to support this option when specified.
#3 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_testcases_20140522a.zip added
The testcases executed in 4GL under Linux and screenshots uploaded. Yes, you are right, the HIDDEN
flag as TRUE
excludes widgets from processing list. The exceptions/notes is the DISPLAY
statement case. As you can see the widget itself is not displaying but the location reserved for hidden widget is anyway visible.
Also the statement ENABLE ALL WITH FRAME...
sets the HIDDEN
flag to FALSE
for widget. So further processing will consider the widget as not hidden(the testcase uh_display_test2.p
and uh_disable_not_enabled.jpg
screen).
Continue testing with correct conversion.
#4 Updated by Eugenie Lyzenko almost 10 years ago
Currently only DISPLAY
and ENABLE
are supported with UNLESS-HIDDEN
option on the conversion level. For other statements the usual disable(elementList)
, promptFor(elementList)
, set(elementList)
and update(elementList)
are generated while conversion.
#5 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140522a.zip added
This fix for your review is conversion rule change that allow the UNLESS-HIDDEN
option to be properly converted for:
DISABLE PROMPT-FOR SET UPDATE
The runtime implementation is planned to be done in GenericFrame
server side class by checking the HIDDEN
flag of the widget, excluding the hidden widget from the list and calling respective display()
, disable()
, enable()
, promptFor()
, set()
or update()
method for modified widget list.
#6 Updated by Greg Shah almost 10 years ago
Code Review 0522a
The changes look good.
Also the statement ENABLE ALL WITH FRAME... sets the HIDDEN flag to FALSE for widget. So further processing will consider the widget as not hidden(the testcase uh_display_test2.p and uh_disable_not_enabled.jpg screen).
Make sure to implement this too if we don't already support it.
#7 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140522b.zip added
- File uh_display_p2j.jpg added
Make sure to implement this too if we don't already support it.
OK. The second drop for today contains runtime modification to support UNLESS-HIDDEN
for you to review. The idea is to have two helper methods to process the widget lists:
... private GenericWidget[] removeHiddenWidgets(GenericWidget[] inputList) private FrameElement[] removeHiddenWidgets(FrameElement[] inputList) ...
Different input and output types is from fact we have two possible input types:
GenericWidget[]
or FrameElement[]
in *UnlessHidden()
converted methods. Then call to displayUnlessHidden()
for example will be implemented as just display(removeHiddenWidgets())
.
Testing to compare with original 4GL. For now I can tell the DISPLAY UNLESS-HIDDEN
has difference. The P2J shows the label for hidden widget(not widget value itself) while 4GL does not (ui_display_p2j.jpg).
#8 Updated by Eugenie Lyzenko almost 10 years ago
- File deleted (
uh_display_p2j.jpg)
#9 Updated by Eugenie Lyzenko almost 10 years ago
- File uh_display_p2j.jpg added
Reattached the srceen shot for issue.
#10 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_testcases_20140523a.zip added
- File evl_upd20140523a.zip added
Update for review with adding minimum level of safety checking. The modified widget list will be passed to the usual method if the list is not null and size > 0.
The handling of the ENABLE ALL WITH FRAME...
works as expected for UNLESS-HIDDEN
option. So this is not an issue.
The issue we have is the first time DISPLAY UNLESS-HIDDEN
. You can see it in uh_display_test4.p
and uh_display4_(4gl|p2j)_0.jpg
to see the difference. The problematic area is in red. The 4GL engine does not display even label for hidden widget, while P2J still displays the label. So I'm going to debug and fix this mismatch.
#11 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_testcases_20140523b.zip added
Updated testcases for DISPLAY
statement. Looks like the problem with DISPLAY UNLESS-HIDDEN
is not related to UNLESS-HIDDEN
option. The same deviation can be seen with DISPLAY
statement (without UNLESS-HIDDEN
option) when hidden widget is not inside the list. The testcase is uh_display_test5.p
.
So this is the general bug in DISPLAY
statement handling and if there are no objections I'll debug it.
#12 Updated by Greg Shah almost 10 years ago
Code Review 0523a
The changes look good.
So this is the general bug in DISPLAY statement handling and if there are no objections I'll debug it.
Yes, please fix this.
#13 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140528a.zip added
The fix for hidden widgets has been added to the update.
The goal is to suppress label text drawing for hidden widgets that was never visible. And to draw the label for hidden widgets that was made visible at least once. The idea is to use the existing emptyMode
flag in LabelImpl
class to disable label text draw. To know when this mode should be turned on the another flag(storing in widget itself is used) - wasVisible
. Initially this flag is false. When the layout is performing the ZeroColumnLayout
checks if this flag is false and turn the emptyMode
on. Respectively the AbstractContainer
drawing code enumerates all widgets to draw in a frame and if the widget become visible the wasVisible
become true and the emptyMode
is turning off, so the label text become visible even for hidden widgets.
#14 Updated by Greg Shah almost 10 years ago
Code Review 0528a
I like the approach. My only questions:
1. The hidden()
method of LabeledWidget
is already present in the Widget
interface. LabeledDataContainer
extends FixedSizeContainer
which is already a Widget
, so hidden()
should already be there. Unless there is some other reason, I'd like to remove hidden()
from LabeledWidget
.
2. Please change LabeledWidget.wasVisibleOn()
to LabeledWidget.setWasVisible()
to be clearer (and more consistent with our standards).
#15 Updated by Eugenie Lyzenko almost 10 years ago
1. The hidden() method of LabeledWidget is already present in the Widget interface. LabeledDataContainer extends FixedSizeContainer which is already a Widget, so hidden() should already be there. Unless there is some other reason, I'd like to remove hidden() from LabeledWidget.
I thought about this. This addition was made for following ZeroColumnLayout
code:
void handleLabeledWidget(int i, Container container) { ... LabeledWidget fin = null; if (c[i] instanceof LabeledWidget) fin = (LabeledWidget) c[i]; ... // fix for UNLESS-HIDDEN option if (fin.hidden() && !fin.wasVisible()) { label.setEmptyModeOn(); } ...
If not add
hidden()
to LabeledWidget - we will need explicit casting fin
to some class that have hidden()
inside the if
clause. That's why I added the method to interface. But we can change it. What do you think?#16 Updated by Greg Shah almost 10 years ago
If not add hidden() to LabeledWidget - we will need explicit casting fin to some class that have hidden() inside the if clause. That's why I added the method to interface. But we can change it. What do you think?
Yes, please do explicitly cast it. Otherwise it is confusing to future readers/maintainers of the code.
#17 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140528b.zip added
Yes, please do explicitly cast it. Otherwise it is confusing to future readers/maintainers of the code.
OK. The next update changing the LabelWidget
removing hidden()
method and renamed setter to setWasVisible()
. Also minor Javadoc fixes for GenericFrame
. Also I had to add new method implementation stubs in the following classes:
Button, ComboBox, LabeledBorderedPanel
These classes implement LabeledWidget
and has different inheritance path comparing to FillIn <- LabeledDataContainer
so need at least placeholders for wasVisible()/setWasVisible()
to successfully build with ant all
command.
#18 Updated by Greg Shah almost 10 years ago
Code Review 0528b
The changes are good, except that the hidden()
method should be removed from LabeledWidget
instead of being commented out. Please remove that, upload the result as ...0528c.zip.
If everything is working in your local tests, then you can go into regression testing (both conversion and runtime).
#19 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140528c.zip added
The changes are good, except that the
hidden()
method should be removed fromLabeledWidget
instead of being commented out. Please remove that, upload the result as ...0528c.zip.
Sorry, just not cleaned it up.
If everything is working in your local tests, then you can go into regression testing (both conversion and runtime).
OK.
#20 Updated by Eugenie Lyzenko almost 10 years ago
If everything is working in your local tests, then you can go into regression testing (both conversion and runtime).
Found the new issue with recent fix. Because we previously draw label unconditionally the sequence ENABLE ALL ... DISPLAY/SET/PROMPT-FOR/UPDATE/DISABLE UNLESS-HIDDEN ...
worked as expected, simulating the label showing. Now in this case the widget become enabled but label is not drawing in the first display. So looking for bug/solution.
#21 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140529a.zip added
Finally I have got all local tests passed. The new changes in update for review includes:
1. Removing LabelImpl
class from update because in emptyMode
the label text already generated as spaces/(empty string). This is the same as if we just does not display label text at all. So I think we can leave this file as is, let me know if you have objections.
2. In ZeroColumnLayout
the label.setEmptyModeOff()
is required after label.setEmptyModeOn()
to ensure the empty mode will works only once. This fixes the regressions I struggled with previous update.
3. The GenericFrame
needs special version of makeFrameVisible()
method while handling ENABLE ALL
statement because it should reset HIDDEN
widget attribute. So the new method makeFrameEnable()
is now used in this case.
Also some minor syntax errors in comment I made.
So if you do not have any objections after review I'll start the regression testing.
#22 Updated by Greg Shah almost 10 years ago
Code Review 0529a
The changes look good. Please get them regression tested.
#23 Updated by Eugenie Lyzenko almost 10 years ago
The conversion testing has been completed without any differences in converted Java code. Started the regression testing.
#24 Updated by Eugenie Lyzenko almost 10 years ago
The main part has been completed without regressions in two rounds. Continue with the CTRL-C part.
#25 Updated by Eugenie Lyzenko almost 10 years ago
- File evl_upd20140530a.zip added
This update merges UNLESS-HIDDEN
changed with the recent code base. I think the tasks are pretty independent and merge is safe so it is not required to re-run the regression testing(which is still in progress). Let me know if any objections.
#26 Updated by Greg Shah almost 10 years ago
Code Review 0530a
I agree, the changes are safe. No additional testing is needed.
#27 Updated by Eugenie Lyzenko almost 10 years ago
The CTRL-C testing has been completed. There are no regressions found. Had to run 3-way tests in a separate session to pass. The results are in GCD share drive. So the update will be committed and distributed shortly.
#28 Updated by Eugenie Lyzenko almost 10 years ago
The regression tasting has been passed. The update ...0530a
has been committed in bzr as 10540.
#29 Updated by Greg Shah almost 10 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
#30 Updated by Greg Shah over 7 years ago
- Target version changed from Milestone 12 to GUI Support for a Complex ADM2 App