Java Code Examples for org.eclipse.jface.dialogs.Dialog#open()

The following examples show how to use org.eclipse.jface.dialogs.Dialog#open() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GetFieldsSampleDataDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
protected void handleOk( final int samples ) {
  if ( samples >= 0 ) {
    String message = parentDialog.loadFields( parentDialog.getPopulatedMeta(), samples, reloadAllFields );
    if ( wCheckbox != null && wCheckbox.getSelection() ) {
      if ( StringUtils.isNotBlank( message ) ) {
        final EnterTextDialog etd =
          new EnterTextDialog( parentDialog.getShell(),
            BaseMessages.getString( PKG, "GetFieldsSampleDataDialog.ScanResults.DialogTitle" ),
            BaseMessages.getString( PKG, "GetFieldsSampleDataDialog.ScanResults.DialogMessage" ), message, true );
        etd.setReadOnly();
        etd.setModal();
        etd.open();
      } else {
        final Dialog errorDlg = new SimpleMessageDialog( parentDialog.getShell(),
          BaseMessages.getString( PKG, "System.Dialog.Error.Title" ),
          BaseMessages.getString( PKG, "GetFieldsSampleDataDialog.ScanResults.Error.Message" ), MessageDialog.ERROR );
        errorDlg.open();
      }
    }
  }
}
 
Example 2
Source File: GetFieldsSampleDataDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void handleOk( final int samples ) {
  if ( samples >= 0 ) {
    String message = parentDialog.loadFields( parentDialog.getPopulatedMeta(), samples, reloadAllFields );
    if ( wCheckbox != null && wCheckbox.getSelection() ) {
      if ( StringUtils.isNotBlank( message ) ) {
        final EnterTextDialog etd =
          new EnterTextDialog( parentDialog.getShell(),
            BaseMessages.getString( PKG, "System.GetFields.ScanResults.DialogTitle" ),
            BaseMessages.getString( PKG, "System.GetFields.ScanResults.DialogMessage" ), message, true );
        etd.setReadOnly();
        etd.setModal();
        etd.open();
      } else {
        final Dialog errorDlg = new SimpleMessageDialog( parentDialog.getShell(),
          BaseMessages.getString( PKG, "System.Dialog.Error.Title" ),
          BaseMessages.getString( PKG, "System.GetFields.ScanResults.Error.Message" ), MessageDialog.ERROR );
        errorDlg.open();
      }
    }
  }
}
 
Example 3
Source File: JobEntryTransDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    final Dialog dialog = new SimpleMessageDialog( shell,
      BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ),
      BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ), MessageDialog.ERROR );
    dialog.open();
    return;
  }
  // Check if all parameters have names. If so, continue on.
  if ( parameterTableHelper.checkParams( shell ) ) {
    return;
  }

  jobEntry.setName( wName.getText() );

  try {
    getInfo( jobEntry );
  } catch ( KettleException e ) {
    // suppress exceptions at this time - we will let the runtime report on any errors
  }
  jobEntry.setChanged();
  dispose();
}
 
Example 4
Source File: ImportCSSStyleAction.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void run( )
{
	Dialog dialog = new BaseWizardDialog( PlatformUI.getWorkbench( )
			.getDisplay( )
			.getActiveShell( ), new SelectCssStyleWizard( getSelection() ) );
	dialog.open( );

	// FileDialog fd = new FileDialog( PlatformUI.getWorkbench( )
	// .getDisplay( )
	// .getActiveShell( ), SWT.OPEN );
	// fd.setFilterExtensions( new String[]{
	// "*.css"} );//$NON-NLS-1$
	// fd.setFilterNames( new String[]{
	// "CSS Style file" + " (css)" //$NON-NLS-1$ //$NON-NLS-2$
	// } );
	//
	// String file = fd.open( );
	// if ( file != null )
	// {
	// Dialog dialog = new ImportCSSStyleDialog( "Import CSS Style", file );
	// //$NON-NLS-1$
	// dialog.open( );
	// }
	//
}
 
Example 5
Source File: RouteResourcesButtonPart.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
protected void buttonSelected(SelectionEvent e) {
	try {
		Class<?> dialogClass = Platform.getBundle("org.talend.camel.designer").loadClass(
				"org.talend.camel.designer.dialog.RouteResourceSelectionDialog");
		Dialog dialog = (Dialog) dialogClass.getConstructor(Shell.class).newInstance(getShell());
		if (dialog.open() == Dialog.OK) {
			RepositoryNode resourceNode = (RepositoryNode) dialogClass.getMethod("getResult").invoke(dialog);
			if (resourceNode != null) {
				listener.routeResourceNodeSelected(resourceNode);
			}
		}
	} catch (Exception e1) {
		ExceptionHandler.process(new IllegalStateException(
				"Can't load RouteResourceSelectionDialog from specific bundle", e1));
	}
}
 
Example 6
Source File: ConfigureColumnsAction.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void run() {
    save();

    Dialog confColsDialog = new Dialog(Display.getCurrent().getActiveShell()) {
        @Override
        protected Control createDialogArea(Composite parent) {
            return createColumnControlPanel(parent);
        }

    };
    int result = confColsDialog.open();
    if (result == Dialog.CANCEL) {
        restore();
    }
}
 
Example 7
Source File: ActionPipelineDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
protected void ok() {
    if (Utils.isEmpty(wName.getText())) {
        final Dialog dialog = new SimpleMessageDialog(shell,
                BaseMessages.getString(PKG, "System.TransformActionNameMissing.Title"),
                BaseMessages.getString(PKG, "System.ActionNameMissing.Msg"), MessageDialog.ERROR);
        dialog.open();
        return;
    }
    action.setName(wName.getText());

    try {
        getInfo(action);
    } catch (HopException e) {
        // suppress exceptions at this time - we will let the runtime report on any errors
    }
    action.setChanged();
    dispose();
}
 
Example 8
Source File: MapDescriptorProvider.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public boolean add( int handleCount )
{
	boolean result = false;;
	CommandStack stack = SessionHandleAdapter.getInstance( )
			.getCommandStack( );

	try
	{
		stack.startTrans( Messages.getString( "MapPage.transName.addMapRule" ) ); //$NON-NLS-1$

		Dialog dialog = createAddDialog( handleCount );

		if ( dialog.open( ) == Window.OK )
		{
			result = true;
		}

		stack.commit( );

	}
	catch ( Exception e )
	{
		stack.rollback( );
		ExceptionUtil.handle( e );
		result = false;
	}
	return result;
}
 
Example 9
Source File: RefactoringExecutionHelper.java    From typescript.java with MIT License 4 votes vote down vote up
/**
 * @param status the status to show
 * @return <code>true</code> iff the operation should be cancelled
 */
private boolean showStatusDialog(RefactoringStatus status) {
	Dialog dialog= RefactoringUI.createRefactoringStatusDialog(status, fParent, fRefactoring.getName(), false);
	return dialog.open() == IDialogConstants.CANCEL_ID;
}
 
Example 10
Source File: RefactoringExecutionHelper.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @param status the status to show
 * @return <code>true</code> iff the operation should be cancelled
 */
private boolean showStatusDialog(RefactoringStatus status) {
	Dialog dialog= RefactoringUI.createRefactoringStatusDialog(status, fParent, fRefactoring.getName(), false);
	return dialog.open() == IDialogConstants.CANCEL_ID;
}
 
Example 11
Source File: RenameRefactoringExecuter.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected boolean showStatusDialog(RefactoringStatus status) {
	Dialog dialog = RefactoringUI.createRefactoringStatusDialog(status, shell, refactoring.getName(), false);
	return dialog.open() == IDialogConstants.CANCEL_ID;
}
 
Example 12
Source File: CustomizeManager.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public void handleTableCustomization() {
   Dialog dialog = xViewerFactory.getCustomizeDialog(xViewer);
   if (dialog != null) {
      dialog.open();
   }
}
 
Example 13
Source File: WinEmulatorStatusHandler.java    From thym with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void handle(IStatus status) {
	Dialog dialog = new MissingEmulatorsDialog(getShell());
	dialog.open();
}
 
Example 14
Source File: AdditionalResourcesPropertySection.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
private void addAdditionalResource() {
    AdditionalResourceWizard wizard = new AdditionalResourceWizard(getPool());
    Dialog dialog = new AdditionalResourceWizardDialog(Display.getDefault().getActiveShell(), wizard, true);
    dialog.open();
}
 
Example 15
Source File: WinDeviceStatusHandler.java    From thym with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void handle(IStatus status) {
	Dialog dialog = new MissingDeviceDialog(getShell());
	dialog.open();
}
 
Example 16
Source File: NewReportAction.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void run( )
{
	Dialog dialog = new BaseWizardDialog( fWindow.getShell( ),
			new NewReportWizard( ) );
	dialog.open( );
}
 
Example 17
Source File: CommonStepDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
protected void openDialog( final String title, final String message, final int dialogType ) {
  final Dialog dialog = new SimpleMessageDialog( shell, title, message, dialogType );
  dialog.open();
}
 
Example 18
Source File: CommonTransformDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
protected void openDialog( final String title, final String message, final int dialogType ) {
  final Dialog dialog = new SimpleMessageDialog( shell, title, message, dialogType );
  dialog.open();
}
 
Example 19
Source File: NewLibraryAction.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void run( )
{
	Dialog dialog = new BaseWizardDialog( fWindow.getShell( ),
			new NewLibraryWizard( ) );
	dialog.open( );
}
 
Example 20
Source File: NewReportTemplateAction.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void run( )
{
	Dialog dialog = new BaseWizardDialog( fWindow.getShell( ),
			new NewReportTemplateWizard( ) );
	dialog.open( );
}