| 1 | package net.mattmccutchen.addins; |
| 2 | |
| 3 | import com.sun.star.lang.*; |
| 4 | import com.sun.star.lib.uno.helper.*; |
| 5 | |
| 6 | public class ServiceBase<SH extends ServiceHelper> extends WeakBase |
| 7 | implements XServiceInfo, XServiceName { |
| 8 | protected final SH sh; |
| 9 | |
| 10 | protected ServiceBase(SH sh) { |
| 11 | this.sh = sh; |
| 12 | } |
| 13 | |
| 14 | public String getImplementationName() { |
| 15 | return sh.implementationName; |
| 16 | } |
| 17 | |
| 18 | public String[] getSupportedServiceNames() { |
| 19 | return sh.serviceNames.toArray(new String[sh.serviceNames.size()]); |
| 20 | } |
| 21 | |
| 22 | public boolean supportsService(String svc) { |
| 23 | return sh.serviceNames.contains(svc); |
| 24 | } |
| 25 | |
| 26 | public String getServiceName() { |
| 27 | return sh.mainServiceName(); |
| 28 | } |
| 29 | } |