Skip to content

Commit

Permalink
Remove instances of UIUtils.fixMacSiliconItemHeight()
Browse files Browse the repository at this point in the history
- Not needed since Eclipse 4.31
  • Loading branch information
Phillipus committed Feb 15, 2024
1 parent 397bdf6 commit a180b1e
Show file tree
Hide file tree
Showing 22 changed files with 4 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateConcept;
import com.archimatetool.model.IArchimateRelationship;
Expand Down Expand Up @@ -228,9 +227,6 @@ private class RelationsTableViewer extends TableViewer {
RelationsTableViewer(Composite parent, int style) {
super(parent, SWT.FULL_SELECTION | style);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTable());

setColumns();

setContentProvider(new RelationsTableViewerContentProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import com.archimatetool.editor.preferences.IPreferenceConstants;
import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateDiagramModel;
import com.archimatetool.model.IDiagramModelArchimateComponent;
Expand Down Expand Up @@ -151,9 +150,6 @@ private class RelationsTableViewer extends TableViewer {
RelationsTableViewer(Composite parent, int style) {
super(parent, SWT.FULL_SELECTION | style);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTable());

setColumns();

setContentProvider(new RelationsTableViewerContentProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.archimatetool.editor.preferences.IPreferenceConstants;
import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateDiagramModel;
import com.archimatetool.model.IDiagramModelArchimateComponent;
Expand Down Expand Up @@ -267,9 +266,6 @@ private class RelationsTableViewer extends TableViewer {
RelationsTableViewer(Composite parent, int style) {
super(parent, SWT.FULL_SELECTION | style);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTable());

setColumns(getTable());
setContentProvider(new RelationsTableViewerContentProvider());
setLabelProvider(new RelationsTableViewerLabelCellProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

import com.archimatetool.editor.Logger;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;

/**
Expand Down Expand Up @@ -88,9 +87,6 @@ protected Control createDialogArea(Composite parent) {
viewer = new TableViewer(tableComp, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
viewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(viewer.getTable());

viewer.getTable().setHeaderVisible(true);

TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.eclipse.ui.PlatformUI;

import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;

/**
Expand Down Expand Up @@ -89,9 +88,6 @@ protected Control createDialogArea(Composite parent) {
viewer = new TableViewer(tableComp, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
viewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(viewer.getTable());

viewer.getTable().setHeaderVisible(true);

TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.ImageFactory;
import com.archimatetool.editor.ui.ThemeUtils;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.CustomColorDialog;
import com.archimatetool.editor.ui.factory.model.FolderUIProvider;
import com.archimatetool.editor.utils.PlatformUtils;
Expand Down Expand Up @@ -132,9 +131,6 @@ protected Control createContents(Composite parent) {
fTreeViewer = new TreeViewer(client);
GridDataFactory.create(GridData.FILL_BOTH).hint(SWT.DEFAULT, 200).applyTo(fTreeViewer.getTree());

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTreeViewer.getTree());

// Tree Double-click listener
fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import com.archimatetool.editor.ArchiPlugin;
import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.UIUtils;



Expand Down Expand Up @@ -140,9 +139,6 @@ public void widgetSelected(SelectionEvent e) {
private CheckboxTableViewer createRelationsTable(Composite parent) {
final CheckboxTableViewer viewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(viewer.getTable());

GridDataFactory.create(GridData.FILL_HORIZONTAL).hint(SWT.DEFAULT, 100).applyTo(viewer.getTable());

viewer.setLabelProvider(new LabelProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.archimatetool.editor.ArchiPlugin;
import com.archimatetool.editor.ui.FontFactory;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.utils.StringUtils;

/**
Expand Down Expand Up @@ -174,9 +173,6 @@ public Composite createContents(Composite parent) {
private void createTable(Composite parent) {
fTableViewer = new TableViewer(parent);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTableViewer.getTable());

GridDataFactory.create(GridData.FILL_BOTH).hint(SWT.DEFAULT, 200).applyTo(fTableViewer.getTable());

// Table Double-click listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import com.archimatetool.editor.model.IEditorModelManager;
import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateModel;
import com.archimatetool.model.INameable;
Expand Down Expand Up @@ -385,9 +384,6 @@ private class ModelsViewer extends TableViewer {
public ModelsViewer(Composite parent) {
super(parent, SWT.FULL_SELECTION);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTable());

setColumns();
setContentProvider(new ModelsViewerContentProvider());
setLabelProvider(new ModelsViewerLabelProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ private void createTableControl(Composite parent) {
// Font
UIUtils.setFontFromPreferences(fTableViewer.getTable(), IPreferenceConstants.ANALYSIS_TABLE_FONT, true);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTableViewer.getTable());

// Column
TableViewerColumn column = new TableViewerColumn(fTableViewer, SWT.NONE, 0);
tableLayout.setColumnData(column.getColumn(), new ColumnWeightData(100, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ private void createTableControl(Composite parent) {
// Font
UIUtils.setFontFromPreferences(fTableViewer.getTable(), IPreferenceConstants.ANALYSIS_TABLE_FONT, true);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTableViewer.getTable());

// Column
TableViewerColumn column = new TableViewerColumn(fTableViewer, SWT.NONE, 0);
tableLayout.setColumnData(column.getColumn(), new ColumnWeightData(100, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import org.eclipse.ui.PlatformUI;

import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateModel;
import com.archimatetool.model.IProperties;
Expand Down Expand Up @@ -210,9 +209,6 @@ private void createTableControl(Composite parent) {
fTableViewer = new TableViewer(tableComp, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
fTableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTableViewer.getTable());

// Edit cell on double-click and add Tab key traversal
TableViewerEditor.create(fTableViewer, new ColumnViewerEditorActivationStrategy(fTableViewer) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ private void createTableControl(Composite parent) {
// Font
UIUtils.setFontFromPreferences(fTableViewer.getTable(), IPreferenceConstants.PROPERTIES_TABLE_FONT, true);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTableViewer.getTable());

// Edit cell on double-click and add Tab key traversal
TableViewerEditor.create(fTableViewer, new ColumnViewerEditorActivationStrategy(fTableViewer) {
@Override
Expand Down Expand Up @@ -1413,9 +1410,6 @@ private void createTableControl(Composite parent) {
tableViewer = CheckboxTableViewer.newCheckList(tableComp, SWT.MULTI | SWT.FULL_SELECTION);
tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(tableViewer.getControl());

tableViewer.getTable().setLinesVisible(true);

// Column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.ImageFactory;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateFactory;
import com.archimatetool.model.IArchimateModel;
Expand Down Expand Up @@ -241,9 +240,6 @@ private void createTableControl(Composite parent) {
fTableViewer = new TableViewer(tableComp, SWT.MULTI | SWT.FULL_SELECTION);
GridDataFactory.create(GridData.FILL_BOTH).applyTo(fTableViewer.getControl());

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(fTableViewer.getTable());

// Edit cell on single-click and add Tab key traversal
TableViewerEditor.create(fTableViewer, new ColumnViewerEditorActivationStrategy(fTableViewer),
ColumnViewerEditor.TABBING_HORIZONTAL |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.eclipse.swt.widgets.Text;

import com.archimatetool.editor.ArchiPlugin;
import com.archimatetool.editor.utils.PlatformUtils;
import com.archimatetool.editor.utils.StringUtils;


Expand Down Expand Up @@ -246,28 +245,11 @@ public static String shortenText(String text, Control control, int margin) {
}

/**
* Table/Tree/List Item heights on binaries built with Mac SDK 11.1 and later are taller than when using an earlier Mac SDK.
* However, if we change the font of a Table/Tree/List it will revert to the smaller item height.
* See https://github.com/eclipse-platform/eclipse.platform.swt/issues/677
*
* It depends on what binary is being run and what version Mac SDK that binary was compiled against:
*
* Archi executable binary on Intel SDK 10.14 - smaller height
* Archi executable binary on Silicon SDK 11.1 - bigger height
* Java on Intel/Silicon (launch from Eclipse) SDK 11.1 - bigger height
*
* To determine which Mac SDK is used to create the binary run:
* otool -l /path/to/java
* and inspect the LC_VERSION_MIN_MACOSX or LC_BUILD_VERSION entry (look for "sdk")
*
* So call this method in all cases when running on Mac
* For some reason this will ensure that Table/Tree/List Item height is normal on Mac
*
* Note this should really be called "fixMacItemHeight"
* This is no longer needed with Eclipse 4.31 and later
* TODO: Remove this
* @deprecated
*/
public static void fixMacSiliconItemHeight(Control control) {
if(PlatformUtils.isMac()) {
control.setFont(control.getFont());
}
// Do nothing
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public NavigatorViewer(Composite parent, int style) {

UIUtils.setFontFromPreferences(getTree(), IPreferenceConstants.NAVIGATOR_TREE_FONT, true);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTree());

setContentProvider(new NavigatorViewerContentProvider());
setLabelProvider(new NavigatorViewerLabelProvider());
setAutoExpandLevel(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ public TreeModelViewer(Composite parent, int style) {
// Font
UIUtils.setFontFromPreferences(getTree(), IPreferenceConstants.MODEL_TREE_FONT, true);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTree());

setContentProvider(new ModelTreeViewerContentProvider());
setLabelProvider(new ModelTreeViewerLabelProvider());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.eclipse.swt.widgets.TreeColumn;

import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.hammer.validation.issues.IIssue;
import com.archimatetool.hammer.validation.issues.IIssueCategory;

Expand Down Expand Up @@ -62,9 +61,6 @@ public class ValidatorViewer extends TreeViewer {
public ValidatorViewer(Composite parent, int style) {
super(parent, style | SWT.MULTI | SWT.FULL_SELECTION);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTree());

setContentProvider(new ValidatorViewerContentProvider());
setLabelProvider(new ValidatorViewerLabelProvider());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;

import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.templates.model.ITemplate;


Expand All @@ -35,9 +34,6 @@ public class TemplatesTableViewer extends TableViewer {
public TemplatesTableViewer(Composite parent, int style) {
super(parent, SWT.FULL_SELECTION | style);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTable());

setColumns();
setContentProvider(new TemplatesTableViewerContentProvider());
setLabelProvider(new TemplatesTableViewerLabelCellProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.eclipse.swt.widgets.Composite;

import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.templates.model.ITemplate;
import com.archimatetool.templates.model.ITemplateGroup;

Expand All @@ -37,9 +36,6 @@ public class TemplatesTreeViewer extends TreeViewer {
public TemplatesTreeViewer(Composite parent, int style) {
super(parent, style);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTree());

setContentProvider(new TemplatesTreeViewerContentProvider());
setLabelProvider(new TemplatesTreeViewerLabelProvider());
setComparator(new ViewerComparator(Collator.getInstance()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.swt.widgets.Composite;

import com.archimatetool.editor.ui.ArchiLabelProvider;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.model.IFolder;
import com.archimatetool.model.INameable;

Expand All @@ -35,9 +34,6 @@ public class ModelViewsTreeViewer extends TreeViewer {
public ModelViewsTreeViewer(Composite parent, int style) {
super(parent, style | SWT.BORDER);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTree());

setContentProvider(new ModelViewsTreeViewerContentProvider());
setLabelProvider(new ModelViewsTreeViewerLabelProvider());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;

import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.templates.model.ITemplateGroup;
import com.archimatetool.templates.model.TemplateManager;

Expand All @@ -36,9 +35,6 @@ public class TemplateGroupsTableViewer extends TableViewer {
public TemplateGroupsTableViewer(Composite parent, int style) {
super(parent, SWT.FULL_SELECTION | style);

// Mac Silicon Item height
UIUtils.fixMacSiliconItemHeight(getTable());

setColumns();
setContentProvider(new CategoriesTableViewerContentProvider());
setLabelProvider(new CategoriesTableViewerLabelCellProvider());
Expand Down

0 comments on commit a180b1e

Please sign in to comment.