| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.ecview.extension.grid.tests.presentation; |
| |
| import java.util.concurrent.ExecutionException; |
| import java.util.concurrent.Future; |
| import java.util.concurrent.TimeUnit; |
| import java.util.concurrent.TimeoutException; |
| |
| import com.vaadin.server.VaadinRequest; |
| import com.vaadin.ui.UI; |
| import com.vaadin.ui.UIDetachedException; |
| |
| @SuppressWarnings("serial") |
| public class DefaultUI extends UI { |
| |
| @Override |
| protected void init(VaadinRequest request) { |
| |
| } |
| |
| @Override |
| public void accessSynchronously(Runnable runnable) |
| throws UIDetachedException { |
| runnable.run(); |
| } |
| |
| @Override |
| public Future<Void> access(Runnable runnable) { |
| runnable.run(); |
| return new InternalFuture(); |
| } |
| |
| private static class InternalFuture implements Future<Void> { |
| |
| @Override |
| public boolean cancel(boolean mayInterruptIfRunning) { |
| return false; |
| } |
| |
| @Override |
| public boolean isCancelled() { |
| return false; |
| } |
| |
| @Override |
| public boolean isDone() { |
| return true; |
| } |
| |
| @Override |
| public Void get() throws InterruptedException, ExecutionException { |
| return null; |
| } |
| |
| @Override |
| public Void get(long timeout, TimeUnit unit) |
| throws InterruptedException, ExecutionException, |
| TimeoutException { |
| return null; |
| } |
| } |
| } |