Java Code Examples for com.google.gwt.user.client.Timer

The following are top voted examples for showing how to use com.google.gwt.user.client.Timer. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: unitimes   File: HorizontalPanelWithHint.java   View source code 7 votes vote down vote up
public HorizontalPanelWithHint(Widget hint) {
	super();
	iHint = new PopupPanel();
	iHint.setWidget(hint);
	iHint.setStyleName("unitime-PopupHint");
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONMOUSEMOVE);
	iShowHint = new Timer() {
		@Override
		public void run() {
			iHint.show();
		}
	};
	iHideHint = new Timer() {
		@Override
		public void run() {
			iHint.hide();
		}
	};
}
 
Example 2
Project: empiria.player   File: NavigationButtonModule.java   View source code 6 votes vote down vote up
@Override
public void onPlayerEvent(PlayerEvent event) {
    if (testMode) {
        return;
    }

    if (event.getType() == PAGE_LOADED) {
        Timer timer = new Timer() {
            @Override
            public void run() {
                setEnabled(!isEnd());
                setStyleName();
            }
        };
        timer.schedule(300);
    } else if (event.getType() == BEFORE_FLOW) {
        setEnabled(false);
        setStyleName();
    }
}
 
Example 3
Project: empiria.player   File: VideoControlHideTimer.java   View source code 6 votes vote down vote up
@Inject
public VideoControlHideTimer(@Assisted VideoFullScreenView view, EventsBus eventsBus) {
    this.view = view;
    this.eventsBus = eventsBus;
    view.getContainer().addDomHandler(this, TouchEndEvent.getType());
    view.getContainer().addDomHandler(this, ClickEvent.getType());
    view.getContainer().addDomHandler(this, MouseMoveEvent.getType());
    controlsHideTimer = new Timer() {

        @Override
        public void run() {
            hideCotrols();
        }
    };
    controlsHideTimer.schedule(CONTROLS_SHOW_TIME);
}
 
Example 4
Project: unitimes   File: CurriculumProjectionRulesPage.java   View source code 6 votes vote down vote up
public MyFlexTable() {
	super();
	setCellPadding(2);
	setCellSpacing(0);
	sinkEvents(Event.ONMOUSEOVER);
	sinkEvents(Event.ONMOUSEOUT);
	sinkEvents(Event.ONCLICK);
	sinkEvents(Event.ONKEYDOWN);
	setStylePrimaryName("unitime-MainTable");
	iTimer = new Timer() {
		@Override
		public void run() {
			saveOrder();
		}
	};
}
 
Example 5
Project: unitimes   File: EventAdd.java   View source code 6 votes vote down vote up
public CourseRelatedObjectsTable(AcademicSessionProvider session) {
	iSession = session;
	setStyleName("unitime-EventOwners");
	
	List<Widget> header = new ArrayList<Widget>();
	header.add(new UniTimeTableHeader(MESSAGES.colSubject()));
	header.add(new UniTimeTableHeader(MESSAGES.colCourseNumber()));
	header.add(new UniTimeTableHeader(MESSAGES.colConfigOrSubpart()));
	header.add(new UniTimeTableHeader(MESSAGES.colClassNumber()));
	header.add(new UniTimeTableHeader("&nbsp;"));
	
	addRow(null, header);
	
	iChangeTimer = new Timer() {
		@Override
		public void run() {
			List<RelatedObjectInterface> value = getValue();
			if (iLastChange != null && iLastChange.equals(value)) return;
			iLastChange = value;
			ValueChangeEvent.fire(CourseRelatedObjectsTable.this, value);
		}
	};
}
 
Example 6
Project: unitimes   File: MobileNotifications.java   View source code 6 votes vote down vote up
protected void addNotification(final Notification notification) {
	for (Iterator<Notification> i = iNotifications.iterator(); i.hasNext(); ) {
		Notification n = i.next();
		if (n.getText().equals(notification.getText())) {
			i.remove();
		}
	}
	iNotifications.add(notification);
	populate("slideup");
	
	Timer timer = new Timer() {
		@Override
		public void run() {
			iNotifications.remove(notification);
			populate(null);
		}
	};
	timer.schedule(10000);
}
 
Example 7
Project: unitimes   File: UniTimePageHeader.java   View source code 6 votes vote down vote up
private UniTimePageHeader() {
	iHeader = new PageHeader();

	getLeft().setCallback(new Callback() {
		@Override
		public void execute(Callback callback) {
			reloadSolverInfo(true, callback);
		}
	});

	reloadSessionInfo();
	reloadUserInfo();
	iTimer = new Timer() {
		@Override
		public void run() {
			reloadSolverInfo(getLeft().isPopupShowing(), null);
		}
	};
	iTimer.schedule(1000);
}
 
Example 8
Project: optashift-employee-rostering   File: Calendar.java   View source code 6 votes vote down vote up
private Calendar(Integer tenantId, Fetchable<Collection<I>> dataProvider, Fetchable<List<G>> groupProvider,
        DataProvider<G,
                I> instanceCreator, SyncBeanManager beanManager) {
    this.beanManager = beanManager;
    this.tenantId = tenantId;

    shifts = new HashMap<>();
    didTenantChange = true;

    setInstanceCreator(instanceCreator);
    setGroupProvider(groupProvider);
    setDataProvider(dataProvider);

    timer = new Timer() {

        @Override
        public void run() {
            forceUpdate();
        }
    };

    refresh();

}
 
Example 9
Project: appinventor-extensions   File: EditorManager.java   View source code 6 votes vote down vote up
/**
 * Creates the editor manager.
 */
public EditorManager() {
  openProjectEditors = Maps.newHashMap();

  dirtyProjectSettings = new HashSet<ProjectSettings>();
  dirtyFileEditors = new HashSet<FileEditor>();

  autoSaveTimer = new Timer() {
    @Override
    public void run() {
      // When the timer goes off, save all dirtyProjectSettings and
      // dirtyFileEditors.
      Ode.getInstance().lockScreens(true); // Lock out changes
      saveDirtyEditors(new Command() {
          @Override
          public void execute() {
            Ode.getInstance().lockScreens(false); // I/O finished, unlock
          }
        });
    }
  };
}
 
Example 10
Project: gwt-promptly   File: DemoUI.java   View source code 6 votes vote down vote up
private void executeCommandPause(final PromptlyPanel panel) {
   panel.setBlockingHyperlinks(true);
   panel.append("Pausing for 3 seconds (all input ignored) ....");
   panel.setCommandLineMode(false /* is command line mode */, false /* is collect key events */, false /* is collect mouse events */);

   Timer t = new Timer() {
      
      @Override
      public void run() {
         panel.append("... and we are back !");
         panel.setBlockingHyperlinks(false);
         panel.setCommandLineMode(true /* is command line mode */, true /* is collect key events */, true /* is collect mouse events */);
      }
   };
   
   t.schedule(3000);
}
 
Example 11
Project: gwt-history   File: HistoryTest.java   View source code 6 votes vote down vote up
/** Verify that no events are issued via newItem if there were not reqeuested. */
public void testNoEvents() {
  delayTestFinish(5000);

  addHistoryListenerImpl(event -> fail("onHistoryChanged should not have been called"));

  History.newItem("testNoEvents", false);

  timer =
      new Timer() {
        @Override
        public void run() {
          finishTest();
        }
      };
  timer.schedule(500);
}
 
Example 12
Project: gwt-history   File: HistoryTest.java   View source code 6 votes vote down vote up
/**
 * Test to make sure that there is no double unescaping of hash values. See
 * https://bugzilla.mozilla.org/show_bug.cgi?id=483304
 */
@DoNotRunWith(Platform.HtmlUnitUnknown)
public void testNoDoubleTokenUnEscaping() {
  final String shouldBeEncoded = "abc%20abc";

  delayTestFinish(5000);

  History.newItem(shouldBeEncoded);
  History.newItem("someOtherToken");
  History.back();
  // allow browser to update the url
  timer =
      new Timer() {
        @Override
        public void run() {
          // make sure that value in url actually matches the original token
          assertEquals(shouldBeEncoded, History.getToken());
          finishTest();
        }
      };
  timer.schedule(200);
}
 
Example 13
Project: LAS   File: Print.java   View source code 6 votes vote down vote up
public static void it(String html) {
try {
    buildFrame(html);

    if (USE_TIMER) {
	Timer timer	= new Timer() {
		public void run() {
		    printFrame();
		}
	    };
	timer.schedule(TIMER_DELAY * 1000);
    } else {
	DeferredCommand.addCommand(new Command() {
		public void execute() {
		    printFrame();
		}
	    });
    }

} catch (Throwable exc) {
    Window.alert(exc.getMessage());
}
   }
 
Example 14
Project: gwt-material-patterns   File: GoogleDriveView.java   View source code 6 votes vote down vote up
@Inject
GoogleDriveView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    splash.show();
    Timer t = new Timer() {
        @Override
        public void run() {
            splash.hide();
        }
    };
    t.schedule(5000);
    search.addCloseHandler(event -> {
        appNav.setVisible(true);
        searchNav.setVisible(false);
    });
    search.addKeyUpHandler(event -> {
        List<DriveDTO> filteredFiles = DataHelper.getAllDrives().stream().filter(dto -> dto.getFileName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList());
        populateFiles(filteredFiles);
    });
    populateFiles(DataHelper.getAllDrives());
}
 
Example 15
Project: gwt-material-patterns   File: GoogleContactsView.java   View source code 6 votes vote down vote up
@Inject
GoogleContactsView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    splash.show();
    Timer t = new Timer() {
        @Override
        public void run() {
            splash.hide();
        }
    };
    t.schedule(5000);
    search.addCloseHandler(event -> {
        appNav.setVisible(true);
        searchNav.setVisible(false);
    });
    search.addKeyUpHandler(event -> {
        List<UserDTO> filteredUser = DataHelper.getAllUsers().stream().filter(dto -> dto.getName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList());
        populateUsers(filteredUser);
    });
    populateUsers(DataHelper.getAllUsers());
}
 
Example 16
Project: document-management-system   File: TabFolderWorkflow.java   View source code 6 votes vote down vote up
@Override
public void onChange(FolderEventConstant event) {
	if (event.equals(HasFolderEvent.FOLDER_CHANGED)) {
		Workflow.get().setTabFolderSelected();
		workflowManager.findProcessInstancesByNode(Workflow.get().getUuid());
	} else if (event.equals(HasFolderEvent.TAB_CHANGED)) {
		if (TabFolderComunicator.isWidgetExtensionVisible(this)) {
			Timer timer = new Timer() {
				@Override
				public void run() {
					workflowManager.fillWidth();
				}
			};
			timer.schedule(100);
		}
	}
}
 
Example 17
Project: document-management-system   File: TabDocumentWorkflow.java   View source code 6 votes vote down vote up
@Override
public void onChange(DocumentEventConstant event) {
	if (event.equals(HasDocumentEvent.DOCUMENT_CHANGED)) {
		Workflow.get().setTabDocumentSelected();
		workflowManager.findProcessInstancesByNode(Workflow.get().getUuid());
	} else if (event.equals(HasDocumentEvent.TAB_CHANGED)) {
		if (TabDocumentComunicator.isWidgetExtensionVisible(this)) {
			Timer timer = new Timer() {
				@Override
				public void run() {
					workflowManager.fillWidth();
				}
			};
			timer.schedule(100);
		}
	}
}
 
Example 18
Project: document-management-system   File: TabMailWorkflow.java   View source code 6 votes vote down vote up
@Override
public void onChange(MailEventConstant event) {
	if (event.equals(HasMailEvent.MAIL_CHANGED)) {
		Workflow.get().setTabMailSelected();
		workflowManager.findProcessInstancesByNode(Workflow.get().getUuid());
	} else if (event.equals(HasMailEvent.TAB_CHANGED)) {
		if (TabMailComunicator.isWidgetExtensionVisible(this)) {
			Timer timer = new Timer() {
				@Override
				public void run() {
					workflowManager.fillWidth();
				}
			};
			timer.schedule(100);
		}
	}
}
 
Example 19
Project: document-management-system   File: MsgPopup.java   View source code 6 votes vote down vote up
/**
 * logout
 */
private void logout(final HTML countDown, final int seconds) {
	Timer timer = new Timer() {
		@Override
		public void run() {
			countDown.setHTML(Main.i18n("ui.logout") + " " + secondsToHTML(seconds));

			if (seconds > 1) {
				logout(countDown, seconds - 1);
			} else {
				hide();
				Main.get().logoutPopup.logout();
			}
		}
	};

	timer.schedule(1000);
}
 
Example 20
Project: document-management-system   File: LogoutPopup.java   View source code 6 votes vote down vote up
/**
 * logoutAfterChat();
 */
private void logoutAfterChat() {
	Timer timer = new Timer() {
		@Override
		public void run() {
			if (!Main.get().mainPanel.bottomPanel.userInfo.isPendingToClose()) {
				authService.logout(callbackLogout);
			} else {
				logoutAfterChat();
			}
		}
	};

	timer.schedule(100); // Each minute seconds refreshing connected users
	Log.debug("Logout: void");
}
 
Example 21
Project: document-management-system   File: ChatRoomPopup.java   View source code 6 votes vote down vote up
/**
 * refreshUsersInRoom()
 */
private void refreshUsersInRoom(final String room) {
	if (chatRoomActive) {
		chatService.usersInRoom(room, new AsyncCallback<String>() {

			@Override
			public void onSuccess(String result) {
				usersInRoomText.setHTML("(" + result + ") " + Main.i18n("chat.users.in.room"));
				Timer timer = new Timer() {
					@Override
					public void run() {
						refreshUsersInRoom(room);
					}
				};

				timer.schedule(DELAY_USERS_IN_ROOM);
			}

			@Override
			public void onFailure(Throwable caught) {
				Main.get().showError("UsersInRoom", caught);
			}
		});
	}
}
 
Example 22
Project: document-management-system   File: FuturamaWalking.java   View source code 6 votes vote down vote up
/**
 * Evaluate
 */
public void evaluate(String name) {
	if (name.equals("futurama")) {
		left = -180;
		top = Window.getClientHeight() - 80 - 21;
		show();
		setPopupPosition(left, top);

		move = new Timer() {
			public void run() {
				left += 2;
				setPopupPosition(left, top);

				if (left < Window.getClientWidth() + 180) {
					move.schedule(40);
				} else {
					move.cancel();
					hide();
				}
			}
		};

		move.schedule(40);
	}
}
 
Example 23
Project: cuba   File: CubaFileDownloaderConnector.java   View source code 6 votes vote down vote up
public void downloadFileById(String resourceId) {
    final String url = getResourceUrl(resourceId);
    if (url != null && !url.isEmpty()) {
        final IFrameElement iframe = Document.get().createIFrameElement();

        Style style = iframe.getStyle();
        style.setVisibility(Style.Visibility.HIDDEN);
        style.setHeight(0, Style.Unit.PX);
        style.setWidth(0, Style.Unit.PX);

        iframe.setFrameBorder(0);
        iframe.setTabIndex(-1);
        iframe.setSrc(url);
        RootPanel.getBodyElement().appendChild(iframe);

        Timer removeTimer = new Timer() {
            @Override
            public void run() {
                iframe.removeFromParent();
            }
        };
        removeTimer.schedule(60 * 1000);
    }
}
 
Example 24
Project: Wiab.pro   File: SearchPresenter.java   View source code 6 votes vote down vote up
SearchPresenter(TimerService scheduler, Search search,
    SearchesService searchPatternsService,
    SearchPanelView searchUi, WaveActionHandler actionHandler,
    SearchesModifyHandler searchesModifyHandler) {
  this.search = search;
  this.searchesService = searchPatternsService;
  this.searchUi = searchUi;
  this.scheduler = scheduler;
  this.actionHandler = actionHandler;
  this.searchesModifyHandler = searchesModifyHandler;

  digestsUpdateTimer = new Timer() {

    @Override
    public void run() {
      digestUis.each(new IdentityMap.ProcV<DigestView, Digest>() {
        
        @Override
        public void apply(DigestView digestView, Digest digest) {
          digestView.update();
        }
      });
    }
  };
}
 
Example 25
Project: ontobrowser   File: HistoryPopup.java   View source code 6 votes vote down vote up
@Override
public void onKeyDown(KeyDownEvent event) {
	int keyCode = event.getNativeKeyCode();
	if((keyCode == KEY_BACKSPACE || keyCode >= KEY_DELETE) 
			&& keyCode != 91 && keyCode != 93) { // Command/Window keyboard keys
		cancelTimer();
		timer = new Timer() {
			public void run() {
				dataProvider.setFilter(filterTextBox.getValue());
			}
		};

		timer.schedule(TIMEOUT);
	} else if(keyCode == KEY_ENTER) {
		cancelTimer();
		dataProvider.setFilter(filterTextBox.getValue());
	}
}
 
Example 26
Project: ontobrowser   File: ApproveRejectComposite.java   View source code 6 votes vote down vote up
@Override
public void onKeyDown(KeyDownEvent event) {
	int keyCode = event.getNativeKeyCode();
	if((keyCode == KEY_BACKSPACE || keyCode >= KEY_DELETE) 
			&& keyCode != 91 && keyCode != 93) { // Command/Window keyboard keys
		cancelTimer();
		timer = new Timer() {
			public void run() {
				dataProvider.setFilter(filterTextBox.getValue());
			}
		};

		timer.schedule(TIMEOUT);
	} else if(keyCode == KEY_ENTER) {
		cancelTimer();
		dataProvider.setFilter(filterTextBox.getValue());
	}
}
 
Example 27
Project: umlet   File: Notification.java   View source code 6 votes vote down vote up
private static void fade(final Element element, final float startOpacity, final float endOpacity, final int totalTimeMillis) {
	final int numberOfSteps = 30;
	int stepLengthMillis = totalTimeMillis / numberOfSteps;
	stepCount = 0;
	final float deltaOpacity = (endOpacity - startOpacity) / numberOfSteps;
	timerFader = new Timer() {
		@Override
		public void run() {
			float opacity = startOpacity + stepCount * deltaOpacity;
			DOM.setStyleAttribute(element, "opacity", Float.toString(opacity));

			stepCount++;
			if (stepCount == numberOfSteps) {
				DOM.setStyleAttribute(element, "opacity", Float.toString(endOpacity));
				cancel();
			}
		}
	};
	timerFader.scheduleRepeating(stepLengthMillis);
}
 
Example 28
Project: playn   File: WebGLDemo.java   View source code 6 votes vote down vote up
@Override
public void onModuleLoad() {
  canvas = Document.get().createElement("canvas").cast();
  Document.get().getBody().appendChild(canvas);
  canvas.setWidth(CANVAS_WIDTH);
  canvas.setHeight(CANVAS_HEIGHT);

  gl = WebGLRenderingContext.getContext(canvas);
  gl.viewport(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);

  init();

  new Timer() {
    @Override
    public void run() {
      draw();
    }
  }.scheduleRepeating(100);
}
 
Example 29
Project: firefly   File: IrsaCatalogTask.java   View source code 6 votes vote down vote up
private void handleBackgrounding(final MonitorItem monItem) {
    DefaultWorkingWidget working= new DefaultWorkingWidget((ClickHandler)null);
    working.setText("Backgrounding...");
    final MaskPane maskPane = new MaskPane(getMaskWidget(), working);
    maskPane.show();
    Timer t= new Timer() {
        @Override
        public void run() {
            BackgroundMonitor monitor= Application.getInstance().getBackgroundMonitor();
            if (doAnimation) {
                Application.getInstance().getBackgroundManager().animateToManager(_animationX, _animationY, 1300);
            }
            monItem.setWatchable(true);
            monItem.setImmediately(showImmediately);
            monitor.addItem(monItem);
            _response.status(CatalogSearchResponse.RequestStatus.BACKGROUNDING);
            maskPane.hide();
        }
    };
    t.schedule(1000);
}
 
Example 30
Project: listmaker   File: ItemsTable.java   View source code 6 votes vote down vote up
protected void expando(final FlowPanel div2, final DivElement[] notes)
{
	Timer t = new Timer()
	{
		int i = 0;
		final int last = notes.length;

		@Override
		public void run()
		{
			if (i >= last)
				this.cancel();
			else
				div2.getElement().appendChild(notes[i++]);
		}
	};
	// Eye candy
	t.scheduleRepeating(10);
}
 
Example 31
Project: gwt-material   File: MaterialToastTest.java   View source code 6 votes vote down vote up
public void testToastWithCallback() {
    final boolean[] isCallbackFired = new boolean[1];
    new MaterialToast(() -> {
        isCallbackFired[0] = true;
    }).toast("callback", 1000);
    Timer t = new Timer() {
        @Override
        public void run() {
            assertTrue(isCallbackFired[0]);
        }
    };
    t.schedule(1000);
    Element toastContainer = $("body").find("#toast-container").asElement();
    assertNotNull(toastContainer);
    toastContainer.setInnerHTML("");
}
 
Example 32
Project: forplay   File: WebGLDemo.java   View source code 6 votes vote down vote up
@Override
public void onModuleLoad() {
  canvas = Document.get().createElement("canvas").cast();
  Document.get().getBody().appendChild(canvas);
  canvas.setWidth(CANVAS_WIDTH);
  canvas.setHeight(CANVAS_HEIGHT);

  gl = WebGLRenderingContext.getContext(canvas);
  gl.viewport(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);

  init();

  new Timer() {
    @Override
    public void run() {
      draw();
    }
  }.scheduleRepeating(100);
}
 
Example 33
Project: guava-libraries   File: MapMaker.java   View source code 6 votes vote down vote up
private void scheduleRemoval(final K key, final V value) {
  // from MapMaker
  /*
   * TODO: Keep weak reference to map, too. Build a priority queue out of the entries themselves
   * instead of creating a task per entry. Then, we could have one recurring task per map (which
   * would clean the entire map and then reschedule itself depending upon when the next
   * expiration comes). We also want to avoid removing an entry prematurely if the entry was set
   * to the same value again.
   */
  Timer timer = new Timer() {
    @Override
    public void run() {
      remove(key, value);
    }
  };
  timer.schedule((int) expirationMillis);
}
 
Example 34
Project: wbi   File: SeriesView.java   View source code 6 votes vote down vote up
/**
 * Set whether scrollbars are enabled.
 *
 * @param enabled Whether scrollbars are enabled.
 */
public void setScrollEnabled(final boolean enabled) {
    final Element element = getElement();
    boolean scrollEnabled = element.hasClassName(CLASS_NAME_SCROLL);

    if ((scrollEnabled && !enabled) || (!scrollEnabled && enabled)) {
        if (enabled) {
            (new Timer() {
                @Override
                public void run() {
                    element.addClassName(CLASS_NAME_SCROLL);
                }
            }).schedule(SCROLL_DELAY);
        } else {
            element.removeClassName(CLASS_NAME_SCROLL);
        }
    }
}
 
Example 35
Project: che   File: DelayableWebSocketConnection.java   View source code 6 votes vote down vote up
@Override
public void open() {
  final int delay = propertyManager.getConnectionDelay(url);

  if (isClosed() || isClosing()) {
    if (delay == 0) {
      webSocketJsoWrapper = WebSocketJsoWrapper.connect(url, endpoint);
    } else {
      new Timer() {
        @Override
        public void run() {
          webSocketJsoWrapper = WebSocketJsoWrapper.connect(url, endpoint);
        }
      }.schedule(delay);
    }
  } else {
    Log.warn(getClass(), "Opening already opened or connecting web socket.");
  }
}
 
Example 36
Project: che   File: PopupLoaderImpl.java   View source code 6 votes vote down vote up
@Override
public void setSuccess() {
  // Stop animation timer
  playTimer.cancel();

  // Start hide animation
  getElement().addClassName("outDown");

  // Remove from the parent
  new Timer() {
    @Override
    public void run() {
      removeFromParent();
    }
  }.schedule(1000);
}
 
Example 37
Project: che   File: TooltipHint.java   View source code 6 votes vote down vote up
private void close() {
  opacity = 10;

  // Hide animation
  new Timer() {
    @Override
    public void run() {
      opacity--;
      if (opacity <= 0) {
        cancel();
        getElement().getParentElement().removeChild(getElement());
      } else {
        getElement().getStyle().setProperty("opacity", "0." + opacity);
      }
    }
  }.scheduleRepeating(50);
}
 
Example 38
Project: che   File: FullTextSearchViewImpl.java   View source code 6 votes vote down vote up
@Override
public void showDialog() {
  acceptButton.setEnabled(false);
  isUseFileMask.setValue(false);
  filesMask.setEnabled(false);
  isUseDirectory.setValue(false);
  wholeWordsOnly.setValue(false);
  directory.setEnabled(false);
  selectPathButton.setEnabled(false);
  directory.setText("");
  filesMask.setText("*.*");
  directory.setText("/");
  errLabel.setText("");

  new Timer() {
    @Override
    public void run() {
      text.setFocus(true);
    }
  }.schedule(100);

  super.show();
}
 
Example 39
Project: che   File: OpenFileAction.java   View source code 6 votes vote down vote up
private void scrollToLine(EditorPartPresenter editor, String lineParam) {
  if (!(editor instanceof TextEditor)) {
    return;
  }
  new Timer() {
    @Override
    public void run() {
      try {
        int lineNumber = parseInt(lineParam);
        TextEditor textEditor = (TextEditor) editor;
        textEditor.getDocument().setCursorPosition(new TextPosition(lineNumber - 1, 0));
      } catch (NumberFormatException e) {
        Log.error(getClass(), localization.fileToOpenLineIsNotANumber());
      }
    }
  }.schedule(300);
}
 
Example 40
Project: viaja-facil   File: M.java   View source code 6 votes vote down vote up
private void showSelectFromMap() {
	if(!showedSelectFromMapOnce) {
		showedSelectFromMapOnce = true;
		final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true);
	    simplePopup.setWidth("150px");
	    simplePopup.setWidget(new HTML(CONSTANTS.selectFromMap()));
	    simplePopup.addStyleName("popup");
	    simplePopup.center();
	    Timer t = new Timer() {
			public void run() {
				simplePopup.hide();
			}
		};
		t.schedule(2000);
	}
}