[Jsce-develop] SF.net SVN: jsce:[379] trunk/jsc.ui
Status: Alpha
Brought to you by:
dkleinrath
|
From: <dkl...@us...> - 2012-11-26 15:57:14
|
Revision: 379
http://jsce.svn.sourceforge.net/jsce/?rev=379&view=rev
Author: dkleinrath
Date: 2012-11-26 15:57:03 +0000 (Mon, 26 Nov 2012)
Log Message:
-----------
- Updated JSC for the latest version of the LPG runtime
- Removed all references from org.eclipse.imp. IMP will no longer be needed for JSC.
- Added the latest lpg.runtime jar file to jsc.core.
Modified Paths:
--------------
trunk/jsc.ui/META-INF/MANIFEST.MF
trunk/jsc.ui/jsc/jsc/internal/ui/JSCActionDelegate.java
trunk/jsc.ui/jsc/jsc/internal/ui/JSCEclipseRuntimeAPI.java
trunk/jsc.ui/jsc/jsc/internal/ui/JSCElementsConverter.java
trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeExtensionHover.java
trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeInfoHover.java
trunk/jsc.ui/jsc/jsc/old/internal/ui/text/contentassist/DOMCompletionContributor.java
Modified: trunk/jsc.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsc.ui/META-INF/MANIFEST.MF 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/META-INF/MANIFEST.MF 2012-11-26 15:57:03 UTC (rev 379)
@@ -21,7 +21,6 @@
org.eclipse.debug.ui,
jsc.core,
jsc.jsclang.library;bundle-version="0.1.2",
- org.eclipse.imp.runtime;bundle-version="0.1.99",
org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
org.eclipse.ui.navigator;bundle-version="[3.3.200,4.0.0)",
org.eclipse.team.ui;bundle-version="[3.4.100,4.0.0)",
@@ -33,7 +32,6 @@
com.ibm.icu;bundle-version="4.0.1",
org.eclipse.team.core;bundle-version="3.5.0",
jsc.util;bundle-version="1.0.0",
- lpg.runtime;bundle-version="2.0.17",
org.apache.commons.lang;bundle-version="2.3.0"
Bundle-ActivationPolicy: lazy
Export-Package: jsc.internal.ui.helpview;x-friends:="jsc.jdt",
Modified: trunk/jsc.ui/jsc/jsc/internal/ui/JSCActionDelegate.java
===================================================================
--- trunk/jsc.ui/jsc/jsc/internal/ui/JSCActionDelegate.java 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/jsc/jsc/internal/ui/JSCActionDelegate.java 2012-11-26 15:57:03 UTC (rev 379)
@@ -22,8 +22,6 @@
import org.eclipse.core.commands.contexts.ContextManager;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.bindings.Binding;
@@ -33,8 +31,6 @@
import org.eclipse.jface.bindings.keys.KeySequence;
import org.eclipse.jface.bindings.keys.ParseException;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
@@ -42,8 +38,6 @@
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.handlers.IHandlerActivation;
import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.internal.Workbench;
-import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.WorkbenchWindow;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.menus.AbstractContributionFactory;
@@ -54,6 +48,14 @@
import org.eclipse.ui.services.IServiceLocator;
import org.eclipse.ui.statushandlers.StatusManager;
+
+/**
+ * Provides support for dynamically adding extensions for Handlers, Contexts, Commands,
+ * Bindings and Menus to the currently running Eclipse platform.
+ *
+ * @author Dieter Kleinrath
+ *
+ */
public class JSCActionDelegate implements IJSCLangModuleEventListener {
private static class ActionHandler extends AbstractHandler{
@@ -627,20 +629,30 @@
}
public void dispose(){
- getDisplay().syncExec(new Runnable() {
- public void run() {
- synchronized (this) {
- for (ActionRegistry reg : actionRegistries.values()) {
- reg.dispose();
- }
- actionRegistries.clear();
- ICommandService service = getCommandService();
- if (service != null) {
- Category category = service.getCategory(JSC_ACTION_DELEGATE_CATEGORY);
- category.undefine();
- }
+ Display display = getDisplay();
+ if (!display.isDisposed()) {
+ display.syncExec(new Runnable() {
+ public void run() {
+ internalDispose();
}
+ });
+ } else {
+ internalDispose();
+ }
+
+ }
+ private void internalDispose(){
+ synchronized (this) {
+ for (ActionRegistry reg : actionRegistries.values()) {
+ reg.dispose();
}
- });
+ actionRegistries.clear();
+ ICommandService service = getCommandService();
+ if (service != null) {
+ Category category = service.getCategory(JSC_ACTION_DELEGATE_CATEGORY);
+ category.undefine();
+ }
+ }
}
+
}
Modified: trunk/jsc.ui/jsc/jsc/internal/ui/JSCEclipseRuntimeAPI.java
===================================================================
--- trunk/jsc.ui/jsc/jsc/internal/ui/JSCEclipseRuntimeAPI.java 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/jsc/jsc/internal/ui/JSCEclipseRuntimeAPI.java 2012-11-26 15:57:03 UTC (rev 379)
@@ -4,8 +4,16 @@
import org.eclipse.jface.bindings.keys.KeySequence;
-public class JSCEclipseRuntimeAPI {
+/**
+ * Static entry point for SC to add dynamic Extensions.
+ * This class simply delegates to the corresponding Java classes
+ * so all Extension code can be accessed from a single class.
+ *
+ * @author Dieter Kleinrath
+ */
+public final class JSCEclipseRuntimeAPI {
+
/**
* Creates a new hover extension for "jsc.ui.jscEditorTextHovers" and adds it to
* the currently running Eclipse platform.
Modified: trunk/jsc.ui/jsc/jsc/internal/ui/JSCElementsConverter.java
===================================================================
--- trunk/jsc.ui/jsc/jsc/internal/ui/JSCElementsConverter.java 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/jsc/jsc/internal/ui/JSCElementsConverter.java 2012-11-26 15:57:03 UTC (rev 379)
@@ -20,6 +20,13 @@
import jsclang.module.JSCLangMain;
import jsclang.util.StringEscapeUtils;
+
+/**
+ * This class converts IJSCElements to compilable SC code that
+ * instantiates the correspending SC JSCElements.
+ *
+ * @author Dieter Kleinrath
+ */
public class JSCElementsConverter {
public static String createJSCElementArrayCompileString(IJSCElement[] elements) throws JSCModelException{
Modified: trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeExtensionHover.java
===================================================================
--- trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeExtensionHover.java 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeExtensionHover.java 2012-11-26 15:57:03 UTC (rev 379)
@@ -30,6 +30,14 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class can be called from SC to dynamically add hovers to the JSC
+ * hover extension point.
+ *
+ * @author Dieter Kleinrath
+ *
+ */
public class JSCRuntimeExtensionHover extends AbstractJSCEditorTextHover implements IExecutableExtension, IInformationProviderExtension2, ITextHoverExtension{
public static final String EXTENSION_CLASS = "jsc.internal.ui.text.jsc.hover.JSCRuntimeExtensionHover";
Modified: trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeInfoHover.java
===================================================================
--- trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeInfoHover.java 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/jsc/jsc/internal/ui/text/jsc/hover/JSCRuntimeInfoHover.java 2012-11-26 15:57:03 UTC (rev 379)
@@ -20,8 +20,9 @@
@SuppressWarnings("restriction")
/**
- * Provides JSCdoc as hover info for SC elements.
- *
+ * Provides runtime information about SC elements as a hover.
+ *
+ * @author Dieter Kleinrath
*/
public class JSCRuntimeInfoHover extends AbstractJSCdocHover implements IInformationProviderExtension2, ITextHoverExtension{
Modified: trunk/jsc.ui/jsc/jsc/old/internal/ui/text/contentassist/DOMCompletionContributor.java
===================================================================
--- trunk/jsc.ui/jsc/jsc/old/internal/ui/text/contentassist/DOMCompletionContributor.java 2012-11-26 15:47:36 UTC (rev 378)
+++ trunk/jsc.ui/jsc/jsc/old/internal/ui/text/contentassist/DOMCompletionContributor.java 2012-11-26 15:57:03 UTC (rev 379)
@@ -34,6 +34,7 @@
import jsc.ui.text.jsc.JSCContentAssistInvocationContext;
import jsclang.module.JSCCommunicationManager;
import jsclang.module.JSCLangMain;
+import jsclang.module.JSCMessageException;
import jsclang.util.Strings;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -166,7 +167,12 @@
@Override
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
- String[] methodInfo = JSCECommunicationManager.getDefaultModule().getMethodInfoOfInstance(className, methodName);
+ String[] methodInfo;
+ try {
+ methodInfo = JSCECommunicationManager.getDefaultModule().getMethodInfoOfInstance(className, methodName);
+ } catch (JSCMessageException e1) {
+ return null;
+ }
int charPos = Integer.parseInt(methodInfo[0]);
if (charPos > 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|