Example usage for com.google.gwt.core.client Scheduler scheduleDeferred

List of usage examples for com.google.gwt.core.client Scheduler scheduleDeferred

Introduction

In this page you can find the example usage for com.google.gwt.core.client Scheduler scheduleDeferred.

Prototype

public abstract void scheduleDeferred(ScheduledCommand cmd);

Source Link

Document

A deferred command is executed after the browser event loop returns.

Usage

From source file:com.ephesoft.gxt.admin.client.view.navigator.draw.BatchClassNavigationCreator.java

License:Open Source License

private static void addIndexFieldsList(final BatchClassNavigationNode<DocumentTypeDTO> indexFieldHeaderNode) {
    final ScheduledCommand indexFieldAdditionCommand = new ScheduledCommand() {

        @Override//from  w w  w . jav a  2 s .c  om
        public void execute() {
            final DocumentTypeDTO bindedDocument = indexFieldHeaderNode.getBindedObject();
            if (null != bindedDocument) {
                final Collection<FieldTypeDTO> indexFieldCollection = bindedDocument.getFields();
                BatchClassNavigationNode<FieldTypeDTO> indexFieldNode;
                final Collection<BatchClassNavigationNode<?>> indexFieldNodeSet = new TreeSet<BatchClassNavigationNode<?>>(
                        nodeComparator);
                String fieldNodeName = null;
                if (!CollectionUtil.isEmpty(indexFieldCollection)) {
                    for (final FieldTypeDTO fieldTypeDTO : indexFieldCollection) {
                        if (fieldTypeDTO != null) {
                            fieldNodeName = fieldTypeDTO.getName();
                            indexFieldNode = new BatchClassNavigationNode<FieldTypeDTO>(fieldNodeName, null,
                                    fieldTypeDTO);
                            indexFieldNodeSet.add(indexFieldNode);
                        }
                    }
                    navigationTree.addChildren(indexFieldHeaderNode, indexFieldNodeSet);
                    addIndexFieldLevelProperties(indexFieldNodeSet);
                }
            }

        }
    };
    final Scheduler indexFieldAdditionScheduler = new SchedulerImpl();
    indexFieldAdditionScheduler.scheduleDeferred(indexFieldAdditionCommand);
}

From source file:com.ephesoft.gxt.admin.client.view.navigator.draw.BatchClassNavigationCreator.java

License:Open Source License

private static void addTablesList(final BatchClassNavigationNode<DocumentTypeDTO> tableHeaderNode) {
    final ScheduledCommand tablesAdditionCommand = new ScheduledCommand() {

        @Override//  w ww .  ja  v a 2 s. c  o  m
        public void execute() {
            final DocumentTypeDTO bindedDocument = tableHeaderNode.getBindedObject();
            if (null != bindedDocument) {
                final Collection<TableInfoDTO> tableInfoCollection = bindedDocument.getTableInfos();
                BatchClassNavigationNode<TableInfoDTO> tableInfoNode;
                final Collection<BatchClassNavigationNode<?>> tablesNodeSet = new TreeSet<BatchClassNavigationNode<?>>(
                        nodeComparator);
                String tableNodeName = null;
                if (!CollectionUtil.isEmpty(tableInfoCollection)) {
                    for (final TableInfoDTO tableDTO : tableInfoCollection) {
                        if (tableDTO != null) {
                            tableNodeName = tableDTO.getName();
                            tableInfoNode = new BatchClassNavigationNode<TableInfoDTO>(tableNodeName, null,
                                    tableDTO);
                            tablesNodeSet.add(tableInfoNode);
                        }
                    }
                    navigationTree.addChildren(tableHeaderNode, tablesNodeSet);
                    addTableLevelProperties(tablesNodeSet);
                }
            }

        }
    };
    final Scheduler tablesAdditionScheduler = new SchedulerImpl();
    tablesAdditionScheduler.scheduleDeferred(tablesAdditionCommand);
}

From source file:com.ephesoft.gxt.admin.client.view.navigator.draw.BatchClassNavigationCreator.java

License:Open Source License

private static void addTablesExtractionRulesList(
        final BatchClassNavigationNode<TableInfoDTO> tableExtractionRuleHeaderNode) {
    final ScheduledCommand tablesAdditionCommand = new ScheduledCommand() {

        @Override/*from w w  w  . j a v a 2s .c  o  m*/
        public void execute() {
            final TableInfoDTO bindedDocument = tableExtractionRuleHeaderNode.getBindedObject();
            if (null != bindedDocument) {
                final Collection<TableExtractionRuleDTO> tableInfoCollection = bindedDocument
                        .getTableExtractionRuleDTOs();
                BatchClassNavigationNode<TableExtractionRuleDTO> tableExtractionNode;
                final Collection<BatchClassNavigationNode<?>> tableExtractionRulesSet = new TreeSet<BatchClassNavigationNode<?>>(
                        nodeComparator);
                String tableNodeName = null;
                if (!CollectionUtil.isEmpty(tableInfoCollection)) {
                    for (final TableExtractionRuleDTO tableExtractionRuleDTO : tableInfoCollection) {
                        if (tableExtractionRuleDTO != null) {
                            tableNodeName = tableExtractionRuleDTO.getRuleName();
                            tableExtractionNode = new BatchClassNavigationNode<TableExtractionRuleDTO>(
                                    tableNodeName, null, tableExtractionRuleDTO);
                            tableExtractionRulesSet.add(tableExtractionNode);
                        }
                    }
                    navigationTree.addChildren(tableExtractionRuleHeaderNode, tableExtractionRulesSet);
                    addTableExtractionRuleLevelProperties(tableExtractionRulesSet);
                }
            }

        }
    };
    final Scheduler tablesExtractionAdditionScheduler = new SchedulerImpl();
    tablesExtractionAdditionScheduler.scheduleDeferred(tablesAdditionCommand);
}

From source file:com.ephesoft.gxt.rv.client.controller.ReviewValidateController.java

License:Open Source License

public ReviewValidateController(final EventBus eventBus, final ReviewValidateServiceAsync rpcService) {
    super(eventBus, rpcService);
    ReviewValidateEventBus.registerEventBus(eventBus);
    documentMap = new HashMap<String, Document>();
    reviewValidateLayout = new ReviewValidateLayout(this, rpcService);
    ScheduledCommand command = new ScheduledCommand() {

        @Override/*from  w  ww .  j a  v  a2  s. c o m*/
        public void execute() {
            initializeView();
            initializePresenter();
        }
    };
    Scheduler scheduler = new SchedulerImpl();
    scheduler.scheduleDeferred(command);
}

From source file:com.ephesoft.gxt.rv.client.presenter.batch.DataTablePresenter.java

License:Open Source License

@EventHandler
public void handleDefaultCellSelectionEndEvent(
        final DefaultCellSelectionEndEvent defaultCellSelectionEndEvent) {
    String dataTableName = view.getTableName();
    if (null != defaultCellSelectionEndEvent && !StringUtil.isNullOrEmpty(dataTableName)
            && dataTableName.equalsIgnoreCase(ReviewValidateNavigator.getInsertionScriptTableName())) {
        Scheduler scheduler = new SchedulerImpl();
        ScheduledCommand command = new ScheduledCommand() {

            @Override//from   w w w. j  av  a 2  s .  c om
            public void execute() {
                selectPageAfterInsertion(pageBeforeScriptExecution,
                        ReviewValidateNavigator.getBeforeInsertionRowIndex());
                Timer timer = new Timer() {

                    @Override
                    public void run() {
                        ReviewValidateNavigator.setInsertionScriptTableName(null);
                    }
                };
                timer.schedule(3000);
            }
        };
        scheduler.scheduleDeferred(command);
    }
}

From source file:com.ephesoft.gxt.rv.client.presenter.DocumentTreePresenter.java

License:Open Source License

@EventHandler
public void adjustScrollOnDocumentOpenEvent(final DocumentOpenEvent documentOpenEvent) {
    if (null != documentOpenEvent) {
        final ScheduledCommand command = new ScheduledCommand() {

            @Override/*from ww w  . j  a va  2 s  . co  m*/
            public void execute() {
                view.fireScrollEventToLoadDocument();
            }
        };
        final Scheduler scheduler = new SchedulerImpl();
        scheduler.scheduleDeferred(command);
    }
}

From source file:com.ephesoft.gxt.rv.client.presenter.ImageOverlayPresenter.java

License:Open Source License

@EventHandler
public void handleFieldSelectionEvent(final FieldSelectionEvent fieldSelectionEvent) {
    final ScheduledCommand command = new ScheduledCommand() {

        @Override//from   w  w w  .j a  v  a2  s .  co  m
        public void execute() {
            if (null != fieldSelectionEvent) {
                view.clearOverlays();
                final Field selectedField = fieldSelectionEvent.getSelectedField();
                if (null != selectedField) {
                    final String selectedFieldPageIdentifier = selectedField.getPage();
                    if (!StringUtil.isNullOrEmpty(selectedFieldPageIdentifier)) {
                        drawOverlays(selectedField);
                    }
                }
            }
        }
    };
    final Scheduler scheduler = new SchedulerImpl();
    scheduler.scheduleDeferred(command);
}

From source file:com.ephesoft.gxt.rv.client.presenter.ImageOverlayPresenter.java

License:Open Source License

@EventHandler
public void drawOverlaysOnThumbnailSelection(final ThumbnailSelectionEvent thumbnailSelectionEvent) {
    final ScheduledCommand command = new ScheduledCommand() {

        @Override//from  w  ww. j a  va 2 s. com
        public void execute() {
            drawOverlays(ReviewValidateNavigator.getCurrentField());
        }
    };
    final Scheduler scheduler = new SchedulerImpl();
    scheduler.scheduleDeferred(command);
}

From source file:com.ephesoft.gxt.rv.client.presenter.ImageOverlayPresenter.java

License:Open Source License

private void drawOverlays(final Field selectedField) {
    if (null != selectedField) {
        final ScheduledCommand command = new ScheduledCommand() {

            @Override//w  w  w .j a  v  a  2s. c  om
            public void execute() {
                final Page currentPage = ReviewValidateNavigator.getCurrentPage();
                final String selectedFieldPage = selectedField.getPage();
                if (currentPage != null && !StringUtil.isNullOrEmpty(selectedFieldPage)
                        && selectedFieldPage.equalsIgnoreCase(currentPage.getIdentifier())) {
                    Overlay.clearOverlays();
                    view.drawOverlays(selectedField.getCoordinatesList());
                }
            }
        };
        final Scheduler scheduler = new SchedulerImpl();
        scheduler.scheduleDeferred(command);
    }
}

From source file:com.ephesoft.gxt.rv.client.presenter.menu.BatchOptionsPresenter.java

License:Open Source License

@EventHandler
public void handleDocumentOpenEvent(final DocumentOpenEvent documentOpenEvent) {
    final String header = ReviewValidateNavigator
            .getBatchInstanceStatus() == BatchInstanceStatus.READY_FOR_REVIEW
                    ? LocaleConstant.REVIEW_MENU_ITEM_TEXT
                    : LocaleConstant.VALIDATE_MENU_ITEM_TEXT;
    view.setReviewValidateMenuHeader(header);
    final ScheduledCommand command = new ScheduledCommand() {

        @Override//w  w w. j a  va 2  s  .  co m
        public void execute() {
            scheduleDocumentOpenEventOperation(documentOpenEvent);
        }
    };
    final Scheduler scheduler = new SchedulerImpl();
    scheduler.scheduleDeferred(command);
    if (BatchInstanceStatus.READY_FOR_VALIDATION == ReviewValidateNavigator.getBatchInstanceStatus()) {
        view.setTableView(controller.isTableViewValid());
    }
}