view dwtx/jface/action/IStatusLineManager.d @ 26:87d8cf0a3074

StatusLine
author Frank Benoit <benoit@tionex.de>
date Thu, 03 Apr 2008 05:03:09 +0200
parents
children
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 * Port to the D programming language:
 *     Frank Benoit <benoit@tionex.de>
 *******************************************************************************/
module dwtx.jface.action.IStatusLineManager;

import dwtx.jface.action.IContributionManager;

import dwt.graphics.Image;
import dwtx.core.runtime.IProgressMonitor;

import dwt.dwthelper.utils;

/**
 * The <code>IStatusLineManager</code> interface provides protocol
 * for displaying messages on a status line, for monitoring progress,
 * and for managing contributions to the status line.
 * <p>
 * <b>Note:</b> An error message overrides the current message until
 * the error message is cleared.
 * </p><p>
 * This package also provides a concrete status line manager implementation,
 * {@link StatusLineManager <code>StatusLineManager</code>}.
 * </p>
 */
public interface IStatusLineManager : IContributionManager {
    /**
     * Returns a progress monitor which reports progress
     * in the status line.
     *
     * @return the progress monitor
     *
     * Note: There is a delay after a beginTask message before the monitor is shown.
     *   This may not be appropriate for all apps.
     */
    public IProgressMonitor getProgressMonitor();

    /**
     * Returns whether the cancel button on the status line's progress monitor
     * is enabled.
     *
     * @return <code>true</code> if the cancel button is enabled, or <code>false</code> if not
     */
    public bool isCancelEnabled();

    /**
     * Sets whether the cancel button on the status line's progress monitor
     * is enabled.
     *
     * @param enabled <code>true</code> if the cancel button is enabled, or <code>false</code> if not
     */
    public void setCancelEnabled(bool enabled);

    /**
     * Sets the error message text to be displayed on the status line.
     * The image on the status line is cleared.
     * <p>
     * An error message overrides the current message until the error
     * message is cleared (set to <code>null</code>).
     * </p>
     *
     * @param message the error message, or <code>null</code> to clear
     *      the current error message.
     */
    public void setErrorMessage(String message);

    /**
     * Sets the image and error message to be displayed on the status line.
     * <p>
     * An error message overrides the current message until the error
     * message is cleared (set to <code>null</code>).
     * </p>
     *
     * @param image the image to use, or <code>null</code> for no image
     * @param message the error message, or <code>null</code> to clear
     *      the current error message.
     */
    public void setErrorMessage(Image image, String message);

    /**
     * Sets the message text to be displayed on the status line.
     * The image on the status line is cleared.
     * <p>
     * This method replaces the current message but does not affect the
     * error message. That is, the error message, if set, will continue
     * to be displayed until it is cleared (set to <code>null</code>).
     * </p>
     *
     * @param message the message, or <code>null</code> for no message
     */
    public void setMessage(String message);

    /**
     * Sets the image and message to be displayed on the status line.
     * <p>
     * This method replaces the current message but does not affect the
     * error message. That is, the error message, if set, will continue
     * to be displayed until it is cleared (set to <code>null</code>).
     * </p>
     *
     * @param image the image to use, or <code>null</code> for no image
     * @param message the message, or <code>null</code> for no message
     */
    public void setMessage(Image image, String message);
}