Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.Dialog


      if (o != null)
        textEditor = (ITextEditor) o;
    }
    if (textEditor != null) {
      final ITextEditor finalTextEditor = textEditor;
      Dialog cleanupDialog = new CleanupDialogXML(editor.getSite().getShell());
      if (cleanupDialog.open() == Window.OK) {
        // setup runnable
        Runnable runnable = new Runnable() {
          public void run() {
            IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
            if (cleanupProcessor != null) {
View Full Code Here


  }
 
  @Test
  public void testNonBlocking() {
    Shell shell = new Shell(Display.getDefault());
    final Dialog dialog = new Dialog(shell) {};
   
    Listener1 l = new Listener1() {
     
      @Override
      public void finished(State state) {
        super.finished(state);
       
        Display.getDefault().asyncExec(
          new Runnable() {

            public void run() {
              dialog.close();
            }
          }
        );
      }
    };
    pipe.addListener(l);
 
    pipe.start();
    pipe.next();
    pipe.next();
    pipe.next();
    pipe.next();
    pipe.next();
   
    //need to open a dialog here to "halt" the ui thread so that the
    // the workbench doesn't close while the pipe is still running
    dialog.setBlockOnOpen(true);
    dialog.open();
    if (!shell.isDisposed())
      shell.dispose();
   
    assertTrue(l.state1);
    assertTrue(l.state2);
View Full Code Here

 
  @Ignore
  @Test
  public void testStateFailureNonBlocking() {
    Shell shell = new Shell(Display.getDefault());
    final Dialog dialog = new Dialog(shell) {};
   
    //test where one state craps out
    s4.run = false;
   
    Listener1 l = new Listener2() {
      @Override
      public void stateFailed(State state) {
        super.stateFailed(state);
       
        if (dialog.getShell().isVisible()) {
         
          dialog.getShell().getDisplay().asyncExec(
            new Runnable() {
              public void run() {
                dialog.close()
              };
            }
          )
        }
       
      }
     
      @Override
      public void finished(State state) {
        super.finished(state);
        dialog.close();
      }
    };
    pipe.addListener(l);
 
    pipe.start();
    pipe.next();
    pipe.next();
    pipe.next();
    pipe.next();
    pipe.next();
   
    //need to open a dialog here to "halt" the ui thread so that the
    // the workbench doesn't close while the pipe is still running
    // create a watchdog to kill it after a specified amount of time
    Runnable runnable = new Runnable() {

      public void run(){
        System.out.println("Running"); //$NON-NLS-1$
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        System.out.println("Is dialog active dialog"); //$NON-NLS-1$
        Display.getDefault().syncExec(
          new Runnable() {
            public void run() {
              if (dialog.getShell().isVisible()) {
                dialog.close();
              }   
            }
          }
        );
      }
    };
    new Thread(runnable).start();
   
    dialog.setBlockOnOpen(true);
    if( !l.finished )
    dialog.open();
    if (!shell.isDisposed())
      shell.dispose();
   
    assertTrue(l.state1);
    assertTrue(l.state2);
View Full Code Here

    }
  }

  private void tagEditSelection() {
    final IRequestLogRecord record = (IRequestLogRecord)((IStructuredSelection) tableViewer.getSelection()).getFirstElement();
    final Dialog dialog = TaggableEditorDialog.createDialog(getShell(), record);
    if (dialog.open() == Window.OK) {
      tableViewer.refresh();
    }
  } 
View Full Code Here

  public void initializeFrom(ILaunchConfiguration configuration) {
    try {
      modelFileText.setText(configuration.getAttribute(ModelLaunchDelegate.VAR_ROOT_MODEL_PATH, ""));
      launchEverythingButton.setEnabled(configuration.getAttribute(ModelLaunchDelegate.VAR_ROOT_LAUNCH_EVERYTHING, true));
    } catch (CoreException e) {
      Dialog d = new ErrorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
          "Configuration Error", "Error while configuring launch.", new Status(IStatus.ERROR, "q_impress", e.getMessage(), e), 0);
      d.open();
   
   
    dialogChanged();
  }
View Full Code Here

            {
                handleJumpCommand( item, columnsWithHyperlinks.get( 0 ) );
            }
            else if( ! columnsWithHyperlinks.isEmpty() )
            {
                final Dialog dialog = new Dialog( this.table.getShell() )
                {
                    private int choice = columnsWithHyperlinks.get( 0 );
                   
                    @Override
                    protected Control createDialogArea( final Composite parent )
                    {
                        getShell().setText( jumpDialogTitle.text() );
                       
                        final Composite composite = (Composite) super.createDialogArea( parent );
                       
                        final Label prompt = new Label( composite, SWT.WRAP );
                        prompt.setLayoutData( gdwhint( gdhfill(), 300 ) );
                        prompt.setText( jumpDialogPrompt.text() );
                       
                        final SelectionListener listener = new SelectionAdapter()
                        {
                            public void widgetSelected( final SelectionEvent event )
                            {
                                setChoice( (Integer) event.widget.getData() );
                            }
                        };
                       
                        boolean first = true;
                       
                        for( Integer col : columnsWithHyperlinks )
                        {
                            final Button button = new Button( composite, SWT.RADIO | SWT.WRAP );
                            button.setLayoutData( gdhindent( gd(), 10 ) );
                            button.setText( item.getText( col ) );
                            button.setData( col );
                           
                            if( first )
                            {
                                button.setSelection( true );
                                first = false;
                            }
                           
                            button.addSelectionListener( listener );
                        }
                       
                        return composite;
                    }

                    @Override
                    protected void okPressed()
                    {
                        super.okPressed();
                        handleJumpCommand( item, this.choice );
                    }
                   
                    private void setChoice( final int choice )
                    {
                        this.choice = choice;
                    }
                };
               
                dialog.open();
            }
        }
    }
View Full Code Here

        PlatformUI.getWorkbench().getDisplay().asyncExec(
            new Runnable() {
              public void run() {
                final Shell shell = PlatformUI.getWorkbench()
                    .getActiveWorkbenchWindow().getShell();
                final Dialog dialog = new PushResultDialog(
                    shell, localDb, result,
                    destinationString);
                dialog.open();
              }
            });
      }
      return Status.OK_STATUS;
    }
View Full Code Here

    super.buttonPressed(buttonId);
    if (buttonId == CONFIGURE) {
      super.buttonPressed(IDialogConstants.OK_ID);
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
        public void run() {
          Dialog dlg = SimpleConfigureFetchDialog.getDialog(
              PlatformUI.getWorkbench().getDisplay()
                  .getActiveShell(), localDb);
          dlg.open();
        }
      });
    }
  }
View Full Code Here

    super.buttonPressed(buttonId);
    if (buttonId == CONFIGURE) {
      super.buttonPressed(IDialogConstants.OK_ID);
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
        public void run() {
          Dialog dlg = SimpleConfigurePushDialog.getDialog(PlatformUI
              .getWorkbench().getDisplay().getActiveShell(),
              localDb);
          dlg.open();
        }
      });
    }
  }
View Full Code Here

    else if (selectedNode instanceof FetchNode)
      configName = ((RemoteNode) selectedNode.getParent()).getObject();
    else
      return null;

    Dialog dlg = SimpleConfigureFetchDialog.getDialog(getShell(event),
        selectedNode.getRepository(), configName);
    dlg.open();
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.Dialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.