Commit 5984cffb authored by Simon Barner's avatar Simon Barner
Browse files

YELLOW

parent 1225fd4a
ActionService.java bba3d40df33a07a9d30bc6b5945a9087940af057 GREEN
AllocationEditPartFactoryService.java 8d176411639e01c15a65650747ec231ed7281777 GREEN
ConstraintLabelDecorator.java 6dd2665a86800777cc7c17807fddb68dadf73df5 GREEN
......@@ -6,8 +5,7 @@ ConstraintUIService.java dde08f7c2c19e948e397bb9cd3242d4735226ca2 GREEN
ContextMenuService.java f0168796a57fcebfb6124705c5a865516f0cb4c6 YELLOW
EditPartFactoryService.java a5b15d91675caf41fc7d4bc16092c9425326c539 YELLOW
MarkerService.java 04e3960acd4af5d1d41c2a4a2abd74a91441fe76 GREEN
MarkerServiceLabelDecorator.java 97b63001f3175ab190881fd5258dd0b61d9cf142 GREEN
ModelEditorBindingService.java 409efd9126cceda31de5b149745c3d941162b3a7 RED
ModelEditorBindingService.java 67cb577e2b89a9c0479698a3f45cef681885227e YELLOW
ModelElementHandlerService.java 6fa44187d4841b5b11b04de48dcf7b1bb20c7963 YELLOW
NavigatorService.java 9a042a0ff9a21a45d98d14fe39b66e90ab974269 GREEN
ToolingKernelUIInternal.java aefc9a6a7ebcd6ff689558ffc4300992cca89ad6 GREEN
......
......@@ -17,6 +17,7 @@ package org.fortiss.tooling.kernel.ui.internal;
import static java.util.Collections.emptyList;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.isChildElementOf;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import java.util.EventObject;
......@@ -24,13 +25,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.conqat.lib.commons.collections.CollectionUtils;
import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
......@@ -56,7 +58,6 @@ import org.fortiss.tooling.kernel.ui.internal.introspection.items.ModelEditorBin
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
import org.fortiss.tooling.kernel.ui.service.INavigatorService;
import org.fortiss.tooling.kernel.utils.KernelModelElementUtils;
/**
* This class implements the {@link IModelEditorBindingService} interface.
......@@ -158,13 +159,11 @@ public class ModelEditorBindingService extends
return;
}
try {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorPart part =
PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage()
.openEditor(new ModelElementEditorInput(element),
ExtendableMultiPageEditor.ID);
activePage.openEditor(new ModelElementEditorInput(element),
ExtendableMultiPageEditor.ID);
currentEditors.put(part, element);
// ensure registration with part service
IPartService service = (IPartService)part.getSite().getService(IPartService.class);
......@@ -184,7 +183,7 @@ public class ModelEditorBindingService extends
public List<IModelEditorBinding<EObject>> getBindings(EObject element) {
List<IModelEditorBinding<EObject>> bindings = getRegisteredHandlers(element.getClass());
if(bindings == null) {
bindings = CollectionUtils.emptyList();
bindings = emptyList();
}
return bindings;
}
......@@ -213,7 +212,7 @@ public class ModelEditorBindingService extends
IEditorPart[] parts = new IEditorPart[0];
for(IEditorPart editor : currentEditors.keySet().toArray(parts)) {
EObject editedElement = currentEditors.get(editor);
if(KernelModelElementUtils.isChildElementOf(editedElement, parentElement)) {
if(isChildElementOf(editedElement, parentElement)) {
closeEditor(editor);
}
}
......@@ -290,9 +289,8 @@ public class ModelEditorBindingService extends
public void commandStackChanged(EventObject event) {
IEditorPart[] parts = new IEditorPart[0];
for(IEditorPart part : currentEditors.keySet().toArray(parts)) {
ITopLevelElement top =
IPersistencyService.getInstance().getTopLevelElementFor(
currentEditors.get(part));
IPersistencyService ps = IPersistencyService.getInstance();
ITopLevelElement top = ps.getTopLevelElementFor(currentEditors.get(part));
if(top == null) {
closeEditor(part);
}
......@@ -303,9 +301,9 @@ public class ModelEditorBindingService extends
@SuppressWarnings("unchecked")
@Override
public IModelEditor<EObject> getActiveEditor() {
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(activeEditor instanceof ExtendableMultiPageEditor) {
ExtendableMultiPageEditor extEditor = (ExtendableMultiPageEditor)activeEditor;
IModelEditor<EObject> inner = extEditor.getActiveModelEditor();
......
KISSViewPart.java 15140e9e5f20536dcb265a74697e1e02ece5d2ca GREEN
KISSViewerContentProvider.java b280d5334adf9afd9b0267a9a6075e0171f292a4 RED
KISSViewerContentProvider.java 8a318bcbb7ead2e1cc6acd78396ad77569baa676 YELLOW
KISSViewerLabelProvider.java b4e6861277cd43fbabb9407deee7c2f99f838cc5 GREEN
......@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection;
import java.util.Collection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.fortiss.tooling.kernel.introspection.IIntrospectionItem;
......@@ -72,11 +74,10 @@ public class KISSViewerContentProvider implements ITreeContentProvider {
@Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof IIntrospectionItem) {
IIntrospectionItem item = (IIntrospectionItem)parentElement;
if(item.getIntrospectionItems() != null) {
// TODO(VA,19) if possible
return item.getIntrospectionItems().stream()
.filter(c -> c.showInIntrospectionNavigation()).toArray();
Collection<IIntrospectionItem> items =
((IIntrospectionItem)parentElement).getIntrospectionItems();
if(items != null) {
return items.stream().filter(c -> c.showInIntrospectionNavigation()).toArray();
}
}
return null;
......
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