My question: What is the advantage of using the Eclipse ConsoleManager class in opposite of putting my console in a view.
I have created my own console (a REPL) in java and would like to integrate it with Eclipse. I know of two ways to do so:
Create a plug-in view and just display my own textpane in it. Example code to start it:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().
showView(REPL_PLUGIN_ID, project.getName(), IWorkbenchPage.VIEW_ACTIVATE);
Create a plug-in, implement the IConsole interface and add it using the ConsoleManager. Example code to start it:
ConsolePlugin.getDefault().getConsoleManager().addConsoles(myConsoles)
Since I already implemented the Console I favor to the View part. I am not reluctant to implement the IConsole (and all the other interfaces that are required), however, I just don't see the advantages of it.
The Eclipse ConsoleManager must be there for a good reason, what is it? What would be the main reason/advantage to use it?
What I have found so far:
Advantages of implementing IConsole:
Support for default console buttons[3]
Disadvantages of implementing IConsole:
No (default?) support of rich text editing
I tried to make this question as clear as possible, yet if I can elaborate/clarify anything just let me know in a comment.
The advantage is unified user experience. Eclipse has several generic views that users have become accustomed to: outline, properties, problems view, console etc. Imagine if everyone would add their own custom views instead of reusing existing ones. There would be an overflow of perspectives, each containing custom views for a specific task (or, alternatively, a single perspective crowded with custom views). So, if your console falls under the notion of console - task specific (text based) interaction containing only transient data - then you should probably implement your "view" as console.
As the previously quoted wiki entry says the console view is primarily intended for simple ports of traditional code which uses System.out.print and the like.
A few plugins such as the SVN and CVS code use the Console view to provide the traditional output from commands but also provide additional views and dialogs which provide more or better information.
So if you are developing an Eclipse plugin from scratch I would say you create your own view(s). Hopefully you can provide more actions for manipulating your data than are available in the Console view. If appropriate you could also provide the console view like SVN does.
From the Eclipse.org wiki:
When these tools are ported for use with an IDE, this console output is typically replaced with richer forms of feedback, such as views, markers, and decorations. However, users accustomed to the old command-line output may still want to see this raw output as an alternative to other visual forms of feedback. Tools in this category can use the Console view to write this output.
Prior to Eclipse 3.0, each plug-in that wanted console-like output created its own Console view. Eclipse 3.0 provides a single generic Console view that all plug-ins can write to. The view can host several console documents at once and allows the user to switch between different console pages.
Related
due to reasons I am working with undocumented java library code that I cannot alter in any way or write into. Im using eclipse 2020-06 and I would like to leaves some notes for myself to make things easier. Is there a way to do that? or maybe an eclipse extension?
You can use bookmarks. They work somewhat similarly to breakpoints, without pausing execution when you're debugging.
You can add them via the context menu.
If I recall, you're a bit limited by the amount of information you can add. It's basically just a single text box.
See the help section on bookmarks
Maybe there's some plugins which extend the functionality (e.g. this one for adding keyboard shortcuts)
I would like to write small eclipse plugin for code estimation. At start I would like to use results shown in "problems" tab (warnings and errors) instead of writing next, own tool for code analysis. The question is:
Is it possible to use data from one plugin in another?
I would be greatful for any examples or links to tutorials.
Thank you in advance :)
The objects in the Problems view are called 'markers' and are represented by the org.eclipse.core.resources.IMarker interface.
You get the markers defined on a file, folder or project by calling the findMarkers method on the IResource. You can ask for all types of marker or just specific types.
Is it possible to edit the content assistance of Eclipse? Sort of add rules or functions for it? I'm aware that Eclipse is open-sourced, but I was there an "easier way" or an interface?
For example, I'm working in Java 1.4.2, so I don't believe I have the magical "autoboxing"(am I correct in thinking that autoboxing would solve this issue?) . So when I'm working with getting parameters from a request, they all return strings when I may need a Long or an Int. I'm always interested in making things more automated (as any computer scientist usually would), so I was wondering if it was possible to have content assist suggest to use the common java parse functions (Integer.parseInt, Long.parseLong, etc) for the passed in parameters.
If you want to actually augment Content Assist in a highly detailed, customized way, you'd have to write a plugin. Eclipse is very well architected such that there are endless extension points via which plugins can extend base functionality, including Content Assist. But, writing one is not a trivial matter (though a skill that could serve you well, if you have the time to learn it).
Another option is to write your own Java editor template, which can emit any pre-defined snippet of code you want (including inserting parameter values), and will be included in Content Assist. Open Eclipse's Preferences and navigate to Java > Editor > Templates. You can use the ? help button on that Preferences page to learn more about them.
There is a Scenario to be developed for a 3-tier Application .We need to design a Framework or a utility sort of thing .
In tradional aspect of GUI Designing , either we tend to create a static gui page and code the elements on it along with other properties of the elements such as (disabled/enabled,image source,name ,id ,which function to be called under onclick event.) or we tend to drag and drop the elements from the control pallete provided by variety of gui frameworks.
Certain things i need to design a POC so that we can develop this concept.
There must a utility ,such that during creation of screen layout , that screen should be saved in the database(RDBMS) with a screen number.
All the Events related to that control should be saved in some other table which will be dynamically mapped during the calling of screen number by the user.
When the user call that screen ,a generic function should be invoked which'll call the screen file from the database and apply all the properties ,events,etc at runtime and the final output will be displayed to the user.
This POC will help the us to customised the screens according to our usage.also all the code will seperated which can easily be used for some other development process.
Thanks
Amit Kalra
-- Migrated from Answer --
Iam not getting it with GUI framework supporting serialization .
The Concept should be like this .
The Developer has a utility like a Screen Painter in which developer can drag drop controls ,now this file will get saved in 2 formats ,first one is a source file and another on is the compiled one (say compiled in a .cpp format or any other format).
now on a client side ,when the user enters any transaction number ,there should be a utility which can load the file from the database ,also apply all the functions applicable to each event .
This Concept is similar to wat is there in SAP R/3.
please help me in undergoing this POC.
Thanks
If I understand your question, you are asking for a GUI framework supporting serialization. There are several ones supporting this. Two I have been using are the FOX Toolkit (C++, cross-platform) and the Windows Presentation Foundation (.NET), which is using the XAML format for serialization.
You can achieve the purpose by using the Serialization support of many popular languages. Even if there is no support for that it shouldn't not be very difficult, storing essential data in some configuration files (or as such in your case storing in a DB) will do the expected like controls details, their position etc. But standard frameworks will make your life easy in long running.
I am working on an incremental builder for Java code in Eclipse. Eclipse provides a ResourceDelta that tells me which resources have changed since the last build. However, I would like to have more detailed information, e.g. what methods or what field definitions changed. There seems to be functionality similar to what I want in the "compare with -> each other" view. However, this code is quite disconnected from the build engine and seems incompatible with ResourceDeltas. What would be a good way to figure out what I want? The best solution I can see is to compare two ASTs, but I also could not find any built-in support for that.
JavaCore does supply this information via the IElementChangedListener and IJavaElementDelta interfaces. Here's a quick code sample to get you started:
JavaCore.addElementChangedListener(new MyJavaElementChangeReporter(), ElementChangedEvent.POST_RECONCILE);
More details available in Manipulating Java code from the JDT Plug-in Developer Guide.