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

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

Introduction

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

Prototype

public String getMessage();

Source Link

Document

Returns the current message for this message provider.

Usage

From source file:com.mobilesorcery.sdk.builder.iphoneos.IPhoneOSPackager.java

License:Open Source License

@Override
protected void addPlatformSpecifics(MoSyncProject project, IBuildVariant variant,
        CommandLineBuilder commandLine) throws Exception {
    DefaultPackager internal = new DefaultPackager(project, variant);

    // We do not yet support configuration specific certs.
    String cert = getCertificate(project, variant);
    commandLine.flag("--ios-cert").with(cert);

    String version = internal.get(DefaultPackager.APP_VERSION);
    String ver = new Version(version).asCanonicalString(Version.MICRO);
    commandLine.flag("--version").with(ver);

    String bundleId = project.getProperty(PropertyInitializer.IOS_BUNDLE_IDENTIFIER);
    commandLine.flag("--ios-bundle-id").with(bundleId);
    IMessageProvider message = Activator.getDefault().validateBundleIdentifier(internal.resolve(bundleId),
            false);//from  w w  w  .  j  av  a  2s.c o  m
    if (message.getMessageType() == IMessageProvider.ERROR) {
        throw new IllegalArgumentException(message.getMessage());
    } else if (message.getMessageType() == IMessageProvider.WARNING) {
        getBuildConsole().addMessage(IProcessConsole.ERR,
                MessageFormat.format("WARNING: {0}", message.getMessage()));
    }

    if (!shouldBuildWithXcode(project, variant)) {
        commandLine.flag("--ios-project-only");
    } else {
        SDK sdk = getSDK(project, variant);
        commandLine.flag("--ios-sdk").with(sdk.getId());
        String target = getXcodeTarget(project, variant);
        commandLine.flag("--ios-xcode-target").with(target);
    }

    commandLine.flag("--cpp-output").with(internal.resolveFile("%program-output%").getParent());
}

From source file:com.mobilesorcery.sdk.ui.DefaultMessageProvider.java

License:Open Source License

public static boolean isEmpty(IMessageProvider provider) {
    if (provider == null) {
        return true;
    }/* ww w  .  j  a v  a2s  .c  om*/

    return Util.isEmpty(provider.getMessage()) && provider.getMessageType() == IMessageProvider.NONE;
}

From source file:com.mobilesorcery.sdk.ui.internal.launch.MoSyncLaunchParamsTab.java

License:Open Source License

private void validateCurrentLaunchDelegate() {
    IEmulatorLaunchConfigurationPart launcherPart = launcherParts.get(currentLaunchDelegateId);
    if (launcherPart != null) {
        IMessageProvider validationResult = launcherPart.validate();
        if (DefaultMessageProvider.isEmpty(validationResult)) {
            setErrorMessage(null);//  www.j a v a 2s .  co m
        } else {
            setErrorMessage(validationResult.getMessage());
        }
    }
}

From source file:com.mobilesorcery.sdk.ui.MoSyncPropertyPage.java

License:Open Source License

protected void setMessage(IMessageProvider message) {
    String messageStr = message == null ? null : message.getMessage();
    int messageType = message == null ? IMessageProvider.NONE : message.getMessageType();
    setMessage(messageStr, messageType);
    setValid(DefaultMessageProvider.isEmpty(message) || message.getMessageType() != IMessageProvider.ERROR);
    if (message instanceof ValidationMessageProvider) {
        validationHelper.setMessage((ValidationMessageProvider) message);
    }//from  ww w .  j  a v a  2  s  . c o m
}

From source file:org.eclipse.ui.preferences.WizardPropertyPage.java

License:Open Source License

private void setDescription(IWizardPage page, Label messageLabel) {
    String description = null;//from  w  ww. j a v a 2 s  .c o  m
    if (page.getDescription() != null) {
        description = page.getDescription();
    } else if (page instanceof IMessageProvider) {
        IMessageProvider messageProvider = (IMessageProvider) page;
        if (messageProvider.getMessageType() == IMessageProvider.NONE) {
            description = messageProvider.getMessage();
        }
    }

    if (description != null) {
        messageLabel.setText(description);
    } else {
        messageLabel.setVisible(false);
    }
}

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./*from   w  w w. j  av a  2  s  . c o  m*/
 * <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.kalypso.contribs.eclipse.ui.forms.MessageUtilitites.java

License:Open Source License

public static IStatus convertMessage(final IMessageProvider message) {
    final int severity = convertMessageSeverity(message.getMessageType());
    final String msg = message.getMessage();
    return new Status(severity, EclipsePlatformContributionsPlugin.getID(), msg);
}

From source file:org.kalypso.gml.ui.commands.exportshape.ExportShapePage.java

License:Open Source License

protected void updateMessage() {
    final IMessageProvider message = validate();
    if (message == null)
        setMessage(null);/*from w w w  .  ja v  a 2 s  .  c o m*/
    else
        setMessage(message.getMessage(), message.getMessageType());
}

From source file:org.kalypso.model.wspm.tuhh.ui.export.ValidatingWizardPage.java

License:Open Source License

protected void setMessage(final IMessageProvider message) {
    if (message == null) {
        setMessage((String) null);
    } else {/*from  w  ww .  j  a v a  2  s.c  om*/
        setMessage(message.getMessage(), message.getMessageType());
    }

    setPageComplete(message == null || message.getMessageType() != IMessageProvider.ERROR);
}

From source file:org.kalypso.model.wspm.tuhh.ui.imports.WProfImportFilePage.java

License:Open Source License

protected void inputChanged() {
    final IMessageProvider message = checkInput();
    setMessage(message.getMessage(), message.getMessageType());

    setPageComplete(message.getMessageType() == IMessageProvider.NONE);
}