Archive for July, 2011

Save a copy of OS X Lion on DVD

Published by Alessandro Musacchio on July 20th, 2011 - in Mac

I just finished downloading the new Apple’s operating system, before installing it I have seen fit to save a copy of the DVD for possible future installation… 4 GB of download with Italian’s internet connection are heavy.. :)

The procedure is simple:

  1. Download OS X Lion from App Store
  2. After the download does not start the installation program do facciao but right clickit and then click ”Show Package Contents”
  3. Let the path “Contents -> SharedSupport” and copy the file “InstallESD.dmg” in a folder of our pleasure
  4. Insert a 4.7 GB blank DVD into the optical drive of your Mac
  5. We start the Disk Utility, click “Burn”, select the file you just copied InstallESD.dmgfolder, then click “Burn”
  6. When the burning is completed we will have our DVD bootable with OS X Lion:)

Have fun with the lion and do not it angry! :-D

Tags:

Ottenere il padre di un elemento nel Tree View SWT/JFace

Published by Alessandro Musacchio on July 9th, 2011 - in Java

Al lavoro mi è capitato di dover prendere il padre di un oggetto selezionato nel tree view, operazione semplicissima ma che se non si conosce il trucchetto potrebbe richiedere un pò di tempo prima di implementarla, il problema sta nel fatto che la libreria su citata non mette a disposizione un metodo tipo “getParent()” per la classe TreeViewer ma bisogna passare per il relativo ContentProvider.

Vediamo un’esempio esplicativo della soluzione:

// Prendo l'elemento selezionato nel treeView
Object oggettoSelezionato = ((IStructuredSelection)classeTreeView.getSelection()).getFirstElement();
// Prendo il contentProvider del treeView
ITreeContentProvider provider =(ITreeContentProvider) classeTreeView.getContentProvider();
// Mi faccio restituire dal contentProvider il padre dell'oggetto selezionato
Object parent = provider.getParent(oggettoSelezionato);
Come si può facilmente vedere l’operazione richiede un passaggio in più per arrivare al padre ma non è per nulla complicata :)
Spero che possa servire a qualcuno, a me sicuramente ritornerà utile. :D
Tags: ,
© 2010-2012 AlessandroMusacchio.it

Create your own free site