Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions com.vogella.ide.icons.dualtone/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions com.vogella.ide.icons.dualtone/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.vogella.ide.icons.dualtone</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
org.eclipse.jdt.core.compiler.compliance=25
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=25
14 changes: 14 additions & 0 deletions com.vogella.ide.icons.dualtone/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Dualtone
Bundle-SymbolicName: com.vogella.ide.icons.dualtone;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: VOGELLA
Require-Bundle: org.eclipse.jface,
org.eclipse.e4.ui.services,
org.eclipse.e4.core.di.annotations
Bundle-RequiredExecutionEnvironment: JavaSE-25
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)",
org.osgi.framework;version="[1.10.0,2.0.0)"
Automatic-Module-Name: com.vogella.ide.icons.dualtone
7 changes: 7 additions & 0 deletions com.vogella.ide.icons.dualtone/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
fragment.e4xmi
21 changes: 21 additions & 0 deletions com.vogella.ide.icons.dualtone/fragment.e4xmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_BxaXACerEeWxCPrV0pAZQQ">
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_QqSikIrOEeW7h_qdP9N9fw" featurename="commands" parentElementId="xpath:/">
<elements xsi:type="commands:Command" xmi:id="_UCYfwIrOEeW7h_qdP9N9fw" elementId="test.handler.helloWorldCommand" commandName="Hello World">
<persistedState key="persistState" value="false"/>
</elements>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_fW12kIrOEeW7h_qdP9N9fw" featurename="handlers" parentElementId="xpath:/">
<elements xsi:type="commands:Handler" xmi:id="_k2L0IIrOEeW7h_qdP9N9fw" elementId="org.eclipse.pde.ui.templates.handler.0" contributionURI="bundleclass://com.vogella.ide.icons.dualtone/com.vogella.ide.icons.dualtone.handlers.HelloWorldHandler" command="_UCYfwIrOEeW7h_qdP9N9fw">
<persistedState key="persistState" value="false"/>
</elements>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_wcLoQMX-Eea_bKDmo1phvA" featurename="trimContributions" parentElementId="xpath:/">
<elements xsi:type="menu:TrimContribution" xmi:id="_z1UuUMX-Eea_bKDmo1phvA" elementId="org.eclipse.pde.ui.templates.trimcontribution.0" parentId="org.eclipse.ui.main.toolbar" positionInParent="after=org.eclipse.ui.workbench.help">
<persistedState key="persistState" value="false"/>
<children xsi:type="menu:ToolBar" xmi:id="_4jlNMMX-Eea_bKDmo1phvA" elementId="org.eclipse.pde.ui.templates.toolbar.0">
<children xsi:type="menu:HandledToolItem" xmi:id="_5PyL4MX-Eea_bKDmo1phvA" elementId="org.eclipse.pde.ui.templates.handledtoolitem.helloworld" label="Hello world" iconURI="platform:/plugin/com.vogella.ide.icons.dualtone/icons/Sample.png" command="_UCYfwIrOEeW7h_qdP9N9fw"/>

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 tool item references an icon at platform:/plugin/com.vogella.ide.icons.dualtone/icons/Sample.png, but this file is not included in the pull request. This will result in a missing icon at runtime. Please add the icon file to the icons/ directory.

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 attribute is hardcoded to "Hello world". For internationalization (i18n) and better maintainability, UI strings should be externalized into a properties file and referenced using a key, like %command.helloworld.label.

        <children xsi:type="menu:HandledToolItem" xmi:id="_5PyL4MX-Eea_bKDmo1phvA" elementId="org.eclipse.pde.ui.templates.handledtoolitem.helloworld" label="%command.helloworld.label" iconURI="platform:/plugin/com.vogella.ide.icons.dualtone/icons/Sample.png" command="_UCYfwIrOEeW7h_qdP9N9fw"/>

</children>
</elements>
</fragments>
Comment on lines +3 to +20

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

Several elementId attributes in this fragment are using default values from a PDE template (e.g., org.eclipse.pde.ui.templates.handler.0 on line 9) or a test. prefix (on line 4). These should be replaced with unique and meaningful IDs specific to your plugin (e.g., com.vogella.ide.icons.dualtone.command.helloWorld) to avoid potential conflicts and improve maintainability.

</fragment:ModelFragments>
Binary file added com.vogella.ide.icons.dualtone/icons/Sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions com.vogella.ide.icons.dualtone/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

<extension
id="com.vogella.ide.icons.dualtone.fragment"
point="org.eclipse.e4.workbench.model">
<fragment
apply="always"
uri="fragment.e4xmi">
</fragment>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.vogella.ide.icons.dualtone.handlers;

import jakarta.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;

/** <b>Warning</b> :
As explained in <a href="http://wiki.eclipse.org/Eclipse4/RCP/FAQ#Why_aren.27t_my_handler_fields_being_re-injected.3F">this wiki page</a>, it is not recommended to define @Inject fields in a handler. <br/><br/>
<b>Inject the values in the @Execute methods</b>
*/
public class HelloWorldHandler {

@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell s) {

MessageDialog.openInformation(s, "E4 Information Dialog", "Hello world from a pure Eclipse 4 plug-in");

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 title and message for the MessageDialog are hardcoded. These strings should be externalized to a properties file to support internationalization and make them easier to manage.


}


}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<module>com.vogella.lsp.asciidoc.server</module>
<module>com.vogella.lsp.asciidoc.server.tests</module>
<module>z.ex.search</module>
<module>com.vogella.ide.icons.dualtone</module>

<!--Tests-->
<!--
Expand Down
4 changes: 4 additions & 0 deletions updatesite/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<bundle id="com.vogella.lsp.asciidoc.server">
<category name="vogella_minimal_asciidoc_editor"/>
</bundle>
<bundle id="com.vogella.ide.icons.dualtone">
<category name="dual-tone-icon-replacement"/>
</bundle>
<category-def name="vogella_ide_extensions" label="IDE extensions from vogella"/>
<category-def name="vogella_minimal_asciidoc_editor" label="Minimal Asciidoc Editor"/>
<category-def name="search_extension" label="Search Extension">
Expand All @@ -26,4 +29,5 @@
</description>
</category-def>
<category-def name="debug_tools_vogella" label="Debug Tools from vogella"/>
<category-def name="dual-tone-icon-replacement" label="Dual Tone Icons Replacement"/>
</site>
Loading