Lines 16-28
Link Here
|
16 |
import java.util.ArrayList; |
16 |
import java.util.ArrayList; |
17 |
|
17 |
|
18 |
import org.eclipse.core.runtime.IStatus; |
18 |
import org.eclipse.core.runtime.IStatus; |
|
|
19 |
import org.eclipse.jface.resource.JFaceResources; |
20 |
import org.eclipse.jface.viewers.ITableFontProvider; |
19 |
import org.eclipse.jface.viewers.ITableLabelProvider; |
21 |
import org.eclipse.jface.viewers.ITableLabelProvider; |
20 |
import org.eclipse.jface.viewers.LabelProvider; |
22 |
import org.eclipse.jface.viewers.LabelProvider; |
|
|
23 |
import org.eclipse.swt.graphics.Font; |
21 |
import org.eclipse.swt.graphics.Image; |
24 |
import org.eclipse.swt.graphics.Image; |
22 |
|
25 |
|
23 |
public class LogViewLabelProvider |
26 |
public class LogViewLabelProvider |
24 |
extends LabelProvider |
27 |
extends LabelProvider |
25 |
implements ITableLabelProvider { |
28 |
implements ITableLabelProvider, ITableFontProvider { |
26 |
|
29 |
|
27 |
private static int MAX_LABEL_LENGTH = 200; |
30 |
private static int MAX_LABEL_LENGTH = 200; |
28 |
|
31 |
|
Lines 34-46
Link Here
|
34 |
private Image hierarchicalImage; |
37 |
private Image hierarchicalImage; |
35 |
ArrayList consumers = new ArrayList(); |
38 |
ArrayList consumers = new ArrayList(); |
36 |
|
39 |
|
37 |
public LogViewLabelProvider() { |
40 |
private LogView logView; |
|
|
41 |
|
42 |
public LogViewLabelProvider(LogView logView) { |
38 |
errorImage = SharedImages.getImage(SharedImages.DESC_ERROR_ST_OBJ); |
43 |
errorImage = SharedImages.getImage(SharedImages.DESC_ERROR_ST_OBJ); |
39 |
warningImage = SharedImages.getImage(SharedImages.DESC_WARNING_ST_OBJ); |
44 |
warningImage = SharedImages.getImage(SharedImages.DESC_WARNING_ST_OBJ); |
40 |
infoImage = SharedImages.getImage(SharedImages.DESC_INFO_ST_OBJ); |
45 |
infoImage = SharedImages.getImage(SharedImages.DESC_INFO_ST_OBJ); |
41 |
okImage = SharedImages.getImage(SharedImages.DESC_OK_ST_OBJ); |
46 |
okImage = SharedImages.getImage(SharedImages.DESC_OK_ST_OBJ); |
42 |
errorWithStackImage = SharedImages.getImage(SharedImages.DESC_ERROR_STACK_OBJ); |
47 |
errorWithStackImage = SharedImages.getImage(SharedImages.DESC_ERROR_STACK_OBJ); |
43 |
hierarchicalImage = SharedImages.getImage(SharedImages.DESC_HIERARCHICAL_LAYOUT_OBJ); |
48 |
hierarchicalImage = SharedImages.getImage(SharedImages.DESC_HIERARCHICAL_LAYOUT_OBJ); |
|
|
49 |
|
50 |
this.logView = logView; |
44 |
} |
51 |
} |
45 |
public void dispose() { |
52 |
public void dispose() { |
46 |
if (consumers.size() == 0){ |
53 |
if (consumers.size() == 0){ |
Lines 118-121
Link Here
|
118 |
dispose(); |
125 |
dispose(); |
119 |
} |
126 |
} |
120 |
} |
127 |
} |
|
|
128 |
|
129 |
public Font getFont(Object element, int columnIndex) { |
130 |
if ((element instanceof LogSession) && (logView.isCurrentLogSession((LogSession) element))) { |
131 |
return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); |
132 |
} |
133 |
|
134 |
return null; |
135 |
} |
121 |
} |
136 |
} |