Copy & pasting information from one instance to another instance in Eclipse RCP 3.x - eclipse-rcp

I am new by to eclipse RCP. I have an requirement in which, I need to copy some information from any "xyz" editor and paste it to "xyz" editor of another instance of same rcp product.
My application already have this copy paste functionality for single instance of the product, for which I am using customised standard ACTION as per my requirement.
I was trying to have something like "Application or Session" scope for web applications, where we can store that information and used it for different instances.
Please let me know, if something else required to understand the requirement.
Thanks in Advance !!!

As greg-449 mentioned they're running in separate JVMs.
This question is related:
inter jvm communication
It requires Java 7, which might not be available for you if you're using 3.x Platform.
You could also try opening a socket between the JVMs. However I did not find any out-of-the-box solutions.
You might find examples of a locally shared database, like the Java Derby technology. But it's way too much stack of technology for a copy/paste action, so don't use it.

Related

How to use an existing ontology in a Java application?

I've created an ontology with several instances. What I'm going to do with it is :
Using Eclipse, create a searching program. User can input a string, and if an instance has this string as one of its datatype properties, the name and other properties of this instance will be shown to the user.
I really have no idea what plug-ins of eclipse, what grammar, or what other tools I should use. I'm extremely new to semantic web and the relevant tools, so any help will be great. Thank you so much!
You could look at the OWL-API as a starting point for using ontologies in a programmatic fashion. It shouldn't be a problem to integrate it with other Eclipse tools.

JBPM process designer - WebServices

I am trying to add a WebService Service Task to a process in JBPM. I would like to add and configure the task directly from the process design tool.
JBPM has 3 possible tools that you can use to create a process, eclipse plugins: RulesFlow editor and BPMN2 Modeler, as well as a Onyx Designer incorporated into Drools. So far I have not managed to do this in any of them.
I was able to add the WS to the process by manually editing the process XML file (as shown here: http://mswiderski.blogspot.com/2012/07/service-task-with-web-service.html) but we need to be able to do it in a graphical tool (business reasons, don't ask). BPMN2 Modeler comes closest to the generated XML that would in theory work, but when I try to run it, it comes out with a bunch of errors.
I know that the link I provided states that the tools don't yet provide the WS functionality but maybe someone has some ideas as to this problem. Any help will be appreciated.
I don't believe you can directly create a service task from the design tools. I've followed this here :
And after you've created your work item definition, you should be able to see that you can add that service task in your process design. Just remember that you have to register that to your session before you start the process. Hope this helps

Why can't I find Java desktop application in Netbeans 7.1

I downloaded Netbeans 7.1 with all bundle from http://netbeans.org/downloads and installed it successfully on Windows 7.
But I can't find Java Desktop Application which should be under Java category when add new project as 7.0 does.
Where is it? Or what is the substitute one in 7.1? I need something to create GUI by dragging components.
Thanks.
Look here: http://netbeans.org/bugzilla/show_bug.cgi?id=204661
Support for [B]SAF (JSR 296, basically the framework that was behind your "Java Desktop Application" project template) has been abruptly dropped (for no valid reason, let me add).
However, as Bill says in his answer, it is not necessary to use the SAF in order to visually design a form. NetBeans swing-designer (known as Matisse) can be used to design any JFrame, JDialog, JPanel, etc.
You just have to
Right click -> New -> JFrame Form...
and you're ready to drag-and-drop!
(The features you'll be missing are the extra bells and whistles that such framework provided, like SAF Actions, windowing persistence, simplified management for long running Tasks and related visual feedback [now you have to get your hands dirty with the SwingWorker class], etc)
Java Desktop refers to an effort to create a standard or library (libraries) that never really produced anything of significance. I think its likely that they finally removed it from Netbeans.
Its easier to just create a new Java Application project, don't bother with a main, then create a new JFrame Form. That class will have a main for you to use, and you can also design the frame in the form. You can also create JPanel Form classes. Note: you can do this in just about any project in netbeans, there is nothing special about the projects for them.
its better to use NetBeans 7.0 for full support of swing components.
many tutorials and guides feature the "Java Desktop Application" (like the ones for JXMapKit : http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html )
You can find something helpful to create CRUD desktop application in Java.
You can find it here.

Monitoring Eclipse Window Acceptance

I know that the Eclipse Foundation has a program within Eclipse (I guess it is a plugin) that can monitor the user behaviour. E.g. What window was used how many times.
I forgot the name of that program. Is it possible to use the plugin in a company to monitor how the programmers use Eclipse?
It is the Eclipse Usage Data Collector (UDC), with its user guide
At present, the UDC does not expose any official APIs, though there are several under consideration
So, I am not sure you could reuse it directly for internal use. They have a mailing list, though, were you could get a confirmation about that kind of project.
You could may be try and change the "upload address" (if you can setup a compatible server):
(source: eclipse.org)
The data captures are visible here.

What is the basic idea behind Plugins? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Wether you call it Addons, Plugins or extra peices of code that is connected with the original software later, it really doesn't matter. I would love to understand how they work, there has to be a simple explanation of how to design a Plugin System. Unfortunately, I never understood it, and there remains a lot of open question in my mind. For example, how does the program find a plugin? how does it interface with it? when is it preferable for a software to have Plugin System?
Thanks for all helpful answers. It seems I asked too open question, fortunately I got keywords to look for. I liked David answer though I am not a Java guy, but his talk made sense to me :)
Plug-ins work by conforming to well-known interfaces that the main application expects to work with.
There are several ways in which a plug-in architecture actually works, but in general, these are the steps:
Plug-ins are designed to match an interface that the application expects. For example, a simple application might require that plug-ins implement a IPlugin interface.
Plug-ins are loaded by the application, usually when the app is starting up
Plug-ins are often provided access to much of the data that the application manages. For example, Firefox plug-ins can access the current web page, and Eclipse plug-ins can access the open files.
Here are two ways (out of several) in which an application can find plug-ins:
The plug-ins are known to exist in a particular folder, and the application knows to load plug-ins from that folder
Each plug-in runs as a service, and the services are designed to work together (this is how an OSGi-based application works)
When plug-ins are found, they are loaded by the application (sometimes the job of a Class Loader).
A software architect might design a plug-in architecture when they expect that either the software provider or the user community will implement new features that were not originally part of the system. Two great examples are Eclipse and Firefox; other applications include Adobe Photoshop (for artistic techniques and graphical tools) and Winamp (for visualizations).
Create an interface that all plugins of a particular type will implement
Write the code that will 'consume' the plugin against the interface only.
Have a dynamic way to load a DLL containing the plugin type that implements your interface (for instance, have a configurable folder location to test whether any DLLs in that folder contain any types that implement your interface, and dynamically load any that do. In .NET this might use Assembly.LoadFile())
If you want to have a look at some source code, Paint.NET is free and open source, and has a plugin architecture.
A program typically has to be designed to look for a plug-in, and the plug-in has to have a standard access point to accept control from the main program. Every application or website does it a little differently.
The simplest type of plug-in is accessed something like this:
if (a plug-in exists/is configured)
call predefined plug-in code
In this case, the main program is coded to only handle a specific set of plug-ins (many php-based wordpress templates are like this). A slightly more advanced plug-in
perform application specific logic
if any plug-in exists that exposes the run_after_app_specific_logic function
call plug-in code
This second case can handle ridiculously complex plug-ins ... the plug-in would just need to implement more functions called by the master program.
Eclipse in an example of a application-framework which is entirely plugin-based, meaning that all functionality is implemented as plugins. There is a thin layer at the bottom for startup/shutdown and plugin-management, but everything else is implemented as plugins on top of that. This results in a framework which can be used for just about everything. More info about Eclipse plugin architecture can be found here: http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html.
It's very language dependent.
In an interpreted language it simply involves calling a file that follows a pattern.
In C it's pretty hard to do without help. In C+windows a "DLL" can be a plug-in and are often used that way.
In an OO language with reflection, you might create an object that implements an interface and load it reflectively. After it's loaded, you can ignore the fact that it was a plug-in because it's treated as any other object in your code.
.net has a plugin architecture (is it COM?) Well anyway COM can be used as (is?) a plugin system.
Your question is probably too open-ended because of all the possibilities. There is no single answer.
I've never written a plugin system. But this is how I imagine it in my head:
Your program has a subdirectory for plugins (e.g. "C:\Program Files\My Program Name\plugins").
You create plugins as DLL files and place them in the plugins folder.
These DLLs would export functions with predefined names.
When you run your program, it looks through all the DLLs in your plugins folder. In each one it would look for an exported function with a certain name (e.g. "Load") and call that function. The plugin could then do any setup that it needed to do.
The program would then call an exported function on the plugin with a name like "GetPluginName". The plugin would return it's name and the program could then use that name when it displays a list of plugins to the user.
When it comes time to invoke the plugin, the program would call another exported function (maybe "Activate") and probably pass the plugin a pointer to the data that the plugin is going to work on. The program would then do its work on the data.
The plugin might also export another function that the program would call to show a setup dialog where you could change the plugin options.
A plugin system can be implemented in many ways, but the common way for a lot of C/C++ applications is a DLL-based plugin SDK.
The DLL will expose various automated function calls which may allow the plugin to "set itself up" in the running application such as adding menu items, new functionality or extra options for systems (like 3D rendering implementations).
More ofthen there's no need for any special discovery - the plugin mechanizm is generally dumb: Here's a code signature I understand, and here's a call(s) I can make. I have no clue how the thing I'm calling will do the job, but I expect result to be in certain format. And that is pretty much a contract. Now - the plugin will implement the contract and make itself available. In Java, for example "make available" simply means that implementing classes are loaded into memory. JDBC driver for a particular database would be a good example.