From 8ae10f9a828cdc970a3af82968b3cff170cdfc63 Mon Sep 17 00:00:00 2001
From: Phillipus
Date: Mon, 14 Nov 2022 13:42:11 +0000
Subject: [PATCH] Don't use UpdatingTableColumnLayout
- It seems thet table.getParent().layout() does the trick
---
.../views/branches/BranchesTableViewer.java | 3 +--
.../modelrepository/views/branches/BranchesView.java | 4 ++--
.../views/history/HistoryTableViewer.java | 9 ++-------
.../modelrepository/views/history/HistoryView.java | 4 ++--
4 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesTableViewer.java b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesTableViewer.java
index 22b4ef7d..a1a147ce 100644
--- a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesTableViewer.java
+++ b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesTableViewer.java
@@ -29,7 +29,6 @@
import com.archimatetool.editor.ui.ColorFactory;
import com.archimatetool.editor.ui.FontFactory;
-import com.archimatetool.editor.ui.components.UpdatingTableColumnLayout;
/**
@@ -89,7 +88,7 @@ public void doSetInput(IArchiRepository archiRepo) {
setInput(archiRepo);
// Do the Layout kludge
- ((UpdatingTableColumnLayout)getTable().getParent().getLayout()).doRelayout();
+ getTable().getParent().layout();
// Select first row
//Object element = getElementAt(0);
diff --git a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesView.java b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesView.java
index e082fa4e..39a11755 100644
--- a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesView.java
+++ b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/branches/BranchesView.java
@@ -25,6 +25,7 @@
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
@@ -39,7 +40,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
-import com.archimatetool.editor.ui.components.UpdatingTableColumnLayout;
import com.archimatetool.model.IArchimateModel;
@@ -111,7 +111,7 @@ private void createInfoSection(Composite parent) {
private void createTableSection(Composite parent) {
Composite tableComp = new Composite(parent, SWT.NONE);
- tableComp.setLayout(new UpdatingTableColumnLayout(tableComp));
+ tableComp.setLayout(new TableColumnLayout());
// This ensures a minumum and equal size and no horizontal size creep for the table
GridData gd = new GridData(GridData.FILL_BOTH);
diff --git a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryTableViewer.java b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryTableViewer.java
index 23420d6a..070ae730 100644
--- a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryTableViewer.java
+++ b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryTableViewer.java
@@ -33,8 +33,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
-
-import com.archimatetool.editor.ui.components.UpdatingTableColumnLayout;
+import org.eclipse.swt.widgets.Display;
/**
@@ -102,8 +101,7 @@ public void doSetInput(IArchiRepository archiRepo) {
setInput(archiRepo);
- // Do the Layout kludge
- ((UpdatingTableColumnLayout)getTable().getParent().getLayout()).doRelayout();
+ Display.getCurrent().asyncExec(() -> getTable().getParent().layout()); // avoid bogus horizontal scrollbar cheese
// Select first row
//Object element = getElementAt(0);
@@ -120,9 +118,6 @@ public void setSelectedBranch(BranchInfo branchInfo) {
fSelectedBranch = branchInfo;
setInput(getInput());
-
- // Layout kludge
- ((UpdatingTableColumnLayout)getTable().getParent().getLayout()).doRelayout();
}
// ===============================================================================================
diff --git a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryView.java b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryView.java
index 33c8e7ee..88c2cace 100644
--- a/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryView.java
+++ b/org.archicontribs.modelrepository/src/org/archicontribs/modelrepository/views/history/HistoryView.java
@@ -24,6 +24,7 @@
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -43,7 +44,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
-import com.archimatetool.editor.ui.components.UpdatingTableColumnLayout;
import com.archimatetool.model.IArchimateModel;
@@ -151,7 +151,7 @@ private void createHistorySection(Composite parent) {
tableSash.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite tableComp = new Composite(tableSash, SWT.NONE);
- tableComp.setLayout(new UpdatingTableColumnLayout(tableComp));
+ tableComp.setLayout(new TableColumnLayout());
// This ensures a minumum and equal size and no horizontal size creep for the table
GridData gd = new GridData(GridData.FILL_BOTH);