List of usage examples for com.google.gwt.user.client Timer Timer
Timer
From source file:com.elasticgrid.admin.client.widget.LoginDialog.java
License:Open Source License
protected void onSubmit() { status.show();/* w w w . j a va 2s. c om*/ getButtonBar().disable(); Timer t = new Timer() { @Override public void run() { LoginDialog.this.hide(); } }; t.schedule(2000); }
From source file:com.emitrom.lienzo.client.widget.LienzoPanel.java
License:Open Source License
private void initResizeTimer() { m_resize_timer = new Timer() { @Override/*from www . j a va2s. c o m*/ public void run() { m_resizing = false; if (!m_resizing) { int w = getElement().getParentElement().getClientWidth(); int h = getElement().getParentElement().getClientHeight(); getViewport().getHandlerManager().fireEvent(new ResizeEndEvent(w, h)); cancel(); } } }; }
From source file:com.ephesoft.dcma.gwt.rv.client.view.ImageOverlayPanel.java
License:Open Source License
@UiHandler("rotate") public void rotateImage(final ClickEvent event) { fitToPageImage = Boolean.FALSE; rotate.setEnabled(false);//www. j a v a 2 s.c o m ScreenMaskUtility.maskScreen(); presenter.rpcService.rotateImage(presenter.batchDTO.getBatch(), presenter.page, presenter.document.getIdentifier(), new AsyncCallback<Page>() { @Override public void onFailure(final Throwable arg0) { ScreenMaskUtility.unmaskScreen(); rotate.setEnabled(true); if (!presenter.displayErrorMessage(arg0)) { ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get() .getMessageValue(ReviewValidateMessages.MSG_OVERLAYPANEL_ROTATE_ERROR)); } } @Override public void onSuccess(final Page arg0) { presenter.page.setDirection(arg0.getDirection()); presenter.page.setIsRotated(arg0.isIsRotated()); final List<Document> docList = presenter.batchDTO.getBatch().getDocuments().getDocument(); for (Document doc : docList) { if (presenter.document.getIdentifier().equals(doc.getIdentifier())) { final List<Page> pageList = doc.getPages().getPage(); int index = 0; for (final Page pg : pageList) { if (pg.getIdentifier().equals(presenter.page.getIdentifier())) { pageList.set(index, presenter.page);// presenter.page; } index++; } doc = presenter.document; } } final Direction direction = presenter.page.getDirection(); final String absoluteURLFor = presenter.batchDTO.getAbsoluteURLForRotatedImage( presenter.page.getDisplayFileName(), direction.toString()); pageImage.setUrl(absoluteURLFor, direction); pageImage.setStyleName("thumbnailHighlighted"); ImageOverlayPanel.this.fireEvent(new PageChangeEvent(presenter.document, presenter.page)); timeout = new Timer() { public void run() { ScreenMaskUtility.unmaskScreen(); timeout = null; } }; timeout.schedule(1000); rotate.setEnabled(true); } }); }
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 ww w.ja v a 2 s. co 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 ww w. j av a2 s . c o 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
/** * /*from w w w . j a v a 2 s.com*/ * @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/* w ww. jav a2s. 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 v a 2s. c om*/ 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 w w w .j a v a 2 s .c om * * @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);/*ww w .j ava 2s .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(); }