Commit af625489 authored by Matija Obreza's avatar Matija Obreza
Browse files

Reverted Highlighting

This reverts commits fdab4f0a, 8a363b73 and 38729c94
parent 8d9d3a91
...@@ -482,7 +482,7 @@ public class AppWindow { ...@@ -482,7 +482,7 @@ public class AppWindow {
}); });
tabFolder = new CTabFolder(sashForm, SWT.NONE); tabFolder = new CTabFolder(sashForm, SWT.NONE);
tabFolder.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND)); tabFolder.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT)); tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
tableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.FULL_SELECTION); tableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
......
...@@ -39,11 +39,11 @@ import org.eclipse.jface.viewers.DoubleClickEvent; ...@@ -39,11 +39,11 @@ import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StyledCellLabelProvider; import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.SashForm;
...@@ -60,7 +60,7 @@ import org.eclipse.swt.events.DisposeListener; ...@@ -60,7 +60,7 @@ import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
...@@ -106,13 +106,6 @@ public class SheetDisplay extends Composite { ...@@ -106,13 +106,6 @@ public class SheetDisplay extends Composite {
@Autowired @Autowired
private ObjectMapper mapper; private ObjectMapper mapper;
final Color listBackgroundColor = SWTResourceManager.getColor(SWT.COLOR_LIST_BACKGROUND);
final Color listForegroundColor = SWTResourceManager.getColor(SWT.COLOR_LIST_FOREGROUND);
final Color unmappedColumnSelectedColor = SWTResourceManager.getColor(100, 50, 50);
final Color mappedColumnUnselectedColor = SWTResourceManager.getColor(50, 50, 100);
final Color mappedColumnSelectedColor = SWTResourceManager.getColor(50, 100, 50);
final Color mappedSelectedForegroundColor = SWTResourceManager.getColor(SWT.COLOR_WHITE);
private static class ContentProvider implements IStructuredContentProvider { private static class ContentProvider implements IStructuredContentProvider {
@Override @Override
public Object[] getElements(Object inputElement) { public Object[] getElements(Object inputElement) {
...@@ -131,40 +124,23 @@ public class SheetDisplay extends Composite { ...@@ -131,40 +124,23 @@ public class SheetDisplay extends Composite {
} }
} }
private class TableLabelProvider extends StyledCellLabelProvider { private class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
@Override @Override
public void update(final ViewerCell cell) { public Image getColumnImage(Object element, int columnIndex) {
final int columnIndex = cell.getColumnIndex(); return null;
// System.err.println("Update col " + columnIndex); }
final Object element = cell.getElement();
@Override
public String getColumnText(Object element, int columnIndex) {
if (element instanceof Object[]) { if (element instanceof Object[]) {
Object[] elArr = (Object[]) element; Object[] elArr = (Object[]) element;
if (columnIndex < elArr.length) { if (columnIndex < elArr.length) {
Object el = ((Object[]) element)[columnIndex]; Object el = ((Object[]) element)[columnIndex];
cell.setText(el == null ? "" : el.toString()); return el == null ? "" : el.toString();
} } else
} return null;
final Column selectedColumn = dsw.getSelectedColumn();
final Column currentColumn = dsw.getDataSourceSheet().getColumns().get(columnIndex);
if (currentColumn.getRdfTerm() != null && !currentColumn.getRdfTerm().isEmpty()) {
if (currentColumn == selectedColumn) {
cell.setBackground(mappedColumnSelectedColor); // pink
cell.setForeground(mappedSelectedForegroundColor);
} else {
cell.setBackground(mappedColumnUnselectedColor); // light blue
cell.setForeground(mappedSelectedForegroundColor);
}
} else {
if (currentColumn == selectedColumn) {
cell.setBackground(unmappedColumnSelectedColor); // yellow
cell.setForeground(mappedSelectedForegroundColor);
} else {
cell.setBackground(listBackgroundColor); // default
cell.setForeground(listForegroundColor);
}
} }
return element.toString();
} }
} }
...@@ -256,7 +232,6 @@ public class SheetDisplay extends Composite { ...@@ -256,7 +232,6 @@ public class SheetDisplay extends Composite {
tbtmQuery.setText("SQL Query"); tbtmQuery.setText("SQL Query");
Composite compositeQuery = new Composite(tabFolder, SWT.NONE); Composite compositeQuery = new Composite(tabFolder, SWT.NONE);
compositeQuery.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
compositeQuery.setLayout(new GridLayout(4, false)); compositeQuery.setLayout(new GridLayout(4, false));
tbtmQuery.setControl(compositeQuery); tbtmQuery.setControl(compositeQuery);
...@@ -300,7 +275,7 @@ public class SheetDisplay extends Composite { ...@@ -300,7 +275,7 @@ public class SheetDisplay extends Composite {
tbtmColumnProperties.setText("Column"); tbtmColumnProperties.setText("Column");
ScrolledComposite scrolledComposite = new ScrolledComposite(tabFolder, SWT.V_SCROLL); ScrolledComposite scrolledComposite = new ScrolledComposite(tabFolder, SWT.V_SCROLL);
scrolledComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND)); scrolledComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
scrolledComposite.setExpandVertical(true); scrolledComposite.setExpandVertical(true);
scrolledComposite.setExpandHorizontal(true); scrolledComposite.setExpandHorizontal(true);
tbtmColumnProperties.setControl(scrolledComposite); tbtmColumnProperties.setControl(scrolledComposite);
...@@ -428,7 +403,7 @@ public class SheetDisplay extends Composite { ...@@ -428,7 +403,7 @@ public class SheetDisplay extends Composite {
tbtmSheet.setText("Headers"); tbtmSheet.setText("Headers");
Composite compoHeaders = new Composite(tabFolder, SWT.NONE); Composite compoHeaders = new Composite(tabFolder, SWT.NONE);
compoHeaders.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND)); compoHeaders.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
tbtmSheet.setControl(compoHeaders); tbtmSheet.setControl(compoHeaders);
compoHeaders.setLayout(new GridLayout(2, false)); compoHeaders.setLayout(new GridLayout(2, false));
new Label(compoHeaders, SWT.NONE); new Label(compoHeaders, SWT.NONE);
...@@ -479,7 +454,7 @@ public class SheetDisplay extends Composite { ...@@ -479,7 +454,7 @@ public class SheetDisplay extends Composite {
tbtmCSV.setText("CSV"); tbtmCSV.setText("CSV");
ScrolledComposite scrolledComposite2 = new ScrolledComposite(tabFolder, SWT.V_SCROLL); ScrolledComposite scrolledComposite2 = new ScrolledComposite(tabFolder, SWT.V_SCROLL);
scrolledComposite2.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND)); scrolledComposite2.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
scrolledComposite2.setExpandVertical(true); scrolledComposite2.setExpandVertical(true);
scrolledComposite2.setExpandHorizontal(true); scrolledComposite2.setExpandHorizontal(true);
tbtmCSV.setControl(scrolledComposite2); tbtmCSV.setControl(scrolledComposite2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment