Search in sources :

Example 21 with Order

use of org.eclipse.scout.rt.platform.Order 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 22 with Order

use of org.eclipse.scout.rt.platform.Order 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 23 with Order

use of org.eclipse.scout.rt.platform.Order in project scout.rt by eclipse.

the class AbstractWizardStep method calculateViewOrder.

/**
 * Calculates the column's view order, e.g. if the @Order annotation is set to 30.0, the method will return 30.0. If
 * no {@link Order} annotation is set, the method checks its super classes for an @Order annotation.
 *
 * @since 3.10.0-M4
 */
@SuppressWarnings("squid:S1244")
protected double calculateViewOrder() {
    double viewOrder = getConfiguredViewOrder();
    Class<?> cls = getClass();
    if (viewOrder == IOrdered.DEFAULT_ORDER) {
        while (cls != null && IWizardStep.class.isAssignableFrom(cls)) {
            if (cls.isAnnotationPresent(Order.class)) {
                Order order = (Order) cls.getAnnotation(Order.class);
                return order.value();
            }
            cls = cls.getSuperclass();
        }
    }
    return viewOrder;
}
Also used : Order(org.eclipse.scout.rt.platform.Order)

Example 24 with Order

use of org.eclipse.scout.rt.platform.Order in project scout.rt by eclipse.

the class AbstractDataModelAttribute method calculateViewOrder.

/**
 * Calculates the column's view order, e.g. if the @Order annotation is set to 30.0, the method will return 30.0. If
 * no {@link Order} annotation is set, the method checks its super classes for an @Order annotation.
 *
 * @since 3.10.0-M4
 */
@SuppressWarnings("squid:S1244")
protected double calculateViewOrder() {
    double viewOrder = getConfiguredViewOrder();
    Class<?> cls = getClass();
    if (viewOrder == IOrdered.DEFAULT_ORDER) {
        while (cls != null && IDataModelAttribute.class.isAssignableFrom(cls)) {
            if (cls.isAnnotationPresent(Order.class)) {
                Order order = (Order) cls.getAnnotation(Order.class);
                return order.value();
            }
            cls = cls.getSuperclass();
        }
    }
    return viewOrder;
}
Also used : Order(org.eclipse.scout.rt.platform.Order)

Example 25 with Order

use of org.eclipse.scout.rt.platform.Order 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)

Aggregations

Order (org.eclipse.scout.rt.platform.Order)26 ConfigOperation (org.eclipse.scout.rt.platform.annotations.ConfigOperation)20 IDataModelEntity (org.eclipse.scout.rt.shared.data.model.IDataModelEntity)4 EntityNode (org.eclipse.scout.rt.client.ui.form.fields.composer.node.EntityNode)3 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 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 HashSet (java.util.HashSet)1 TreeMap (java.util.TreeMap)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