Skip to content

Commit

Permalink
Merge pull request #9 from jirkafm/idea_2
Browse files Browse the repository at this point in the history
Fix for issue #8 and implented things from idea #2
  • Loading branch information
planger authored Feb 8, 2021
2 parents 4134e36 + 76d4205 commit 8af0449
Show file tree
Hide file tree
Showing 15 changed files with 234 additions and 8 deletions.
1 change: 1 addition & 0 deletions com.eclipsesource.megit.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

<modules>
<module>../com.eclipsesource.megit.product</module>
<module>../com.eclipsesource.megit.plugin</module>
<module>../com.eclipsesource.megit.product.feature</module>
<module>../com.eclipsesource.megit.target</module>
</modules>
Expand Down
7 changes: 7 additions & 0 deletions com.eclipsesource.megit.plugin/.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-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions com.eclipsesource.megit.plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
28 changes: 28 additions & 0 deletions com.eclipsesource.megit.plugin/.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.eclipsesource.megit.plugin</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>
38 changes: 38 additions & 0 deletions com.eclipsesource.megit.plugin/LegacyIDE.e4xmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="ASCII"?>
<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">
<children xsi:type="basic:TrimmedWindow" xmi:id="IDEWindow" elementId="IDEWindow" label="%trimmedwindow.label.eclipseSDK" width="1024" height="768">
<persistedState key="coolBarVisible" value="false"/>
<persistedState key="perspectiveBarVisible" value="false"/>
<trimBars xmi:id="_vCH1AF1sEeOF8qbLMOkG7A" elementId="org.eclipse.ui.main.toolbar"/>
<trimBars xmi:id="_CT96oF6VEeO_3ZCXGA_PQg" elementId="org.eclipse.ui.trim.status" side="Bottom">
<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">
<tags>stretch</tags>
</children>
<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">
<tags>Draggable</tags>
</children>
<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">
<tags>Draggable</tags>
</children>
</trimBars>
<trimBars xmi:id="_DU4lEF6VEeO_3ZCXGA_PQg" elementId="org.eclipse.ui.trim.vertical1" side="Left"/>
<trimBars xmi:id="_Ek7QoF6VEeO_3ZCXGA_PQg" elementId="org.eclipse.ui.trim.vertical2" side="Right"/>
</children>
<bindingTables xmi:id="_SeXUEO8EEd6FC9cDb6iV7x" bindingContext="_SeXUHO8EEd6BC9cDb6iV7y"/>
<rootContext xmi:id="_SeXUHO8EEd6BC9cDb6iV7y" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="%bindingcontext.name.dialogAndWindows">
<children xmi:id="_SeXUEO8EEd6FC9cDb6iV7w" elementId="org.eclipse.ui.contexts.window" name="%bindingcontext.name.windows">
<children xmi:id="_SeXUEO8EEd6FC9cDb6yV7x" elementId="org.eclipse.e4.ui.contexts.views" name="%bindingcontext.name.bindingView"/>
</children>
<children xmi:id="_SeXUEO8EEd6FC9cDb6iV7x" elementId="org.eclipse.ui.contexts.dialog" name="%bindingcontext.name.dialogs"/>
</rootContext>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
</application:Application>
19 changes: 19 additions & 0 deletions com.eclipsesource.megit.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Plugin
Bundle-SymbolicName: com.eclipsesource.megit.plugin;singleton:=true
Bundle-Version: 0.0.1.qualifier
Bundle-Activator: com.eclipsesource.megit.plugin.Activator
Bundle-Vendor: ECLIPSESOURCE
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.e4.ui.di,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.model.workbench,
org.eclipse.osgi.services,
org.eclipse.e4.core.di.annotations,
org.eclipse.e4.core.contexts,
javax.inject
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: com.eclipsesource.megit.plugin
Bundle-ActivationPolicy: lazy
7 changes: 7 additions & 0 deletions com.eclipsesource.megit.plugin/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
plugin_customization.ini,\
LegacyIDE.e4xmi
24 changes: 24 additions & 0 deletions com.eclipsesource.megit.plugin/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="megit"
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.ui.ide.workbench"
name="Miminal EGit">
<property
name="appName"
value="Miminal EGit">
</property>
<property
name="applicationXMI"
value="com.eclipsesource.megit.plugin/LegacyIDE.e4xmi">
</property>
<property
name="lifeCycleURI"
value="bundleclass://com.eclipsesource.megit.plugin/com.eclipsesource.megit.plugin.LifeCycle">
</property>
</product>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ eclipse.preferences.version=1
org.eclipse.core.resources/encoding=UTF-8
org.eclipse.ui/defaultPerspectiveId=org.eclipse.egit.ui.GitRepositoryExploring
org.eclipse.ui/SHOW_MEMORY_MONITOR=true
org.eclipse.ui/showIntro=false
org.eclipse.ui/showIntro=false
15 changes: 15 additions & 0 deletions com.eclipsesource.megit.plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.eclipsesource.megit</groupId>
<artifactId>com.eclipsesource.megit.parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../com.eclipsesource.megit.parent</relativePath>
</parent>
<artifactId>com.eclipsesource.megit.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.eclipsesource.megit.plugin;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {

// The plug-in ID
public static final String PLUGIN_ID = "com.eclipsesource.megit.plugin"; //$NON-NLS-1$

// The shared instance
private static Activator plugin;

/**
* The constructor
*/
public Activator() {
}

@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 Activator getDefault() {
return plugin;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.eclipsesource.megit.plugin;

import java.util.List;

import javax.inject.Inject;

import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.osgi.service.event.Event;

public class LifeCycle {

private static final String FIRST_RUN_TAG = "firstRunTag";
private static final String EDITOR_AREA = "org.eclipse.ui.editorss";

@Optional
@Inject
public void minimizeEditorAreaOnAppStartup(
@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) final Event event, EModelService modelService,
MApplication app) {
MUIElement editorArea = modelService.find(EDITOR_AREA, app);
if (shouldMinimize(editorArea)) {
editorArea.getTags().add(IPresentationEngine.MINIMIZED);
editorArea.getTags().add(FIRST_RUN_TAG);
}
}

private boolean shouldMinimize(MUIElement element) {
if (element != null) {
List<String> tags = element.getTags();
return !tags.contains(FIRST_RUN_TAG) && !tags.contains(IPresentationEngine.MINIMIZED);
}
return false;
}
}
3 changes: 1 addition & 2 deletions com.eclipsesource.megit.product.feature/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
bin.includes = feature.xml
root=file:plugin_customization.ini
bin.includes = feature.xml
6 changes: 6 additions & 0 deletions com.eclipsesource.megit.product.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@
[Enter License Description here.]
</license>

<plugin
id="com.eclipsesource.megit.plugin"
download-size="0"
install-size="0"
version="0.0.0"/>

</feature>
7 changes: 2 additions & 5 deletions com.eclipsesource.megit.product/megit.product
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="Miminal EGit" uid="com.eclipsesource.megit" id="org.eclipse.platform.ide" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">

<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">

<configIni use="default">
</configIni>
Expand All @@ -17,14 +16,12 @@

<windowImages/>


<launcher name="megit">
<win useIco="false">
<bmp/>
</win>
</launcher>


<vm>
</vm>

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

<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>
Expand Down

0 comments on commit 8af0449

Please sign in to comment.