removed warnings
diff --git a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/application/Activator.java b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/application/Activator.java
index 990742a..cfd78d6 100644
--- a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/application/Activator.java
+++ b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/application/Activator.java
@@ -1,10 +1,7 @@
package org.eclipse.emf.ecp.e4.application;
-import java.util.Collection;
-
import org.eclipse.e4.core.contexts.IContextFunction;
import org.eclipse.e4.ui.internal.workbench.E4Workbench;
-import org.eclipse.e4.ui.services.EContextService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -34,13 +31,15 @@
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
-
- public static EPartService getEPartService(){
+
+ public static EPartService getEPartService() {
try {
- ServiceReference<?> service=context.getServiceReferences(IContextFunction.class.getName(),"(service.context.key="+EPartService.class.getName()+")")[0];
- //TODO a "bit" ugly
- return (EPartService) ((IContextFunction)context.getService(service)).compute(E4Workbench.getServiceContext());
- } catch (InvalidSyntaxException e) {
+ final ServiceReference<?> service = context.getServiceReferences(IContextFunction.class.getName(),
+ "(service.context.key=" + EPartService.class.getName() + ")")[0];
+ // TODO a "bit" ugly
+ return (EPartService) ((IContextFunction) context.getService(service)).compute(
+ E4Workbench.getServiceContext(), null);
+ } catch (final InvalidSyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
diff --git a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/editor/E4ModelElementOpener.java b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/editor/E4ModelElementOpener.java
index 11f1262..bd5c137 100644
--- a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/editor/E4ModelElementOpener.java
+++ b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/editor/E4ModelElementOpener.java
@@ -1,13 +1,8 @@
package org.eclipse.emf.ecp.e4.editor;
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.contexts.ContextInjectionFactory;
-import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecp.core.ECPProject;
import org.eclipse.emf.ecp.e4.application.Activator;
import org.eclipse.emf.ecp.ui.util.ECPModelElementOpener;
@@ -16,16 +11,15 @@
final String partId = "org.eclipse.emf.ecp.e4.application.partdescriptor.editor";
- @Override
public void openModelElement(Object modelElement, ECPProject ecpProject) {
- EPartService partService = Activator.getEPartService();
- for (MPart existingPart : partService.getParts()) {
+ final EPartService partService = Activator.getEPartService();
+ for (final MPart existingPart : partService.getParts()) {
if (!partId.equals(existingPart.getElementId())) {
continue;
}
-
- if (existingPart.getContext()==null) {
+
+ if (existingPart.getContext() == null) {
continue;
}
@@ -37,7 +31,7 @@
}
}
- MPart part = partService.createPart(partId);
+ final MPart part = partService.createPart(partId);
partService.showPart(part, PartState.ACTIVATE);
part.getContext().set(ECPProject.class, ecpProject);
part.getContext().set(ECPE4Editor.INPUT, modelElement);
diff --git a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPModelView.java b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPModelView.java
index 61a1046..5af9d3e 100644
--- a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPModelView.java
+++ b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPModelView.java
@@ -28,59 +28,63 @@
private TreeViewer modelExplorerTree;
private ModelContentProvider contentProvider;
- public ECPModelView(){
-
+ public ECPModelView() {
+
}
-
+
@PostConstruct
- public void create(Composite composite,EMenuService menuService,final ESelectionService selectionService,final EPartService partService){
+ public void create(Composite composite, EMenuService menuService, final ESelectionService selectionService,
+ final EPartService partService) {
modelExplorerTree = TreeViewerFactory.createModelExplorerViewer(composite, false, null);
- menuService.registerContextMenu(modelExplorerTree.getTree(), "org.eclipse.emf.ecp.e4.application.popupmenu.navigator");
- contentProvider=(ModelContentProvider) modelExplorerTree.getContentProvider();
+ menuService.registerContextMenu(modelExplorerTree.getTree(),
+ "org.eclipse.emf.ecp.e4.application.popupmenu.navigator");
+ contentProvider = (ModelContentProvider) modelExplorerTree.getContentProvider();
modelExplorerTree.addDoubleClickListener(new IDoubleClickListener() {
-
- @Override
+
public void doubleClick(DoubleClickEvent event) {
if (event.getSelection() instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
- Object firstElement = structuredSelection.getFirstElement();
-
+ final IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
+ final Object firstElement = structuredSelection.getFirstElement();
+
if (firstElement instanceof ECPProject) {
- ECPProject project = (ECPProject) firstElement;
+ final ECPProject project = (ECPProject) firstElement;
if (!project.isOpen()) {
project.open();
}
}
else if (firstElement instanceof EObject) {
- ECPContainer context = ECPUtil.getModelContext(contentProvider, structuredSelection.toArray());
+ final ECPContainer context = ECPUtil.getModelContext(contentProvider,
+ structuredSelection.toArray());
ECPHandlerHelper.openModelElement(firstElement, (ECPProject) context);
-// MPart part=partService.createPart("org.eclipse.emf.ecp.e4.application.partdescriptor.editor");
-// part.setLabel(modelElement.eClass().getName());
-// partService.showPart(part, PartState.ACTIVATE);
- }
+ // MPart
+ // part=partService.createPart("org.eclipse.emf.ecp.e4.application.partdescriptor.editor");
+ // part.setLabel(modelElement.eClass().getName());
+ // partService.showPart(part, PartState.ACTIVATE);
+ }
}
}
});
modelExplorerTree.addSelectionChangedListener(new ISelectionChangedListener() {
-
- @Override
+
public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection=event.getSelection();
- if(IStructuredSelection.class.isInstance(selection)){
- IStructuredSelection structuredSelection=(IStructuredSelection) selection;
- if(!structuredSelection.isEmpty()){
+ final ISelection selection = event.getSelection();
+ if (IStructuredSelection.class.isInstance(selection)) {
+ final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ if (!structuredSelection.isEmpty()) {
selectionService.setSelection(structuredSelection.getFirstElement());
}
}
}
});
}
+
@Focus
- public void setFocus(){
+ public void setFocus() {
modelExplorerTree.getTree().setFocus();
}
+
@PreDestroy
- public void dispose(){
-
+ public void dispose() {
+
}
}
diff --git a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPRepositoryView.java b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPRepositoryView.java
index c3f25a6..8e2fef4 100644
--- a/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPRepositoryView.java
+++ b/extra/org.eclipse.emf.ecp.application.e4/src/org/eclipse/emf/ecp/e4/view/ECPRepositoryView.java
@@ -24,27 +24,26 @@
@PostConstruct
public void create(Composite composite, EMenuService menuService,
- final ESelectionService selectionService) {
+ final ESelectionService selectionService) {
repositoryTree = TreeViewerFactory.createRepositoryExplorerViewer(
- composite, null);
+ composite, null);
menuService.registerContextMenu(repositoryTree.getTree(),
- "org.eclipse.emf.ecp.e4.application.popupmenu.repository");
+ "org.eclipse.emf.ecp.e4.application.popupmenu.repository");
repositoryTree
- .addSelectionChangedListener(new ISelectionChangedListener() {
+ .addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (IStructuredSelection.class.isInstance(selection)) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- if (!structuredSelection.isEmpty()) {
- selectionService
- .setSelection(structuredSelection
- .getFirstElement());
- }
+ public void selectionChanged(SelectionChangedEvent event) {
+ final ISelection selection = event.getSelection();
+ if (IStructuredSelection.class.isInstance(selection)) {
+ final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ if (!structuredSelection.isEmpty()) {
+ selectionService
+ .setSelection(structuredSelection
+ .getFirstElement());
}
}
- });
+ }
+ });
}
@Focus