lunedì 29 marzo 2010

How to Fix VirtualBox USB Support

The VirtualBox USB support on linux host doesn't work properly without giving the right permissions to your user.

Follow the illustrated tutorial in http://news.softpedia.com/news/How-to-Fix-VirtualBox-USB-Support-111715.shtml.

Oddly, on my pc, logging out and then logging in wasn't enough to make the changes work, so I've had to completely restart.

mercoledì 24 marzo 2010

Connect to a remote folder via ssh with Nautilus

Nautilus has the capability to connect to a remote folder via ssh. You should use the uri
ssh://user:password@host/path/to/folder
If the password is left out you will be prompted for.

venerdì 5 febbraio 2010

Gestione dei tab nelle viste

Per una migliore gestione dei tab nelle viste, è consigliabile usare i seguenti oggetti:

org.eclipse.swt.custom.CTabFolder;
org.eclipse.swt.custom.CTabItem;


Il "CTabFolder" ha le stesse funzionalità del TabFolder, in più:
permette di non avere bordi nella finestra

CTabFolder tabFolder = new CTabFolder(externalInfoCreComposite, SWT.BOTTOM);

di impostare i colori di sfondo

tabFolder.setSelectionBackground(new Color[]{
Display.getCurrent().getSystemColor(SWT.COLOR_BLUE),
Display.getCurrent().getSystemColor(SWT.COLOR_RED),
Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW) }, new int[]{50, 100 });

Blue= colore del tab selezionato
Rosso e giallo parte del contorno

Sfondo della tabella

tabFolder.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));

Qui sono visualizzabili alcuni esempi: http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/DemonstratesCTabFolder.htm

mercoledì 27 gennaio 2010

Organize extension point popupMenus

A popupMenu declares one or more insertionPoints that will be used by contributors to organize their contributions into a meaningful, more user-friendly, consistent list.
If clients only specify the "popupMenuId" attribute of the viewer element, then the set of insertionPoints used by the context menu will default to the following list in the given order:

"group.new" separator="true"
"group.goto"
"group.open" separator="true"
"group.openWith"
"group.show" separator="true"
"group.edit" separator="true"
"group.reorganize"
"group.port"
"group.generate" separator="true"
"group.search" separator="true"
"group.build" separator="true"
"additions" separator="true"
"group.properties" separator="true"


If not specified, the default group is additions.

Clients that wish to refer to these values programmatically may use the corresponding constants in org.eclipse.ui.navigator.ICommonMenuConstants.

Clients that wish to customize their menus are encouraged to start with this list and add or remove insertion points as necessary. Clients are also encouraged to follow the pattern of beginning each group name with "group.".

martedì 26 gennaio 2010

How to start a java application for remote debugging

In order to allow remote debugging for a java application the command line should be customized with the following arguments:
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n MyClass
-Xdebug enables debugging mode;
-Xrunjdwp configures Java Debug Wire Protocol with sub-options; like the communication mode between jvm and debugger, the listening port, whether wait until the debugger connection or not, etc. See links for further details

See also:
-Xrunjdwp sub-options
Remote Debugging with Eclipse

lunedì 23 novembre 2009

Java plugin per Firefox su Ubuntu

To execute applets in your Firefox browser you have to install the java plugin.

Follow this steps:
1) sudo apt-get install sun-java6-jdk
2) ln -s /usr/lib/jvm/__JDK-VERSION__/jre/plugin/i386/ns7/libjavaplugin_oji.so /home/__USER__/.mozilla/plugins/