1 20 21 package org.apache.directory.ldapstudio.actions; 22 23 24 import org.apache.directory.ldapstudio.Messages; 25 import org.eclipse.jface.action.Action; 26 import org.eclipse.jface.action.IAction; 27 import org.eclipse.swt.custom.BusyIndicator; 28 import org.eclipse.ui.IWorkbenchWindow; 29 import org.eclipse.update.ui.UpdateJob; 30 import org.eclipse.update.ui.UpdateManagerUI; 31 32 33 41 public class UpdateAction extends Action implements IAction 42 { 43 private IWorkbenchWindow window; 44 45 46 51 public UpdateAction( IWorkbenchWindow window ) 52 { 53 this.window = window; 54 setId( "org.apache.directory.ldapstudio.newUpdates" ); setText( Messages.getString( "UpdateAction.Search_for_updates" ) ); setToolTipText( Messages.getString( "UpdateAction.Search_for_updates_for_LDAP_Studio" ) ); } 58 59 60 63 public void run() 64 { 65 BusyIndicator.showWhile( window.getShell().getDisplay(), new Runnable () 66 { 67 public void run() 68 { 69 UpdateJob job = new UpdateJob( Messages.getString( "UpdateAction.Searching_for_updates" ), false, false ); UpdateManagerUI.openInstaller( window.getShell(), job ); 71 } 72 } ); 73 } 74 75 } 76 | Popular Tags |