Example usage for org.eclipse.jface.dialogs IDialogConstants HELP_ID

List of usage examples for org.eclipse.jface.dialogs IDialogConstants HELP_ID

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants HELP_ID.

Prototype

int HELP_ID

To view the source code for org.eclipse.jface.dialogs IDialogConstants HELP_ID.

Click Source Link

Document

Button id for a "Help" button (value 17).

Usage

From source file:org.talend.designer.core.ui.dialog.HelpAvailableDialog.java

License:Open Source License

/**
 * Add create Help Button if {@link #isHelpAvailable()} = true.
 * //www . java 2s .com
 * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    if (isHelpAvailable()) {
        createButton(parent, IDialogConstants.HELP_ID, IDialogConstants.HELP_LABEL, false);
    }
    // create OK and Cancel buttons by default
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:org.talend.designer.core.ui.dialog.HelpAvailableDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (IDialogConstants.HELP_ID == buttonId) {
        if (getShell() != null) {
            Control c = getShell().getDisplay().getFocusControl();
            while (c != null) {
                if (c.isListening(SWT.Help)) {
                    c.notifyListeners(SWT.Help, new Event());
                    break;
                }/*from  ww  w.  jav  a  2s .  c o m*/
                c = c.getParent();
            }
        }
    } else {
        super.buttonPressed(buttonId);
    }
}

From source file:org.talend.registration.wizards.register.RegisterWizardPage1.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {

    if (IDialogConstants.NEXT_ID == buttonId) {
        emailStr = getEmail();/*w w w.ja va  2  s. c  o m*/
        setEmailStr(emailStr);
        countryStr = getCountry();
        boolean alreadyRegistered = false;
        String firstname = "";//$NON-NLS-N$
        String lastname = "";//$NON-NLS-N$
        String pseudonym = "";//$NON-NLS-N$
        String password = "";//$NON-NLS-N$

        try {
            String userInfos = RegisterManagement.getInstance().checkUser(emailStr, isProxyEnable, proxyHost,
                    proxyPort, proxyUser, proxyPassword);
            if (userInfos != null && !"".equals(userInfos)) {
                alreadyRegistered = true;
                String[] split = userInfos.split(",");//$NON-NLS-N$
                if (split.length > 2) {

                    firstname = split[0];
                    if (split[0] != null && split[0].length() > 1 && split[0].startsWith("\"")
                            && split[0].endsWith("\"")) {//$NON-NLS-N$//$NON-NLS-N$
                        firstname = split[0].substring(1, split[0].length() - 1);
                    }
                    if (split[1] != null && split[1].length() > 1 && split[1].startsWith("\"")
                            && split[1].endsWith("\"")) {//$NON-NLS-N$//$NON-NLS-N$
                        lastname = split[1].substring(1, split[1].length() - 1);
                    }
                    if (split[2] != null && split[2].length() > 1 && split[2].startsWith("\"")
                            && split[2].endsWith("\"")) {//$NON-NLS-N$//$NON-NLS-N$
                        pseudonym = split[2].substring(1, split[2].length() - 1);
                    }
                    //                        if (split[3] != null && split[3].length() > 1 && split[3].startsWith("\"") && split[3].endsWith("\"")) {//$NON-NLS-N$//$NON-NLS-N$
                    // password = split[3].substring(1, split[3].length() - 1);
                    // }
                }

            }
        } catch (BusinessException e) {
            alreadyRegistered = false;
            // MessageBoxExceptionHandler.process(e);

        }

        close();
        RegisterWizard registerWizard = new RegisterWizard();
        RegisterWizardPage2 dialog = new RegisterWizardPage2(this.getShell(), registerWizard, emailStr,
                countryStr, alreadyRegistered, firstname, lastname, pseudonym, password, isProxyEnable,
                proxyHost, proxyPort);
        dialog.open();
    } else if (IDialogConstants.CANCEL_ID == buttonId) {
        RegisterManagement.decrementTry();
        RegisterManagement.increaseFailRegisterTimes();
        close();
    } else if (IDialogConstants.HELP_ID == buttonId) {
        NetworkSettingDialog netSettingDialog = new NetworkSettingDialog(getParentShell());
        if (netSettingDialog.open() == Dialog.OK) {
            String[] proxyString = netSettingDialog.getProxyString();
            proxyHost = proxyString[0];
            proxyPort = proxyString[1];
            proxyUser = proxyString[2];
            proxyPassword = proxyString[3];
            if (proxyHost != null && !"".equals(proxyHost)) {//$NON-NLS-N$
                isProxyEnable = true;
            }
        } else {
            proxyHost = null;
            proxyPort = null;
            proxyUser = null;
            proxyPassword = null;
            isProxyEnable = false;
        }
    }
}

From source file:org.talend.registration.wizards.register.RegisterWizardPage1.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    createButton(parent, IDialogConstants.HELP_ID, Messages.getString("RegisterWizardPage.netWorkSetting"),
            true);//from w  w w.  j a v  a2 s . co  m
    new Label(parent, SWT.NONE);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.getString("RegisterWizardPage.registerLater"),
            true);
    new Label(parent, SWT.NONE);
    new Label(parent, SWT.NONE);
    nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true);
    if (emailText.getText() != null && !"".equals(emailText.getText())) {
        nextButton.setEnabled(true);
    } else {
        nextButton.setEnabled(false);
    }
}

From source file:org.talend.repository.ui.dialog.ProjectSettingsPreferenceDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    switch (buttonId) {
    case IDialogConstants.OK_ID: {
        okPressed();/*from  w w  w  .  j  a v  a 2 s. c o  m*/
        commiteProjectSettings();
        return;
    }
    case IDialogConstants.CANCEL_ID: {
        cancelPressed();
        return;
    }
    case IDialogConstants.HELP_ID: {
        helpPressed();
        return;
    }
    case IMPORT: {
        importPressed();
        commiteProjectSettings();
        return;
    }
    case EXPORT: {
        exportPressed();
        return;
    }
    }
}

From source file:org.universaal.tools.packaging.tool.api.WizardDialogMod.java

License:Open Source License

@Override
public void buttonPressed(int buttonId) {
    switch (buttonId) {
    case IDialogConstants.HELP_ID: {
        helpPressed();/*from w  w w.j ava 2 s  . com*/
        break;
    }
    case IDialogConstants.BACK_ID: {
        WizardPageMod page = (WizardPageMod) getCurrentPage();
        if (page.backPressed()) // to handle custom events
            backPressed();
        break;
    }
    case IDialogConstants.NEXT_ID: {

        WizardPageMod page = (WizardPageMod) getCurrentPage();
        if (page.nextPressed()) // to handle custom events
            nextPressed();
        break;
    }
    case IDialogConstants.FINISH_ID: {
        finishPressed();
        break;
    }
    }
}