Skip to content
Snippets Groups Projects
Commit a72803ef authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Initial changes to kernel for tutorial extension.

refs 2567
parent a4f2f567
No related branches found
No related tags found
No related merge requests found
Showing with 268 additions and 12 deletions
org.fortiss.tooling.kernel.ui/trunk/icons/tutorial.gif

583 B

......@@ -22,21 +22,16 @@ Export-Package: org.fortiss.tooling.kernel;uses:="org.eclipse.core.runtime,org.o
org.fortiss.tooling.kernel.extension.exception,
org.fortiss.tooling.kernel.introspection,
org.fortiss.tooling.kernel.introspection.items,
org.fortiss.tooling.kernel.model;uses:="org.eclipse.emf.ecore",
org.fortiss.tooling.kernel.model;uses:=org.eclipse.emf.ecore,
org.fortiss.tooling.kernel.model.constraints,
org.fortiss.tooling.kernel.model.constraints.impl,
org.fortiss.tooling.kernel.model.constraints.util,
org.fortiss.tooling.kernel.model.impl;uses:="org.fortiss.tooling.kernel.model",
org.fortiss.tooling.kernel.model.util;
uses:="org.eclipse.emf.ecore,
org.fortiss.tooling.kernel.model,
org.eclipse.emf.common.notify.impl,
org.eclipse.emf.common.notify",
org.fortiss.tooling.kernel.service;
uses:="org.eclipse.core.runtime,
org.eclipse.emf.ecore,
org.fortiss.tooling.kernel.interfaces,
org.conqat.lib.commons.collections",
org.fortiss.tooling.kernel.model.impl;uses:=org.fortiss.tooling.kernel.model,
org.fortiss.tooling.kernel.model.tutorial,
org.fortiss.tooling.kernel.model.tutorial.impl,
org.fortiss.tooling.kernel.model.tutorial.util,
org.fortiss.tooling.kernel.model.util;uses:="org.eclipse.emf.ecore, org.fortiss.tooling.kernel.model, org.eclipse.emf.common.notify.impl, org.eclipse.emf.common.notify",
org.fortiss.tooling.kernel.service;uses:="org.eclipse.core.runtime, org.eclipse.emf.ecore, org.fortiss.tooling.kernel.interfaces, org.conqat.lib.commons.collections",
org.fortiss.tooling.kernel.service.base,
org.fortiss.tooling.kernel.service.listener,
org.fortiss.tooling.kernel.utils;uses:="org.eclipse.emf.ecore,org.eclipse.core.resources"
......@@ -161,4 +161,21 @@
<eClassifiers xsi:type="ecore:EClass" name="ErrorVerificationStatus" eSuperTypes="#//constraints/IConstraintVerificationStatus"/>
<eClassifiers xsi:type="ecore:EClass" name="SuccessVerificationStatus" eSuperTypes="#//constraints/IConstraintVerificationStatus"/>
</eSubpackages>
<eSubpackages name="tutorial" nsURI="http://www.fortiss.org/tooling/base/model/element/tutorial"
nsPrefix="org-fortiss-tooling-kernel-tutorial">
<eClassifiers xsi:type="ecore:EClass" name="TutorialDefinition">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="globalWhitelistProviderClassName"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="steps" lowerBound="1"
upperBound="-1" eType="#//tutorial/TutorialStep" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TutorialStep">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="whitelistProviderClassName"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="completionCheckerClassName"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>
......@@ -79,5 +79,18 @@
<genClasses ecoreClass="kernel.ecore#//constraints/ErrorVerificationStatus"/>
<genClasses ecoreClass="kernel.ecore#//constraints/SuccessVerificationStatus"/>
</nestedGenPackages>
<nestedGenPackages prefix="Tutorial" basePackage="org.fortiss.tooling.kernel.model"
disposableProviderFactory="true" ecorePackage="kernel.ecore#//tutorial">
<genClasses ecoreClass="kernel.ecore#//tutorial/TutorialDefinition">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//tutorial/TutorialDefinition/title"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//tutorial/TutorialDefinition/globalWhitelistProviderClassName"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference kernel.ecore#//tutorial/TutorialDefinition/steps"/>
</genClasses>
<genClasses ecoreClass="kernel.ecore#//tutorial/TutorialStep">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//tutorial/TutorialStep/whitelistProviderClassName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//tutorial/TutorialStep/completionCheckerClassName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//tutorial/TutorialStep/description"/>
</genClasses>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
......@@ -20,6 +20,22 @@
uri="http://www.fortiss.org/tooling/kernel">
</package>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated kernel -->
<package
uri="http://www.fortiss.org/tooling/base/model/element/constraints"
class="org.fortiss.tooling.kernel.model.constraints.ConstraintsPackage"
genModel="model/kernel.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated kernel -->
<package
uri="http://www.fortiss.org/tooling/base/model/element/tutorial"
class="org.fortiss.tooling.kernel.model.tutorial.TutorialPackage"
genModel="model/kernel.genmodel"/>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelStorageProvider">
<modelStorageProvider
......
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2016 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.extension;
/**
* Instances of this class provide completion checkers for
* tutorial steps.
*
* @author hoelzl
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash:
*/
public interface ITutorialStepCompletionChecker {
// TODO: define
}
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2016 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.extension;
/**
* Instances of this interface provide white lists for tool functions
* globally enabled in tutorial or locally enabled in a tutorial step.
*
* @author hoelzl
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash:
*/
public interface ITutorialWhitelistProvider {
// TODO: define
}
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2016 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.internal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.conqat.lib.commons.collections.UnmodifiableList;
import org.fortiss.tooling.kernel.model.tutorial.TutorialDefinition;
import org.fortiss.tooling.kernel.model.tutorial.TutorialStep;
import org.fortiss.tooling.kernel.service.ITutorialService;
/**
* This class implements the {@link ITutorialService} interface.
*
* @author hoelzl
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash:
*/
public final class TutorialService implements ITutorialService {
/** The collection of all defined tutorials. */
private List<TutorialDefinition> allTutorials = new ArrayList<>();
/** The active tutorial. */
private TutorialDefinition activeTutorial = null;
/** The active tutorial step. */
private TutorialStep activeStep = null;
/** {@inheritDoc} */
@Override
public boolean isTutorialActive() {
return activeTutorial != null;
}
/** {@inheritDoc} */
@Override
public TutorialDefinition getActiveTutorial() {
return activeTutorial;
}
/** {@inheritDoc} */
@Override
public TutorialStep getActiveTutorialStep() {
return activeStep;
}
/** {@inheritDoc} */
@Override
public Collection<TutorialDefinition> getAllTutorials() {
return new UnmodifiableList<>(allTutorials);
}
/** {@inheritDoc} */
@Override
public void registerTutorial(TutorialDefinition definition) {
if(!allTutorials.contains(definition)) {
allTutorials.add(definition);
}
}
/** {@inheritDoc} */
@Override
public void startTutorial(TutorialDefinition definition) {
activeTutorial = definition;
// steps relation is 1..* => get(0) always works
activeStep = activeTutorial.getSteps().get(0);
}
/** {@inheritDoc} */
@Override
public void stopTutorial() {
activeStep = null;
activeTutorial = null;
}
}
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2016 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.service;
import java.util.Collection;
import org.fortiss.tooling.kernel.internal.TutorialService;
import org.fortiss.tooling.kernel.model.tutorial.TutorialDefinition;
import org.fortiss.tooling.kernel.model.tutorial.TutorialStep;
/**
* The tutorial service provides pre-defined models with step-wise
* example procedures for implementing educational tutorials to
* the end-user.
*
* @author hoelzl
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash:
*/
public interface ITutorialService {
/** Returns the singleton instance of the service. */
public static final ITutorialService INSTANCE = new TutorialService();
/** Returns whether any tutorial is currently enabled. */
public boolean isTutorialActive();
/** Returns the current tutorial definition or <code>null</code> if no tutorial is active. */
public TutorialDefinition getActiveTutorial();
/** Starts the given tutorial. */
public void startTutorial(TutorialDefinition definition);
/** Stops the current tutorial. */
public void stopTutorial();
/** Returns the active tutorial step. */
public TutorialStep getActiveTutorialStep();
/** Returns all registered tutorial definitions. */
public Collection<TutorialDefinition> getAllTutorials();
/** Programmatically register a tutorial. */
public void registerTutorial(TutorialDefinition definition);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment