Search in sources :

Example 16 with ConfigOperation

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

the class AbstractComposerField method execResolveRootPathForTopLevelEntity.

/**
 * see {@link #interceptResolveEntityPath(EntityNode)}
 */
@ConfigOperation
@Order(98)
protected void execResolveRootPathForTopLevelEntity(IDataModelEntity e, List<IDataModelEntity> lifeList) {
    IDataModelEntity tmp = (e != null ? e.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)

Example 17 with ConfigOperation

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

the class AbstractComposerField method execResolveAttributePath.

/**
 * see {@link #execResolveEntityPathForEntityExport(EntityNode)}, {@link AttributePath} for more details
 * <p>
 * The path in the composer tree is prefixed with
 * {@link #interceptResolveRootPathForTopLevelAttribute(IDataModelAttribute, List)}
 */
@ConfigOperation
@Order(99)
protected AttributePath execResolveAttributePath(AttributeNode node) {
    LinkedList<IDataModelEntity> list = new LinkedList<IDataModelEntity>();
    if (node == null) {
        return null;
    }
    EntityNode tmp = node.getAncestorNode(EntityNode.class);
    while (tmp != null) {
        if (tmp.getEntity() != null) {
            list.add(0, tmp.getEntity());
        }
        // next
        tmp = tmp.getAncestorNode(EntityNode.class);
    }
    if (list.size() > 0) {
        interceptResolveRootPathForTopLevelEntity(list.get(0), list);
    } else {
        interceptResolveRootPathForTopLevelAttribute(node.getAttribute(), list);
    }
    return new AttributePath(list, node.getAttribute());
}
Also used : IDataModelEntity(org.eclipse.scout.rt.shared.data.model.IDataModelEntity) LinkedList(java.util.LinkedList) EntityNode(org.eclipse.scout.rt.client.ui.form.fields.composer.node.EntityNode) AttributePath(org.eclipse.scout.rt.shared.data.model.AttributePath) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 18 with ConfigOperation

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

the class AbstractClipboardField method execDropRequest.

@ConfigOperation
@Order(80)
protected void execDropRequest(TransferObject transferObject) {
    if (transferObject instanceof ResourceListTransferObject) {
        ResourceListTransferObject resourceListTransferObject = (ResourceListTransferObject) transferObject;
        setValue(resourceListTransferObject.getResources());
    }
}
Also used : ResourceListTransferObject(org.eclipse.scout.rt.client.ui.dnd.ResourceListTransferObject) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 19 with ConfigOperation

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

the class AbstractListBox method execLoadTableData.

@ConfigOperation
@Order(230)
protected List<? extends ILookupRow<KEY>> execLoadTableData() {
    List<? extends ILookupRow<KEY>> data;
    // (1) get data by service
    if (getLookupCall() != null) {
        ILookupCall<KEY> call = BEANS.get(ILookupCallProvisioningService.class).newClonedInstance(getLookupCall(), new FormFieldProvisioningContext(AbstractListBox.this));
        prepareLookupCall(call);
        data = call.getDataByAll();
        data = filterLookupResult(call, data);
    } else // (b) get data direct
    {
        data = filterLookupResult(null, null);
    }
    return data;
}
Also used : FormFieldProvisioningContext(org.eclipse.scout.rt.client.services.lookup.FormFieldProvisioningContext) ILookupCallProvisioningService(org.eclipse.scout.rt.client.services.lookup.ILookupCallProvisioningService) Order(org.eclipse.scout.rt.platform.Order) ConfigOperation(org.eclipse.scout.rt.platform.annotations.ConfigOperation)

Example 20 with ConfigOperation

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

the class TreeProposalChooser method execGetSingleMatch.

/**
 * Override this method to change that behaviour of what is a single match. By default a single match is when there is
 * a single enabled LEAF node in the tree
 */
@ConfigOperation
@Order(40)
@Override
protected ILookupRow<LOOKUP_KEY> execGetSingleMatch() {
    final List<ILookupRow<LOOKUP_KEY>> foundLeafs = new ArrayList<>();
    ITreeVisitor v = new ITreeVisitor() {

        @Override
        public boolean visit(ITreeNode node) {
            if (node.isEnabled() && node.isLeaf()) {
                @SuppressWarnings("unchecked") ILookupRow<LOOKUP_KEY> row = (ILookupRow<LOOKUP_KEY>) node.getCell().getValue();
                if (row != null && row.isEnabled()) {
                    foundLeafs.add(row);
                }
            }
            return foundLeafs.size() <= 2;
        }
    };
    m_model.visitVisibleTree(v);
    if (foundLeafs.size() == 1) {
        return foundLeafs.get(0);
    } else {
        return null;
    }
}
Also used : ITreeNode(org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode) ILookupRow(org.eclipse.scout.rt.shared.services.lookup.ILookupRow) ArrayList(java.util.ArrayList) ITreeVisitor(org.eclipse.scout.rt.client.ui.basic.tree.ITreeVisitor) 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