Search in sources :

Example 11 with ConfigOperation

use of org.eclipse.scout.rt.platform.annotations.ConfigOperation in project scout.rt by eclipse.

the class AbstractPageWithTable method execPopulateTable.

/**
 * Populates this page's table.
 * <p>
 * It is good practice to populate table using {@code ITable.replaceRows} instead of {@code ITable.removeAllRows();
 * ITable.addRows} because in the former case the outline tree structure below the changing rows is not discarded but
 * only marked as dirty. The subtree is lazily reloaded when the user clicks next time on a child node.
 * <p>
 * Subclasses can override this method. In most cases it is sufficient to override
 * {@link #interceptLoadData(SearchFilter)} or {@link #interceptLoadTableData(SearchFilter)} instead.<br/>
 * This default implementation does the following: It queries methods {@link #isSearchActive()} and
 * {@link #isSearchRequired()} and then calls {@link #interceptLoadData(SearchFilter)} if appropriate.
 */
@ConfigOperation
@Order(100)
protected void execPopulateTable() {
    if (isSearchActive()) {
        SearchFilter filter = getSearchFilter();
        if (filter.isCompleted() || !isSearchRequired()) {
            // create a copy of the filter, just in case the subprocess is modifying
            // or extending the filter
            filter = filter.copy();
            interceptLoadData(filter);
        }
    } else {
        // searchFilter should never be null
        interceptLoadData(new SearchFilter());
    }
    // update table data status
    if (isSearchActive() && getSearchFilter() != null && (!getSearchFilter().isCompleted()) && isSearchRequired()) {
        setTableStatus(new Status(TEXTS.get("TooManyRows"), IStatus.WARNING));
    } else {
        setTableStatus(null);
    }
    T table = getTable();
    if (isLimitedResult() && table != null) {
        String maxOutlineWarningKey = "MaxOutlineRowWarning";
        if (UserAgentUtility.isTouchDevice()) {
            maxOutlineWarningKey = "MaxOutlineRowWarningMobile";
        }
        setTableStatus(new Status(TEXTS.get(maxOutlineWarningKey, "" + table.getRowCount()), IStatus.WARNING));
    }
}
Also used : IStatus(org.eclipse.scout.rt.platform.status.IStatus) Status(org.eclipse.scout.rt.platform.status.Status) SearchFilter(org.eclipse.scout.rt.shared.services.common.jdbc.SearchFilter) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 12 with ConfigOperation

use of org.eclipse.scout.rt.platform.annotations.ConfigOperation in project scout.rt by eclipse.

the class AbstractBookmarkMenu method execInitAction.

@Override
@ConfigOperation
@Order(10)
protected void execInitAction() {
    BEANS.get(IBookmarkService.class).addBookmarkServiceListener(new BookmarkServiceListener() {

        @Override
        public void bookmarksChanged(BookmarkServiceEvent e) {
            handleBookmarksChanged();
        }
    });
    handleBookmarksChanged();
}
Also used : BookmarkServiceListener(org.eclipse.scout.rt.client.services.common.bookmark.BookmarkServiceListener) IBookmarkService(org.eclipse.scout.rt.client.services.common.bookmark.IBookmarkService) BookmarkServiceEvent(org.eclipse.scout.rt.client.services.common.bookmark.BookmarkServiceEvent) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 13 with ConfigOperation

use of org.eclipse.scout.rt.platform.annotations.ConfigOperation in project scout.rt by eclipse.

the class AbstractComposerField method execCreateAdditionalOrNode.

/**
 * Override this method to decorate or enhance new nodes whenever they are created
 *
 * @return the new node or null to ignore the add of a new node of this type
 *         <p>
 *         Normally overrides call super.{@link #interceptCreateAdditionalOrNode(ITreeNode, boolean)}
 */
@ConfigOperation
@Order(140)
protected EitherOrNode execCreateAdditionalOrNode(ITreeNode eitherOrNode, boolean negated) {
    EitherOrNode node = new EitherOrNode(this, false);
    node.setNegative(negated);
    node.setStatus(ITreeNode.STATUS_INSERTED);
    return node;
}
Also used : EitherOrNode(org.eclipse.scout.rt.client.ui.form.fields.composer.node.EitherOrNode) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 14 with ConfigOperation

use of org.eclipse.scout.rt.platform.annotations.ConfigOperation in project scout.rt by eclipse.

the class AbstractComposerField method execCreateEitherNode.

/**
 * Override this method to decorate or enhance new nodes whenever they are created
 *
 * @return the new node or null to ignore the add of a new node of this type
 *         <p>
 *         Normally overrides call super.{@link #interceptCreateEitherNode(ITreeNode, boolean)}
 */
@ConfigOperation
@Order(130)
protected EitherOrNode execCreateEitherNode(ITreeNode parentNode, boolean negated) {
    EitherOrNode node = new EitherOrNode(this, true);
    node.setNegative(negated);
    node.setStatus(ITreeNode.STATUS_INSERTED);
    return node;
}
Also used : EitherOrNode(org.eclipse.scout.rt.client.ui.form.fields.composer.node.EitherOrNode) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 15 with ConfigOperation

use of org.eclipse.scout.rt.platform.annotations.ConfigOperation in project scout.rt by eclipse.

the class AbstractComposerField method execResolveRootPathForTopLevelAttribute.

/**
 * see {@link #interceptResolveAttributePath(AttributeNode)}
 */
@ConfigOperation
@Order(98)
protected void execResolveRootPathForTopLevelAttribute(IDataModelAttribute a, List<IDataModelEntity> lifeList) {
    IDataModelEntity tmp = (a != null ? a.getParentEntity() : null);
    while (tmp != null) {
        lifeList.add(0, tmp);
        tmp = tmp.getParentEntity();
    }
}
Also used : IDataModelEntity(org.eclipse.scout.rt.shared.data.model.IDataModelEntity) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Aggregations

ConfigOperation (org.eclipse.scout.rt.platform.annotations.ConfigOperation)21 Order (org.eclipse.scout.rt.platform.Order)20 IDataModelEntity (org.eclipse.scout.rt.shared.data.model.IDataModelEntity)4 EntityNode (org.eclipse.scout.rt.client.ui.form.fields.composer.node.EntityNode)3 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)2 EitherOrNode (org.eclipse.scout.rt.client.ui.form.fields.composer.node.EitherOrNode)2 SQLException (java.sql.SQLException)1 Calendar (java.util.Calendar)1 HashSet (java.util.HashSet)1 BookmarkServiceEvent (org.eclipse.scout.rt.client.services.common.bookmark.BookmarkServiceEvent)1 BookmarkServiceListener (org.eclipse.scout.rt.client.services.common.bookmark.BookmarkServiceListener)1 IBookmarkService (org.eclipse.scout.rt.client.services.common.bookmark.IBookmarkService)1 FormFieldProvisioningContext (org.eclipse.scout.rt.client.services.lookup.FormFieldProvisioningContext)1 ILookupCallProvisioningService (org.eclipse.scout.rt.client.services.lookup.ILookupCallProvisioningService)1 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)1 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)1 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)1 ITreeVisitor (org.eclipse.scout.rt.client.ui.basic.tree.ITreeVisitor)1