Skip to content

Commit c6340fc

Browse files
joaodinissfclaude
andcommitted
refactor: migrate Xtend to Java - com.avaloq.tools.ddk.xtext.format.ui
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent aec5702 commit c6340fc

7 files changed

Lines changed: 65 additions & 59 deletions

File tree

com.avaloq.tools.ddk.xtext.format.ui/.classpath

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
</accessrules>
99
</classpathentry>
1010
<classpathentry kind="src" path="src"/>
11-
<classpathentry kind="src" path="xtend-gen"/>
1211
<classpathentry kind="src" path="src-gen">
1312
<attributes>
1413
<attribute name="ignore_optional_problems" value="true"/>

com.avaloq.tools.ddk.xtext.format.ui/.project

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
<arguments>
2121
</arguments>
2222
</buildCommand>
23-
<buildCommand>
24-
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
25-
<arguments>
26-
</arguments>
27-
</buildCommand>
2823
<buildCommand>
2924
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
3025
<arguments>
@@ -44,7 +39,6 @@
4439
<natures>
4540
<nature>org.eclipse.jdt.core.javanature</nature>
4641
<nature>org.eclipse.pde.PluginNature</nature>
47-
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
4842
<nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
4943
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
5044
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>

com.avaloq.tools.ddk.xtext.format.ui/META-INF/MANIFEST.MF

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ Require-Bundle: com.avaloq.tools.ddk.xtext.format;visibility:=reexport,
2424
org.eclipse.xtext,
2525
org.eclipse.xtext.xbase.ui,
2626
org.eclipse.jdt.debug.ui,
27-
org.eclipse.xtext.xbase.lib,
28-
org.eclipse.xtext.ui.codetemplates.ui,
29-
org.eclipse.xtend.lib;resolution:=optional
27+
org.eclipse.xtext.ui.codetemplates.ui
3028
Import-Package: org.apache.log4j
3129
Bundle-RequiredExecutionEnvironment: JavaSE-21
3230
Export-Package: com.avaloq.tools.ddk.xtext.format.ui.builder,
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
source.. = src/,\
2-
src-gen/,\
3-
xtend-gen/
2+
src-gen/
43
bin.includes = META-INF/,\
54
.,\
65
plugin.xml
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2016 Avaloq Group AG and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Avaloq Group AG - initial API and implementation
10+
*******************************************************************************/
11+
package com.avaloq.tools.ddk.xtext.format.ui;
12+
13+
import org.eclipse.ui.plugin.AbstractUIPlugin;
14+
import org.eclipse.xtext.builder.IXtextBuilderParticipant;
15+
import org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkHelper;
16+
import org.eclipse.xtext.ui.editor.templates.CrossReferenceTemplateVariableResolver;
17+
import org.eclipse.xtext.xtext.generator.model.project.IXtextProjectConfig;
18+
import org.eclipse.xtext.xtext.generator.model.project.XtextProjectConfig;
19+
20+
import com.avaloq.tools.ddk.xtext.format.ui.builder.FormatBuilderParticipant;
21+
import com.avaloq.tools.ddk.xtext.format.ui.hyperlinking.FormatHyperlinkHelper;
22+
import com.avaloq.tools.ddk.xtext.ui.templates.KeywordAwareCrossReferenceTemplateVariableResolver;
23+
import com.google.inject.Binder;
24+
25+
/**
26+
* Use this class to register components to be used within the Eclipse IDE.
27+
*/
28+
public class FormatUiModule extends AbstractFormatUiModule {
29+
30+
public FormatUiModule(final AbstractUIPlugin plugin) {
31+
super(plugin);
32+
}
33+
34+
/**
35+
* Binds a {@link CrossReferenceTemplateVariableResolver} which prefixes keywords with escape characters.
36+
*
37+
* @return {@link KeywordAwareCrossReferenceTemplateVariableResolver}
38+
*/
39+
public Class<? extends CrossReferenceTemplateVariableResolver> bindCrossReferenceTemplateVariableResolver() {
40+
return KeywordAwareCrossReferenceTemplateVariableResolver.class;
41+
}
42+
43+
/**
44+
* Bind hyperlink helper to provide hyperlinking from "override" keyword to extended rule.
45+
*
46+
* @return FormatHyperlinkHelper.class
47+
*/
48+
@Override
49+
public Class<? extends IHyperlinkHelper> bindIHyperlinkHelper() {
50+
return FormatHyperlinkHelper.class;
51+
}
52+
53+
@Override
54+
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
55+
return FormatBuilderParticipant.class;
56+
}
57+
58+
@Override
59+
public void configure(final Binder binder) {
60+
super.configure(binder);
61+
binder.bind(IXtextProjectConfig.class).to(XtextProjectConfig.class);
62+
}
63+
}

com.avaloq.tools.ddk.xtext.format.ui/src/com/avaloq/tools/ddk/xtext/format/ui/FormatUiModule.xtend

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

com.avaloq.tools.ddk.xtext.format.ui/xtend-gen/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)