Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 15-28
Link Here
|
15 |
import java.util.Iterator; |
15 |
import java.util.Iterator; |
16 |
|
16 |
|
17 |
import org.eclipse.jface.util.Util; |
17 |
import org.eclipse.jface.util.Util; |
|
|
18 |
import org.eclipse.jface.viewers.ColumnLabelProvider; |
19 |
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; |
18 |
import org.eclipse.jface.viewers.ContentViewer; |
20 |
import org.eclipse.jface.viewers.ContentViewer; |
19 |
import org.eclipse.jface.viewers.IBaseLabelProvider; |
21 |
import org.eclipse.jface.viewers.IBaseLabelProvider; |
20 |
import org.eclipse.jface.viewers.IColorProvider; |
|
|
21 |
import org.eclipse.jface.viewers.IFontProvider; |
22 |
import org.eclipse.jface.viewers.ILabelProvider; |
22 |
import org.eclipse.jface.viewers.ILabelProvider; |
23 |
import org.eclipse.jface.viewers.IStructuredContentProvider; |
23 |
import org.eclipse.jface.viewers.IStructuredContentProvider; |
24 |
import org.eclipse.jface.viewers.IStructuredSelection; |
24 |
import org.eclipse.jface.viewers.IStructuredSelection; |
25 |
import org.eclipse.jface.viewers.LabelProvider; |
|
|
26 |
import org.eclipse.jface.viewers.TableViewer; |
25 |
import org.eclipse.jface.viewers.TableViewer; |
27 |
import org.eclipse.jface.viewers.Viewer; |
26 |
import org.eclipse.jface.viewers.Viewer; |
28 |
import org.eclipse.jface.viewers.ViewerComparator; |
27 |
import org.eclipse.jface.viewers.ViewerComparator; |
Lines 30-35
Link Here
|
30 |
import org.eclipse.swt.graphics.Color; |
29 |
import org.eclipse.swt.graphics.Color; |
31 |
import org.eclipse.swt.graphics.Font; |
30 |
import org.eclipse.swt.graphics.Font; |
32 |
import org.eclipse.swt.graphics.Image; |
31 |
import org.eclipse.swt.graphics.Image; |
|
|
32 |
import org.eclipse.swt.graphics.Point; |
33 |
import org.eclipse.swt.graphics.RGB; |
33 |
import org.eclipse.swt.graphics.RGB; |
34 |
import org.eclipse.swt.layout.GridData; |
34 |
import org.eclipse.swt.layout.GridData; |
35 |
import org.eclipse.swt.widgets.Composite; |
35 |
import org.eclipse.swt.widgets.Composite; |
Lines 37-42
Link Here
|
37 |
import org.eclipse.swt.widgets.Display; |
37 |
import org.eclipse.swt.widgets.Display; |
38 |
import org.eclipse.swt.widgets.Shell; |
38 |
import org.eclipse.swt.widgets.Shell; |
39 |
import org.eclipse.swt.widgets.Table; |
39 |
import org.eclipse.swt.widgets.Table; |
|
|
40 |
import org.eclipse.ui.IWorkbenchPartReference; |
40 |
import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabItem; |
41 |
import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabItem; |
41 |
import org.eclipse.ui.internal.presentations.util.AbstractTabItem; |
42 |
import org.eclipse.ui.internal.presentations.util.AbstractTabItem; |
42 |
import org.eclipse.ui.internal.presentations.util.PresentablePartFolder; |
43 |
import org.eclipse.ui.internal.presentations.util.PresentablePartFolder; |
Lines 78-85
Link Here
|
78 |
} |
79 |
} |
79 |
} |
80 |
} |
80 |
|
81 |
|
81 |
private class BasicStackListLabelProvider extends LabelProvider implements |
82 |
private class BasicStackListLabelProvider extends ColumnLabelProvider { |
82 |
IFontProvider, IColorProvider { |
|
|
83 |
|
83 |
|
84 |
private Font visibleEditorsFont; |
84 |
private Font visibleEditorsFont; |
85 |
private Font invisibleEditorsFont; |
85 |
private Font invisibleEditorsFont; |
Lines 158-167
Link Here
|
158 |
} |
158 |
} |
159 |
} |
159 |
} |
160 |
|
160 |
|
161 |
public Color getBackground(Object element) { |
|
|
162 |
return null; |
163 |
} |
164 |
|
165 |
public Color getForeground(Object element) { |
161 |
public Color getForeground(Object element) { |
166 |
IPresentablePart presentablePart = (IPresentablePart)element; |
162 |
IPresentablePart presentablePart = (IPresentablePart)element; |
167 |
|
163 |
|
Lines 174-179
Link Here
|
174 |
|
170 |
|
175 |
return null; |
171 |
return null; |
176 |
} |
172 |
} |
|
|
173 |
|
174 |
public String getToolTipText(Object element) { |
175 |
if (element instanceof PresentablePart) { |
176 |
PresentablePart part = (PresentablePart) element; |
177 |
IWorkbenchPartReference reference = part.getPane() |
178 |
.getPartReference(); |
179 |
return reference.getTitleToolTip(); |
180 |
} |
181 |
return null; |
182 |
} |
183 |
|
184 |
public Point getToolTipShift(Object object) { |
185 |
return new Point(5, 5); |
186 |
} |
187 |
|
188 |
public int getToolTipDisplayDelayTime(Object object) { |
189 |
return 200; |
190 |
} |
177 |
} |
191 |
} |
178 |
|
192 |
|
179 |
private class BasicStackListViewerComparator extends ViewerComparator { |
193 |
private class BasicStackListViewerComparator extends ViewerComparator { |
Lines 296-301
Link Here
|
296 |
tableViewer.setComparator(new BasicStackListViewerComparator()); |
310 |
tableViewer.setComparator(new BasicStackListViewerComparator()); |
297 |
} |
311 |
} |
298 |
tableViewer.setLabelProvider(new BasicStackListLabelProvider()); |
312 |
tableViewer.setLabelProvider(new BasicStackListLabelProvider()); |
|
|
313 |
|
314 |
ColumnViewerToolTipSupport.enableFor(tableViewer); |
315 |
|
299 |
return tableViewer; |
316 |
return tableViewer; |
300 |
} |
317 |
} |
301 |
|
318 |
|