NewProductFileAction.java :  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » ui » wizards » product » Java Open Source

Java Open Source » IDE Eclipse » Eclipse plug in development 
Eclipse plug in development » org » eclipse » pde » internal » ui » wizards » product » NewProductFileAction.java
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.pde.internal.ui.wizards.product;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.pde.internal.ui.PDEPlugin;
import org.eclipse.pde.internal.ui.util.SWTUtil;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.cheatsheets.ICheatSheetAction;
import org.eclipse.ui.cheatsheets.ICheatSheetManager;

public class NewProductFileAction extends Action implements ICheatSheetAction {
  
  public NewProductFileAction() {
    super("NewProductFile");  //$NON-NLS-1$
  }
  
  /**
   * @see IActionDelegate#run(IAction)
   */
  public void run() {
    run(new String [] {}, null);
  }
  
  /* (non-Javadoc)
   * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager)
   */
  public void run(String[] params, ICheatSheetManager manager) {
    NewProductFileWizard wizard = new NewProductFileWizard();
    wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
    WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard);
    dialog.create();
    SWTUtil.setDialogSize(dialog, 500, 500);
    dialog.getShell().setText(wizard.getWindowTitle());
    int result = dialog.open();
    notifyResult(result==Window.OK);
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.