Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public AbstractTableInformationControl(Shell parent, int shellStyle,
fTableViewer = createTableViewer(fComposite, controlStyle);

final Table table = fTableViewer.getTable();
table.setFont(JFaceResources.getDialogFont());
table.addKeyListener(KeyListener.keyPressedAdapter(e -> {
switch (e.keyCode) {
case SWT.ESC:
Expand Down Expand Up @@ -314,10 +315,11 @@ public TableViewer getTableViewer() {

protected Text createFilterText(Composite parent) {
fFilterText = new Text(parent, SWT.NONE);
fFilterText.setFont(JFaceResources.getDialogFont());

GridData data = new GridData();
GC gc = new GC(parent);
gc.setFont(parent.getFont());
gc.setFont(fFilterText.getFont());
FontMetrics fontMetrics = gc.getFontMetrics();
gc.dispose();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,41 +35,16 @@
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;

public class BasicPartList extends AbstractTableInformationControl {

private class BasicStackListLabelProvider extends ColumnLabelProvider {

private final Font boldFont;

public BasicStackListLabelProvider() {
Font font = Display.getDefault().getSystemFont();
FontData[] fontDatas = font.getFontData();
for (FontData fontData : fontDatas) {
fontData.setStyle(fontData.getStyle() | SWT.BOLD);
}
boldFont = new Font(Display.getDefault(), fontDatas);
}

@Override
public Font getFont(Object element) {
if (element instanceof MPart part) {
CTabItem item = renderer.findItemForPart(part);
if (item != null && !item.isShowing()) {
return boldFont;
}
}
return super.getFont(element);
}

@Override
public String getText(Object element) {
if (element instanceof MDirtyable
Expand Down Expand Up @@ -97,11 +72,6 @@ public String getToolTipText(Object element) {
public boolean useNativeToolTip(Object object) {
return true;
}

@Override
public void dispose() {
boldFont.dispose();
}
}

private MElementContainer<?> input;
Expand Down
Loading