01: /*******************************************************************************
02: * Copyright (c) 2006, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal;
11:
12: import org.eclipse.core.runtime.jobs.Job;
13:
14: /**
15: * @since 3.3
16: *
17: */
18: public class InternalSaveable {
19:
20: private Job backgroundSaveJob;
21:
22: /**
23: * @return
24: */
25: /* package */Job getBackgroundSaveJob() {
26: return backgroundSaveJob;
27: }
28:
29: /**
30: * @param savingInBackground
31: * The savingInBackground to set.
32: */
33: /* package */void setBackgroundSaveJob(Job backgroundSaveJob) {
34: this .backgroundSaveJob = backgroundSaveJob;
35: }
36:
37: /**
38: * @return
39: */
40: /* package */boolean isSavingInBackground() {
41: Job saveJob = backgroundSaveJob;
42: if (saveJob == null) {
43: return false;
44: }
45: return (backgroundSaveJob.getState() & (Job.WAITING | Job.RUNNING)) != 0;
46: }
47:
48: }
|