Content assist in eclipse JSDT javascript editor fails using object notation - eclipse

I'm using eclipse JSDT and I have a javascript object declaration that looks like this:
var rs1 = {};
rs1.person1 = {};
rs1.person1.phone = "hg";
rs1.person1.name = "lk";
Content assist will pull up rs1 properties (rs1.person1.name) in the editor if I add it to a file in the project javascript include path user library, but the following notation
var rs1 = {person1:{ phone:"hg", name:"lk"}};
then content assist will only go as far as rs1.person and stop. If I use this same JSON notation directly in my javascript, then content assist works as expected. It just doesn't work when I add it the project include path.
I've been struggling with this for a few days but I can't find a way to make it work.
Any ideas?

It seems that this may be a problem with eclipse on linux (I'm running ubuntu). I downloaded a fresh copy of indigo to ensure that it wasn't some third party plugin that was causing the problem, but the content assist was still not working.
Just tried it on a windows box this morning and content assist works as expected.

Related

Debug portal_skins order for Dexterity content types

We have one Plone site (4.3.x) using TinyMCE version 1.4.3, but we found that we should have the version 1.3.18 instead for this Plone version.
So I:
Uninstalled the TinyMCE package ( manage / portal_setup / import / Remove TinyMCE profile ).
Pin buildout version to 1.3.18 and run buildout.
Reinstalled TinyMCE package ( same procediment, but select TinyMCE install profile).
After that I notice that:
For default Plone content types it worked fine.
For the new dexterity content types defined in this Plone Site it didn't work. It load just a textarea with html into it instead of load TinyMCE.
I did many tests on this, and what I can see is that my content type should use wysiwygEditorBox macro from this template Products/TinyMCE/skins/tinymce/tinymce_wysiwyg_support.pt but instead it is using this template Products/CMFPlone/skins/plone_wysiwyg/wysiwyg_support.pt.
I tried to change order of portal_skins but it just affect Archetypes types, not Dexterity types.
What step should I do next? is there any better way to debug it instead of adding <span> tags with debug messages?
Looking in the parts/omelette directory shows the following in plone/app/form/widgets/wysiwygwidget.pt (line 21)
support_path string:nocall:here/${editor}_wysiwyg_support|here/${editor}/wysiwyg_support|here/po
My guess is that ${editor} isn't set right (ie to tinymce) so the above line is falling back to search for the wysiwyg_support.pt template.

Safari 8.0.3 fails to load NPAPI plugin (Mac OS X)

I am very new to Plugin development. I have an existing NPAPI plugin that works fine on Firefox. I want to reuse it and load it in Safari as well. To get started I downloaded the sample plugin from http://mxr.mozilla.org/mozilla2.0/source/modules/plugin/sdk/samples/basic/mac/. Built it in XCode and added the plugin under /Library/Internet Plugins/. I see that browser notifies asking for permission to access the plugin but I don't see it actually getting loaded. I am doing the following.
var npPlugin = document.createElement("embed");
(npPlugin).type = "application/x-myPlugin";
(npPlugin).data = "data:application/x-myPlugin,";
npPlugin.setAttribute("style", "width:0;height:0");
window.document.body.appendChild(npPlugin);
Couldn't find a good way to debug it, so tried the raw way of creating a file and writing logs to it. I added this to both NP_GetEntryPoints & NP_Initialize with a hope that one of these functions will be invoked at the time of loading and will log for me. I didn't see any signs of my plugin getting loaded. Any ideas on how to make it to load or how to actually debug it?
I commented out any code that was other than the NPAPI required methods. It helped me get around this problem.

How can I access which files the user currently has open from an eclipse plugin?

I'm very new to eclipse plugin development, and frankly to eclipse itself. I am trying to find a way to access a list of which files are currently being worked on by the user, and possibly even more specifically, what part of these files (which class, method, block of code, etc.).
I am thinking that I would like to have the plugin grab information on which files are currently open in the tabs, and then go from there, but I can't even figure out how to do this. I've been searching the eclipse documentation at help.eclipse.org, but I still haven't found anything useful for what I want to do. Does anyone have any ideas?
Try the following code:
IWorkbenchPage[] pages = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getPages();
for (IWorkbenchPage page : pages) {
IEditorReference[] references = page.getEditorReferences();
for (IEditorReference reference : references) {
IEditorInput input = reference.getEditorInput();
}
}
You should be able to walk your way from the workbench to a workbench page (IWorkbenchPage), which as a findEditors method.

adding python interpreters programmatically

Is there a simple way to add and change interpreters using the Pydev plugin interface? I'm running pydev 1.6.1 and I'd like to be able to add and use a given interpreter based on a list of available interpreters in my environment.
Right now I can see the PythonInterpreterManager has a createInterpreterInfo call, but that doesn't seem to do anything. Looking at the source for pydev, it seems like I have to actually work with the preference pages to keep track of all of them.
Is there a simpler set of functions I can call to add these?
PythonInterpreterManager manager = (PythonInterpreterManager)PydevPlugin.getPythonInterpreterManager(true);
IInterpreterInfo info = manager.createInterpreterInfo(execPath, new NullProgressMonitor());
manager.addInterpreterInfo(info);
I can already do the above, but that only caches it, but doesn't display it as a valid interpreter option in the preferences.
I've even tried doing reflection to add these without much luck. I can call addNewInput on the editor as the Add button does, but then it says it doesn't have any knowledge of that interpreter. I've tried creating a popup preferences page and adding the values to the various members via reflection as getNewInput() would, but still don't see any more options in the preference page. I'm not sure if this is because I'm missing something or the popup preference page I make is totally unrelated to the page that pops up using the Window->"Preferences" pulldown.
The API is something as:
IInterpreterManager iMan = PydevPlugin.getPythonInterpreterManager(true);
IInterpreterInfo interpreterInfo = iMan.createInterpreterInfo("c:/python/python.exe", monitor, false);
iMan.setInfos(new IInterpreterInfo[]{interpreterInfo}, null, null);
Note that if you have 'manager.addInterpreterInfo' in there, you probably have an old version of PyDev... (and at that call you set all the interpreters available, so, if you want to keep some configuration, you should query it and add them back).
You can use: org.python.pydev.editor.codecompletion.revisited.javaintegration.AbstractWorkbenchTestCase.createPythonInterpreterManager(NullProgressMonitor) as a reference.

TinyMCE editor doesn't show during message composition roundcube

I am working on a new project on roundcube and after long hours of sleepless nights managed to get all the necessary software installed and configured roundcube on the test server. I am able to log into the server and send and receive messages, but the problem is that I am unable to see the TinyMCE editor when I am composing the message.
The following parameter is enabled in the main.inc.php file:
// compose html formatted messages by default
$rcmail_config['htmleditor'] = TRUE;
but still I am unable to find the editor. When I view the source of the loaded compose page, I am able to see the tiny_mce javascript file loaded which makes it even more confusing why the editor is not shown..
Am I missing something?? Please help...
You need to call a bit of javascript to amek the editor appear.
Ideally there is something like the following script on your page:
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced"
});
</script>
This will transform all textareas on your page into tinymce instances.
There are many configuration options which allow to define what buttons you want to see where and much more...
Here is a list of all possible configuration options.
Thank you for your information, but I tried what you said, it didn't work :(
However, the actual issue was that the tiny_mce editor js file was not found on the server. This I was able to confirm once I was the apache error logs. I uploaded the tiny_mce editor js file and now I am able to see the editor during composing a message.