blob: 2ecdeeb4ed7c4ab954bfe9c65afbeccc0693cb01 [file] [log] [blame]
/*
*
* 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Florian Pirchner - Initial implementation
* Loetz GmbH&Co.KG
*
*/
package org.eclipse.osbp.vaadin.emf.views;
import com.vaadin.ui.UI;
// TODO: Auto-generated Javadoc
/**
* An abstraction to sync changes with the UI. Is required to sync model changes
* with the UI, since the model could also become modified in a NON-UI-Thread.
*/
public class UiSync {
/** The ui. */
private final UI ui;
/**
* Instantiates a new ui sync.
*
* @param ui
* the ui
*/
public UiSync(UI ui) {
super();
this.ui = ui;
}
/**
* Syncs the runnable with the UI-Thread.
*
* @param runnable
* the runnable
*/
public void sync(Runnable runnable) {
ui.accessSynchronously(runnable);
}
}