Tuesday, May 22, 2012
The JvmModelInferrer, the debugger and Xbase in Xtext 2.3
See the original post here:
The JvmModelInferrer, the debugger and Xbase in Xtext 2.3
Pubblicato da betto a 7:07 PM 0 commenti
Wednesday, May 09, 2012
Eclipse internal Web Browser in Kubuntu Precise Pangoline 12.04
This can be seen as a sort of follow-up of my previous post, Eclipse internal Web Browser in Ubuntu Lucid: after installing Kubuntu Precise Pangolin 12.04 the internal browser of Eclipse stopped working. In particular, when using Mylyn Gerrit connector (relying on OpenID authentication, which requires the eclipse internal browser) I got this error
org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)])and indeed, by looking at the preferences corresponding to the Web browser I cannot select the internal browser:
Last time, I had solved this problem by installing the xulrunner package, but, sad to hear, this package has been dropped since Oneiric!
Fortunately, we can rely on another package:
sudo apt-get install libwebkitgtk-1.0-0and you'll enjoy Eclipse internal web browser again! :)
Pubblicato da betto a 9:02 PM 7 commenti
Friday, February 03, 2012
Closing the Eclipse Welcome screen programmatically
When writing Junit plugin tests in Eclipse I wanted to close the welcome page programmatically before starting the tests; looks like it's pretty easy :) Just use this @BeforeClass static method and you'll be fine!
@BeforeClass
public static void closeWelcome() {
final IIntroManager introManager =
PlatformUI.getWorkbench().getIntroManager();
IIntroPart part = introManager.getIntro();
introManager.closeIntro(part);
}
Pubblicato da betto a 11:54 AM 1 commenti
Monday, December 26, 2011
Xtext 2.1: using Xbase variables
See the original post here:
Xtext 2.1: using Xbase variables
In this post, I’d like to continue to inspect how to use only a small part of Xbase and still have the control on the generation part: in particular (for other projects) I would like to retain the control on the generation for my model, while relying on the Xbase generation for the Xbase parts. Thus, in this post I’ll describe:
- how to integrate Xbase variables (XVariableDeclaration) and expressions (XExpression) in your DSL
- how to extend Xbase scoping for making the variables visible in the expressions
- write a generator for your DSL and reuse the XbaseCompiler for the code of XVariableDeclaration and XExpressions
Pubblicato da betto a 10:43 AM 0 commenti
Wednesday, November 23, 2011
Xtext 2.1: using Xbase expressions
See the whole blog post here:
Xtext 2.1: using Xbase expressions
I’d like to inspect how to use only a small part of Xbase and still have the control on the generation part: in particular (for other projects) I would like to retain the control on the generation for my model, while relying on the Xbase generation for the Xbase parts. Thus, in this post I’ll describe:
- how to integrate Xbase expressions (XExpression) in your DSL
- write a generator for your DSL and reuse the XbaseCompiler for the code of XExpressions
Pubblicato da betto a 3:01 PM 0 commenti
Monday, November 21, 2011
Using JVM Types in Xtext 2.1 and the ImportManager
Pubblicato da betto a 6:23 PM 0 commenti
Sunday, October 30, 2011
Testing the Eclipse StatusLineManager
Here's the link to a new post, where I explain how to test the current text of the Status Line in Eclipse
Testing the Eclipse StatusLineManager
Pubblicato da betto a 3:43 PM 0 commenti
Etichette: eclipse, unit tests
Sunday, May 22, 2011
Using Savannah with Mylyn
The GNU software I maintain, Source-Highlight, Gengetopt and Gengen, are hosted on Savannah, which has its own bug tracking system. Recently I've started to use the wonderful Mylyn tool under Eclipse for but and feature tracking (in general, "tasks"), and I wanted to use it also with Savannah, but since there is no specific connector, we can use the generic web connector (actually, having a specific connector would be better, but for the moment, that's better than nothing ;)
Since there is not a template ready to use for accessing Savannah from Mylyn, I thought I could blog about my experience, hoping that it's useful to others.
First of all, you need mylyn in eclipse together with its ui functionalities (but if you downloaded an eclipse distribution you'll likely have it already); then you need to install the Web Templates Connector, from the update site http://download.eclipse.org/tools/mylyn/update/incubator (add a repository)
Then, after you restarted eclipse, open the Task Repositories View, choose Add Task Repository, and select Web Template,
For this tutorial I will use my GNU project Source-Highlight as an example:
- Server: https://savannah.gnu.org/bugs/?group=src-highlite
- Label: choose a label to represent your task repository
- put your savannah username and password
- Additional Settings
- Add two parameters:
- group with value the name of the project on savannah (in my case it's src-highlite)
- tracker with the specific kind of tasks you want to follow on savannah (e.g., bugs, or patches, etc.)
- Advanced Configuration
- Task URL: https://savannah.gnu.org/${tracker}/?
- New Task URL: ${serverUrl}&func=additem
- Query Request Pattern: ${serverUrl}&chunksz=150&report_id=100
- Query Pattern:
<td.*?#({Id}[0-9]+).*?/td>\n<td ><a.*?>({Description}.*?)</a></td>
When you click Finish, also accepts to add a query for the repository.
In the query properties dialog you can check whether all the inserted parameters for the task repository are correct, by clicking on the preview button (you should see a list of bugs, otherwise the dialog should tell you that query is not correct and cannot produce results)
Now, if you open the view Task List, you should see the bugs related to your query.
Now clicking on a bug will open a browser editor window in eclipse and you access that bug page. Remember that, since you access the savannah repository through a generic web connector you won't be able to enjoy the typical Mylyn rich editor for bugs, like the ones for bugzilla and trac). However, you'll still have the context tab and the private tab.
Hope this helps :)
Pubblicato da betto a 12:47 PM 6 commenti
Monday, November 22, 2010
Eclipse icons in menus are not showing in Ubuntu Maverick Linux
I don't like Gnome and I usually use KDE, but on a specific computer I have to use Gnome, and I noted that after switching to Ubuntu Maverick, icons on eclipse menus were not showing anymore.
I asked on some newsgroups with no luck, then on IRC I was pointed to this bug, which solved my issue :)
You need to enable icons in menus with gnome configuration. You find some ways to do that on that bug report, but I simply ran gconf-editor on the command line, and enabled that checkbox:
Now my icons in menus are back :)
Tuesday, May 11, 2010
Eclipse internal Web Browser in Ubuntu Lucid
After switching to Ubuntu Lucid I noted that in my eclipse php installation the internal web browser was not working anymore since it was lacking some mozilla libraries.
In that case, it is enough to install the current xulrunner:
sudo apt-get install xulrunner-1.9.2
and the internal web browser in eclipse will work again! :)
Pubblicato da betto a 9:14 PM 1 commenti
Saturday, June 06, 2009
Tutorial: using Autotools with Eclipse (and Linux Tools Project)
As a GNU maintainer, I've always been using autotools (i.e., automake, autoconf, etc.), and I must admit I still haven't found anything such powerful. Now, I started using the plugins of the Linux Tool Project which seem to have improved a lot! They provide plugins for ChangeLog, Valgrind, and in particular for autotools based projects. Since I haven't seen any tutorial for using the autotools plugin, I thought I could write one; well, it's not that difficult to use the autotools plugin, but I hope it can help :-)
Of course, first of all, you need to install the autotools plugin, and I personally prefer the update site method, using http://download.eclipse.org/technology/linuxtools/update. Remember that the linux tools are based on CDT plugin.
For this tutorial, we will use an already autotools based project (for the moment, the autotools plugin can create an autotools based project, but without any templates). We will use the GNU Hello program, so you can download the last version from the web site. Then you can untar the contents in a directory (say tmp).
Now, it's time to create a new project in eclipse, in particular, a GNU C Autotools Project (or a C++ project if you're project uses C++):
Let's call it "hello" (and then you can select your location and accept the other defaults). You will now have an empty autotools based C project.
Now, let's import the hello package from the directory where we had untarred it, by using "import file system":
Now, the hello project is populated with the package of GNU Hello; notice that configure.ac, Makefile.am and .m4 files are handled by the autotools plugins with syntax highlighting, outline, mouse over functionalities, etc.:
Now, BEFORE building the project for the first time, let's take a look at the properties of the project, where you can see we now have an autotools part, where you can customize the autotools versions you might want to use (I take the defaults):
In particular, from "C/C++ Build - Settings" you can configure the arguments passed to the tools, and the build directory (it is often advised to build a package in a different directory, so that you can configure different builds; by default, the build directory is "build", and I'd leave this that way):
Now, let's change some options! For instance, the configure's --prefix option:
The suffix of the installed program
Since we build the program for development and for debugging, let's make sure to turn off C compiler optimizations (which make debugging a pain):
You can then check that debugging is already turned on, as also '-Wall' option (to report all warnings).
Since we downloaded the source package of hello, produced by 'make dist', this provides all the scripts generated by the autotools in order to run 'configure && make'. However, if you get a program from the CVS, it is likely that you need to bootstrap autotools. Now, the autotools plugin relies on an 'autogen.sh' script which calls all the autotools in the right order, which must be provided by the package itself; however, this is kind of an old method, since now, to bootstrap autotools, you can rely on the program 'autoreconf' which is part of autotools; so, in case you need to bootstrap the autotools, you can simply call 'autoreconf -i' (this will install required files from autotools) from a shell, in the directory of the project.
Now, you can build the project, by right clicking on the project and by choosing "Build Project"! Since this is the first time we build it, the build directory will be created, the configure script will be called with all the features we selected, and the files are compiled!
Hey, but wait a minute! We could have used ccache to compile the sources! And we should have also enable maintainer mode specific configuration settings! Well, we can still do that by going back to the settings of the project, enable the maintainer setting check box, and specify the gcc command as 'ccache gcc':
Now, let's clean the project (this will issue a 'make distclean', but you can customize this from the setting), and build it again, so that it will be reconfigured with the new settings.
Now, let's create another build configuration (e.g., for the release version of the package, with optimized compiler options, with a different prefix, removing the suffix '-debug' and without the maintainer-mode option enabled). We just need to go to "Manage Configurations...", create a new one, starting from the previous default one:
and now we can set the optimization level for the compiler, disable maintainer mode and use another --prefix option (e.g., '/usr/local/'). It is also important to specify another build directory, say 'build_release' (but when creating a new configuration, the build directory has already been changed to something different from the previous one, i.e., 'build1'):
Now, we can switch between the two different build configurations:
Well, that's all for now; I hope you find this tutorial useful :-)
Pubblicato da betto a 5:02 PM 18 commenti
Wednesday, March 04, 2009
Qt Eclipse Integration
Recently, I started to play with Qt 4 also under Windows, in order to be able to port some of my Linux applications that use Qt. Usually, I'm using KDevelop under Linux to develop Qt applications, but under Windows? Then I noticed that Trolltech provides Qt Eclipse Integration, i.e., an Eclipse plugin to program Qt programs with Eclipse. So I gave it a try...
IMPRESSIVE, really a nice piece of software!
The installation is immediate, and you get a menu item to run Eclipse already setup to start programming with Qt (relying on the CDT plugin for the C++ part). To try it, I followed the tutorial you find here.
The new project wizard now provides also Qt project options:
Pubblicato da betto a 10:29 PM 11 commenti
Sunday, March 01, 2009
PDT, XDebug, Eclipse in Linux
I finally had a working version of PDT (Php eclipse plugin) and XDebug, so that I can finally debug, not only php script, but also php web sites! :-)
This blog post helped me a lot, but I must also admit that pdt people did a wonderful job, and now everything seems to work out of the box!
First of all I relied on the pdt all in one version (i.e., eclipse together with all the requested plugins and the pdt plugin), that can be found at http://www.eclipse.org/pdt/downloads.
However, you also need to install xdebug and (k)ubuntu already has a package for this, so you just need to type
apt-get install php5-xdebug
Now just check the path of the xdebug.so library file, in my case it is
/usr/lib/php5/20060613+lfs/xdebug.so
then you'll need to add some parts in the php.ini configuration file, so you need to add at the end of your /etc/php5/apache2/php.ini these lines (use the path of xdebug.so above):
; XDebugAlso, set implicit flush on in the same php.ini file, so you need to search for implicit_flush in the file and make sure it is set to on:
zend_extension="/usr/lib/php5/20060613+lfs/xdebug.so"
xdebug.remote_enable=true
xdebug.remote_host="127.0.0.1" ; if debugging on remote server,
; put client IP here
implicit_flush = On
Now you're set and you can run eclipse, and try to make a new Php project with a simple file, and try to debug it!
You need to create a new debug configuration, in particular a "Php Web Page" debug configuration. Also make sure that the server debugger is set to XDebug. Then specify the php file you want to test (in this example is newfile.php). Unless the project and all files are already in the root directory of your web server, you need to manually set the URL, so uncheck "Auto Generate" check box and write the complete path (starting from the root of your webserver directory, or, as in my case, a path relative to my user web space); this is also a way of passing, for instance, some GET arguments in the URL, as in this example: xamplevar=30&other=foobar.
Before starting the debugger, make sure you have the web browser set in eclipse; I'm using the internal web browser (actually the only one available in this eclipse installation). NOTE: sometimes, when starting eclipse, the web browser seems to have been lost, and you'll get an error when starting the debugger; in this case I simply restart eclipse.