1 5 package org.hibernate.eclipse.console.actions; 6 7 import org.eclipse.core.resources.ResourcesPlugin; 8 import org.eclipse.jface.action.Action; 9 import org.eclipse.jface.wizard.WizardDialog; 10 import org.eclipse.ui.IViewPart; 11 import org.eclipse.ui.PlatformUI; 12 import org.hibernate.console.ImageConstants; 13 import org.hibernate.eclipse.console.utils.EclipseImages; 14 import org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard; 15 16 22 public class AddConfigurationAction extends Action { 23 24 private final IViewPart part; 25 26 public AddConfigurationAction(IViewPart part) { 27 this.part = part; 28 setText("Add Configuration"); 29 setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.ADD)); 30 } 31 32 public void run() { 33 doAddConfiguration(); 34 } 35 36 protected void doAddConfiguration() { 37 ConsoleConfigurationCreationWizard wizard = new ConsoleConfigurationCreationWizard(); 38 wizard.init(PlatformUI.getWorkbench(), null); WizardDialog dialog = new WizardDialog(part.getSite().getShell(), wizard); 40 dialog.open(); 42 } 43 } 44 | Popular Tags |