Skip to content

Commit a177ac7

Browse files
committed
Suppress "removal" warnings related to the Designer palette
The deprecated methods have to be used internally for backwards compatibility and can only be removed together with the deprecated classes.
1 parent 8e7a095 commit a177ac7

9 files changed

Lines changed: 29 additions & 14 deletions

File tree

org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/editor/palette/DesignerPalette.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -385,6 +385,7 @@ public Tool createTool() {
385385
/**
386386
* @return the {@link ICategory} for given {@link CategoryInfo}.
387387
*/
388+
@SuppressWarnings("removal")
388389
private DesignerContainer getVisualCategory(final CategoryInfo categoryInfo) {
389390
DesignerContainer category = m_categoryInfoToVisual.get(categoryInfo);
390391
if (category == null) {
@@ -471,6 +472,7 @@ public void selectDefault() {
471472

472473
@Override
473474
@Deprecated
475+
@SuppressWarnings("removal")
474476
public void moveCategory(ICategory _category, ICategory _nextCategory) {
475477
CategoryInfo category = m_visualToCategoryInfo.get(_category);
476478
CategoryInfo nextCategory = m_visualToCategoryInfo.get(_nextCategory);
@@ -479,6 +481,7 @@ public void moveCategory(ICategory _category, ICategory _nextCategory) {
479481

480482
@Override
481483
@Deprecated
484+
@SuppressWarnings("removal")
482485
public void moveEntry(IEntry _entry, ICategory _targetCategory, IEntry _nextEntry) {
483486
EntryInfo entry = m_visualToEntryInfo.get(_entry);
484487
CategoryInfo category = m_visualToCategoryInfo.get(_targetCategory);

org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/DefaultPalettePreferences.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2024 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -22,6 +22,7 @@
2222
* @coverage core.control.palette
2323
* @deprecated Replaced by {@link DesignPaletteViewerPreferences}.
2424
*/
25+
@SuppressWarnings("removal")
2526
@Deprecated(forRemoval = true, since = "1.18.0")
2627
public final class DefaultPalettePreferences implements IPalettePreferences {
2728
@Override

org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/ICategory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -48,5 +48,6 @@ public interface ICategory {
4848
/**
4949
* @return the {@link List} of {@link IEntry}'s.
5050
*/
51+
@SuppressWarnings("removal")
5152
List<? extends IEntry> getEntries();
5253
}

org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/IPalette.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -37,6 +37,7 @@ public interface IPalette {
3737
/**
3838
* @return the {@link List} of {@link ICategory}'s to display as roots of palette.
3939
*/
40+
@SuppressWarnings("removal")
4041
List<? extends ICategory> getCategories();
4142

4243
/**
@@ -62,10 +63,12 @@ public interface IPalette {
6263
/**
6364
* Moves given <code>category</code> before given <code>nextCategory</code>.
6465
*/
66+
@SuppressWarnings("removal")
6567
void moveCategory(ICategory category, ICategory nextCategory);
6668

6769
/**
6870
* Moves given <code>entry</code> into given category before <code>nextEntry</code>.
6971
*/
72+
@SuppressWarnings("removal")
7073
void moveEntry(IEntry entry, ICategory targetCategory, IEntry nextEntry);
7174
}

org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/PaletteComposite.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -230,6 +230,7 @@ public void dispose() {
230230
* @deprecated Use {@link #setPalette(DesignerRoot)}. This method will be
231231
* removed after the 2027-03 release.
232232
*/
233+
@SuppressWarnings("removal")
233234
@Deprecated(since = "1.19", forRemoval = true)
234235
public void setPalette(IPalette palette) {
235236
m_palette = palette;
@@ -257,6 +258,7 @@ public void refreshPalette() {
257258
* @deprecated Use {@link #setPreferences(DesignerPaletteViewerPreferences)}.
258259
* This method will be removed after the 2027-03 release.
259260
*/
261+
@SuppressWarnings("removal")
260262
@Deprecated(since = "1.19", forRemoval = true)
261263
public void setPreferences(IPalettePreferences preferences) {
262264
m_preferences = preferences;
@@ -281,6 +283,7 @@ public void setPreferences(DesignerPaletteViewerPreferences preferences) {
281283
* @deprecated Use {@link #selectEntry(DesignerEntry, boolean)} instead. This
282284
* method will be removed after the 2027-03 release.
283285
*/
286+
@SuppressWarnings("removal")
284287
@Deprecated(since = "3.19", forRemoval = true)
285288
public void selectEntry(IEntry selectedEntry, boolean reload) {
286289
// activate new entry
@@ -313,6 +316,7 @@ public void selectEntry(DesignerEntry selectedEntry, boolean reload) {
313316
* @deprecated Use {@link #getCategoryFigure(DesignerContainer)} instead. This
314317
* method will be removed after the 2027-03 release.
315318
*/
319+
@SuppressWarnings("removal")
316320
@Deprecated(since = "3.19", forRemoval = true)
317321
public Figure getCategoryFigure(ICategory category) {
318322
return m_categoryFigures.get(category);
@@ -332,6 +336,7 @@ public IFigure getCategoryFigure(DesignerContainer category) {
332336
* @deprecated Use {@link #getEntryFigure(DesignerContainer, DesignerEntry)}
333337
* instead. This method will be removed after the 2027-03 release.
334338
*/
339+
@SuppressWarnings("removal")
335340
@Deprecated(since = "3.19", forRemoval = true)
336341
public Figure getEntryFigure(ICategory category, IEntry entry) {
337342
CategoryFigure categoryFigure = m_categoryFigures.get(category);

org.eclipse.wb.core/src/org/eclipse/wb/core/controls/test/PaletteTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -172,11 +172,13 @@ public void selectDefault() {
172172

173173
@Override
174174
@Deprecated
175+
@SuppressWarnings("removal")
175176
public void moveCategory(ICategory category, ICategory nextCategory) {
176177
}
177178

178179
@Override
179180
@Deprecated
181+
@SuppressWarnings("removal")
180182
public void moveEntry(IEntry entry, ICategory targetCategory, IEntry nextEntry) {
181183
}
182184
}

org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/palette/ToolEntryInfoTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2023 Google, Inc.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -57,7 +57,7 @@ public Tool createTool() throws Exception {
5757
// initialize
5858
assertTrue(toolEntry.initialize(editPartViewer, panel));
5959
// activate
60-
assertFalse(toolEntry.activate(false));
60+
assertNull(toolEntry.createTool(false));
6161
}
6262

6363
/**
@@ -82,7 +82,7 @@ public Tool createTool() throws Exception {
8282
// initialize
8383
assertTrue(toolEntry.initialize(editPartViewer, panel));
8484
// activate
85-
assertTrue(toolEntry.activate(false));
85+
assertNotNull(toolEntry.createTool(false));
8686
}
8787

8888
/**
@@ -109,7 +109,7 @@ public Tool createTool() throws Exception {
109109
// activate
110110
try {
111111
DesignerPlugin.setDisplayExceptionOnConsole(false);
112-
assertFalse(toolEntry.activate(false));
112+
assertNull(toolEntry.createTool(false));
113113
} finally {
114114
DesignerPlugin.setDisplayExceptionOnConsole(true);
115115
}

org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutGefTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -137,7 +137,7 @@ public void test_replaceGridLayout_withAbsolute() throws Exception {
137137
{
138138
AbsoluteLayoutEntryInfo absoluteEntry = new AbsoluteLayoutEntryInfo();
139139
absoluteEntry.initialize(m_viewerCanvas, shell);
140-
absoluteEntry.activate(false);
140+
absoluteEntry.createTool(false);
141141
canvas.target(shell).in(250, 50).move().click();
142142
waitEventLoop(0);
143143
}

org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/layouts/grid/GridLayoutGefTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2025 Google, Inc. and others.
2+
* Copyright (c) 2011, 2026 Google, Inc. and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -151,7 +151,7 @@ public void test_replaceGridLayout_withAbsolute() throws Exception {
151151
{
152152
AbsoluteLayoutEntryInfo absoluteEntry = new AbsoluteLayoutEntryInfo();
153153
absoluteEntry.initialize(m_viewerCanvas, composite);
154-
absoluteEntry.activate(false);
154+
absoluteEntry.createTool(false);
155155
canvas.target(composite).in(250, 50).move().click();
156156
waitEventLoop(20);
157157
}

0 commit comments

Comments
 (0)