Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Saturday, April 16, 2016

Perfect GTK styles for Eclipse

Recently i switch to KDE and i had to work on the eclipse gtk settings again to get rid of huge toolbars. But lucky ubuntu forums had lot of help and the following particular forum post helped to solve it.
http://ubuntuforums.org/showthread.php?t=1465712

Now before you start you need to make sure the eclipse is running in gtk2 mode. Basically you can do it with a small shell script as below.

#!/bin/bash
export SWT_GTK3=0
./eclipse
Now you need to create a gtkrc file which you can select any name you like, But i choose it to name as .eclipse-gtkrc-2.0. Now copy the following content into this file and save it.

include "/home/{user.home}/.gtkrc-2.0-kde4"
style "gtkcompact" {
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=0
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
style "compact-toolbar"
{
GtkToolbar::internal-padding = 0
xthickness = 1
ythickness = 1
}
style "compact-button"
{
xthickness = 0
ythickness = 0
}
class "GtkToolbar"   style "compact-toolbar"
widget_class "**" style "compact-button"
class "GtkWidget" style "gtkcompact"
{user.home} must be replaced with the user home folder name of yours.

Now update the shell script that you have made to run eclipse in gtk2 mode as follows.

#!/bin/bash
export SWT_GTK3=0
ECLIPSE_HOME=/opt/eclipse/neon/eclipse
GTK2_RC_FILES=~/.eclipse-gtkrc-2.0 $ECLIPSE_HOME/eclipse
Update the paths to suite you and that's it. Your eclipse will look as follows


Enjoy :)

Saturday, February 22, 2014

How to configure Eclipse Mylyn with Google Code project

First you need to install/upgrade the latest Mylyn snapshot version which is 3.11 from this update site
http://download.eclipse.org/mylyn/releases/latest

Then you need to install the Mylyn Web Template connector from the Mylyn Incubator which is at
http://download.eclipse.org/mylyn/incubator/3.11

After following the above steps you will have a Mylyn installation with Web Template connector in your Eclipse IDE.

The next part is configuring the web template connector to read issues from google code issues. There are lot of articles and posts on how to do this. But the following article was the one which worked for me with the above Mylyn version.
http://alblue.bandlem.com/2009/04/google-code-and-mylyn-redux.html


After configuring it you will be able to read the Google Code issues from Mylyn Task list :)

Thursday, December 13, 2012

Gnome shell popup menu problem [Solved]

Well if you are a gnome shell user and using eclipse for development you may have come across this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=343278. Well some thinks its related to java and some thinks its related to SWT. But my friends its a gnome shell bug or i would say a feature that's not yet implemented :).

My Story:
I was sick of unity because of the slowness and high memory usage which is believe its really unnecessary. Yes Yes i know the memory are cheap these days, but still i don't like to wast my memory unnecessarily.

So i went on searching for a DE that fits my needs, i tried gnome shell but gave up because of this problem.
Then KDE ................ Hmmmmm nop not my choice feels bit odd, may be due to the fact that i was a gnome user for very long time now.
Then i tried Cinnamon, well it was not the one i was looking for either. But for for my surprise it didn't had the right click problem. I knew that cinnamon was a fork of gnome shell and if cinnamon can fix this why not gnome :).

Well i did some search on the cinnamon issue list and came across the following issue https://github.com/linuxmint/Cinnamon/issues/482

Great now its time to find the change that they have done. So i went through the cinnamon commit history to find the changes and end up with the following commits.

https://github.com/linuxmint/Cinnamon/commit/f8c7922777b102dc574bb3695fc649b89879ebab

https://github.com/linuxmint/muffin/commit/9e45c4c8f1cc2f92f266a5f8e1c4e83d4ce70ef1

https://github.com/linuxmint/muffin/commit/0e575275078d4b8b518978448bba60f404b3746d

Now you need to clone mutter and gnome shell code from the gnome git repository. Then you need to create new branches based on the 3.6.1 tag for both the projects.

When appling changes you will need to map some files from cinnamon to gnome shell, muffin to mutter as follows since there are some file name differences.

Cinnamon     : src/cinnamon-global.c
Gnome Shell : src/shell-global.c

Muffin     : src/meta/compositor-muffin.h

Mutter    : src/meta/compositor-mutter.h


Now compile and install the changes. The problem will be solved :). I wonder why gnome shell developers are not considering taking this fix in from cinnamon :(.


Monday, November 5, 2012

Changing font size of view titles in Juno

If you are running the new eclipse platform which is 4.2 on linux you have already seen that the fonts sizes of view titles are pretty big. To adjust the font size for your prefference you need to edit the following file e4_default_gtk.css which is inside org.eclipse.platform_4.2.1.v201209141800/css. The version number might differ based on the updates you have installed in your sdk. The following entry in the above file needs to be change by providing the font size you would like to have

In above as you can see i have changed the default size to 8. Now save the file and start eclipse. You will have nice view titles which will match to you preference :).

Friday, August 31, 2012

Eclipse feature patch not getting installed

Recently i was trying to modify an existing eclipse plugin to make it work with JUNO. The orginal plugin was installed without problem in JUNO but when trying it fails to find some classes since there are API changes in the platform.

So i patch the original plugin with the new API and ran the plugin using eclipse and it works successfully. Now it was time to make it a package so i can install the patch without modifying jar files manually. So i read about how to create a eclipse feature patch which was exactly what i was looking for. So i created the patch and when i try to install it i was getting the following error:
              [patch name] is not applicable to the current configuration and will not be installed.

So what i though was that some thing wrong with the plugins that contained in the feature patch. So i first tried by replacing the new classes in the original plugin jar and changed the manifest to include the new API dependency. And it worked. So now i was sured that my plugin code was not the problem. So i them replaces the original plugin jar with my patched plugin jar and this cause the plugin to disappear. So now it seems some thing wrong with my manifest of my patched jar.
So i went through the manifest of my patched plugin once again and i saw that i have messed with a dependency. The problem was a dependency plugin version was mentioned with a qualifier which actually didn't included in my feature patch. So my patched plugin fails to load because that version cannot be found at runtime. But when i run through eclipse that it works because the dependency plugin project is there in my workspace. Fixing the version solved the problem with the installation and the feature patch was successfully installed.

So for starters with eclipse platform plugin development like me, if you get the above error check you plugin manifest whether it is correct for the target runtime environment.