/*******************************************************************************
 * Copyright (c) 2015-2016 Oak Ridge National Laboratory.
 * 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
 *******************************************************************************/
package org.csstudio.display.builder.editor;

import java.io.File;
import java.io.FileInputStream;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

import org.csstudio.display.builder.model.DisplayModel;
import org.csstudio.display.builder.model.persist.ModelReader;
import org.csstudio.display.builder.model.util.NamedDaemonPool;
import org.csstudio.display.builder.representation.javafx.JFXRepresentation;

import javafx.scene.Scene;

/** Editor utility
 *  @author Kay Kasemir
 */
@SuppressWarnings("nls")
public class EditorUtil
{
    private static final ExecutorService executor = NamedDaemonPool.createThreadPool("DisplayEditor");

    /** @return ExecutorService for thread pool meant for editor-related background tasks */
    public static ExecutorService getExecutor()
    {
        return executor;
    }

    public static void setSceneStyle(final Scene scene)
    {
        JFXRepresentation.setSceneStyle(scene);
        scene.getStylesheets().add(EditorUtil.class.getResource("opieditor.css").toExternalForm());
    }

    /** Load model from file
     *  @param file File that contains the model
     *  @return
     */
    public Future<DisplayModel> loadModel(final File file)
    {
        final Callable<DisplayModel> task = () ->
        {
            final ModelReader reader = new ModelReader(new FileInputStream(file));
            return reader.readModel();
        };
        return executor.submit(task);
    }
}

@@ -522,287 +522,41 @@
 ava.
-io.File;%0Aimport java.io.FileInputStream;%0Aimport java.util.concurrent.Callable;%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.Future;%0A%0Aimport org.csstudio.display.builder.model.DisplayModel;%0Aimport org.csstudio.display.builder.model.persist.ModelReader;
+util.concurrent.ExecutorService;%0A
 %0Aimp
@@ -1322,412 +1322,7 @@
    %7D
-%0A%0A    /** Load model from file%0A     *  @param file File that contains the model%0A     *  @return%0A     */%0A    public Future%3CDisplayModel%3E loadModel(final File file)%0A    %7B%0A        final Callable%3CDisplayModel%3E task = () -%3E%0A        %7B%0A            final ModelReader reader = new ModelReader(new FileInputStream(file));%0A            return reader.readModel();%0A        %7D;%0A        return executor.submit(task);%0A    %7D
 %0A%7D%0A

Remove unused loadModel()