if you look in the documentation for IScriptService you will find
the exact java call to get the service. Do not unse getInstance(),
it will vanish as soon as I have time to fix some base dependencies
to that getter.
Regarding your error on getScriptType: what location are you using
there?
I am trying to figure out how to get language specific block
comments and have posted a comment on Mattermost.
How should try following command?
IScriptService scriptService =
ScriptService.getInstance();
ScriptType scriptType =
scriptService.getScriptType(location);
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/e4/ui/workbench/IWorkbench
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:91)
at org.eclipse.ease.sign.ScriptTypeTest.main(ScriptTypeTest.java:26)
Caused by: java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.IWorkbench
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 14 more
/*******************************************************************************
* Copyright (c) 2016 varun 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* varun - initial API and implementation
*******************************************************************************/
package org.eclipse.ease.sign;
import org.eclipse.ease.service.IScriptService;
import org.eclipse.ease.service.ScriptType;
import org.eclipse.ui.PlatformUI;
/**
* @author varun
*
*/
public class ScriptTypeTest {
public static void main(String args[]) {
IScriptService scriptService = PlatformUI.getWorkbench().getService(IScriptService.class);
ScriptType sc = scriptService.getScriptType("workspace://org.eclipse.ease/src/org/eclipse/ease/sign/hello.js");
}
}