Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2014-03-24 09:56:47 +0000
committerLars Vogel2014-08-08 14:14:24 +0000
commitde8855e834146071f95dc58d5ab4c1f2e703577d (patch)
tree8cee39bb52249293615983e70374a9f8a4bad25e
parent85cd24f45156d44c9eca280705314e7bf9e6d277 (diff)
downloadeclipse.platform.ui-de8855e834146071f95dc58d5ab4c1f2e703577d.tar.gz
eclipse.platform.ui-de8855e834146071f95dc58d5ab4c1f2e703577d.tar.xz
eclipse.platform.ui-de8855e834146071f95dc58d5ab4c1f2e703577d.zip
Bug 430981 - Add type information to IServiceLocator.getService
Change-Id: Ia4985081cf3673b7f15c83bc122367e400e7b260 Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceLocator.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceLocator.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceLocator.java
index 1534aec066c..89b914fe0b2 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceLocator.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceLocator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 430981 - Generified API
*******************************************************************************/
package org.eclipse.ui.services;
@@ -19,8 +20,7 @@ package org.eclipse.ui.services;
* </p>
*
* <pre>
- * IHandlerService service = (IHandlerService) workbenchWindow
- * .getService(IHandlerService.class);
+ * IHandlerService service = workbenchWindow.getService(IHandlerService.class);
* </pre>
*
* <p>
@@ -40,7 +40,8 @@ public interface IServiceLocator {
* @return The service, or <code>null</code> if no such service could be
* found.
*/
- public Object getService(Class api);
+
+ public <T> T getService(Class<T> api);
/**
* Whether this service exists within the scope of this service locator.
@@ -51,8 +52,8 @@ public interface IServiceLocator {
* @param api
* This is the interface that the service implements. Must not be
* <code>null</code>.
- * @return <code>true</code> iff the service locator can find a service
- * for the given API; <code>false</code> otherwise.
+ * @return <code>true</code> if the service locator can find a service for
+ * the given API; <code>false</code> otherwise.
*/
- public boolean hasService(Class api);
+ public boolean hasService(Class<?> api);
}

Back to the top