Package org.erlide.ui.util

Source Code of org.erlide.ui.util.BackendManagerPopup

/*******************************************************************************
* Copyright (c) 2006 Vlad Dumitrescu and others.
* 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:
*     Vlad Dumitrescu
*******************************************************************************/
package org.erlide.ui.util;

import org.eclipse.core.resources.IProject;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.erlide.backend.BackendCore;
import org.erlide.backend.api.IBackend;
import org.erlide.backend.api.IBackendListener;
import org.erlide.util.ErlLogger;

public final class BackendManagerPopup implements IBackendListener {

    private static final IBackendListener fInstance = new BackendManagerPopup();

    private BackendManagerPopup() {
    }

    public static void init() {
        BackendCore.getBackendManager().addBackendListener(fInstance);
    }

    @Override
    public void runtimeAdded(final IBackend b) {
        DisplayUtils.asyncExec(new Runnable() {

            @Override
            public void run() {
                // PopupDialog.showBalloon("Backend notification", "Added "
                // + b.getInfo().getName(), DELAY);
            }
        });
    }

    @Override
    public void runtimeRemoved(final IBackend b) {
        ErlLogger.debug("$$ removed backend " + b.getName());
        final IWorkbench workbench = PlatformUI.getWorkbench();
        final Display display = workbench.getDisplay();
        display.asyncExec(new Runnable() {

            @Override
            public void run() {
                // PopupDialog.showBalloon("Backend notification", "Removed "
                // + b.getInfo().getName(), DELAY);
            }
        });
    }

    @Override
    public void moduleLoaded(final IBackend backend, final IProject project,
            final String moduleName) {
    }
}
TOP

Related Classes of org.erlide.ui.util.BackendManagerPopup

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.