Skip to content

Commit ad9c4cf

Browse files
committed
Use the proper TemplatePersistenceData class
Instead of the deprecated old one, which is just a wrapper now.
1 parent 9e4e1ad commit ad9c4cf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntTemplatePreferencePage.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2011 John-Mason P. Shackelford and others.
2+
* Copyright (c) 2000, 2025 John-Mason P. Shackelford and others.
33
*
4-
* This program and the accompanying materials
4+
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
77
* https://www.eclipse.org/legal/epl-2.0/
88
*
99
* SPDX-License-Identifier: EPL-2.0
10-
*
10+
*
1111
* Contributors:
1212
* John-Mason P. Shackelford - initial API and implementation
1313
* IBM Corporation - bug fixes
@@ -27,11 +27,11 @@
2727
import org.eclipse.jface.text.source.SourceViewer;
2828
import org.eclipse.jface.text.source.SourceViewerConfiguration;
2929
import org.eclipse.jface.text.templates.Template;
30-
import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
3130
import org.eclipse.jface.viewers.IStructuredSelection;
3231
import org.eclipse.swt.SWT;
3332
import org.eclipse.swt.graphics.Font;
3433
import org.eclipse.swt.widgets.Composite;
34+
import org.eclipse.text.templates.TemplatePersistenceData;
3535
import org.eclipse.ui.PlatformUI;
3636
import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
3737

@@ -79,8 +79,7 @@ protected void updateViewerInput() {
7979
IStructuredSelection selection = (IStructuredSelection) getTableViewer().getSelection();
8080
SourceViewer viewer = getViewer();
8181

82-
if (selection.size() == 1 && selection.getFirstElement() instanceof TemplatePersistenceData) {
83-
TemplatePersistenceData data = (TemplatePersistenceData) selection.getFirstElement();
82+
if (selection.size() == 1 && selection.getFirstElement() instanceof TemplatePersistenceData data) {
8483
Template template = data.getTemplate();
8584
if (AntUIPlugin.getDefault().getPreferenceStore().getBoolean(getFormatterPreferenceKey())) {
8685
String formatted = XmlFormatter.format(template.getPattern(), fFormattingPreferences);

0 commit comments

Comments
 (0)