Skip to content

Commit 692f1f0

Browse files
Merge branch 'master' into zwsp
2 parents b072735 + 5922d0c commit 692f1f0

File tree

44 files changed

+427
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+427
-1001
lines changed

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2008, 2020 IBM Corporation and others.
2+
* Copyright (c) 2008, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -87,6 +87,8 @@
8787
import org.eclipse.swt.custom.CTabFolder2Listener;
8888
import org.eclipse.swt.custom.CTabFolderEvent;
8989
import org.eclipse.swt.custom.CTabItem;
90+
import org.eclipse.swt.dnd.DND;
91+
import org.eclipse.swt.dnd.DropTarget;
9092
import org.eclipse.swt.events.ControlEvent;
9193
import org.eclipse.swt.events.ControlListener;
9294
import org.eclipse.swt.events.MouseAdapter;
@@ -719,6 +721,11 @@ public Object createWidget(MUIElement element, Object parent) {
719721
if (PartStackUtil.isEditorStack(element)) {
720722
createOnboardingControls(tabFolder);
721723
initializeOnboardingInformationInEditorStack(tabFolder);
724+
int drop = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
725+
// Bug: eclipse-platform/eclipse.platform.swt/issues/649
726+
Composite dropZone = new Composite(tabFolder, SWT.NONE);// additional Composite/child to support dropping
727+
new Label(dropZone, SWT.NONE);
728+
new DropTarget(dropZone, drop);
722729
}
723730
tabFolder.setMRUVisible(getMRUValue());
724731

bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ public void addMouseListener(MouseListener listener) {
624624
fBuffer.dispose();
625625
fBuffer= null;
626626
}
627+
layout(false);
627628
});
628629
});
629630

bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public WizardDialog setModal(boolean modal) {
370370
*/
371371
public boolean isModal() {
372372
return (getShellStyle() & SWT.PRIMARY_MODAL) == SWT.PRIMARY_MODAL
373-
|| (getShellStyle() & SWT.PRIMARY_MODAL) == SWT.APPLICATION_MODAL;
373+
|| (getShellStyle() & SWT.APPLICATION_MODAL) == SWT.APPLICATION_MODAL;
374374
}
375375

376376
/**

bundles/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java

Lines changed: 73 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2020 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -32,6 +32,7 @@
3232
import java.util.ArrayList;
3333
import java.util.Arrays;
3434
import java.util.Collections;
35+
import java.util.Comparator;
3536
import java.util.Deque;
3637
import java.util.LinkedList;
3738
import java.util.List;
@@ -403,6 +404,9 @@ public void update(ViewerCell cell) {
403404
private Combo searchIn;
404405
private Label listLabel;
405406

407+
private int sortColumnIndex = -1;
408+
private boolean sortDirectionAscending = true;
409+
406410
/**
407411
* Creates a new instance of the class.
408412
*
@@ -840,19 +844,45 @@ public void getName(AccessibleEvent e) {
840844
// new ScrollListener(list.getTable().getVerticalBar());
841845
// new SelectionChangedListener(list);
842846

847+
Table table = list.getTable();
843848
TableViewerColumn col = new TableViewerColumn(list, SWT.RIGHT);
849+
TableColumn column = col.getColumn();
850+
column.setText(Messages.QuickSearchDialog_line);
851+
column.setWidth(40);
852+
column.addSelectionListener(new SelectionAdapter() {
853+
@Override
854+
public void widgetSelected(SelectionEvent e) {
855+
Comparator<LineItem> lineNumberComparator = Comparator.comparingInt(LineItem::getLineNumber);
856+
handleColumnSort(table, 0, lineNumberComparator);
857+
}
858+
});
844859
col.setLabelProvider(LINE_NUMBER_LABEL_PROVIDER);
845-
col.getColumn().setText(Messages.QuickSearchDialog_line);
846-
col.getColumn().setWidth(40);
860+
847861
col = new TableViewerColumn(list, SWT.LEFT);
848-
col.getColumn().setText(Messages.QuickSearchDialog_text);
862+
column = col.getColumn();
863+
column.setText(Messages.QuickSearchDialog_text);
864+
column.setWidth(400);
865+
column.addSelectionListener(new SelectionAdapter() {
866+
@Override
867+
public void widgetSelected(SelectionEvent e) {
868+
Comparator<LineItem> textComparator = Comparator.comparing( LineItem::getText);
869+
handleColumnSort(table, 1, textComparator);
870+
}
871+
});
849872
col.setLabelProvider(LINE_TEXT_LABEL_PROVIDER);
850-
col.getColumn().setWidth(400);
873+
851874
col = new TableViewerColumn(list, SWT.LEFT);
852-
col.getColumn().setText(Messages.QuickSearchDialog_path);
875+
column = col.getColumn();
876+
column.setText(Messages.QuickSearchDialog_path);
877+
column.setWidth(150);
878+
column.addSelectionListener(new SelectionAdapter() {
879+
@Override
880+
public void widgetSelected(SelectionEvent e) {
881+
Comparator<LineItem> lineItemComparator = Comparator.comparing(item -> item.getFile().getFullPath().toString());
882+
handleColumnSort(table, 2, lineItemComparator);
883+
}
884+
});
853885
col.setLabelProvider(LINE_FILE_LABEL_PROVIDER);
854-
col.getColumn().setWidth(150);
855-
856886
new TableResizeHelper(list).enableResizing();
857887

858888
//list.setLabelProvider(getItemsListLabelProvider());
@@ -951,6 +981,21 @@ public void keyPressed(KeyEvent e) {
951981
return dialogArea;
952982
}
953983

984+
private void handleColumnSort(Table table, int columnIndex, Comparator sorter) {
985+
if (sortColumnIndex == columnIndex) {
986+
sortDirectionAscending = !sortDirectionAscending;
987+
} else {
988+
sortColumnIndex = columnIndex;
989+
sortDirectionAscending = true;
990+
}
991+
table.setSortColumn(table.getColumn(columnIndex));
992+
table.setSortDirection(sortDirectionAscending ? SWT.UP : SWT.DOWN);
993+
994+
contentProvider.setComparator(sortDirectionAscending ? sorter : sorter.reversed());
995+
contentProvider.sortList();
996+
refreshWidgets();
997+
}
998+
954999
private Composite createNestedComposite(Composite parent, int numRows, boolean equalRows) {
9551000
Composite nested = new Composite(parent, SWT.NONE);
9561001
{
@@ -1468,7 +1513,7 @@ private void applyPathMatcher() {
14681513
private class ContentProvider implements IStructuredContentProvider, ILazyContentProvider {
14691514

14701515
private List items;
1471-
1516+
private Comparator<LineItem> comparator;
14721517
/**
14731518
* Creates new instance of <code>ContentProvider</code>.
14741519
*/
@@ -1551,6 +1596,25 @@ public void updateElement(int index) {
15511596

15521597
}
15531598

1599+
/**
1600+
* Sorts the current search results based on current comparator
1601+
*/
1602+
public void sortList() {
1603+
if (comparator == null) {
1604+
return;
1605+
}
1606+
items.sort(comparator);
1607+
}
1608+
1609+
/**
1610+
* Sets a custom comparator for comparing LineItem objects.
1611+
*
1612+
* @param comparator a <code>Comparator<code> object that defines the custom comparison logic.
1613+
*/
1614+
public void setComparator(Comparator<LineItem> comparator) {
1615+
this.comparator = comparator;
1616+
}
1617+
15541618
}
15551619

15561620
/**

bundles/org.eclipse.ui.themes/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Plugin.name
44
Bundle-SymbolicName: org.eclipse.ui.themes;singleton:=true
5-
Bundle-Version: 1.2.2800.qualifier
5+
Bundle-Version: 1.2.2900.qualifier
66
Bundle-Vendor: %Plugin.providerName
77
Bundle-Localization: plugin
88
Require-Bundle: org.eclipse.e4.ui.css.swt.theme

bundles/org.eclipse.ui.themes/css/high-contrast.css

Lines changed: 0 additions & 28 deletions
This file was deleted.

bundles/org.eclipse.ui.themes/plugin.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ theme.classic = Classic
1919
theme.light = Light
2020

2121
theme.dark = Dark
22-
theme.high-contrast = High Contrast
2322

2423
#New theme element definitions
2524
DARK_BACKGROUND=Dark Background Color

bundles/org.eclipse.ui.themes/plugin.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@
5151
label="%theme.light"
5252
os="win32">
5353
</theme>
54-
<theme
55-
basestylesheeturi="css/high-contrast.css"
56-
id="org.eclipse.e4.ui.css.theme.high-contrast"
57-
label="%theme.high-contrast">
58-
</theme>
5954

6055
<themeAssociation
6156
themeId="org.eclipse.e4.ui.css.theme.e4_classic"

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/ObjectContributorManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ private static List removeDups(List list) {
658658
* collection of objects.
659659
*/
660660
private List getCommonClasses(List objects, List commonAdapters) {
661-
if (objects == null || objects.isEmpty()) {
661+
if (objects == null || objects.isEmpty() || !Platform.isRunning()) {
662662
return null;
663663
}
664664

0 commit comments

Comments
 (0)