title: how to display a simple swt window with text fileld and a button when clicking on a menu item in eclipse plugins?
body: <p>I know how to create a swt window with text box and other things . and i know how to create a plugin . but i could not create a plugin with a menu which generates event of generating window.</p>
  
  <p>i tried this swt to generate window with textbox and button .</p>
  
  <pre><code>import org.eclipse.swt.*;
  import org.eclipse.swt.widgets.*;
  import org.eclipse.swt.events.*;
  class demoMAIN {
  
  /**
   * @param args
   */
  public static void main(String[] args) {
      // TODO Auto-generated method stub
      Display display = new Display();
      final Shell shell =new Shell(display);
  
      shell.setSize(1000,1000);
  
      shell.open();
  
      Label label =new Label(shell,SWT.BORDER);
  
      label.setText("Enter something and click on button");
      label.setLocation(10, 10);
      label.pack();
  
      final Text text = new Text(shell,SWT.NONE);
      text.setBounds(10, 30, 100, 30);
  
  
      Button button = new Button(shell,SWT.PUSH);
      button.setText("OK");
      button.setSize(50, 50);
      button.setLocation(10,75);
  
  
      button.addSelectionListener(new SelectionAdapter(){
          public void widgetSelected(SelectionEvent e) {
              System.out.println("your data is "+text.getText());
              shell.dispose();
              }
      });
  
  
  
  
      while(!shell.isDisposed()){
          if(!display.readAndDispatch())
          display.sleep();
          }
          display.dispose();
  
  }
  
  }
  </code></pre>
  
  <p>and it is working.</p>
  
  <p>and pluggin project with file SampleHandler</p>
  
  <pre><code>import org.eclipse.core.commands.AbstractHandler;
  import org.eclipse.core.commands.ExecutionEvent;
  import org.eclipse.core.commands.ExecutionException;
  import org.eclipse.ui.IWorkbenchWindow;
  import org.eclipse.ui.handlers.HandlerUtil;
  import org.eclipse.jface.dialogs.MessageDialog;
  
  /**
    * Our sample handler extends AbstractHandler, an IHandler base class.
    * @see org.eclipse.core.commands.IHandler
    * @see org.eclipse.core.commands.AbstractHandler
  */
  public class SampleHandler extends AbstractHandler {
  /**
   * The constructor.
   */
  public SampleHandler() {
  }
  
  /**
   * the command has been executed, so extract extract the needed information
   * from the application context.
   */
  public Object execute(ExecutionEvent event) throws ExecutionException {
      IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
      MessageDialog.openInformation(window.getShell(),"project","Hello, Eclipse world");
  
  
  
  
      return null;
  }
  }
  </code></pre>
  
  <p>please help me doing this .. thanks in advance ... 
  And im referring all eclipse plugin development sites like </p>
  
  <p><a href="http://www.vogella.com/tutorials/Eclipse3RCP/article.html" rel="nofollow">http://www.vogella.com/tutorials/Eclipse3RCP/article.html</a></p>