|
Lines 20-47
Link Here
|
| 20 |
public abstract class ProgressContentProvider implements |
20 |
public abstract class ProgressContentProvider implements |
| 21 |
IProgressUpdateCollector, IStructuredContentProvider { |
21 |
IProgressUpdateCollector, IStructuredContentProvider { |
| 22 |
|
22 |
|
|
|
23 |
private boolean overrideValue; |
| 23 |
/** |
24 |
/** |
| 24 |
* Return whether or not we are filtering debug items. |
25 |
* Return whether or not we check the preferences or overide. |
| 25 |
*/ |
26 |
*/ |
| 26 |
protected boolean filterDebug; |
27 |
private boolean override = false; |
| 27 |
|
28 |
|
| 28 |
/** |
29 |
/** |
| 29 |
* Create a new instance of the receiver with all of the |
30 |
* Create a new instance of the receiver with all of the |
| 30 |
* default values. |
31 |
* default values. |
| 31 |
*/ |
32 |
*/ |
| 32 |
public ProgressContentProvider() { |
33 |
public ProgressContentProvider() { |
| 33 |
this(!ProgressViewUpdater.getSingleton().debug); |
34 |
ProgressViewUpdater.getSingleton().addCollector(this); |
| 34 |
} |
35 |
} |
| 35 |
|
36 |
|
| 36 |
/** |
37 |
/** |
| 37 |
* Create a new instance of the receiver with a flag to |
38 |
* Create a new instance of the receiver with a flag to |
| 38 |
* indicate if there will be debug info shown or not. |
39 |
* indicate if there will be debug info shown or not. |
| 39 |
* @param noDebug If true debug information will be shown |
40 |
* @param debug If true debug information will be shown |
| 40 |
* if the debug flag in the ProgressManager is true. |
41 |
* if the debug flag in the ProgressManager is true. |
| 41 |
*/ |
42 |
*/ |
| 42 |
public ProgressContentProvider(boolean noDebug) { |
43 |
public ProgressContentProvider(boolean debug) { |
| 43 |
ProgressViewUpdater.getSingleton().addCollector(this); |
44 |
this(); |
| 44 |
filterDebug = noDebug; |
45 |
override = true; |
|
|
46 |
overrideValue = debug; |
| 45 |
} |
47 |
} |
| 46 |
|
48 |
|
| 47 |
/* |
49 |
/* |
|
Lines 51-57
Link Here
|
| 51 |
*/ |
53 |
*/ |
| 52 |
public Object[] getElements(Object inputElement) { |
54 |
public Object[] getElements(Object inputElement) { |
| 53 |
|
55 |
|
| 54 |
return ProgressManager.getInstance().getRootElements(!filterDebug); |
56 |
return ProgressManager.getInstance().getRootElements(debug()); |
| 55 |
} |
57 |
} |
| 56 |
|
58 |
|
| 57 |
/* |
59 |
/* |
|
Lines 72-76
Link Here
|
| 72 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
74 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
| 73 |
//No change when input changes |
75 |
//No change when input changes |
| 74 |
} |
76 |
} |
|
|
77 |
|
| 78 |
/** |
| 79 |
* Return whether or not we are debugging. Check the |
| 80 |
* system settings unless we are overiding them. |
| 81 |
* @return boolean <code>true</code> if debug |
| 82 |
* (system) jobs are being shown. |
| 83 |
*/ |
| 84 |
public boolean debug(){ |
| 85 |
if(override) |
| 86 |
return overrideValue; |
| 87 |
return ProgressViewUpdater.getSingleton().debug; |
| 88 |
|
| 89 |
} |
| 75 |
|
90 |
|
| 76 |
} |
91 |
} |