Skip to main content
aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-09-12WIP: Fix recomputeEnabled() for EllipsisMenufeatures/bschwarzent/recomputeEnabledBeat Schwarzentrub4-5/+90
Change-Id: I5ea6b49e8e98e93b1eff5e4921db1153681c1537
2018-09-12CancelMenu, CloseMenu: disable inheritAccessibilityBeat Schwarzentrub2-0/+2
CancelMenu and CloseMenu should always be enabled, even when the entire form is disabled. (Otherwise, the form could not be closed again.) Therefore, we set inheritAccessibility to false by default. Change-Id: I3f700c383d0b08abd3f3ff06f4ea07e3784beb98
2018-09-12Adapt to Scout change: New DoList.updateAll() methodPaolo Bazzi13-76/+63
Change-Id: I27e5ea93d2430d3b308497e3897eb1e4827b56ef
2018-09-12DoList: Added updateAll(array) / updateAll(collection) methodPaolo Bazzi2-9/+112
- Changed removeAll() / addAll() to accept and ignore null value Change-Id: I017647b7200993842a2351eac1920e3f68df7d91 Reviewed-on: https://git.eclipse.org/r/129218 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-09-12Change copyright headers where neededArthur van Dorp196-331/+1809
Change-Id: I4267f88279f8abbdc9d7e186532d1f3701bfdd57 Signed-off-by: Arthur van Dorp <Arthur.vanDorp@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/129193
2018-09-12TileGrid Virtual Scrolling: improve tile accordionClaudio Guglielmo7-16/+70
One of the big challenges of the virtual scrolling for tiles is the fact, that the tile grid is often used in combination with useUiHeight. This is the case if it is used in a tile accordion. This means, the tile grid itself is not scrollable but the accordion is. So not the tile grid needs to attach a scroll listener, but the tile accordion resp. the first scrollable parent. But not only scrolling is relevant, also collapsing of a group. This will move the groups below up meaning tiles might need to be rendered. But: the tile grid itself does not know that it was moved. Unfortunately this cannot be handled in a generic way because JavaScript does not provide such a listener. So, the tile accordion needs to take care of that.
2018-09-12TileGrid Virtual Scrolling: support placeholders and Scout ClassicClaudio Guglielmo9-76/+121
Placeholders are added by the tile grid itself when needed. Currently they are added as soon as the logical grid is validated. Unfortunately this is done very ofthe during the layout which would call _renderTileDelta many times. This makes it very hard to deal with because the control is lost. So in order to make it easier (and faster) the preferred size calculation is now completely based on math instead of looping. This is possible because of the virtual scrolling restrictions (same sized tiles). Another solution could be to update the placeholders at the end of the layouting process rather at the grid validation. If various row heights need to be supported sometime this could be an option.
2018-09-12TileGrid Virtual Scrolling: improve performance of non virtual modeClaudio Guglielmo2-8/+69
If non virtual mode would be the same as virtual but always using the max view range, it would be easier to maintain, but the performance would suffer, especially when working with filtered tiles. Reason: In virtual mode filtering renders and removes the tiles, this is expensive if there are a lot of tiles. To make it faster, non virtual mode just makes them invisible. But of course, this just works to a certain number of tiles, the virtual mode should be used whenever possible.
2018-09-12TileGrid: implement virtual scrollingClaudio Guglielmo16-138/+1656
Virtual Scrolling of the tile grid is implemented similarly to the one of Table and Tree. But there are some important differences and challenges worth pointing out: Layouting: The tile grid is based on the logical grid layout, every tile is positioned absolutely. The table uses a CSS based table layout so adding a row will increase the scroll height automatically because it has the correct height and width as soon it is added to the DOM. A tile needs to be layouted first. This means scrolling cannot just render the viewport but also has to layout the newly rendered tiles. Animations: The tile grid uses a lot of different animations: insert, delete, filter, sort, move etc. Since most of the tiles are not rendered, the tiles cannot just be moved from their old position, because there is no old position. Filtering: Previously, not accepted tiles were made invisible. Now, the tiles need to be removed because the idea is to only render the visible tiles in the viewport. Since the animation for filtering and removing is not the same but both need to work with the animateRemoval concept of the widget, some extensions to the widget had to be made. Grid Config: Because it is based on the logical grid, the tiles could have total different grid configurations, meaning they could have a different size. Although it could be possible to handle various row heights (as done for the table) but it would be a lot more complicated because of the layouting and more expensive too because of the wrapping feature. Also, since the grid is often used with useUiHeight = true (accordion) the pref size needs to be correct, which is impossible if the height of the tiles is not known (e.g. if useUiHeight is true for tiles as well). Therefore the decision was to only support real grids with tiles of equal size, which is the main use case. Virtual vs. non virtual Because the virtual mode does not support all cases due to the limitations mentioned above, the non virtual mode needs to still work well. Multiple tiles in a row Compared to the table, a tile grid does not only work with rows, the individual tiles can be added or removed from a single row. This means just using _renderViewPort won't work because the tiles could change inside the view port too. That is why _renderTileDelta was introduced. A class VirtualScrolling.js was added with the main Virtual Scrolling feature which are used by Tree and Table, too, with the intention that maybe it could be shared among these three one time. But at the moment it is only used by the tile grid.
2018-09-11BrowserField: IE does not show scrollbars sometimesClaudio Guglielmo1-0/+7
Use case: 1. BrowserField is rendered (with no location and scrollbarEnabled = false) 2. Location: 'xy' and scrollBarEnabled: true should be changed by the same response 3. Location is set first, scrollBarEnabled afterwards -> Scrollbar won't be visible It worked with 6.1 because the properties obviously came with a different order. Fixed by making sure setScrollBarEnabled is called before setLocation. A similar case has already been fixed with commit d67ca1ffd0b9a619961f22f1e61250c4636dbbf0. 229830
2018-09-11Added missing setFixturesAndré Wegmüller1-0/+4
Otherwise Spec fails when test runs in test-suite
2018-09-07Collapsible property on groups.Oli Schmid3-4/+19
Controls weather a group can be collapsed by UI or not. Collapsing the group programatically is still possible. Change-Id: Iddb5c873da946777825e4063e168f0819dc322ef
2018-09-07Fixed order of menus/buttons in group-box menubarAndré Wegmüller2-2/+55
Without the fix, right aligned (1) menu-items have been rendered on the right side of the right aligned buttons, which looks ugly. Now right-aligned menus are rendered on the left side of the buttons.
2018-09-07DoList: Use upper-bounded wildcard on collection-typed with methodAndi Bur14-22/+22
Change-Id: Idd7fc827821920180e1644b8612a675517b3585e Reviewed-on: https://git.eclipse.org/r/128908 Tested-by: CI Bot Reviewed-by: Andi Bur <andi.bur@gmail.com>
2018-09-07Resolve constants in Action.jsAndré Wegmüller1-0/+7
2018-09-06Add form event TYPE_RESET_COMPLETERalf Muri4-1/+24
Introduce new form event in AbstractForm.doReset(). The new default behavior for searchForms is to trigger a reload on reset if isSearchRequired == false. To avoid unnecessary calls of reloadPage a specific form reset event is needed. Change-Id: I13bb02a79e7cc53e7a40e58bdc9ef7d0321cd581 Signed-off-by: Ralf Muri <ralf.muri@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127346 Tested-by: CI Bot Reviewed-by: Andi Bur <andi.bur@gmail.com>
2018-09-06Resolve constants in JSON models.André Wegmüller4-0/+94
This allows developers to use a constant-tag in their JSON model, which is especially useful for enums/constants with numeric values. It's also easier to find all references for the same constant in .js and .json files. Usage: ${const:ON_FIELD} A widget (like FormField.js) must call the resolveConst function in its init function in order to resolve known instance variables.
2018-09-05TableField: rename validate to getValidationResultSamuel Keusch1-2/+2
In a change in scout.FormField, the method validate was renamed to getValidationResult (commit 26a0870, 2017-06-01). TableField was then not refactored. Change-Id: I1a8eb9291041a9d28b7547b0f6bd4542bd40f94a Signed-off-by: Samuel Keusch <samuel.keusch@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/128444 Reviewed-by: Andre Wegmueller <awe@bsiag.com> Tested-by: Andre Wegmueller <awe@bsiag.com>
2018-09-04Enable external link protectionMatthias Villiger9-68/+100
If a Scout application opens a popup browser window and loads an untrusted external site, this site gets a reference to the origin Scout application using the 'window.opener' reference set by the browser. The untrusted site is then able to load any other site or content in the original browser window holding the Scout application. This allows to load a phishing site to steal credentials or other sensitive information of the victim. The victim may not notice that the original browser has been modified. To prevent this attack the opener reference is cleared for popups opened using JavaScript. For links the additional attribute rel="norefferer noopener" is added. Please note that this feature is not yet supported by all browsers. This affects: - The URI open handler used by IDesktop#openUri - The BrowserField which may be configured to open in a popup window - Forms having the DISPLAY_HINT_POPUP_WINDOW - The builder to create HTML links like <a href="..."> See https://mathiasbynens.github.io/rel-noopener/ #231171 Change-Id: I11475aefbb68b9c5d216d7c9bc3b9debbb648a53 Reviewed-on: https://git.eclipse.org/r/128461 Tested-by: CI Bot Reviewed-by: Claudio Guglielmo <claudio.guglielmo@bsiag.com> Reviewed-by: Matthias Villiger <mvi@bsi-software.com>
2018-09-03Performance improvement for PROP_ENABLED_COMPUTED propagationMatthias Villiger1-1/+2
Only get the root field enabled status once. Change-Id: Icb30bf74a32e9671621e1f1b6bf27c1a013912d1 Reviewed-on: https://git.eclipse.org/r/128573 Tested-by: CI Bot Reviewed-by: Matthias Villiger <mvi@bsi-software.com>
2018-08-29TreeAdapter: copy htmlEnabled flag from cell to nodeBeat Schwarzentrub1-0/+1
On "nodeChanged" event, the htmlEnabled flag may have been changed on the server. Like the other properties (text, foregroundColor, cssClass etc.), htmlEnabled should be updated on the node according to the cell's value. See also: JsonTree.putCellProperties() Change-Id: I58d8d79ca760b661a5f1325b271fdfd6d884f8c2
2018-08-29Value Data Objects: Added byte[] and List<IDoEntity> value DOsPaolo Bazzi2-0/+93
Change-Id: I99cae2e79abbf083217357880ef75e7d6f025dc0
2018-08-29Add IDoEntity#removeIfRalph Steiner4-0/+42
Change-Id: I83ddaadf2997d7d5bb873d10796853a6ca3c7741 Reviewed-on: https://git.eclipse.org/r/128296 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-27FileChooser: fix widthBeat Schwarzentrub2-2/+6
If file chooser text is short (e.g. in English), use minimal width defined in CSS. Otherwise, the buttons would look bad if the chooser suddenly gets larger (e.g. when a file is selected). For mobile devices, the entire window size has to be checked as well. Change-Id: Ia2d0f985301ac92b6d3d979fbe3215f0ec7c49eb
2018-08-27HtmlDocumentParser: fix external path conversionBeat Schwarzentrub3-7/+4
Don't use java.io.File to extract the file name from a path. If the path contains path separators ("/"), they are returned differently on some operating systems (slash -> backslash). This might lead to broken results when building the external path. Instead, just split the string at the last occurrence of "/" and put everything before as it is into the resulting path. Change-Id: I9a2ab6b6c159c8eb4c31f3a56277c1139202bd80
2018-08-27Add imap helper and mail bounce detectorStephan Merkli12-16/+843
Improvements for SmtpServerConfig to provide session properties for connection directly. Add getter/setter for all properties in ImapAdapter and use them instead of direct property access. Mark IIMAPService/IImapAdapter as deprecated. Change-Id: Ie5e6c3119848a2b8da88f619bb2c60d34b02b73d Reviewed-on: https://git.eclipse.org/r/128119 Tested-by: CI Bot Reviewed-by: Andi Bur <andi.bur@gmail.com>
2018-08-27FormField: fix JS error in _linkWithLabel() when field has no $fieldBeat Schwarzentrub1-1/+1
Example: group box inside a radio button group (group boxes are form fields, but don't have $field and $fieldContainer). Change-Id: I4f1290677ad861360f5a1980115e054964a5c06d
2018-08-24REST exception mapper: validate attached entity "ErrorResponse"Paolo Bazzi4-11/+43
Ensure all Scout-implemented ExceptionMapper return a REST Response with entity ErrorResponse attached as payload Change-Id: Icc9c0a1654a22d46d69098ba2e1cc7d8e507bcce Reviewed-on: https://git.eclipse.org/r/128021 Tested-by: CI Bot Reviewed-by: Beat Schwarzentrub <bsh@bsiag.com>
2018-08-24EnumerationUtility: Add asEnumeration(Iterator<T>) methodJeremie Miserez2-0/+35
This covers the cases where Collections.enumeration(Collection<T>) is insufficient as only an iterator is available, e.g. when iterating over streams. Change-Id: I72ce2725d74d0fb8d0bde2bb34a01be7059381c8 Signed-off-by: Jeremie Miserez <jeremie.miserez@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/128025 Tested-by: CI Bot Reviewed-by: Beat Schwarzentrub <bsh@bsiag.com>
2018-08-24Add ValueDo to wrap objects along with their Java typeBeat Schwarzentrub13-0/+694
Sub types of IValueDo provide typed holders for Java objects. This allows the type to be included in the serialized representation of the DO and the correct restoration during deserialization. Without those holders, the target type could only be guessed. Because there is no 1:1 mapping between the serialized representation and the source type, this guessing cannot be 100% correct. Example (for JSON serialization): WITHOUT VALUE DO: Java BigDecimal: new BigDecimal("12345") Plain JSON serialization: 12345 Plain deserialization from JSON (best guess): new Integer(12345) WITH VALUE DO: Java BigDecimalValueDo: BigDecimalValueDo.of(new BigDecimal("12345")) Typed JSON serialization: { "_type": "BigDecimalValue", "value": 12345 } Typed deserialization from JSON (no guessing needed): BigDecimalValueDo.of(new BigDecimal("12345")) Change-Id: If0e4cec9f38bf477593bf9afd39169b5b3c139aa Reviewed-on: https://git.eclipse.org/r/127981 Tested-by: CI Bot Reviewed-by: Beat Schwarzentrub <bsh@bsiag.com>
2018-08-24MailHelper: add methods getHtmlBody, readContentAsString andStephan Merkli3-55/+301
getAttachmentFilename Improve code that extracts charset from part. Change-Id: I06f9309787f290ccb2dfb16f4557ad990524ed39 Reviewed-on: https://git.eclipse.org/r/127926 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-23SequenceBox with SmartField correct from/to validationAndreas Hoegger1-0/+5
BUG: A SequenceBox with SmartFields does only validate once the from to constraint. FIX: Send the error status in every accept input response to keep the model and UI in sync. 231548 Change-Id: I388de5401579603d4cf397adf35c6dc34a68ba18
2018-08-23remove dead desktop cleanup codeMichael Rudolf1-103/+0
this code has always been executed outside any RunContext or Session, hence the Desktop was always null so this check for open forms cannot work. Changing this requires a change in how the RunContext is established which will break current tests. Change-Id: I994926eadd78ab29992af56c8a84569fc8e617e4 Signed-off-by: Michael Rudolf <mru@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127914 Reviewed-by: Patrick B??nziger <patrick.baenziger@bsi-software.com> Tested-by: CI Bot
2018-08-23Table: do not uncheck row on right-click when it's already checkedSamuel Keusch1-3/+6
Applies only to table that have checkableStyle = scout.Table.CheckableStyle.TABLE_ROW In this checkable style mode, a row is checked when you click on it. But when you right-click on an already checked row, it is unchecked and then the context menu is shown. the desired behavior is, that the row stays checked and the context menu is shown. Change-Id: I789e5bd6938e26857c84b5fdb9aefe3ff23cc27b Signed-off-by: Samuel Keusch <samuel.keusch@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127791 Tested-by: CI Bot Reviewed-by: Andre Wegmueller <awe@bsiag.com>
2018-08-22SmartField: don't perform lookup when field is blurredAndré Wegmüller3-12/+64
Added 'sync' parameter to acceptInput. When aboutToBlurByMouseDown is called the parameter is set to true. In that case the SmartField does not perform a search by text lookup, because this would change the order of events sent to the UI server. Since the clicked field that gains the focus cannot wait until the lookup is done, the solution is not to perform a lookup in this case. In every other case the behavior of the SmartField is the same as before. 228888
2018-08-22StreamUtility: Add not(Predicate)Jeremie Miserez1-0/+10
This method is motivated by Java 11's Predicate#not(Predicate)} and can be removed when upgrading. Change-Id: I052645bbee1770a601cfc06a5c2e94b1c0fe44a1 Signed-off-by: Jeremie Miserez <jeremie.miserez@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127833 Tested-by: CI Bot Reviewed-by: Ralph Steiner <rst@bsiag.com>
2018-08-21RadioButtonGroup: radio buttons not displayed when loaded asyncSamuel Keusch3-33/+84
When using the lookupCall property on RadioButtonGroup, the lookupCall creates RadioButtons on completion and should insert them into the RadioButtonGroup. But if this lookupCall takes more time than form creation etc., the lookupCall returned too late and the RadioButtons were not rendered, because the RadioButtonGroup was already rendered. This commit fixes this issue by implementing a similiar functionality as in GroupBox. With setFields, fields can be dynamically inserted into the RadioButtonGroup. For better indication, while the lookupCallis executing, a loading icon is displayed instead. A new test was added that checks if this.radioButtons equals to this.fields after creation. Note: in _renderFields, the layout tree needs to be revalidated to prevent flickering in the ui (radiobuttons are visible before they are correctly positioned) Change-Id: Ic8a9702fc3bca6d50dd7697adfd55402023529c0 Signed-off-by: Samuel Keusch <samuel.keusch@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127710 Tested-by: CI Bot Reviewed-by: Andre Wegmueller <awe@bsiag.com>
2018-08-17Widget: cleanup remove handler properlyClaudio Guglielmo1-3/+8
A widget which will be removed by an animation attaches a listener to its parent. This listener needs to be removed when the widget is removed, otherwise the event listener list grows and grows if the widget is rendered and removed a lot.
2018-08-17Widget: preserving scroll positions decreases performanceClaudio Guglielmo2-10/+159
When _renderScrollTop or _renderScrollLeft is executed, the current scroll positions are read from the scrollable element. This forces the browser to do a reflow which is expensive. The check was there to detect non scrollable elements and to prevent updating the scroll position for such elements. The solution is to set the positions to null initially and don't do anything while rendering if they are null. Another approach would be to remember the scrollable on the widget when installing the scrollbars or to even have a preserveScrollPos property. But at the time installScrollbars is called, _renderScrollTop may already be executed, so it would not work that easy. Also, setScrollTop and setScrollLeft don't fire a property change anymore. Reason: scrolling did not use the setter so no property change was fired on scroll (mainly due to fear of poor performance). So it does not really help if some scrollTop changes trigger an event and some not. If someone is interested he can always add a scroll listener.
2018-08-17correct tooltip position of GroupBox statusAndreas Hoegger1-0/+5
The layout of the group box ensures the tooltip to be at the correct position. Change-Id: I1f23a04ff24b8507f4b301444ba0341e3b5fea0f
2018-08-17Data Object Serialization: Allow custom date pattern within DoList<>Paolo Bazzi7-30/+86
Change-Id: I9a17570581acee3bdcd54ce4b06ac551203de574 Reviewed-on: https://git.eclipse.org/r/127512 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-16Remove html-tags from column-title if html-formatting is enabledAdrian Egloff3-0/+13
232013 Change-Id: Ie0c9fda8e9a090dd0cb853a59af8ca03871d5155 Signed-off-by: Adrian Egloff <adrian.egloff@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127516 Tested-by: CI Bot Reviewed-by: Claudio Guglielmo <claudio.guglielmo@bsiag.com>
2018-08-16Add IPrettyPrintDataObjectMapper to pretty print JSONBeat Schwarzentrub2-0/+37
Change-Id: Icd6bbee41aac337301ed3ec933367f248906d4e5 Reviewed-on: https://git.eclipse.org/r/127479 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-15Enhance error logging for showing modal formsMichael Rudolf4-4/+39
Add class names and titles (where possible) of forms / message boxes / file choosers that prevent a modal form from being opened Change-Id: I6324e57023b25760aded1af7369e8f27a404c99e Signed-off-by: Michael Rudolf <mru@bsi-software.com> Reviewed-on: https://git.eclipse.org/r/127417 Tested-by: CI Bot Reviewed-by: Andreas Hoegger <Andreas.Hoegger@bsiag.com>
2018-08-15Data Objects: Extended DoValue/DoList.toString() with exists()Paolo Bazzi2-2/+2
Change-Id: I595faa4ea9f41db487ce947a64743bc36b4aa06a Reviewed-on: https://git.eclipse.org/r/127443 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-15Added IUuidProvider to make random UUIDs predictable in unit testsAndré Wegmüller3-0/+90
May be used in productive code in place of UUID.randomUUID().
2018-08-14Fix JavaDocBeat Schwarzentrub2-2/+2
Change-Id: I8ac0acf7ccb2190acc4ea780420c231c7545f06b
2018-08-13BeanTestingHelper: remove methods registerWithReplace andStephan Merkli4-38/+15
registerWithTestingOrder These methods are not/rarely used and the same behavior can be achieved easily without a helper method. Change-Id: I54ad0715f14dc700b8069fe2a579da1a124d1d43 Reviewed-on: https://git.eclipse.org/r/127338 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-13MailHelper: extract getMessageId to own methodStephan Merkli1-15/+26
Additionally remove calls with BEANS.get(MailHelper.class) inside MailHelper. Change-Id: Ic0c6d5eca6c9b9bf7b95919a310eea660b31b86c Reviewed-on: https://git.eclipse.org/r/127334 Tested-by: CI Bot Reviewed-by: Paolo Bazzi <paolo.bazzi@bsi-software.com>
2018-08-10ButtonAdapterMenu: ensure 'action' event fired on doAction()Beat Schwarzentrub1-2/+6
When doAction() is called on a ButtonAdapterMenu, it clicks the button. However, an 'action' event for the adapter menu should also be fired. Otherwise, external observers (e.g. ContextMenuPopup._onMenuItemAction) would not be informed that the menu was clicked. 229543 Change-Id: I78a531d5ecc7c3989222e4dc9968e4a65c9b2452 Reviewed-on: https://git.eclipse.org/r/127270 Tested-by: CI Bot Reviewed-by: Beat Schwarzentrub <bsh@bsiag.com>

Back to the top