compiles empty plugin with mvn clean package

This commit is contained in:
2024-05-14 19:31:21 +00:00
commit a0481f0bf4
31 changed files with 846 additions and 0 deletions

View File

@@ -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-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>click.kamil.ui</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>

View File

@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Java Ui
Bundle-SymbolicName: click.kamil.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: click.kamil.ui.UiPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: click.kamil.ui
Bundle-ActivationPolicy: lazy

View File

@@ -0,0 +1,6 @@
source.. = src/main/java/
output.. = target/classes/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<category
id="click.kamil.ui.commands.category"
name="Sample Category">
</category>
<command
categoryId="click.kamil.ui.commands.category"
name="Sample Command"
id="click.kamil.ui.commands.sampleCommand">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="click.kamil.ui.handlers.SampleHandler"
commandId="click.kamil.ui.commands.sampleCommand">
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="click.kamil.ui.commands.sampleCommand"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+6">
</key>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu
id="click.kamil.ui.menus.sampleMenu"
label="Sample Menu"
mnemonic="M">
<command
commandId="click.kamil.ui.commands.sampleCommand"
id="click.kamil.ui.menus.sampleCommand"
mnemonic="S">
</command>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar
id="click.kamil.ui.toolbars.sampleToolbar">
<command
id="click.kamil.ui.toolbars.sampleCommand"
commandId="click.kamil.ui.commands.sampleCommand"
icon="icons/sample.png"
tooltip="Say hello world">
</command>
</toolbar>
</menuContribution>
</extension>
</plugin>

View File

@@ -0,0 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>click.kamil.ui</artifactId>
<packaging>eclipse-plugin</packaging>
<name>My UI Plugin</name>
<parent>
<groupId>click.kamil</groupId>
<artifactId>click.kamil.eclipse-plugin.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/pom.xml</relativePath>
</parent>
<dependencies>
</dependencies>
</project>

View File

@@ -0,0 +1,55 @@
package click.kamil.ui;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class UiPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "click.kamil.ui"; //$NON-NLS-1$
// The shared instance
private static UiPlugin plugin;
/**
* The constructor
*/
public UiPlugin() {
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static UiPlugin getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}

View File

@@ -0,0 +1,21 @@
package click.kamil.ui.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.jface.dialogs.MessageDialog;
public class SampleHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
// MessageDialog.openInformation(
// window.getShell(),
// "Java Ui",
// "Hello, Eclipse world");
return null;
}
}