Skip to content

Commit 8af0449

Browse files
authored
Merge pull request #9 from jirkafm/idea_2
Fix for issue #8 and implented things from idea #2
2 parents 4134e36 + 76d4205 commit 8af0449

File tree

15 files changed

+234
-8
lines changed

15 files changed

+234
-8
lines changed

com.eclipsesource.megit.parent/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
<modules>
4040
<module>../com.eclipsesource.megit.product</module>
41+
<module>../com.eclipsesource.megit.plugin</module>
4142
<module>../com.eclipsesource.megit.product.feature</module>
4243
<module>../com.eclipsesource.megit.target</module>
4344
</modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.eclipsesource.megit.plugin</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.pde.PluginNature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
</natures>
28+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="ASCII"?>
2+
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xsi:schemaLocation="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic http://www.eclipse.org/ui/2010/UIModel/application#//ui/basic http://www.eclipse.org/ui/2010/UIModel/application/ui/menu http://www.eclipse.org/ui/2010/UIModel/application#//ui/menu" xmi:id="org.eclipse.e4.legacy.ide.application" elementId="org.eclipse.e4.legacy.ide.application" bindingContexts="_SeXUHO8EEd6BC9cDb6iV7y">
3+
<children xsi:type="basic:TrimmedWindow" xmi:id="IDEWindow" elementId="IDEWindow" label="%trimmedwindow.label.eclipseSDK" width="1024" height="768">
4+
<persistedState key="coolBarVisible" value="false"/>
5+
<persistedState key="perspectiveBarVisible" value="false"/>
6+
<trimBars xmi:id="_vCH1AF1sEeOF8qbLMOkG7A" elementId="org.eclipse.ui.main.toolbar"/>
7+
<trimBars xmi:id="_CT96oF6VEeO_3ZCXGA_PQg" elementId="org.eclipse.ui.trim.status" side="Bottom">
8+
<children xsi:type="menu:ToolControl" xmi:id="_6CqUoHB1EemL5_T8nUqtDA" elementId="org.eclipse.ui.StatusLine" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.StandardTrim">
9+
<tags>stretch</tags>
10+
</children>
11+
<children xsi:type="menu:ToolControl" xmi:id="_ndBZwHB2EemL5_T8nUqtDA" elementId="org.eclipse.ui.HeapStatus" toBeRendered="false" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.StandardTrim">
12+
<tags>Draggable</tags>
13+
</children>
14+
<children xsi:type="menu:ToolControl" xmi:id="_oCZ-wHB2EemL5_T8nUqtDA" elementId="org.eclipse.ui.ProgressBar" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.StandardTrim">
15+
<tags>Draggable</tags>
16+
</children>
17+
</trimBars>
18+
<trimBars xmi:id="_DU4lEF6VEeO_3ZCXGA_PQg" elementId="org.eclipse.ui.trim.vertical1" side="Left"/>
19+
<trimBars xmi:id="_Ek7QoF6VEeO_3ZCXGA_PQg" elementId="org.eclipse.ui.trim.vertical2" side="Right"/>
20+
</children>
21+
<bindingTables xmi:id="_SeXUEO8EEd6FC9cDb6iV7x" bindingContext="_SeXUHO8EEd6BC9cDb6iV7y"/>
22+
<rootContext xmi:id="_SeXUHO8EEd6BC9cDb6iV7y" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="%bindingcontext.name.dialogAndWindows">
23+
<children xmi:id="_SeXUEO8EEd6FC9cDb6iV7w" elementId="org.eclipse.ui.contexts.window" name="%bindingcontext.name.windows">
24+
<children xmi:id="_SeXUEO8EEd6FC9cDb6yV7x" elementId="org.eclipse.e4.ui.contexts.views" name="%bindingcontext.name.bindingView"/>
25+
</children>
26+
<children xmi:id="_SeXUEO8EEd6FC9cDb6iV7x" elementId="org.eclipse.ui.contexts.dialog" name="%bindingcontext.name.dialogs"/>
27+
</rootContext>
28+
<addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXg" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
29+
<addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXh" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
30+
<addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXi" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
31+
<addons xmi:id="_LK0NgPZmEd-XstlTZ6nTXj" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
32+
<addons xmi:id="_LK0NgPZmEd-XstlTZ6nTXk" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
33+
<addons xmi:id="_LK0NgPZmEd-XstlTZ6nTXl" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
34+
<addons xmi:id="_XwQYkE2EEd-DfN2vYY4Lew" elementId="Cleanup Addon" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon"/>
35+
<addons xmi:id="_bqcWME2EEd-DfN2vYY4Lew" elementId="DnD Addon" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon"/>
36+
<addons xmi:id="_7GC6sGp-Ed-QyNZjH9g15Q" elementId="MinMax Addon" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon"/>
37+
<addons xmi:id="_00yosOXqEeGugqEu_OWUGQ" elementId="org.eclipse.ui.workbench.addon.0" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
38+
</application:Application>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Plugin
4+
Bundle-SymbolicName: com.eclipsesource.megit.plugin;singleton:=true
5+
Bundle-Version: 0.0.1.qualifier
6+
Bundle-Activator: com.eclipsesource.megit.plugin.Activator
7+
Bundle-Vendor: ECLIPSESOURCE
8+
Require-Bundle: org.eclipse.ui,
9+
org.eclipse.core.runtime,
10+
org.eclipse.e4.ui.di,
11+
org.eclipse.e4.ui.workbench,
12+
org.eclipse.e4.ui.model.workbench,
13+
org.eclipse.osgi.services,
14+
org.eclipse.e4.core.di.annotations,
15+
org.eclipse.e4.core.contexts,
16+
javax.inject
17+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
18+
Automatic-Module-Name: com.eclipsesource.megit.plugin
19+
Bundle-ActivationPolicy: lazy
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source.. = src/
2+
output.. = bin/
3+
bin.includes = META-INF/,\
4+
.,\
5+
plugin.xml,\
6+
plugin_customization.ini,\
7+
LegacyIDE.e4xmi
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse version="3.4"?>
3+
<plugin>
4+
<extension
5+
id="megit"
6+
point="org.eclipse.core.runtime.products">
7+
<product
8+
application="org.eclipse.ui.ide.workbench"
9+
name="Miminal EGit">
10+
<property
11+
name="appName"
12+
value="Miminal EGit">
13+
</property>
14+
<property
15+
name="applicationXMI"
16+
value="com.eclipsesource.megit.plugin/LegacyIDE.e4xmi">
17+
</property>
18+
<property
19+
name="lifeCycleURI"
20+
value="bundleclass://com.eclipsesource.megit.plugin/com.eclipsesource.megit.plugin.LifeCycle">
21+
</property>
22+
</product>
23+
</extension>
24+
</plugin>

com.eclipsesource.megit.product.feature/plugin_customization.ini renamed to com.eclipsesource.megit.plugin/plugin_customization.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ eclipse.preferences.version=1
22
org.eclipse.core.resources/encoding=UTF-8
33
org.eclipse.ui/defaultPerspectiveId=org.eclipse.egit.ui.GitRepositoryExploring
44
org.eclipse.ui/SHOW_MEMORY_MONITOR=true
5-
org.eclipse.ui/showIntro=false
5+
org.eclipse.ui/showIntro=false
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6+
<modelVersion>4.0.0</modelVersion>
7+
<parent>
8+
<groupId>com.eclipsesource.megit</groupId>
9+
<artifactId>com.eclipsesource.megit.parent</artifactId>
10+
<version>0.0.1-SNAPSHOT</version>
11+
<relativePath>../com.eclipsesource.megit.parent</relativePath>
12+
</parent>
13+
<artifactId>com.eclipsesource.megit.plugin</artifactId>
14+
<packaging>eclipse-plugin</packaging>
15+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.eclipsesource.megit.plugin;
2+
3+
import org.eclipse.ui.plugin.AbstractUIPlugin;
4+
import org.osgi.framework.BundleContext;
5+
6+
/**
7+
* The activator class controls the plug-in life cycle
8+
*/
9+
public class Activator extends AbstractUIPlugin {
10+
11+
// The plug-in ID
12+
public static final String PLUGIN_ID = "com.eclipsesource.megit.plugin"; //$NON-NLS-1$
13+
14+
// The shared instance
15+
private static Activator plugin;
16+
17+
/**
18+
* The constructor
19+
*/
20+
public Activator() {
21+
}
22+
23+
@Override
24+
public void start(BundleContext context) throws Exception {
25+
super.start(context);
26+
plugin = this;
27+
}
28+
29+
@Override
30+
public void stop(BundleContext context) throws Exception {
31+
plugin = null;
32+
super.stop(context);
33+
}
34+
35+
/**
36+
* Returns the shared instance
37+
*
38+
* @return the shared instance
39+
*/
40+
public static Activator getDefault() {
41+
return plugin;
42+
}
43+
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.eclipsesource.megit.plugin;
2+
3+
import java.util.List;
4+
5+
import javax.inject.Inject;
6+
7+
import org.eclipse.e4.core.di.annotations.Optional;
8+
import org.eclipse.e4.ui.di.UIEventTopic;
9+
import org.eclipse.e4.ui.model.application.MApplication;
10+
import org.eclipse.e4.ui.model.application.ui.MUIElement;
11+
import org.eclipse.e4.ui.workbench.IPresentationEngine;
12+
import org.eclipse.e4.ui.workbench.UIEvents;
13+
import org.eclipse.e4.ui.workbench.modeling.EModelService;
14+
import org.osgi.service.event.Event;
15+
16+
public class LifeCycle {
17+
18+
private static final String FIRST_RUN_TAG = "firstRunTag";
19+
private static final String EDITOR_AREA = "org.eclipse.ui.editorss";
20+
21+
@Optional
22+
@Inject
23+
public void minimizeEditorAreaOnAppStartup(
24+
@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) final Event event, EModelService modelService,
25+
MApplication app) {
26+
MUIElement editorArea = modelService.find(EDITOR_AREA, app);
27+
if (shouldMinimize(editorArea)) {
28+
editorArea.getTags().add(IPresentationEngine.MINIMIZED);
29+
editorArea.getTags().add(FIRST_RUN_TAG);
30+
}
31+
}
32+
33+
private boolean shouldMinimize(MUIElement element) {
34+
if (element != null) {
35+
List<String> tags = element.getTags();
36+
return !tags.contains(FIRST_RUN_TAG) && !tags.contains(IPresentationEngine.MINIMIZED);
37+
}
38+
return false;
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
bin.includes = feature.xml
2-
root=file:plugin_customization.ini
1+
bin.includes = feature.xml

com.eclipsesource.megit.product.feature/feature.xml

+6
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@
1717
[Enter License Description here.]
1818
</license>
1919

20+
<plugin
21+
id="com.eclipsesource.megit.plugin"
22+
download-size="0"
23+
install-size="0"
24+
version="0.0.0"/>
25+
2026
</feature>

com.eclipsesource.megit.product/megit.product

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<?pde version="3.5"?>
33

4-
<product name="Miminal EGit" uid="com.eclipsesource.megit" id="org.eclipse.platform.ide" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
5-
4+
<product name="Miminal EGit" uid="com.eclipsesource.megit" id="com.eclipsesource.megit.plugin.megit" application="org.eclipse.ui.ide.workbench" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
65

76
<configIni use="default">
87
</configIni>
@@ -17,14 +16,12 @@
1716

1817
<windowImages/>
1918

20-
2119
<launcher name="megit">
2220
<win useIco="false">
2321
<bmp/>
2422
</win>
2523
</launcher>
2624

27-
2825
<vm>
2926
</vm>
3027

@@ -323,9 +320,9 @@ version(s), and exceptions or additional permissions here}.&quot;
323320
</features>
324321

325322
<configurations>
323+
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
326324
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
327325
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
328-
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
329326
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
330327
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
331328
</configurations>

0 commit comments

Comments
 (0)