Example usage for org.eclipse.jface.dialogs MessageDialog NONE

List of usage examples for org.eclipse.jface.dialogs MessageDialog NONE

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs MessageDialog NONE.

Prototype

int NONE

To view the source code for org.eclipse.jface.dialogs MessageDialog NONE.

Click Source Link

Document

Constant for no image (value 0).

Usage

From source file:org.eclipse.jdt.internal.debug.ui.classpath.DefaultClasspathEntryDialog.java

License:Open Source License

public DefaultClasspathEntryDialog(Shell parentShell, IRuntimeClasspathEntry entry) {
    super(parentShell, ClasspathMessages.DefaultClasspathEntryDialog_0, null,
            NLS.bind(ClasspathMessages.DefaultClasspathEntryDialog_1,
                    new String[] { entry.getJavaProject().getElementName() }),
            MessageDialog.NONE, new String[] { ClasspathMessages.DefaultClasspathEntryDialog_2,
                    ClasspathMessages.DefaultClasspathEntryDialog_3 },
            0);//from www  . j a  v a2  s.  c o  m
    fEntry = (DefaultProjectClasspathEntry) entry;
}

From source file:org.eclipse.linuxtools.internal.oprofile.ui.view.OprofileViewLogReaderAction.java

License:Open Source License

public OprofiledLogDialog(Shell parentShell, String dialogMessage) {
    super(parentShell, OprofileUiMessages.getString("oprofiled.logreader.dialog.title"), null, null, //$NON-NLS-1$
            MessageDialog.NONE, new String[] { IDialogConstants.OK_LABEL }, 0);
    textContent = dialogMessage;/*  w w w . j  av a  2  s  . c om*/
}

From source file:org.eclipse.mylyn.commons.tests.manual.TestWebBrowserDialog.java

License:Open Source License

public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setText("Test Web Browser Dialog");
    shell.setLayout(new RowLayout());

    final Text locationText = new Text(shell, SWT.BORDER);
    locationText.setLayoutData(new RowData(200, SWT.DEFAULT));
    locationText.setText("http://localhost");

    Button userButton = new Button(shell, SWT.PUSH);
    userButton.setText("Open");
    userButton.addSelectionListener(new SelectionAdapter() {
        @Override//from   w  ww .  j a v a 2 s.co m
        public void widgetSelected(SelectionEvent e) {
            WebBrowserDialog dialog = new WebBrowserDialog(shell, "Browse " + locationText.getText(), null,
                    "Web Browser Dialog Test", MessageDialog.NONE,
                    new String[] { IDialogConstants.CANCEL_LABEL }, 0);
            dialog.create();
            dialog.setUrl(locationText.getText(), null, null);
            dialog.open();
        }
    });

    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
}

From source file:org.eclipse.mylyn.internal.commons.repositories.ui.auth.OpenIdCredentialsProviderUi.java

License:Open Source License

@Override
public IStatus open(Shell parentShell,
        AuthenticationRequest<AuthenticationType<OpenIdCredentials>> authRequest) {
    if (!(authRequest instanceof OpenIdAuthenticationRequest)) {
        throw new IllegalArgumentException(
                "Extected instanceof OpenIdAuthenticationRequest, got " + authRequest.getClass()); //$NON-NLS-1$
    }//w w w .ja  va  2  s  .c  o m
    final OpenIdAuthenticationRequest request = (OpenIdAuthenticationRequest) authRequest;

    final WebBrowserDialog dialog = new WebBrowserDialog(WorkbenchUtil.getShell(),
            Messages.OpenIdCredentialsProviderUi_Login, null,
            Messages.OpenIdCredentialsProviderUi_Login_to_OpenID_Provider, MessageDialog.NONE,
            new String[] { IDialogConstants.CANCEL_LABEL }, 0);
    dialog.create();

    dialog.getBrowser().addLocationListener(new LocationAdapter() {
        @Override
        public void changing(LocationEvent event) {
            if (event.location != null && event.location.startsWith(request.getReturnUrl())) {
                credentials = new OpenIdCredentials(event.location, null);
            }
            // alternatively check cookies since IE does not notify listeners of redirects 
            String value = Browser.getCookie(request.getCookie(), request.getCookieUrl());
            if (value != null) {
                credentials = new OpenIdCredentials(event.location, value);
            }
            if (credentials != null) {
                event.doit = false;
                // delay execution to avoid IE crash
                dialog.getBrowser().getDisplay().asyncExec(new Runnable() {
                    public void run() {
                        if (dialog.getShell() != null && !dialog.getShell().isDisposed()) {
                            dialog.close();
                        }
                    }
                });
            }
        }
    });

    // navigate to login page
    dialog.getBrowser().setUrl(request.getRequestUrl() + "?" + getRequestParameters(request)); //$NON-NLS-1$

    if (dialog.open() == Window.OK) {
        return Status.OK_STATUS;
    } else {
        return Status.CANCEL_STATUS;
    }
}

From source file:org.eclipse.mylyn.internal.gerrit.ui.GerritRepositoryLocationUi.java

License:Open Source License

private OpenIdAuthenticationResponse showAuthenticationDialog(final String repositoryUrl,
        final OpenIdAuthenticationRequest request) {
    final StringBuilder sb = new StringBuilder();
    try {//from  ww  w. java 2s  .  c  o  m
        for (Map.Entry<String, String> entry : request.getProviderArgs().entrySet()) {
            if (sb.length() > 0) {
                sb.append("&"); //$NON-NLS-1$
            }
            sb.append(URLEncoder.encode(entry.getKey(), "UTF-8")); //$NON-NLS-1$
            sb.append("="); //$NON-NLS-1$
            sb.append(URLEncoder.encode(entry.getValue(), "UTF-8")); //$NON-NLS-1$
        }
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e);
    }

    final AtomicReference<OpenIdAuthenticationResponse> result = new AtomicReference<OpenIdAuthenticationResponse>();
    Display.getDefault().syncExec(new Runnable() {
        @Override
        public void run() {
            final WebBrowserDialog dialog = new WebBrowserDialog(WorkbenchUtil.getShell(), "Login", null,
                    "Login to OpenID Provider", MessageDialog.NONE,
                    new String[] { IDialogConstants.CANCEL_LABEL }, 0) {
                @Override
                protected Point getInitialSize() {
                    return new Point(780, 580);
                }
            };
            dialog.create();

            dialog.getBrowser().addLocationListener(new LocationAdapter() {
                @Override
                public void changing(LocationEvent event) {
                    if (event.location != null && event.location.startsWith(request.getReturnUrl())) {
                        result.set(new OpenIdAuthenticationResponse(event.location, null));
                    }
                    // alternatively check cookies since IE does not notify listeners of redirects 
                    String value = Browser.getCookie(request.getCookie(), request.getCookieUrl());
                    if (value != null) {
                        result.set(new OpenIdAuthenticationResponse(event.location, value));
                    }
                    if (result.get() != null) {
                        event.doit = false;
                        // delay execution to avoid IE crash
                        dialog.getBrowser().getDisplay().asyncExec(new Runnable() {
                            @Override
                            public void run() {
                                if (dialog.getShell() != null && !dialog.getShell().isDisposed()) {
                                    dialog.close();
                                }
                            }
                        });
                    }
                }
            });

            // navigate to login page
            dialog.getBrowser().setUrl(request.getRequestUrl() + "?" + sb.toString());
            dialog.open();
        }
    });
    return result.get();
}

From source file:org.eclipse.osee.ats.util.widgets.dialog.TransitionStatusDialog.java

License:Open Source License

public TransitionStatusDialog(String dialogTitle, String dialogMessage, TransitionStatusData data) {
    super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE,
            new String[] { "OK", "Cancel" }, 0);
    this.data = data;
}

From source file:org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog.java

License:Open Source License

public BranchSelectionDialog(String title, Collection<Branch> branches) {
    super(Displays.getActiveShell(), title, null, null, MessageDialog.NONE, new String[] { "Ok", "Cancel" }, 0);
    allowOnlyWorkingBranches = false;//from  w w  w. ja v a  2  s  . co  m
    selected = null;
    this.branches = branches;
    setShellStyle(getShellStyle() | SWT.RESIZE);
}

From source file:org.eclipse.osee.framework.ui.skynet.update.ReflectArtifactStatusDialog.java

License:Open Source License

public ReflectArtifactStatusDialog(List<TransferObject> transferObjects) {
    super(Displays.getActiveShell(), TITLE, null, null, MessageDialog.NONE, new String[] { OK, CANCEL }, 0);
    this.transferObjects = transferObjects;
}

From source file:org.eclipse.osee.framework.ui.skynet.widgets.dialog.DateSelectionDialog.java

License:Open Source License

public DateSelectionDialog(String dialogTitle, String dialogMessage, Date selectedDate) {
    this(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE,
            new String[] { "Ok", "Cancel" }, 0, selectedDate);
}

From source file:org.eclipse.osee.framework.ui.skynet.widgets.dialog.FilteredCheckboxTreeDialog.java

License:Open Source License

public FilteredCheckboxTreeDialog(String dialogTitle, String dialogMessage, IContentProvider contentProvider,
        IBaseLabelProvider labelProvider, ViewerSorter viewerSorter) {
    super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE,
            new String[] { "OK", "Cancel" }, 0);
    this.contentProvider = contentProvider;
    this.labelProvider = labelProvider;
    this.viewerSorter = viewerSorter;
    this.patternFilter = new PatternFilter();
    setShellStyle(getShellStyle() | SWT.RESIZE);
}