Example usage for org.eclipse.jface.dialogs IMessageProvider INFORMATION

List of usage examples for org.eclipse.jface.dialogs IMessageProvider INFORMATION

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IMessageProvider INFORMATION.

Prototype

int INFORMATION

To view the source code for org.eclipse.jface.dialogs IMessageProvider INFORMATION.

Click Source Link

Document

Constant for an info message (value 1).

Usage

From source file:org.jcryptool.crypto.xml.ui.sign.PageOpenKey.java

License:Open Source License

/**
 * Determines the (error) message for the missing field.
 *//* w w w. ja  v  a2 s. c om*/
private void dialogChanged() {
    if (tKeystore.getText().length() == 0) {
        updateStatus(Messages.selectKeyFile, IMessageProvider.INFORMATION);
        return;
    }
    if (tKeystorePassword.getText().length() == 0) {
        updateStatus(Messages.enterKeystorePassword, IMessageProvider.INFORMATION);
        return;
    }
    if (tKeyName.getText().length() == 0) {
        updateStatus(Messages.enterKeyName, IMessageProvider.INFORMATION);
        return;
    }
    if (tKeyPassword.getText().length() == 0) {
        updateStatus(Messages.enterKeyPassword, IMessageProvider.INFORMATION);
        return;
    }

    if (new File(tKeystore.getText()).exists()) {
        try {
            keystore = new Keystore(tKeystore.getText(), tKeystorePassword.getText(), IGlobals.KEYSTORE_TYPE);
            boolean loaded = keystore.load();

            if (loaded) {
                if (keystore.containsKey(tKeyName.getText())) {
                    if (keystore.getPrivateKey(tKeyName.getText(),
                            tKeyPassword.getText().toCharArray()) == null) {
                        updateStatus(Messages.verifyKeyPassword, IMessageProvider.ERROR);
                        return;
                    }
                } else {
                    updateStatus(Messages.verifyKeyName, IMessageProvider.ERROR);
                    return;
                }
            } else {
                updateStatus(Messages.verifyKeystorePassword, IMessageProvider.ERROR);
                return;
            }
        } catch (Exception ex) {
            updateStatus(Messages.verifyAll, IMessageProvider.ERROR);
            return;
        }
    } else {
        updateStatus(Messages.keystoreNotFound, IMessageProvider.ERROR);
        return;
    }

    updateStatus(null, IMessageProvider.NONE);
}

From source file:org.jcryptool.crypto.xml.ui.sign.PageResource.java

License:Open Source License

/**
 * Determines the (error) message for the missing field.
 *///from   ww w  .  ja v  a2 s. c om
private void dialogChanged() {
    if (globalError) {
        return;
    }

    if (bXpath.getSelection() && tXpath.getText().isEmpty()) {
        updateStatus(Messages.enterXPath, IMessageProvider.INFORMATION);
        return;
    } else if (bXpath.getSelection() && !tXpath.getText().isEmpty()) {
        String xpathValidator = Utils.validateXPath(doc, tXpath.getText());
        if (xpathValidator.equals("none")) { //$NON-NLS-1$
            updateStatus(Messages.xpathNoElement, IMessageProvider.ERROR);
            return;
        } else if (xpathValidator.equals("multiple")) { //$NON-NLS-1$
            updateStatus(Messages.xpathMultipleElements, IMessageProvider.ERROR);
            return;
        } else if (xpathValidator.equals("attribute")) { //$NON-NLS-1$
            updateStatus(Messages.xpathAttribute, IMessageProvider.ERROR);
            return;
        }
    }
    if (bDetached.getSelection() && tDetachedFile.getText().isEmpty()) {
        updateStatus(Messages.detachedFile, IMessageProvider.INFORMATION);
        return;
    } else if (bDetached.getSelection() && !tDetachedFile.getText().isEmpty()) {
        File tempFile = new File(tDetachedFile.getText());
        if (!tempFile.exists()) {
            updateStatus(Messages.verifyDetachedFile, IMessageProvider.ERROR);
            return;
        }
    }

    updateStatus(null, IMessageProvider.NONE);
}

From source file:org.jcryptool.games.numbershark.strategies.HeuristicStrategyDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    setTitle(Messages.HeuStratDialog_0);
    setMessage(Messages.HeuStratDialog_5, IMessageProvider.INFORMATION);

    Composite area = (Composite) super.createDialogArea(parent);

    Composite composite = new Composite(area, SWT.NONE);
    GridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
    gd_composite.widthHint = 470;//from   ww w  . jav  a  2s  .  c o  m
    composite.setLayoutData(gd_composite);
    GridLayout gl_composite = new GridLayout(1, false);
    gl_composite.marginTop = 15;
    gl_composite.marginLeft = 15;

    composite.setLayout(gl_composite);

    Group strategyGroup = new Group(composite, SWT.NONE);
    strategyGroup.setText(Messages.HeuStratDialog_8);
    GridData gd_strategyGroup = new GridData(SWT.LEFT, SWT.CENTER, false, false);
    gd_strategyGroup.verticalIndent = 5;
    gd_strategyGroup.widthHint = 430;
    gd_strategyGroup.horizontalIndent = 6;

    strategyGroup.setLayoutData(gd_strategyGroup);
    GridLayout gl_strategyGroup = new GridLayout(1, true);
    strategyGroup.setLayout(gl_strategyGroup);
    final Button[] radioButton = new Button[4];
    radioButton[0] = new Button(strategyGroup, SWT.RADIO);
    radioButton[0].setText(Messages.HeuStratDialog_1);

    radioButton[1] = new Button(strategyGroup, SWT.RADIO);
    radioButton[1].setText(Messages.HeuStratDialog_2);

    radioButton[2] = new Button(strategyGroup, SWT.RADIO);
    radioButton[2].setText(Messages.HeuStratDialog_3);
    /*
    radioButton[3] = new Button(composite, SWT.RADIO);
    radioButton[3].setText(Messages.HeuStratDialog_4);
    */

    SelectionAdapter radioButtonListener = new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            if (e.getSource() == radioButton[0]) {
                selectedStrategy = 2;
            }
            if (e.getSource() == radioButton[1]) {
                selectedStrategy = 3;
            }
            if (e.getSource() == radioButton[2]) {
                selectedStrategy = 4;
            }

            if (e.getSource() == radioButton[3]) {
                selectedStrategy = 5;
            }
        }
    };

    radioButton[0].addSelectionListener(radioButtonListener);
    radioButton[1].addSelectionListener(radioButtonListener);
    radioButton[2].addSelectionListener(radioButtonListener);

    createSliders(area, false, 2000, 40);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, NumberSharkPlugin.PLUGIN_ID + ".heuStratDialog"); //$NON-NLS-1$

    return area;
}

From source file:org.jcryptool.games.numbershark.strategies.OptimalStrategyDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    setTitle(Messages.OptStratDialog_0);
    setMessage(Messages.OptStratDialog_5, IMessageProvider.INFORMATION);

    Composite area = (Composite) super.createDialogArea(parent);

    Composite composite = new Composite(area, SWT.NONE);
    GridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
    gd_composite.widthHint = 470;/*  www. j  av  a  2 s.c om*/
    composite.setLayoutData(gd_composite);
    GridLayout gl_composite = new GridLayout(1, false);
    gl_composite.marginTop = 15;
    gl_composite.marginLeft = 15;
    composite.setLayout(gl_composite);

    Button showButton = new Button(composite, SWT.RADIO);
    showButton.setText(Messages.OptStratDialog_2);

    Button calcButton = new Button(composite, SWT.RADIO);
    calcButton.setText(Messages.OptStratDialog_1);

    final Group compositeSliders = createSliders(area, true, 400, 40);

    calcButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            selectedStrategy = 1;
            compositeSliders.setVisible(true);
        }
    });

    showButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            selectedStrategy = 0;
            compositeSliders.setVisible(false);
        }
    });

    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, NumberSharkPlugin.PLUGIN_ID + ".optStratDialog"); //$NON-NLS-1$

    return area;
}

From source file:org.jcryptool.games.numbershark.strategies.ResultDialHeuristicStrategy.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    setTitle(Messages.ShowHeuStrategy_1);
    String algo = "";
    switch (this.getSelectedStrategy()) {

    case 2://  w ww.  j  a va  2 s .c  om
        algo = Messages.ShowHeuStrategy_5;
        break;

    case 3:
        algo = Messages.ShowHeuStrategy_6;
        break;

    case 4:
        algo = Messages.ShowHeuStrategy_7;
        break;
    }

    String msg = NLS.bind(Messages.ShowHeuStrategy_2, new Object[] { algo });
    setMessage(msg, IMessageProvider.INFORMATION);
    Composite area = (Composite) super.createDialogArea(parent);

    columns[0].setText(Messages.ShowOptStrategy_3);
    columns[1].setText(Messages.ShowHeuStrategy_4);
    columns[2].setText(Messages.ShowOptStrategy_5);
    columns[3].setText(Messages.ShowHeuStrategy_3);
    columns[4].setText(Messages.ShowOptStrategy_7);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
            NumberSharkPlugin.PLUGIN_ID + ".heuStratResultDialog"); //$NON-NLS-1$

    return area;
}

From source file:org.jcryptool.games.numbershark.strategies.ResultDialOptimalStrategy.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    setTitle(Messages.ShowOptStrategy_1);
    setMessage(Messages.ShowOptStrategy_2, IMessageProvider.INFORMATION);
    Composite area = (Composite) super.createDialogArea(parent);

    columns[0].setText(Messages.ShowOptStrategy_3);
    columns[1].setText(Messages.ShowOptStrategy_4);
    columns[2].setText(Messages.ShowOptStrategy_5);
    columns[3].setText(Messages.ShowOptStrategy_6);
    columns[4].setText(Messages.ShowOptStrategy_7);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
            NumberSharkPlugin.PLUGIN_ID + ".optStratResultDialog"); //$NON-NLS-1$

    return area;//from w ww  .  jav a 2s .  c  om
}

From source file:org.jkiss.dbeaver.tools.project.ProjectImportWizardPageFile.java

License:Open Source License

private boolean updateProjectsSelection() {
    importData.clearProjectNameMap();//from  w w w. j  a  v a2s  .  com
    boolean failed = false;
    for (TableItem item : projectsTable.getItems()) {
        boolean validItem = checkProjectItem(item);
        if (!validItem && item.getChecked()) {
            failed = true;
        }
    }

    if (!failed) {
        boolean hasChecked = false;
        for (TableItem item : projectsTable.getItems()) {
            if (item.getChecked()) {
                importData.addProjectName(item.getText(0), item.getText(1));
                hasChecked = true;
            }
        }
        if (hasChecked) {
            setMessage(CoreMessages.dialog_project_import_wizard_file_message_ready,
                    IMessageProvider.INFORMATION);
        } else {
            setMessage(CoreMessages.dialog_project_import_wizard_file_message_choose_project,
                    IMessageProvider.INFORMATION);
        }
    }
    return !failed;
}

From source file:org.jlibrary.client.ui.export.wizard.TemplatesDataPage.java

License:Open Source License

private void checkButtonsEnabled() {

    setPageComplete(false);//from   w w w. j av  a2  s . c om

    IStructuredSelection selection = (IStructuredSelection) templatesList.getSelection();
    if (selection.isEmpty()) {
        setMessage(Messages.getMessage("export_wizard_templates_select"), IMessageProvider.ERROR);
        return;
    }

    if (!directoryText.getText().equals("")) {
        setMessage(Messages.getMessage("export_wizard_type_finish"), IMessageProvider.INFORMATION);
        setPageComplete(true);
    } else {
        setMessage(Messages.getMessage("export_wizard_type_enter_directory"), IMessageProvider.ERROR);
    }
}

From source file:org.jlibrary.client.ui.repository.wizard.ImportDataPage.java

License:Open Source License

private void checkButtonsEnabled() {

    setPageComplete(false);//from w w  w .j a va2s .  c om
    if (fileText.getText().trim().equals("")) {
        return;
    }
    if (nameText.getText().trim().equals("")) {
        return;
    }

    File file = new File(fileText.getText());

    if (!(file.exists())) {
        setMessage(Messages.getMessage("import_wizard_file_not_found"), IMessageProvider.ERROR);
    } else if (file.isDirectory()) {
        setMessage(Messages.getMessage("import_wizard_directory"), IMessageProvider.ERROR);
    } else if (!file.getName().endsWith(".jlib")) {
        setMessage(Messages.getMessage("import_wizard_jlib"), IMessageProvider.ERROR);
    } else {
        setMessage(Messages.getMessage("import_wizard_next"), IMessageProvider.INFORMATION);
        setPageComplete(true);
    }
}

From source file:org.jlibrary.client.ui.repository.wizard.RepositorySelectionDataPage.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
 *//*  w w w.  j  a  v  a 2s .  co m*/
public void createControl(Composite outer) {

    Composite parent = new Composite(outer, SWT.NONE);

    GridLayout pageLayout = new GridLayout();
    pageLayout.numColumns = 1;
    pageLayout.verticalSpacing = 10;

    parent.setLayout(pageLayout);

    viewer = new ListViewer(parent, SharedImages.getImage(SharedImages.IMAGE_OPEN_REPOSITORY));

    GridData data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.heightHint = 100;
    data.grabExcessHorizontalSpace = true;
    viewer.getControl().setLayoutData(data);

    autoConnectButton = new Button(parent, SWT.CHECK | SWT.NONE);
    autoConnectButton.setText(Messages.getMessage("repository_dialog_autoconnect"));
    data = new GridData();
    data.heightHint = 50;
    autoConnectButton.setLayoutData(data);

    viewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {

            repositoryInfo = (RepositoryInfo) ((StructuredSelection) viewer.getSelection()).getFirstElement();
            String id = repositoryInfo.getId();
            if (event.getSelection().isEmpty()) {
                setPageComplete(false);
                setErrorMessage(null);
                return;
            }
            Repository repository = RepositoryRegistry.getInstance().getRepository(id);
            if (repository != null) {
                // Debemos estar conectndonos con el mismo usuario
                Ticket ticket = userDataPage.getTicket();
                if (ticket.getUser().equals(repository.getTicket().getUser())) {
                    setMessage(Messages.getMessage("open_repository_wizard_repository_opened"),
                            IMessageProvider.INFORMATION);
                    setPageComplete(false);
                    return;
                }
            }
            setMessage(getDescription());
            setPageComplete(true);
        }
    });

    setControl(parent);
}