Skip to content

Commit 5ca5ae0

Browse files
committed
updates
1 parent ce139af commit 5ca5ae0

File tree

286 files changed

+9515
-2514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+9515
-2514
lines changed

External Plug-in Libraries/.searchable

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
44
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
55
<classpathentry kind="src" path="src"/>
66
<classpathentry kind="output" path="bin"/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>de.vogella.tycho.rcp</name>
3+
<name>de.vogella.jdt.projectcreation</name>
44
<comment></comment>
55
<projects>
66
</projects>

de.vogella.tycho.rcp/.settings/org.eclipse.jdt.core.prefs renamed to de.vogella.jdt.projectcreation/.settings/org.eclipse.jdt.core.prefs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4-
org.eclipse.jdt.core.compiler.compliance=1.6
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.compliance=1.7
55
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
66
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7-
org.eclipse.jdt.core.compiler.source=1.6
7+
org.eclipse.jdt.core.compiler.source=1.7
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Projectcreation
4+
Bundle-SymbolicName: de.vogella.jdt.projectcreation; singleton:=true
5+
Bundle-Version: 1.0.0.qualifier
6+
Require-Bundle: org.eclipse.ui,
7+
org.eclipse.jdt.ui;bundle-version="3.9.0",
8+
org.eclipse.jdt.core;bundle-version="3.8.1",
9+
org.eclipse.core.resources;bundle-version="3.8.0",
10+
org.eclipse.core.runtime;bundle-version="3.8.0",
11+
org.eclipse.jdt;bundle-version="3.8.0",
12+
org.eclipse.jdt.launching;bundle-version="3.6.100"
13+
Bundle-RequiredExecutionEnvironment: JavaSE-1.7

de.vogella.tycho.rcp/build.properties renamed to de.vogella.jdt.projectcreation/build.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ source.. = src/
22
output.. = bin/
33
bin.includes = plugin.xml,\
44
META-INF/,\
5-
.
5+
.,\
6+
icons/
983 Bytes
Loading
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse version="3.4"?>
3+
<plugin>
4+
5+
<extension
6+
point="org.eclipse.ui.commands">
7+
<category
8+
name="Sample Category"
9+
id="de.vogella.jdt.projectcreation.commands.category">
10+
</category>
11+
<command
12+
name="Sample Command"
13+
categoryId="de.vogella.jdt.projectcreation.commands.category"
14+
id="de.vogella.jdt.projectcreation.commands.sampleCommand">
15+
</command>
16+
</extension>
17+
<extension
18+
point="org.eclipse.ui.handlers">
19+
<handler
20+
commandId="de.vogella.jdt.projectcreation.commands.sampleCommand"
21+
class="de.vogella.jdt.projectcreation.handlers.CreateProjectHandler">
22+
</handler>
23+
</extension>
24+
<extension
25+
point="org.eclipse.ui.bindings">
26+
<key
27+
commandId="de.vogella.jdt.projectcreation.commands.sampleCommand"
28+
contextId="org.eclipse.ui.contexts.window"
29+
sequence="M1+6"
30+
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
31+
</key>
32+
</extension>
33+
<extension
34+
point="org.eclipse.ui.menus">
35+
<menuContribution
36+
locationURI="menu:org.eclipse.ui.main.menu?after=additions">
37+
<menu
38+
label="Sample Menu"
39+
mnemonic="M"
40+
id="de.vogella.jdt.projectcreation.menus.sampleMenu">
41+
<command
42+
commandId="de.vogella.jdt.projectcreation.commands.sampleCommand"
43+
mnemonic="S"
44+
id="de.vogella.jdt.projectcreation.menus.sampleCommand">
45+
</command>
46+
</menu>
47+
</menuContribution>
48+
<menuContribution
49+
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
50+
<toolbar
51+
id="de.vogella.jdt.projectcreation.toolbars.sampleToolbar">
52+
<command
53+
commandId="de.vogella.jdt.projectcreation.commands.sampleCommand"
54+
icon="icons/sample.gif"
55+
tooltip="Say hello world"
56+
id="de.vogella.jdt.projectcreation.toolbars.sampleCommand">
57+
</command>
58+
</toolbar>
59+
</menuContribution>
60+
</extension>
61+
62+
</plugin>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
package de.vogella.jdt.projectcreation.handlers;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
import org.eclipse.core.commands.AbstractHandler;
7+
import org.eclipse.core.commands.ExecutionEvent;
8+
import org.eclipse.core.commands.ExecutionException;
9+
import org.eclipse.core.resources.IFolder;
10+
import org.eclipse.core.resources.IProject;
11+
import org.eclipse.core.resources.IProjectDescription;
12+
import org.eclipse.core.resources.IResource;
13+
import org.eclipse.core.resources.ResourcesPlugin;
14+
import org.eclipse.core.runtime.CoreException;
15+
import org.eclipse.core.runtime.IPath;
16+
import org.eclipse.core.runtime.Path;
17+
import org.eclipse.jdt.core.IClasspathEntry;
18+
import org.eclipse.jdt.core.IJavaProject;
19+
import org.eclipse.jdt.core.IPackageFragment;
20+
import org.eclipse.jdt.core.IPackageFragmentRoot;
21+
import org.eclipse.jdt.core.JavaCore;
22+
import org.eclipse.jdt.core.JavaModelException;
23+
import org.eclipse.jdt.launching.IVMInstall;
24+
import org.eclipse.jdt.launching.JavaRuntime;
25+
import org.eclipse.jdt.launching.LibraryLocation;
26+
import org.eclipse.jdt.ui.PreferenceConstants;
27+
import org.eclipse.jface.dialogs.MessageDialog;
28+
import org.eclipse.swt.widgets.Shell;
29+
import org.eclipse.ui.handlers.HandlerUtil;
30+
31+
/**
32+
* Our sample handler extends AbstractHandler, an IHandler base class.
33+
*
34+
* @see org.eclipse.core.commands.IHandler
35+
* @see org.eclipse.core.commands.AbstractHandler
36+
*/
37+
public class CreateProjectHandler extends AbstractHandler {
38+
39+
private static final String SOURCE_FOLDER = "src";
40+
41+
/**
42+
* the command has been executed, so extract extract the needed information
43+
* from the application context.
44+
*/
45+
public Object execute(ExecutionEvent event) throws ExecutionException {
46+
Shell shell = HandlerUtil.getActiveShell(event);
47+
48+
try {
49+
IProject project = ResourcesPlugin.getWorkspace().getRoot()
50+
.getProject("aaaa.example");
51+
if (project.exists()) {
52+
MessageDialog.openInformation(shell, "Error",
53+
"Project exists already");
54+
}
55+
project.create(null);
56+
project.open(null);
57+
58+
IProjectDescription description = project.getDescription();
59+
description.setNatureIds(new String[] { JavaCore.NATURE_ID });
60+
project.setDescription(description, null);
61+
62+
IJavaProject javaProject = JavaCore.create(project);
63+
64+
IFolder binFolder = project.getFolder("bin");
65+
binFolder.create(false, true, null);
66+
javaProject.setOutputLocation(binFolder.getFullPath(), null);
67+
68+
List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
69+
IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
70+
LibraryLocation[] locations = JavaRuntime
71+
.getLibraryLocations(vmInstall);
72+
for (LibraryLocation element : locations) {
73+
entries.add(JavaCore.newLibraryEntry(
74+
element.getSystemLibraryPath(), null, null));
75+
}
76+
77+
IFolder sourceFolder = project.getFolder(SOURCE_FOLDER);
78+
sourceFolder.create(false, true, null);
79+
80+
IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(sourceFolder);
81+
IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
82+
IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
83+
System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
84+
newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
85+
javaProject.setRawClasspath(newEntries, null);
86+
87+
88+
89+
createPackage(project);
90+
91+
try {
92+
project.refreshLocal(IResource.DEPTH_INFINITE, null);
93+
} catch (CoreException e) {
94+
e.printStackTrace();
95+
}
96+
} catch (CoreException e) {
97+
e.printStackTrace();
98+
}
99+
return null;
100+
}
101+
102+
private void createPackage(IProject project) {
103+
IJavaProject javaProject = JavaCore.create(project);
104+
IFolder folder = project.getFolder(SOURCE_FOLDER);
105+
// folder.create(true, true, null);
106+
IPackageFragmentRoot srcFolder = javaProject
107+
.getPackageFragmentRoot(folder);
108+
try {
109+
srcFolder.createPackageFragment(
110+
project.getName(), true, null);
111+
} catch (JavaModelException e) {
112+
e.printStackTrace();
113+
}
114+
}
115+
}

de.vogella.tycho.feature/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
<artifactId>de.vogella.tycho.feature</artifactId>
1313
<packaging>eclipse-feature</packaging>
1414

15-
<name>Tycho Test Build</name>
15+
<name>de.vogella.tycho.feature feature build</name>
1616
</project>

0 commit comments

Comments
 (0)