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

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

Introduction

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

Prototype

int NONE

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

Click Source Link

Document

Constant for a regular message (value 0).

Usage

From source file:org.jboss.tools.openshift.cdk.server.ui.internal.CDKServerWizardFragment.java

License:Open Source License

private void validate() {
    String err = findError();/*from  ww w.j  a v a  2s  . c  o m*/
    if (err != null) {
        handle.setMessage(err, IMessageProvider.ERROR);
        setComplete(false);
    } else {
        setComplete(true);
        String warn = findWarning();
        if (warn != null) {
            handle.setMessage(warn, IMessageProvider.WARNING);
        } else {
            handle.setMessage(null, IMessageProvider.NONE);
        }
    }
    handle.update();
}

From source file:org.jboss.tools.openshift.express.internal.ui.server.CommitDialog.java

License:Open Source License

private void updateMessage() {
    if (commitButton == null)
        // Not yet fully initialized.
        return;/* w ww . ja v  a 2 s  . c  o  m*/

    String message = null;
    int type = IMessageProvider.NONE;

    String commitMsg = commitMessageComponent.getCommitMessage();
    if (commitMsg == null || commitMsg.trim().length() == 0) {
        message = UIText.CommitDialog_Message;
        type = IMessageProvider.INFORMATION;
    } else if (!isCommitWithoutFilesAllowed()) {
        message = UIText.CommitDialog_MessageNoFilesSelected;
        type = IMessageProvider.INFORMATION;
    } else {
        CommitStatus status = commitMessageComponent.getStatus();
        message = status.getMessage();
        type = status.getMessageType();
    }

    //      setMessage(message, type);
    //      boolean commitEnabled = type == IMessageProvider.WARNING
    //            || type == IMessageProvider.NONE;
    this.canCommit = type == IMessageProvider.WARNING || type == IMessageProvider.NONE;
    commitButton.setEnabled(canCommit);
    //      commitAndPushButton.setEnabled(commitEnabled);
    if (canCommit) {
        commitButton.setText("Commit and Publish");
        commitButton.setEnabled(canCommit);
    } else {
        if (isAhead) {
            commitButton.setText("Publish Only");
            commitButton.setEnabled(true);
        } else {
            commitButton.setText("Commit and Publish");
            commitButton.setEnabled(false);
        }
    }

    if (!canCommit && isAhead && isDirty()) {
        message += NLS.bind(
                "\nIf you publish now, uncommitted changes will not be present in your OpenShift application {0}",
                applicationName);
    }

    setMessage(message, type);
}

From source file:org.jboss.tools.openshift.internal.ui.server.ChooseOpenshiftConnectionFragment.java

License:Open Source License

private IPageChangingListener onPageChanging(IWizardHandle wizardHandle) {
    return new IPageChangingListener() {
        @Override/*  ww w .java 2 s .  c  o  m*/
        public void handlePageChanging(PageChangingEvent event) {
            if (event.getCurrentPage() == getPage(wizardHandle)) {
                if (event.getTargetPage() == null
                        || event.getTargetPage().equals(getPage(wizardHandle).getNextPage())) {
                    String blockedMsg = null;
                    try {
                        blockedMsg = runConnectionJob();
                    } catch (Exception e) {
                        blockedMsg = "Error while checking if we can connect to OpenShift Connection: "
                                + e.getMessage();
                    }
                    event.doit = (blockedMsg == null);
                    handle.setMessage(blockedMsg,
                            (blockedMsg == null ? IMessageProvider.NONE : IMessageProvider.ERROR));
                }
                if (selectedConnection instanceof Connection) {
                    OpenShiftServerTaskModelAccessor.set((Connection) selectedConnection, getTaskModel());
                }
            }
        }
    };
}

From source file:org.jboss.tools.smooks.configuration.editors.SmooksConfigurationOverviewPage.java

License:Open Source License

protected void updateFormHeader() {
    if (currentMessageType == IMessageProvider.NONE) {
        if (this.getManagedForm() != null) {
            getManagedForm().getMessageManager().removeAllMessages();
            getManagedForm().getMessageManager().update();

            streamFilterTypeCombo.setEnabled(true);
            defaultSerializationOnCheckbox.setEnabled(true);
        }//from w w w  .  j  a  v a  2 s . co  m
    } else {
        if (this.getManagedForm() != null) {
            streamFilterTypeCombo.setEnabled(false);
            defaultSerializationOnCheckbox.setEnabled(false);
            String[] messages = currentMessage.split("\n"); //$NON-NLS-1$
            List<IMessage> messageList = new ArrayList<IMessage>();
            for (int i = 0; i < messages.length; i++) {
                String message = messages[i];
                if (message != null)
                    message.trim();
                if (message.length() == 0) {
                    continue;
                }
                messageList.add(new SmooksMessage(currentMessageType, message));
            }
            String mainMessage = null;
            if (messageList.isEmpty()) {
                mainMessage = currentMessage;
            } else {
                mainMessage = messageList.get(0).getMessage();
            }
            this.getManagedForm().getForm().getForm().setMessage(mainMessage, currentMessageType,
                    messageList.toArray(new IMessage[] {}));
        }
    }
}

From source file:org.jboss.tools.smooks.graphical.editors.SmooksProcessGraphicalEditor.java

License:Open Source License

protected void updateHeaderFormMessage() {
    if (this.getManagedForm() != null) {
        getManagedForm().getMessageManager().removeAllMessages();
        getManagedForm().getMessageManager().update();
        getProcessGraphViewer().getControl().setEnabled(true);
        getProcessGraphViewer().getControl()
                .setBackground(getManagedForm().getToolkit().getColors().getBackground());
    }//from  w  ww .j  ava 2 s .  c  o m
    if (currentMessageType != IMessageProvider.NONE && currentMessage != null) {
        if (this.getProcessGraphViewer() != null) {
            getProcessGraphViewer().getControl().setBackground(GraphicsConstants.BORDER_CORLOR);
            getProcessGraphViewer().getControl().setEnabled(false);
            getProcessGraphViewer().setInput(new Object());
            showTaskControl(null);
        }
        if (this.getManagedForm() != null) {

            String[] messages = currentMessage.split("\n"); //$NON-NLS-1$
            List<IMessage> messageList = new ArrayList<IMessage>();
            for (int i = 0; i < messages.length; i++) {
                String message = messages[i];
                if (message != null)
                    message.trim();
                if (message.length() == 0) {
                    continue;
                }
                messageList.add(new SmooksMessage(currentMessageType, message));
            }
            String mainMessage = null;
            if (messageList.isEmpty()) {
                mainMessage = currentMessage;
            } else {
                mainMessage = messageList.get(0).getMessage();
            }

            this.getManagedForm().getForm().getForm().setMessage(mainMessage, currentMessageType,
                    messageList.toArray(new IMessage[] {}));

        }
    }
}

From source file:org.jboss.tools.vpe.editor.template.VpeEditAnyDialog.java

License:Open Source License

/**
 * Sets the message for this dialog with an indication of what type of
 * message it is.// w  ww.  ja va2s . c  om
 * <p>
 * @param message the message, or <code>null</code> to clear the message
 */
public void setMessage(IMessageProvider message) {
    if (message == null) {
        setMessage(null, IMessageProvider.NONE);
    } else {
        setMessage(message.getMessage(), message.getMessageType());
    }
}

From source file:org.jcryptool.analysis.transpositionanalysis.ui.wizards.autoanalysiswizard.NewAnalysisSelectionPage.java

License:Open Source License

private void setNormalMessage() {
    setMessage(normalMessage, IMessageProvider.NONE);
}

From source file:org.jcryptool.crypto.xml.ui.decrypt.PageKey.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 (tKeyName.getText().length() == 0) {
        updateStatus(Messages.missingKeyName, IMessageProvider.INFORMATION);
        return;
    }

    if (tKeyPassword.getText().length() == 0) {
        updateStatus(Messages.missingKeyPassword, IMessageProvider.INFORMATION);
        return;
    }

    updateStatus(null, IMessageProvider.NONE);
}

From source file:org.jcryptool.crypto.xml.ui.decrypt.PageKeystore.java

License:Open Source License

/**
 * Determines the (error) message for the missing field.
 *//* ww w  .jav a2 s.com*/
private void dialogChanged() {
    if (tKeystore.getText().length() == 0) {
        updateStatus(Messages.missingKeystore, IMessageProvider.INFORMATION);
        return;
    } else if (!(new File(tKeystore.getText()).exists())) {
        updateStatus(Messages.keystoreNotFound, IMessageProvider.ERROR);
        return;
    }

    if (tKeystorePassword.getText().length() == 0) {
        updateStatus(Messages.missingKeystorePassword, IMessageProvider.INFORMATION);
        return;
    }

    if (tKeyName.getText().length() == 0) {
        updateStatus(Messages.missingKeyName, IMessageProvider.INFORMATION);
        return;
    }

    if (tKeyPassword.getText().length() == 0) {
        updateStatus(Messages.missingKeyPassword, IMessageProvider.INFORMATION);
        return;
    }

    if (new File(tKeystore.getText()).exists()) {
        try {
            keystore = new Keystore(tKeystore.getText(), tKeystorePassword.getText(), IGlobals.KEYSTORE_TYPE);
            keystore.load();
            if (!keystore.containsKey(tKeyName.getText())) {
                updateStatus(Messages.verifyKeyName, IMessageProvider.ERROR);
                return;
            }

            if (keystore.getSecretKey(tKeyName.getText(), tKeyPassword.getText().toCharArray()) == null) {
                updateStatus(Messages.verifyKeyPassword, 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.decrypt.PageResource.java

License:Open Source License

/**
 * Determines the (error) message for the missing field.
 *//*from  w  ww  .  j av a 2 s  .  c  om*/
private void dialogChanged() {
    if (globalError) {
        return;
    }

    if ("".equals(cEncryptionId.getText())) {
        updateStatus(Messages.missingEncryptionId, IMessageProvider.INFORMATION);
        return;
    }

    updateStatus(null, IMessageProvider.NONE);
}