IDETalk Question.

Hi,

Since in a previous thread was mentioned that IDETalk will be part of the IDE, I suppose
this newsgroup is the right place.

Would it be possible for IDETalk to support something like:
"Talk/listen to webapplication"?

Many webapplications(when in demo/example mode) have something like "Show Source".
This is mostly implemented/hardcoded and it's by far not as good as the poorest IDE.

The idea would be to use IDETalk + IntelliJ instead of actual solutions.
- The webapplications would have a 'link' where IDETalk would listen.
- If a user clicks on such a link (view source for this page):
- IDETalk/IDEA would open that file (if the corresponding project is open)
- IDETalk/IDEA would 'steal the focus' :), (but now for a good purpose :)), and come
to foreground, so that the user can see 'the source' right away.

Thank in advance,

Ahmed.

9 comments
Comment actions Permalink

How is this feature related to IDETalk? It sounds like a separate feature.

Ahmed Mohombe wrote:

Hi,

Since in a previous thread was mentioned that IDETalk will be part of
the IDE, I suppose
this newsgroup is the right place.

Would it be possible for IDETalk to support something like:
"Talk/listen to webapplication"?

Many webapplications(when in demo/example mode) have something like
"Show Source".
This is mostly implemented/hardcoded and it's by far not as good as the
poorest IDE.

The idea would be to use IDETalk + IntelliJ instead of actual solutions.
- The webapplications would have a 'link' where IDETalk would listen.
- If a user clicks on such a link (view source for this page):
- IDETalk/IDEA would open that file (if the corresponding project is
open)
- IDETalk/IDEA would 'steal the focus' :), (but now for a good
purpose :)), and come
to foreground, so that the user can see 'the source' right away.

Thank in advance,

Ahmed.

0
Comment actions Permalink

How is this feature related to IDETalk? It sounds like a separate feature.

Because it would be like the actual ]]> , but not from a user, but
from a webapplication.

Ahmed.

0
Comment actions Permalink

Hello Ahmed,

>> How is this feature related to IDETalk? It sounds like a separate
>> feature.
>>
AM> Because it would be like the actual , but AM>]]> not from a user, but from a webapplication.

A code pointer simply points to a location in a source file which is (generally)
present on the recipient's machine. What you suggest is much more of a "send
a project", with no need to point to a specific line/column in a source code
file.

Completely different feature, in other words.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

We've embedded the XML-RPC server into IDEA. It will be possible to
register protocol handler in Windows to be some script, which will call
a service in IDEA.

Ahmed Mohombe wrote:

Hi,

Since in a previous thread was mentioned that IDETalk will be part of
the IDE, I suppose
this newsgroup is the right place.

Would it be possible for IDETalk to support something like:
"Talk/listen to webapplication"?

Many webapplications(when in demo/example mode) have something like
"Show Source".
This is mostly implemented/hardcoded and it's by far not as good as the
poorest IDE.

The idea would be to use IDETalk + IntelliJ instead of actual solutions.
- The webapplications would have a 'link' where IDETalk would listen.
- If a user clicks on such a link (view source for this page):
- IDETalk/IDEA would open that file (if the corresponding project is
open)
- IDETalk/IDEA would 'steal the focus' :), (but now for a good
purpose :)), and come
to foreground, so that the user can see 'the source' right away.

Thank in advance,

Ahmed.

0
Comment actions Permalink

Ops... Mike, can you please show a simple example with using services server in IDEA instance?
I believe that server inside IDEA is a little "Fat Monster". This server will total control anything in IDEA? :)

0
Comment actions Permalink

Here's the actual code of one service:

-


Test python script for service invocation -


import xmlrpclib

server_url = 'http://localhost:63342/';
server = xmlrpclib.Server(server_url);
server.fileOpener.open("C:\Temp
test.txt");


-


Actual Service -


/*

  • Copyright (c) 2005 JetBrains s.r.o. All Rights Reserved.

*/
package com.intellij.ide;

import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.fileEditor.ex.FileEditorProviderManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NonNls;

import java.io.File;

/**

  • @author mike

*/
public class OpenFileXmlRpcHandler implements ApplicationComponent {
private static final String HANDLER_NAME = "fileOpener";
private final XmlRpcServer myXmlRpcServer;

public OpenFileXmlRpcHandler(final XmlRpcServer xmlRpcServer) {
myXmlRpcServer = xmlRpcServer;
}

@NonNls
public String getComponentName() {
return "OpenFileXmlRpcHandler";
}

public void initComponent() {
myXmlRpcServer.addHandler(HANDLER_NAME, new OpenFileHandler());
}

public void disposeComponent() {
myXmlRpcServer.removeHandler(HANDLER_NAME);
}

public static class OpenFileHandler {
@SuppressWarnings({"MethodMayBeStatic"})
public boolean open(final String absolutePath) {
final Application application = ApplicationManager.getApplication();

application.invokeLater(new Runnable() {
public void run() {
final Project[] openProjects =
ProjectManager.getInstance().getOpenProjects();
if (openProjects.length == 0) return;
Project project = openProjects[0];

String correctPath = absolutePath.replace(File.separatorChar,
'/');
final VirtualFile[] virtualFiles = new VirtualFile[1];
final String correctPath1 = correctPath;
application.runWriteAction(new Runnable() {
public void run() {
virtualFiles[0] =
LocalFileSystem.getInstance().refreshAndFindFileByPath(correctPath1);
}
});
if (virtualFiles[0] == null) return;

FileEditorProviderManager editorProviderManager =
FileEditorProviderManager.getInstance();
if (editorProviderManager.getProviders(project,
virtualFiles[0]).length == 0) return;
OpenFileDescriptor descriptor = new
OpenFileDescriptor(project, virtualFiles[0]);

FileEditorManager.getInstance(project).openTextEditor(descriptor, true);
}
});

return true;
}
}
}
-


0
Comment actions Permalink

:))
Look like known code :) From one old plugin :)

0
Comment actions Permalink

Cool, I guess this will make it possible to double-click files to open them in IDEA,
right? Probably also fixing the issue of not being able to open a project by
double-clicking when IDEA is already running.

Just an observation: Shouldn't the OpenFileHandler try to pick a project that has a
content root which matches the file to be opened, instead of just opening the file in the
first available project? Assume we have project A (root is c:\prj\A) and project B
(c:\prj\B) currently open. Opening a file (c:\prj\B\something\file.txt) via this service
should open it in project B, not A.

Sascha

Mike Aizatsky (JetBrains) wrote:

Here's the actual code of one service:

0
Comment actions Permalink

Hi,
Is it possible to run this server under 5.x ?

Thanks,
Dmitry

0

Please sign in to leave a comment.