001: /*******************************************************************************
002: * Copyright (c) 2004, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.progress;
011:
012: import org.eclipse.core.runtime.QualifiedName;
013: import org.eclipse.ui.PlatformUI;
014:
015: /**
016: * Constants relating to progress UI functionality of the workbench plug-in.
017: * <p>
018: * The four constants define property keys that are used to associate
019: * UI related information with Jobs (<code>org.eclipse.core.runtime.jobs.Job</code>).
020: *
021: * @see org.eclipse.core.runtime.jobs.Job#setProperty
022: * @since 3.0
023: */
024: public interface IProgressConstants {
025:
026: /**
027: * Common prefix for properties defined in this interface.
028: */
029: static final String PROPERTY_PREFIX = PlatformUI.PLUGIN_ID
030: + ".workbench.progress"; //$NON-NLS-1$
031:
032: /**
033: * This property provides a hint to the progress UI to keep Jobs
034: * in the UI after they have finished. This can be used to communicate results of a Job
035: * back to the user.
036: * <p>
037: * The property must be of type <code>Boolean</code> and the hint is used
038: * if its value is <code>true</code>.
039: * </p>
040: */
041: public static final QualifiedName KEEP_PROPERTY = new QualifiedName(
042: PROPERTY_PREFIX, "keep"); //$NON-NLS-1$
043:
044: /**
045: * The KEEPONE_PROPERTY is an extension to the KEEP_PROPERTY, that provides a hint
046: * to the progress UI to ensure that only a single Job of a Job family is kept in the
047: * set of kept Jobs. That is, whenever a Job that has the KEEPONE_PROPERTY starts or finishes,
048: * all other kept Jobs of the same family are removed first.
049: * <p>
050: * Membership to family is determined using a Job's <code>belongsTo</code>
051: * method. The progress service will pass each job that currently exists in the
052: * view to the <code>belongsTo</code> method of a newly added job. Clients who
053: * set the <code>KEEPONE_PROPERTY</code> must implement a <code>belongsTo</code>
054: * method that determines if the passed job is of the same family as their job
055: * and return <code>true</code> if it is.
056: * </p>
057: * <p>
058: * Please note that other Jobs of the same family are only removed if they have finished.
059: * Non finished jobs of the same family are left alone.
060: * </p>
061: **/
062: public static final QualifiedName KEEPONE_PROPERTY = new QualifiedName(
063: PROPERTY_PREFIX, "keepone"); //$NON-NLS-1$
064:
065: /**
066: * This property is used to associate an <code>IAction</code> with a Job.
067: * If the Job is shown in the UI, the action might be represented as a button or
068: * hyper link to allow the user to trigger a job specific action, like showing
069: * the Job's results.
070: * <p>
071: * The progress UI will track the enabled state of the action and its tooltip text.
072: * </p>
073: * <p>
074: * If the action implements <code>ActionFactory.IWorkbenchAction</code>, its
075: * <code>dispose</code> method will be called as soon as the Job is finally
076: * removed from the set of kept jobs.
077: * </p>
078: * @see org.eclipse.jface.action.IAction
079: * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction
080: **/
081: public static final QualifiedName ACTION_PROPERTY = new QualifiedName(
082: PROPERTY_PREFIX, "action"); //$NON-NLS-1$
083:
084: /**
085: * This property is used to associate an <code>ImageDescriptor</code> with a Job.
086: * If the Job is shown in the UI, this descriptor is used to create an icon that
087: * represents the Job.
088: * <p>
089: * Please note, that this property is only used if no <code>ImageDescriptor</code> has been
090: * registered for the Job family with the <code>IProgressService</code>.
091: * </p>
092: * @see org.eclipse.jface.resource.ImageDescriptor
093: * @see org.eclipse.ui.progress.IProgressService
094: **/
095: public static final QualifiedName ICON_PROPERTY = new QualifiedName(
096: PROPERTY_PREFIX, "icon"); //$NON-NLS-1$
097:
098: /**
099: * Constant for the progress view id.
100: */
101: public static String PROGRESS_VIEW_ID = "org.eclipse.ui.views.ProgressView"; //$NON-NLS-1$
102:
103: /**
104: * This is a property set on a user job if the user has not decided to
105: * run the job in the background.
106: * The value is set to <code>true</code> when the job starts and set to
107: * <code>false</code> if the user subsequently decides to complete the job in the
108: * background.
109: * <p>
110: * This property is not intended to be set by clients.
111: * </p>
112: * @see org.eclipse.core.runtime.jobs.Job#isUser()
113: */
114: public static final QualifiedName PROPERTY_IN_DIALOG = new QualifiedName(
115: IProgressConstants.PROPERTY_PREFIX, "inDialog"); //$NON-NLS-1$
116:
117: /**
118: * This property provides a hint to the progress UI to not prompt on errors
119: * immediately but instead make the errors available through the progress UI.
120: * <p>
121: * The property must be of type <code>Boolean</code> and the hint is used
122: * if its value is <code>true</code>.
123: * </p>
124: * @since 3.1
125: */
126: public static final QualifiedName NO_IMMEDIATE_ERROR_PROMPT_PROPERTY = new QualifiedName(
127: PROPERTY_PREFIX, "delayErrorPrompt"); //$NON-NLS-1$
128: }
|