Example usage for com.google.gwt.user.client Timer schedule

List of usage examples for com.google.gwt.user.client Timer schedule

Introduction

In this page you can find the example usage for com.google.gwt.user.client Timer schedule.

Prototype

public synchronized void schedule(int delayMs) 

Source Link

Document

Schedules a timer to elapse in the future.

Usage

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java

License:Open Source License

private void addHandlersToFileIconedName(final FileWrapper file, final String fileName, HTML fileIconedName) {
    fileIconedName.addMouseDownHandler(new MouseDownHandler() {

        @Override//  www . j a v  a2  s .c  o  m
        public void onMouseDown(MouseDownEvent mouseDown) {
            presenter.setSelectedFile(file);
            com.google.gwt.user.client.Timer timer = new com.google.gwt.user.client.Timer() {

                @Override
                public void run() {
                    presenter.setSelectedFile(null);
                }
            };
            timer.schedule(500);
            if (mouseDown.getNativeButton() == Event.BUTTON_RIGHT) {
                performOperationsOnRightClick(file, fileName, mouseDown);
            }
        }

    });
}

From source file:com.ephesoft.dcma.gwt.rv.client.view.ValidatePanel.java

License:Open Source License

/**
 * The <code>setTimerToExecuteScript</code> method is for setting timer before executing script on value change.
 *//*from w  w w . j a  va 2 s  .  c  o  m*/
private void setTimerToExecuteScript() {
    Timer timer = new Timer() {

        @Override
        public void run() {
            if (!currentFieldSet) {
                presenter.executeScriptOnFieldChange(presenter.getFieldValueChangeName());
            }
        }
    };
    timer.schedule(300);
}

From source file:com.ephesoft.gxt.admin.client.presenter.kvextraction.AdvancedKVExtraction.AdvancedKVExtractionImageViewPresenter.java

License:Open Source License

@Override
public void bind() {
    view.getPageImage().setUrl(BatchClassConstants.EMPTY_STRING);
    view.getPageImage().setVisible(false);
    view.getPageImage().setCachedOverlaysToNull();
    if (controller.getAdvKvExtractionPresenter().isEdit()) {
        KVExtractionDTO selectedKVExtraction = controller.getSelectedKVExtraction();
        if (selectedKVExtraction != null) {
            if (selectedKVExtraction.getXoffset() != null) {
                view.setxOffset(String.valueOf(selectedKVExtraction.getXoffset()));
            } else {
                view.setxOffset(AdminConstants.EMPTY_STRING);
            }//from  w w w .j a  v a 2 s. co  m
            if (selectedKVExtraction.getYoffset() != null) {
                view.setyOffset(String.valueOf(selectedKVExtraction.getYoffset()));
            } else {
                view.setyOffset(AdminConstants.EMPTY_STRING);
            }
            if (selectedKVExtraction.getWidth() != null) {
                view.setWidthOfRect(String.valueOf(selectedKVExtraction.getWidth()));
            } else {
                view.setWidthOfRect(AdminConstants.EMPTY_STRING);
            }
            if (selectedKVExtraction.getLength() != null) {
                view.setLengthOfRect(String.valueOf(selectedKVExtraction.getLength()));
            } else {
                view.setLengthOfRect(AdminConstants.EMPTY_STRING);
            }
        }
    }
    // To set Buttons height
    Timer timer = new Timer() {

        @Override
        public void run() {
            setBoundaryOnOverlays();
        }
    };
    timer.schedule(100);

}

From source file:com.ephesoft.gxt.admin.client.presenter.kvextraction.AdvancedKVExtraction.AdvancedKVExtractionPresenter.java

License:Open Source License

/**
 * /*  w  w w . j ava 2  s.  c o  m*/
 * @param event
 */
@EventHandler
public void openAdvKVScreen(final AdvancedKVExtractionShowEvent event) {
    setEdit(event.isEdit());
    window = new Window((WindowAppearance) GWT.create(GrayWindowAppearance.class));
    window.setPagePosition(0, 0);
    window.setWidth(com.google.gwt.user.client.Window.getClientWidth());
    window.setHeight(com.google.gwt.user.client.Window.getClientHeight());
    window.setClosable(false);
    window.setHeaderVisible(false);
    window.setDraggable(false);
    window.setResizable(false);
    window.getElement().getStyle().setZIndex(5);
    window.setBorders(false);
    window.removeStyleName("noheader");
    window.addStyleName("advWindow");
    window.add(controller.createAdvKVView());
    if (!isEdit) {
        ContentPanel panel = controller.getAdvancedKVLayout().getBottomsPanel();
        if (panel != null) {
            panel.setExpanded(true);
        }
    }
    window.addDomHandler(new KeyDownHandler() {

        @Override
        public void onKeyDown(KeyDownEvent event) {
            if (event.isControlKeyDown() && event.getNativeKeyCode() == KeyCodes.KEY_K) {
                event.preventDefault();
                event.stopPropagation();
            }
        }
    }, KeyDownEvent.getType());
    WidgetUtil.setID(window, "advKVScreen");
    Timer timer = new Timer() {

        @Override
        public void run() {
            RootPanel.get().add(window);
            window.forceLayout();
        }
    };
    timer.schedule(20);
    window.focus();

    addresize();
}

From source file:com.ephesoft.gxt.admin.client.presenter.kvextraction.AdvancedKVExtraction.AdvancedKVExtractionPresenter.java

License:Open Source License

private void addresize() {
    com.google.gwt.user.client.Window.addResizeHandler(new ResizeHandler() {

        @Override/*from   w  w  w  . j a v a 2s  .  c  o m*/
        public void onResize(ResizeEvent event) {
            if (null != window && window.isAttached()) {
                Timer timer = new Timer() {

                    @Override
                    public void run() {
                        adjustView();
                    }
                };
                timer.schedule(100);
            }
        }
    });
}

From source file:com.ephesoft.gxt.admin.client.presenter.module.AddNewModulePresenter.java

License:Open Source License

public void showAddNewModuleView() {
    view.getDialogWindow().add(view);//from  ww  w .  j a va2  s.  c o m
    view.getDialogWindow()
            .setHeadingText(LocaleDictionary.getConstantValue(BatchClassConstants.ADD_NEW_MODULE_LABEL));
    view.getDialogWindow().setWidth("290px");
    view.getDialogWindow().setFocusWidget(view.getNameTextBox());
    view.getDialogWindow().show();
    view.getDialogWindow().center();
    Timer timer = new Timer() {

        @Override
        public void run() {
            view.getNameTextBox().clearInvalid();
        }
    };
    timer.schedule(20);
}

From source file:com.ephesoft.gxt.admin.client.presenter.plugin.PluginConfigurePresenter.java

License:Open Source License

/**
 * Insert plugin.//from   ww w . ja va 2s .  c o m
 * 
 * @param batchClassModuleDTO the batch class module dto
 * @param pluginName the plugin name
 * @param pluginDetails the plugin details
 * @param identifier the identifier
 */
private void insertPlugin(final BatchClassModuleDTO batchClassModuleDTO, String pluginName,
        PluginDetailsDTO pluginDetails, int identifier) {
    if (batchClassModuleDTO != null && batchClassModuleDTO.getNonDeletedPluginByName(pluginName) == null) {
        // Message.display("Plugin Inserted ", " " + pluginName);
        BatchClassPluginDTO batchClassPluginDTO = new BatchClassPluginDTO();
        batchClassPluginDTO.setPlugin(pluginDetails);
        batchClassPluginDTO.setBatchClassModule(batchClassModuleDTO);
        batchClassPluginDTO.setNew(true);
        batchClassPluginDTO.setOrderNumber(identifier);
        batchClassPluginDTO.setIdentifier(String.valueOf(RandomIdGenerator.getIdentifier()));
        batchClassModuleDTO.addBatchClassPlugin(batchClassPluginDTO);
        if (batchClassModuleDTO == controller.getSelectedBatchClassModule()) {
            view.addSelectedPluginDTO(Collections.singletonList(batchClassPluginDTO));
        }
        Timer timer = new Timer() {

            @Override
            public void run() {
                BatchClassManagementEventBus.fireEvent(new PluginSubTreeRefreshEvent(batchClassModuleDTO));
            }
        };
        timer.schedule(10);
    }
}

From source file:com.ephesoft.gxt.admin.client.presenter.tablecolumnextraction.advancedtablecolumnextractionrule.AdvancedTableColumnExtractionPresenter.java

License:Open Source License

@EventHandler
public void openAdvancedTableColumnExtractionScreen(AdvancedTableColumnExtractionShowEvent event) {

    window = new Window((WindowAppearance) GWT.create(GrayWindowAppearance.class));
    window.setPagePosition(0, 0);/*from   w w w  . j  a va  2  s  .co m*/
    window.setWidth(com.google.gwt.user.client.Window.getClientWidth());
    window.setHeight(com.google.gwt.user.client.Window.getClientHeight());
    window.setClosable(false);
    window.setHeaderVisible(false);
    window.setDraggable(false);
    window.setResizable(false);
    window.add(controller.createAdvTableColumnExtractionView());
    window.getElement().getStyle().setZIndex(5);
    window.setBorders(false);
    window.addStyleName("advWindow");
    //Ctrl + K functionality on Set Coordinates Screen.
    window.addDomHandler(new KeyDownHandler() {

        @Override
        public void onKeyDown(KeyDownEvent event) {
            if (event.isControlKeyDown() && event.getNativeKeyCode() == KeyCodes.KEY_K) {
                event.preventDefault();
                event.stopPropagation();
            }
        }
    }, KeyDownEvent.getType());

    WidgetUtil.setID(window, "advTableColumnExtractionView");

    Timer timer = new Timer() {

        @Override
        public void run() {
            RootPanel.get().add(window);
            window.forceLayout();
        }
    };
    timer.schedule(20);

    //      RootPanel.get().add(window);
    window.focus();
    addresize();
}

From source file:com.ephesoft.gxt.admin.client.view.kvextraction.AdvancedKVExtraction.AdvanvcedKVExtractionGridView.java

License:Open Source License

private void applyColorCodingToGrid() {
    Timer timer = new Timer() {

        @Override//ww  w  .  j av  a 2s.  c  o  m
        public void run() {
            // TODO Auto-generated method stub

            for (int i = 0; i < outputDataGrid.getGridRowCount(); i++) {
                String value = outputDataGrid.getView().getCell(i, 5).getInnerText();
                if (null != outputDataGrid.getView().getCell(i, 5).getFirstChildElement()) {
                    outputDataGrid.getView().getCell(i, 5).getFirstChildElement().getStyle()
                            .setBackgroundColor(value);
                }
                outputDataGrid.getView().getCell(i, 5).getStyle().setBackgroundColor(value);
                outputDataGrid.getView().getCell(i, 5).getStyle().setOpacity(0.4);
                outputDataGrid.getView().getCell(i, 5).getStyle().setColor(value);
            }
        }
    };
    timer.schedule(30);
}

From source file:com.ephesoft.gxt.admin.client.view.kvextraction.AdvancedKVExtraction.OverlayImage.java

License:Open Source License

public void setImagePanel(ContentPanel imagePanel) {
    this.imagePanel = imagePanel;
    if (null != imagePanel) {
        imagePanel.addResizeHandler(new ResizeHandler() {

            @Override/*from  w ww.  jav  a2 s.  co  m*/
            public void onResize(ResizeEvent event) {

                Timer timer = new Timer() {

                    @Override
                    public void run() {
                        if (!type.equals(OverlayType.LABEL)) {
                            Overlay.redrawAll(false);
                        } else {
                            ImageLabel.redrawAll();
                        }
                    }
                };
                timer.schedule(20);
            }
        });
    }
}