Skip to content

Commit

Permalink
Don't use UpdatingTableColumnLayout
Browse files Browse the repository at this point in the history
- It seems thet table.getParent().layout() does the trick
  • Loading branch information
Phillipus committed Nov 14, 2022
1 parent de701e5 commit 5551cf9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import com.archimatetool.editor.ui.ColorFactory;
import com.archimatetool.editor.ui.FontFactory;
import com.archimatetool.editor.ui.components.UpdatingTableColumnLayout;


/**
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;


Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -102,8 +101,12 @@ public void doSetInput(IArchiRepository archiRepo) {

setInput(archiRepo);

// Do the Layout kludge
((UpdatingTableColumnLayout)getTable().getParent().getLayout()).doRelayout();
// avoid bogus horizontal scrollbar cheese
Display.getCurrent().asyncExec(() -> {
if(!getTable().getParent().isDisposed()) {
getTable().getParent().layout();
}
});

// Select first row
//Object element = getElementAt(0);
Expand All @@ -120,9 +123,6 @@ public void setSelectedBranch(BranchInfo branchInfo) {
fSelectedBranch = branchInfo;

setInput(getInput());

// Layout kludge
((UpdatingTableColumnLayout)getTable().getParent().getLayout()).doRelayout();
}

// ===============================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;


Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5551cf9

Please sign in to comment.