diff options
author | Matthias Villiger | 2021-05-18 10:00:17 +0000 |
---|---|---|
committer | Matthias Villiger | 2021-05-18 10:00:17 +0000 |
commit | 6b9ca12a048ad2caae674cad266b1c89406a3600 (patch) | |
tree | fa732a14a6d01bfe297a4d834415881a378a46d0 | |
parent | 04017072c144b09d90f2240acf04d59faa5ced85 (diff) | |
download | org.eclipse.scout.rt-6b9ca12a048ad2caae674cad266b1c89406a3600.tar.gz org.eclipse.scout.rt-6b9ca12a048ad2caae674cad266b1c89406a3600.tar.xz org.eclipse.scout.rt-6b9ca12a048ad2caae674cad266b1c89406a3600.zip |
Improve widget return type definition
-rw-r--r-- | eclipse-scout-core/src/index.js | 10 | ||||
-rw-r--r-- | eclipse-scout-core/src/scout.js | 5 | ||||
-rw-r--r-- | eclipse-scout-core/src/widget/Widget.js | 12 | ||||
-rw-r--r-- | eclipse-scout-core/src/widget/widgets.js | 4 |
4 files changed, 20 insertions, 11 deletions
diff --git a/eclipse-scout-core/src/index.js b/eclipse-scout-core/src/index.js index 8b5d716755..697ce7c968 100644 --- a/eclipse-scout-core/src/index.js +++ b/eclipse-scout-core/src/index.js @@ -702,6 +702,16 @@ import * as self from './index.js'; export default self; +/** + * @typedef {Form|TileOverviewForm|UnsavedFormChangesForm|FieldStatus|StatusMenuMapping|FormField|CompositeField|ValueField|WidgetField|Button|WizardProgressField|CarouselField|TileField|TreeField|ImageField|TableField + * |PlaceholderField|WrappedFormField|PlannerField|CalendarField|AccordionField|BreadcrumbBarField|OutlineTileField|TabArea|TabBoxHeader|Tab|ProposalChooser|TableProposalChooser|TreeProposalChooser|MenubarBox|MenuBar|MenuBox + * |DesktopToolBox|Tile|BeanTile|CompositeTile|WidgetTile|PlaceholderTile|HtmlTile|TileGrid|PageTileGrid|Tree|CompactTree|Outline|Group|Image|Icon|Label|Popup|TagChooserPopup|SmartFieldPopup|ContextMenuPopup|TouchPopup|PopupWithHead + * |WidgetPopup|TableHeaderMenu|CellEditorPopup|DatePickerPopup|TimePickerPopup|PopupManager|TableFooter|TableHeader|TableRowTileMapping|TableRowDetail|Table|TableTileGridMediator|TableHeaderMenuGroup|Action|Menu|TableHeaderMenuButton + * |TableControl|ViewButton|Mode|BreadcrumbItem|IFrame|Slider|Switch|SimpleTab|DesktopTab|SimpleTabArea|DesktopTabArea|SimpleTabBox|TagBar|Composite|NullWidget|Desktop|DesktopLogo|BenchColumn|DesktopBench|DesktopHeader|OutlineOverview + * |TileOutlineOverview|DesktopNavigation|ViewButtonBox|ViewMenuTab|Planner|PlannerHeader|BusyIndicator|Tooltip|TableInfoSelectionTooltip|TableTooltip|TableInfoLoadTooltip|TableInfoFilterTooltip|WidgetTooltip|CalendarComponent|Calendar + * |YearPanel|Carousel|Splitter|Accordion|TileAccordion|GlassPane|Scrollbar|DatePicker|MessageBox|TimePicker|FileInput|FileChooser|ModeSelector|Notification|BreadcrumbBar|CollapseHandle|DesktopNavigationHandle|any} AnyWidget + */ + // Add all functions from the scout object to the scout object on the window // Note: the scout object on the window still needs its own scout object (window.scout.scout). // It is required when the eclipse-core/scout is mapped as external webpack library to window.scout diff --git a/eclipse-scout-core/src/scout.js b/eclipse-scout-core/src/scout.js index f0419442bc..d44559cb0a 100644 --- a/eclipse-scout-core/src/scout.js +++ b/eclipse-scout-core/src/scout.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2019 BSI Business Systems Integration AG. + * Copyright (c) 2010-2021 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -173,8 +173,7 @@ export function installSyntheticActiveStateHandler(myDocument) { * @param [partId] * partId of the session the widget belongs to (optional, only relevant if the * argument is a widget ID). If omitted, the first session is used. - * @returns - * the widget for the given element or id + * @returns {AnyWidget} the widget for the given element or id */ export function widget(widgetIdOrElement, partId) { if (objects.isNullOrUndefined(widgetIdOrElement)) { diff --git a/eclipse-scout-core/src/widget/Widget.js b/eclipse-scout-core/src/widget/Widget.js index 2222c64fb7..bf012174c7 100644 --- a/eclipse-scout-core/src/widget/Widget.js +++ b/eclipse-scout-core/src/widget/Widget.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 BSI Business Systems Integration AG. + * Copyright (c) 2010-2021 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -242,7 +242,7 @@ export default class Widget { * Calls {@link scout.create} for the given model, or if model is already a Widget simply returns the widget. * * @param model {Object|Widget} - * @returns {Widget} + * @returns {AnyWidget} */ _createChild(model) { if (model instanceof Widget) { @@ -1733,7 +1733,7 @@ export default class Widget { } /** - * @returns {Widget} the original widget from which this one was cloned. If it is not a clone, itself is returned. + * @returns {AnyWidget} the original widget from which this one was cloned. If it is not a clone, itself is returned. */ original() { let original = this; @@ -1900,7 +1900,7 @@ export default class Widget { * Returns the widget with the requested ID or null if no widget has been found. * * @param widgetId - * @returns {Widget} the found widget for the given id + * @returns {AnyWidget} the found widget for the given id */ widget(widgetId) { if (predicate(this)) { @@ -1977,7 +1977,7 @@ export default class Widget { } /** - * @returns {Widget} the first parent for which the given function returns true. + * @returns {AnyWidget} the first parent for which the given function returns true. */ findParent(predicate) { let parent = this.parent; @@ -1991,7 +1991,7 @@ export default class Widget { } /** - * @returns {Widget} the first child for which the given function returns true. + * @returns {AnyWidget} the first child for which the given function returns true. */ findChild(predicate) { let foundChild = null; diff --git a/eclipse-scout-core/src/widget/widgets.js b/eclipse-scout-core/src/widget/widgets.js index 36f0732ed7..bb4846ca4f 100644 --- a/eclipse-scout-core/src/widget/widgets.js +++ b/eclipse-scout-core/src/widget/widgets.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 BSI Business Systems Integration AG. + * Copyright (c) 2010-2021 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,7 +15,7 @@ let uniqueIdSeqNo = 0; /** * @param {(HTMLElement|$)} a HTML or jQuery element to find the corresponding widget for - * @returns {Widget} the widget for the given element. If the element is not linked with a widget directly, it searches its ancestors for the widget. + * @returns {AnyWidget} the widget for the given element. If the element is not linked with a widget directly, it searches its ancestors for the widget. */ export function get($elem) { $elem = $.ensure($elem); |