Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>4.0.10</version>
<version>5.0.0</version>
</extension>
</extensions>
7 changes: 5 additions & 2 deletions com.vogella.tasks.ui.contribute/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Contribute
Bundle-SymbolicName: com.vogella.tasks.ui.contribute
Bundle-SymbolicName: com.vogella.tasks.ui.contribute;singleton:=true
Bundle-Version: 1.0.0.qualifier
Import-Package: jakarta.inject;version="2.0.1",
org.eclipse.e4.ui.services
Bundle-Vendor: VOGELLA
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface,
org.eclipse.e4.core.di,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.di,
org.eclipse.e4.ui.model.workbench
org.eclipse.e4.ui.model.workbench,
org.eclipse.e4.core.contexts;bundle-version="1.13.200"
Bundle-RequiredExecutionEnvironment: JavaSE-21
Model-Fragment: fragment.e4xmi
Automatic-Module-Name: com.vogella.tasks.ui.contribute
Expand Down
3 changes: 2 additions & 1 deletion com.vogella.tasks.ui.contribute/build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin.includes = META-INF/,\
.,\
fragment.e4xmi
fragment.e4xmi,\
plugin.xml
source.. = src/
output.. = bin/
17 changes: 17 additions & 0 deletions com.vogella.tasks.ui.contribute/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="id1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The id="id1" for the extension is generic. It's a good practice to use more descriptive IDs to prevent potential conflicts and improve readability, especially in larger applications or when integrating with other plugins. Consider using a naming convention like com.vogella.tasks.ui.contribute.menuprocessor.extension.

Suggested change
id="id1"
id="com.vogella.tasks.ui.contribute.menuprocessor.extension"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The extension ID id1 is very generic. It's a best practice to use a more descriptive and unique ID, typically prefixed with the bundle's symbolic name, to avoid potential conflicts with other plugins. For example: com.vogella.tasks.ui.contribute.modelprocessor.menu.

Suggested change
id="id1"
id="com.vogella.tasks.ui.contribute.modelprocessor.menu"

point="org.eclipse.e4.workbench.model">
<processor
apply="always"
beforefragment="true"
class="com.vogella.tasks.ui.contribute.processors.MenuProcessor">
<element
id="org.eclipse.ui.file.menu">
</element>
</processor>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.vogella.tasks.ui.contribute.dialogs;

import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

public class ExitDialog extends Dialog {
@Inject
public ExitDialog(@Named(IServiceConstants.
ACTIVE_SHELL) Shell shell) {
super(shell);
}
Comment on lines +15 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's good practice to provide a title for a dialog window to give users context. You can override the configureShell method to set the title. The title string should also be externalized for internationalization.

	@Inject
	public ExitDialog(@Named(IServiceConstants.
			ACTIVE_SHELL) Shell shell) {
		super(shell);
	}

	@Override
	protected void configureShell(Shell newShell) {
		super.configureShell(newShell);
		newShell.setText("Confirm Exit"); // Should be externalized
	}


@Override
protected Control createDialogArea(Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText("Closing this application may result in data loss. "
+ "Are you sure you want that?");
Comment on lines +24 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The dialog message is hardcoded. For applications that might need to be translated, it's a best practice to externalize strings into a properties file and load them using Eclipse's NLS (National Language Support) mechanism.

return parent;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.vogella.tasks.ui.contribute.handlers;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.workbench.IWorkbench;
import org.eclipse.jface.window.Window;

import com.vogella.tasks.ui.contribute.dialogs.ExitDialog;

public class ExitHandlerWithCheck {
@Execute
public void execute(IEclipseContext context, IWorkbench workbench) {
ExitDialog dialog = ContextInjectionFactory.
make(ExitDialog.class, context);
if (dialog.open() == Window.OK) {
workbench.close();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.vogella.tasks.ui.contribute.processors;

import java.util.ArrayList;
import java.util.List;

import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem;
import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement;
import org.eclipse.e4.ui.workbench.modeling.EModelService;

import com.vogella.tasks.ui.contribute.handlers.ExitHandlerWithCheck;

public class MenuProcessor {

// the menu is injected based on the parameter
// defined in the extension point
@Inject
@Named("org.eclipse.ui.file.menu")
private MMenu menu;

@Execute
public void execute(EModelService modelService) {
// remove the old exit menu entry
if (!menu.getChildren().isEmpty()) {
List<MMenuElement> list = new ArrayList<>();
for (MMenuElement element : menu.getChildren()) {
// use ID instead of label as label is later translated
if (element.getElementId() != null) {
if (element.getElementId().contains("exit")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current approach of checking element.getElementId().contains("exit") to remove the old exit menu entry is fragile. If another menu item's ID unexpectedly contains "exit", it could be removed unintentionally. It's more robust to match the exact elementId of the original exit menu item, which is org.eclipse.ui.file.exit as defined in Application.e4xmi.

Suggested change
if (element.getElementId().contains("exit")) {
if (element.getElementId().equals("org.eclipse.ui.file.exit")) {

list.add(element);
}
}
}
menu.getChildren().removeAll(list);
}
Comment on lines +28 to +39

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for removing menu elements can be significantly simplified by using removeIf with a lambda expression. This makes the code more concise and readable.

		menu.getChildren().removeIf(element -> element.getElementId() != null && element.getElementId().contains("exit"));


// now add a new menu entry
MDirectMenuItem menuItem = modelService.createModelElement(MDirectMenuItem.class);
menuItem.setLabel("Another Exit");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The label "Another Exit" is hardcoded. For applications that might need to be translated into other languages, it's a best practice to externalize strings into a properties file and load them using Eclipse's NLS (National Language Support) mechanism.

menuItem.setContributionURI("bundleclass://"
+ "com.vogella.tasks.ui.contribute/"
+ ExitHandlerWithCheck.class.getName());
Comment on lines +44 to +46

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the bundle symbolic name com.vogella.tasks.ui.contribute makes the code fragile. If the bundle name is changed in META-INF/MANIFEST.MF, this code will break. It's better to define the bundle ID as a constant, for example in a dedicated constants class or at the top of this class, and reuse it here.

menu.getChildren().add(menuItem);
}
}
12 changes: 6 additions & 6 deletions com.vogella.tasks.ui/Application.e4xmi
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,12 @@
<mainMenu xmi:id="_FPu-YLSZEeq-dNF-Hsy_bw" elementId="org.eclipse.ui.main.menu">
<children xsi:type="menu:Menu" xmi:id="_kD4sQMz8EeqxQICfeITfhA" elementId="org.eclipse.ui.file.menu" label="&amp;File">
<children xsi:type="menu:HandledMenuItem" xmi:id="_wfjnoMnEEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.handledmenuitem.save" label="&amp;Save" command="_cGIQYMnEEeuD8-bVRByS6Q"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_gvkHMF2EEfCdebTTo0pPlw" elementId="com.vogella.tasks.ui.handledmenuitem.exit" label="Exit"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_gvkHMF2EEfCdebTTo0pPlw" elementId="com.vogella.tasks.ui.handledmenuitem.exit" label="Exit" command="_bIFDcL7uEfCRiML5YJx9jw"/>
</children>
<children xsi:type="menu:Menu" xmi:id="_lMhIQMz8EeqxQICfeITfhA" elementId="com.vogella.tasks.ui.menu.edit" label="Edit">
<children xsi:type="menu:HandledMenuItem" xmi:id="_HNmNMMnCEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.handledmenuitem.0" command="_Cp2VMMnCEeuD8-bVRByS6Q"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_GjwwwMnoEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.handledmenuitem.4" command="_pxm0AMnnEeuD8-bVRByS6Q"/>
</children>
<children xsi:type="menu:Menu" xmi:id="_vX5mkMnFEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.menu.processes" label="Processes">
<children xsi:type="menu:HandledMenuItem" xmi:id="_xsUgQMnFEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.handledmenuitem.2" command="_glwA4MnFEeuD8-bVRByS6Q">
<parameters xmi:id="_1H52UMnFEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.parameter.0" name="com.vogella.tasks.ui.commandparameter.perspectiveid" value="com.vogella.tasks.ui.perspective.playground"/>
</children>
</children>
<children xsi:type="menu:Menu" xmi:id="_KpgZcOrqEeuJV86xbIgfVw" elementId="com.vogella.tasks.ui.menu.window" label="Window">
<children xsi:type="menu:Menu" xmi:id="_OV7n4OrqEeuJV86xbIgfVw" elementId="com.vogella.tasks.ui.menu.perspectives" label="Perspectives">
<children xsi:type="menu:HandledMenuItem" xmi:id="_MaPXQOrqEeuJV86xbIgfVw" elementId="com.vogella.tasks.ui.handledmenuitem.switchperspective" label="Switch to default Perspective" command="_glwA4MnFEeuD8-bVRByS6Q">
Expand All @@ -77,6 +72,9 @@
<children xsi:type="menu:Menu" xmi:id="_Qs_9gF27EfCdebTTo0pPlw" elementId="com.vogella.tasks.ui.menu.dynamicthememenu" label="Dynamic Theme Menu">
<children xsi:type="menu:DynamicMenuContribution" xmi:id="_SpKvQF27EfCdebTTo0pPlw" elementId="com.vogella.tasks.ui.dynamicmenucontribution.1" contributionURI="bundleclass://com.vogella.tasks.ui/com.vogella.tasks.ui.menu.DynamicSwitchThemeMenu"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_xsUgQMnFEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.handledmenuitem.2" command="_glwA4MnFEeuD8-bVRByS6Q">
<parameters xmi:id="_1H52UMnFEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.parameter.0" name="com.vogella.tasks.ui.commandparameter.perspectiveid" value="com.vogella.tasks.ui.perspective.playground"/>
</children>
</children>
<children xsi:type="menu:Menu" xmi:id="_lgosQDbyEfCi08omLLzthw" elementId="com.vogella.tasks.ui.menu.onlyvisibleiftaskselected" toBeRendered="false" label="Only visible if task selected">
<children xsi:type="menu:HandledMenuItem" xmi:id="_-u6SkDbyEfCi08omLLzthw" elementId="com.vogella.tasks.ui.handledmenuitem.5" toBeRendered="false" command="_qzqvUBO9Ee2nkPMV9zMJ2A">
Expand All @@ -89,6 +87,7 @@
</children>
</mainMenu>
<trimBars xmi:id="_WwDtIMnQEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.trimbar.0">
<children xsi:type="menu:ToolControl" xmi:id="_CRGkkLDREfCGx_QsNwKmjA" elementId="com.vogella.tasks.ui.toolcontrol.0" contributionURI="bundleclass://com.vogella.tasks.ui/com.vogella.tasks.ui.toolcontrols.SearchToolControl"/>
<children xsi:type="menu:ToolBar" xmi:id="_XSRCUMnQEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.toolbar.0">
<children xsi:type="menu:HandledToolItem" xmi:id="_X_D24MnQEeuD8-bVRByS6Q" elementId="com.vogella.tasks.ui.handledtoolitem.0" iconURI="platform:/plugin/com.vogella.tasks.ui/images/deleteTask.svg" command="_K-EDkMnBEeuD8-bVRByS6Q"/>
</children>
Expand Down Expand Up @@ -125,6 +124,7 @@
<commands xmi:id="_o5kxkFyPEfC-z4xraj1QdA" elementId="com.vogella.tasks.ui.command.theme.switch" commandName="Theme Switch">
<parameters xmi:id="_Ui7MEFyQEfC-z4xraj1QdA" elementId="themeId" name="Theme"/>
</commands>
<commands xmi:id="_bIFDcL7uEfCRiML5YJx9jw" elementId="org.eclipse.ui.file.exit" commandName="Exit"/>
<addons xmi:id="_78U5ULSYEeq-dNF-Hsy_bw" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
<addons xmi:id="_78U5UbSYEeq-dNF-Hsy_bw" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
<addons xmi:id="_78U5UrSYEeq-dNF-Hsy_bw" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
Expand Down
3 changes: 2 additions & 1 deletion com.vogella.tasks.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.18.0",
com.vogella.tasks.events;bundle-version="1.0.0",
org.eclipse.swt,
org.eclipse.jface,
org.osgi.service.event
org.osgi.service.event,
org.eclipse.nebula.widgets.chips;bundle-version="2.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-21
Automatic-Module-Name: com.vogella.tasks.ui
Import-Package: com.vogella.swt.widgets,
Expand Down
2 changes: 1 addition & 1 deletion com.vogella.tasks.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
value="to-do">
</property>
<property
name="cssTheme2"
name="cssTheme"
value="com.vogella.eclipse.css.dark">
</property>
<property
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,68 @@
package com.vogella.tasks.ui.parts;

import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.di.extensions.EventTopic;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.jface.resource.ResourceManager;
import static org.eclipse.jface.layout.GridDataFactory.fillDefaults;
import static org.eclipse.jface.widgets.WidgetFactory.button;
import static org.eclipse.jface.widgets.WidgetFactory.text;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.eclipse.e4.ui.di.Focus;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.nebula.widgets.chips.Chips;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;

import com.vogella.imageloader.services.IBundleResourceLoader;

import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;

public class PlaygroundPart {
private Text text;
private Browser browser;
private Text target;


@Inject
MPart part;
@Inject
IBundleResourceLoader loader;

@PostConstruct
public void createControls(Composite parent) {
parent.setLayout(new GridLayout(2, false));
Chips chip1 = new Chips(parent, SWT.CLOSE);
chip1.setText("Example");
chip1.setChipsBackground(Display.getDefault().getSystemColor(SWT.COLOR_RED));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's generally safer to get the Display instance from a widget (e.g., parent.getDisplay()) rather than using Display.getDefault(). Display.getDefault() returns null if the calling thread is not a UI thread, which could lead to a NullPointerException. Using parent.getDisplay() is more robust.

Suggested change
chip1.setChipsBackground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
chip1.setChipsBackground(parent.getDisplay().getSystemColor(SWT.COLOR_RED));

text = text(SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL).message("Enter City")
.layoutData(fillDefaults().grab(true, false).create()).create(parent);
text.addSelectionListener(SelectionListener.widgetDefaultSelectedAdapter(e -> updateBrowser()));

ContentProposalAdapter contentProposal = new ContentProposalAdapter(text, new TextContentAdapter(),
new SimpleContentProposalProvider("Hamburg", "New York", "New Delhi"), null, null);

Label label = new Label(parent, SWT.NONE);

// the following code assumes that you have a vogella.png file
// in a folder called "images" in this plug-in
ResourceManager resourceManager =
new LocalResourceManager(JFaceResources.getResources(), label);
Image image = resourceManager.
create(loader.getImageDescriptor(this.getClass(), "images/sbahn.svg"));
label.setImage(image);

contentProposal.setPopupSize(new Point(200, 100));
contentProposal.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
button(SWT.PUSH).text("Search").onSelect(e -> updateBrowser()).create(parent);

browser = new Browser(parent, SWT.NONE);
browser.setLayoutData(fillDefaults().grab(true, true).span(2, 1).create());
}

@Persist
public void saveItReallyReally() {
// TODO really do the saving
part.setDirty(false);
private void updateBrowser() {
String city = text.getText();
if (city.isEmpty()) {
return;
}
try {
browser.setUrl("https://www.google.com/maps/place/" + URLEncoder.encode(city, "UTF-8") + "/&output=embed");

} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using e1.printStackTrace(); is generally not recommended in production code as it can expose sensitive information and doesn't provide structured logging. Consider replacing this with a proper logging mechanism (e.g., SLF4J, Log4j) or displaying a user-friendly error message.

            // Log the exception properly or display a user-friendly error
            // Logger.error("Failed to encode city name for URL", e1);
            // MessageDialog.openError(parent.getShell(), "Encoding Error", "Failed to encode city name.");

}
Comment on lines +56 to +61

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The try-catch block for UnsupportedEncodingException can be avoided. Since you are using Java 21, you can use URLEncoder.encode(String, Charset) with StandardCharsets.UTF_8. This version of the method does not throw a checked exception, which simplifies the code. Also, e1.printStackTrace() is generally discouraged in favor of proper logging.

			browser.setUrl("https://www.google.com/maps/place/" + URLEncoder.encode(city, java.nio.charset.StandardCharsets.UTF_8) + "/&output=embed");

}

@Inject
public void getFromOSGi(@Optional @EventTopic("YOURKEY") String value) {
System.out.println(value);
@Focus
public void onFocus() {
text.setFocus();
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package com.vogella.tasks.ui.toolcontrols;

import jakarta.annotation.PostConstruct;

import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

import jakarta.annotation.PostConstruct;

public class SearchToolControl {

@PostConstruct
public void createGui(Composite parent) {
Text text = new Text(parent, SWT.SEARCH | SWT.CANCEL | SWT.BORDER);
final Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
Text text = new Text(comp, SWT.SEARCH | SWT.CANCEL | SWT.ICON_SEARCH | SWT.BORDER);
text.setMessage("Search");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The message "Search" is hardcoded. For applications that might need to be translated, it's a best practice to externalize strings into a properties file and load them using Eclipse's NLS (National Language Support) mechanism.


GridDataFactory.fillDefaults().hint(130, SWT.DEFAULT).applyTo(text);
}
}
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<packaging>pom</packaging>

<properties>
<tycho.version>4.0.10</tycho.version>
<tycho.version>5.0.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
Expand Down Expand Up @@ -121,9 +121,9 @@
<module>com.vogella.tasks.ui.contribute</module>
<module>com.vogella.eclipse.css</module>
<module>com.vogella.tasks.product</module>
<<<<<<< Upstream, based on origin/main
<!--
<module>com.vogella.tasks.services.tests</module>
=======
-->
<module>com.vogella.swt.widgets</module>

<!-- These artifacts are from optional exercises
Expand All @@ -133,7 +133,6 @@
<module>com.vogella.tasks.update</module>
<module>com.example.e4.renderer.swt</module>

>>>>>>> c8f4211 Refactor pom.xml to clarify module examples and reorganize optional exercises
<!--
<module>com.example.e4.swtbot.tests</module>
-->
Expand Down
6 changes: 2 additions & 4 deletions target-platform/target-platform.target
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
<unit id="junit-jupiter-engine"/>
<unit id="org.eclipse.pde.spies.feature.group"/>
</location>
<!--
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/latest"/>
<unit id="org.eclipse.pde.spies.feature.group"/>
<repository location="https://download.eclipse.org/nebula/updates/release"/>
<unit id="org.eclipse.nebula.widgets.chips.feature.feature.group"/>
</location>
-->
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/justj/jres/21/updates/release/latest"/>
<unit id="org.eclipse.justj.openjdk.hotspot.jre.minimal.feature.group"/>
Expand Down
Loading