KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > progress > IProgressConstants


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.progress;
12
13 import org.eclipse.core.runtime.QualifiedName;
14 import org.eclipse.ui.PlatformUI;
15
16 /**
17  * Constants relating to progress UI functionality of the workbench plug-in.
18  * <p>
19  * The four constants define property keys that are used to associate
20  * UI related information with Jobs (<code>org.eclipse.core.runtime.jobs.Job</code>).
21  *
22  * @see org.eclipse.core.runtime.jobs.Job#setProperty
23  * @since 3.0
24  */

25 public interface IProgressConstants {
26
27     /**
28      * Common prefix for properties defined in this interface.
29      */

30     static final String JavaDoc PROPERTY_PREFIX = PlatformUI.PLUGIN_ID
31             + ".workbench.progress"; //$NON-NLS-1$
32

33     /**
34      * This property provides a hint to the progress UI to keep Jobs
35      * in the UI after they have finished. This can be used to communicate results of a Job
36      * back to the user.
37      * <p>
38      * The property must be of type <code>Boolean</code> and the hint is used
39      * if its value is <code>true</code>.
40      * </p>
41      */

42     public static final QualifiedName KEEP_PROPERTY = new QualifiedName(
43             PROPERTY_PREFIX, "keep"); //$NON-NLS-1$
44

45     /**
46      * The KEEPONE_PROPERTY is an extension to the KEEP_PROPERTY, that provides a hint
47      * to the progress UI to ensure that only a single Job of a Job family is kept in the
48      * set of kept Jobs. That is, whenever a Job that has the KEEPONE_PROPERTY starts or finishes,
49      * all other kept Jobs of the same family are removed first.
50      * <p>
51      * Membership to family is determined using a Job's <code>belongsTo</code>
52      * method. The progress service will pass each job that currently exists in the
53      * view to the <code>belongsTo</code> method of a newly added job. Clients who
54      * set the <code>KEEPONE_PROPERTY</code> must implement a <code>belongsTo</code>
55      * method that determines if the passed job is of the same family as their job
56      * and return <code>true</code> if it is.
57      * </p>
58      * <p>
59      * Please note that other Jobs of the same family are only removed if they have finished.
60      * Non finished jobs of the same family are left alone.
61      * </p>
62      **/

63     public static final QualifiedName KEEPONE_PROPERTY = new QualifiedName(
64             PROPERTY_PREFIX, "keepone"); //$NON-NLS-1$
65

66     /**
67      * This property is used to associate an <code>IAction</code> with a Job.
68      * If the Job is shown in the UI, the action might be represented as a button or
69      * hyper link to allow the user to trigger a job specific action, like showing
70      * the Job's results.
71      * <p>
72      * The progress UI will track the enabled state of the action and its tooltip text.
73      * </p>
74      * <p>
75      * If the action implements <code>ActionFactory.IWorkbenchAction</code>, its
76      * <code>dispose</code> method will be called as soon as the Job is finally
77      * removed from the set of kept jobs.
78      * </p>
79      * @see org.eclipse.jface.action.IAction
80      * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction
81      **/

82     public static final QualifiedName ACTION_PROPERTY = new QualifiedName(
83             PROPERTY_PREFIX, "action"); //$NON-NLS-1$
84

85     /**
86      * This property is used to associate an <code>ImageDescriptor</code> with a Job.
87      * If the Job is shown in the UI, this descriptor is used to create an icon that
88      * represents the Job.
89      * <p>
90      * Please note, that this property is only used if no <code>ImageDescriptor</code> has been
91      * registered for the Job family with the <code>IProgressService</code>.
92      * </p>
93      * @see org.eclipse.jface.resource.ImageDescriptor
94      * @see org.eclipse.ui.progress.IProgressService
95      **/

96     public static final QualifiedName ICON_PROPERTY = new QualifiedName(
97             PROPERTY_PREFIX, "icon"); //$NON-NLS-1$
98

99     /**
100      * Constant for the progress view id.
101      */

102     public static String JavaDoc PROGRESS_VIEW_ID = "org.eclipse.ui.views.ProgressView"; //$NON-NLS-1$
103

104     /**
105      * This is a property set on a user job if the user has not decided to
106      * run the job in the background.
107      * The value is set to <code>true</code> when the job starts and set to
108      * <code>false</code> if the user subsequently decides to complete the job in the
109      * background.
110      * <p>
111      * This property is not intended to be set by clients.
112      * </p>
113      * @see org.eclipse.core.runtime.jobs.Job#isUser()
114      */

115     public static final QualifiedName PROPERTY_IN_DIALOG = new QualifiedName(
116             IProgressConstants.PROPERTY_PREFIX, "inDialog"); //$NON-NLS-1$
117

118     /**
119      * This property provides a hint to the progress UI to not prompt on errors
120      * immediately but instead make the errors available through the progress UI.
121      * <p>
122      * The property must be of type <code>Boolean</code> and the hint is used
123      * if its value is <code>true</code>.
124      * </p>
125      * @since 3.1
126      */

127     public static final QualifiedName NO_IMMEDIATE_ERROR_PROMPT_PROPERTY = new QualifiedName(
128             PROPERTY_PREFIX, "delayErrorPrompt"); //$NON-NLS-1$
129
}
130
Popular Tags