Commit 45428dee authored by Johannes Eder's avatar Johannes Eder
Browse files

removed development from project ui

Issue-Ref: 3891
Issue-Url: https://af3-developer.fortiss.org/issues/3891

Signed-off-by: Johannes Eder's avatarJohannes Eder <eder@fortiss.org>
parent 1e9b3ffb
/*-------------------------------------------------------------------------+
| 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.af3.project.ui;
import static org.fortiss.af3.project.utils.ProjectUtils.getProjectConfigurationElement;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.model.configuration.DevelopmentProcessConfiguration;
import org.fortiss.af3.project.model.development.ConstraintBasedDevelopmentProcess;
import org.fortiss.af3.project.model.development.IDevelopmentProcess;
import org.fortiss.tooling.base.model.base.ConstraintBasedProcess;
import org.fortiss.tooling.base.ui.utils.ConstraintsBaseUIUtils.ConstraintBasedProcessAwareActivator;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
/**
* Class for centrally starting the listeners.
*
* @author aravantinos
*/
public final class AF3ProjectUI {
/** Start the kernel. */
public static void start() {
ConstraintBasedProcessAwareActivator cstrBasedActivator =
new ConstraintBasedProcessAwareActivator(t -> getConstraintBasedProcess(t));
cstrBasedActivator.start();
}
/** Returns the constraint based process definition associated to the given top element. */
public static ConstraintBasedProcess getConstraintBasedProcess(ITopLevelElement top) {
EObject root = top.getRootModelElement();
DevelopmentProcessConfiguration devConf =
getProjectConfigurationElement(root, DevelopmentProcessConfiguration.class);
if(devConf == null) {
return null;
}
IDevelopmentProcess devType = devConf.getDevelopment();
if(devType instanceof ConstraintBasedDevelopmentProcess) {
return (ConstraintBasedProcess)devType;
}
return null;
}
}
ConstraintBasedDevelopmentProcessCompositor.java 8030ff0c55cd0303553d62968052ed58ef8eca4f GREEN
/*-------------------------------------------------------------------------+
| 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.af3.project.ui.compose;
import org.fortiss.af3.project.model.development.ConstraintBasedDevelopmentProcess;
import org.fortiss.tooling.base.ui.compose.ConstraintBasedProcessCompositor;
/**
* Compositor for {@link ConstraintBasedDevelopmentProcess}.
*
* @author aravantinos
*/
public class ConstraintBasedDevelopmentProcessCompositor
extends ConstraintBasedProcessCompositor<ConstraintBasedDevelopmentProcess> {
// Defaults are fine
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.af3.project.ui.editor;
import org.eclipse.ui.IEditorPart;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.development.ConstraintBasedDevelopmentProcess;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
/**
* Editor binding for {@link ConstraintBasedDevelopmentProcess}.
*
* @author aravantinos
*/
public final class ConstraintBasedDevelopmentProcessEditorBinding
extends ModelEditorBindingBase<FileProject> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass() {
return ProjectCBDEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Development process";
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.af3.project.ui.editor;
import static org.fortiss.af3.project.utils.ProjectUtils.getProjectConfigurationElement;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.configuration.DevelopmentProcessConfiguration;
import org.fortiss.af3.project.model.development.ConstraintBasedDevelopmentProcess;
import org.fortiss.af3.project.model.development.DummyDevelopmentProcess;
import org.fortiss.af3.project.model.development.IDevelopmentProcess;
import org.fortiss.af3.project.utils.ProjectModelElementFactory;
import org.fortiss.tooling.base.ui.editor.ConstraintBasedProcessEditor;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.internal.editor.ModelElementEditorInput;
/**
* Editor for {@link ConstraintBasedDevelopmentProcess}s.
* TODO (SK,2)
* TODO(2931): Current implementation is disgusting.
*
*/
public class ProjectCBDEditor extends EditorBase<FileProject>
implements ContextMenuContextProvider, ISelectionProvider {
/** The embedded constraint-based process editor. */
private ConstraintBasedProcessEditor<ConstraintBasedDevelopmentProcess> cbdEditor;
/** Constructor. */
public ProjectCBDEditor() {
super();
cbdEditor = new ConstraintBasedProcessEditor<ConstraintBasedDevelopmentProcess>();
}
/** {@inheritDoc} */
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
DevelopmentProcessConfiguration devConf = getProjectConfigurationElement(
this.getEditedObject(), DevelopmentProcessConfiguration.class);
IDevelopmentProcess devType = devConf.getDevelopment();
if(devType instanceof DummyDevelopmentProcess) {
devType = ProjectModelElementFactory.createConstraintBasedDevelopmentProcess(devConf);
final IDevelopmentProcess devTypeCopy = devType;
ITopLevelElement modelContext =
IPersistencyService.getInstance().getTopLevelElementFor(this.getEditedObject());
modelContext.runAsNonDirtyingCommand(new Runnable() {
@Override
public void run() {
devConf.setDevelopment(devTypeCopy);
}
});
}
if(devType instanceof ConstraintBasedDevelopmentProcess) {
cbdEditor.init(site, new ModelElementEditorInput(devType));
}
}
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
cbdEditor.createPartControl(parent);
}
/** {@inheritDoc} */
@Override
public void dispose() {
cbdEditor.dispose();
super.dispose();
}
/** {@inheritDoc} */
@Override
public void addSelectionChangedListener(ISelectionChangedListener listener) {
cbdEditor.addSelectionChangedListener(listener);
}
/** {@inheritDoc} */
@Override
public ISelection getSelection() {
return cbdEditor.getSelection();
}
/** {@inheritDoc} */
@Override
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
cbdEditor.removeSelectionChangedListener(listener);
}
/** {@inheritDoc} */
@Override
public void setSelection(ISelection selection) {
cbdEditor.setSelection(selection);
}
/** {@inheritDoc} */
@Override
public EObject getSelectedModelElement() {
return cbdEditor.getSelectedModelElement();
}
/** {@inheritDoc} */
@Override
public List<EObject> getSelectedModelElementList() {
return cbdEditor.getSelectedModelElementList();
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.af3.project.ui.handler;
import static org.fortiss.af3.project.ui.AF3ProjectUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.project.model.development.ConstraintBasedDevelopmentProcess;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
/**
* {@link IModelElementHandler} for {@link ConstraintBasedDevelopmentProcess}s.
*
* @author hoelzl
*/
public final class ConstraintBasedDevelopmentProcessHandler
extends ModelElementHandlerBase<ConstraintBasedDevelopmentProcess> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/execution_configuration.gif");
}
/** {@inheritDoc} */
@Override
public String getName(ConstraintBasedDevelopmentProcess element) {
return "Development process";
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.af3.project.ui.handler;
import static org.fortiss.af3.project.ui.AF3ProjectUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.project.model.configuration.DevelopmentProcessConfiguration;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
/**
* {@link IModelElementHandler} for {@link DevelopmentProcessConfiguration}s.
*
* @author hoelzl
*/
public final class DevelopmentProcessConfigurationHandler
extends ModelElementHandlerBase<DevelopmentProcessConfiguration> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/execution_configuration.gif");
}
/** {@inheritDoc} */
@Override
public String getName(DevelopmentProcessConfiguration element) {
return "Development process";
}
}
NewLibraryWizard.java 34d538b36b03e0541578490d70d64edf4cf1da26 GREEN
NewProjectWizard.java acf2a53cd639985bcba4c09c9e6ec80cd71ca14e GREEN
NewProjectWizard.java 77a6292ff791c55c1abcfc5533fb6544a6488fcb GREEN
......@@ -17,7 +17,6 @@ package org.fortiss.af3.project.ui.wizard;
import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace;
import static org.eclipse.jface.dialogs.MessageDialog.openError;
import static org.fortiss.af3.project.utils.ProjectModelElementFactory.createDummyDevelopmentProcess;
import static org.fortiss.af3.project.utils.ProjectModelElementFactory.createDummyTypeSystem;
import static org.fortiss.af3.project.utils.ProjectModelElementFactory.createFileProject;
import static org.fortiss.af3.project.utils.ProjectModelElementFactory.createProjectConfiguration;
......@@ -79,8 +78,8 @@ public final class NewProjectWizard extends Wizard implements INewWizard {
IContainer container = (IContainer)resource;
IFile file = container.getFile(new Path(page.getFileName()));
FileProject project = createFileProject("NewAF3Project", createProjectConfiguration(
createDummyTypeSystem(), createDummyDevelopmentProcess()));
FileProject project = createFileProject("NewAF3Project",
createProjectConfiguration(createDummyTypeSystem()));
createNewEclipseWorkspaceProject(file, project);
} catch(IOException e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment