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:com.centurylink.mdw.plugin.search.SearchPage.java

License:Apache License

public boolean search(List<WorkflowProject> scopedProjects) {
    try {//from w ww  .  java2 s  .c o  m
        SearchQuery searchQuery = createSearchQuery();

        ProgressMonitorDialog context = new MdwProgressMonitorDialog(getShell());
        NewSearchUI.runQueryInForeground(context, searchQuery);

        // this shouldn't be necessary according to the Eclipse API docs
        NewSearchUI.activateSearchResultView();
        ISearchResultViewPart part = NewSearchUI.getSearchResultView();
        part.updateLabel();
        SearchResultsPage page = (SearchResultsPage) part.getActivePage();
        page.setSearchQuery(searchQuery);
        page.setInput(searchQuery.getSearchResult(), null);
        return true;
    } catch (OperationCanceledException ex) {
        setMessage("Search cancelled", IMessageProvider.INFORMATION);
        return false;
    } catch (Exception ex) {
        PluginMessages.uiError(ex, getEntityTitle() + " Search");
        return false;
    }
}

From source file:com.cisco.yangide.editor.dialogs.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 *//*  w w  w . j av  a2s  . c o m*/
public static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    if (message != null && message.length() == 0) {
        message = null;
    }
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
    case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
    default:
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:com.cisco.yangide.ui.wizards.YangCodeGeneratorDialog.java

License:Open Source License

@Override
public void create() {
    super.create();
    setTitle("Code Generator Configuration");
    setMessage("Specify Maven parameters for code generator configuration", IMessageProvider.INFORMATION);
}

From source file:com.cloudbees.eclipse.dev.ui.views.forge.ForgeSyncConfirmation.java

License:Open Source License

private void checkForgeSyncEnablers() {
    List<String> plugins = getEnabledSCMPlugins();

    if (plugins.isEmpty()) {
        setMessage("Did not find any SCM plugins.", IMessageProvider.WARNING);
    } else {/*  www . j ava 2s  .co m*/
        StringBuilder info = new StringBuilder("Found following SCM plugins: ");

        for (String name : plugins) {
            info.append(name).append(", ");
        }

        info.delete(info.length() - 2, info.length());

        setMessage(info.toString(), IMessageProvider.INFORMATION);
    }
}

From source file:com.density.ezsbt.util.AbstractCommandDialog.java

License:Apache License

@Override
public void create() {
    super.create();
    setTitle(getTitle());
    setMessage(getTipMessage(), IMessageProvider.INFORMATION);
}

From source file:com.density.ezsbt.views.SetJavaHomeDialog.java

License:Apache License

@Override
public void create() {
    super.create();
    setTitle(TITLE + node.getName());
    setMessage(MESSAGE, IMessageProvider.INFORMATION);
}

From source file:com.ebmwebsourcing.petals.common.internal.provisional.utils.MarkerUtils.java

License:Open Source License

/**
 * Gets the {@link IMessageProvider} constant from an {@link IMarker} severity constant.
 * @param markerSeverity//from w  ww  .  java2 s.  co m
 * @return
 */
public static int getMessageSeverityFromMarkerSeverity(int markerSeverity) {

    int type;
    switch (markerSeverity) {
    case IMarker.SEVERITY_ERROR:
        type = IMessageProvider.ERROR;
        break;
    case IMarker.SEVERITY_WARNING:
        type = IMessageProvider.WARNING;
        break;
    case IMarker.SEVERITY_INFO:
        type = IMessageProvider.INFORMATION;
        break;
    default:
        type = IMessageProvider.NONE;
    }

    return type;
}

From source file:com.ebmwebsourcing.petals.components.wizards.ComponentNewWizardPage.java

License:Open Source License

/**
 * Updates the page status./*from w w  w .  j  a v a 2  s  .  c  o  m*/
 * @param message the message to show, or null to show nothing
 * @param status a {@link IMessageProvider} constant
 */
private void updateStatus(String message, int status) {

    setMessage(null, IMessageProvider.ERROR);
    setMessage(null, IMessageProvider.INFORMATION);
    setMessage(null, IMessageProvider.WARNING);
    setMessage(null, IMessageProvider.NONE);

    setMessage(message, status);
    setPageComplete(status != IMessageProvider.ERROR || message == null);
}

From source file:com.ebmwebsourcing.petals.server.ui.wizards.PetalsRuntimeWizardFragment3x.java

License:Open Source License

/**
 * Validates the page data.//from   w w  w.j  av  a 2s.c  o m
 */
public void validate() {

    // Validate the petalsRuntimeWc
    this.petalsRuntimeWc.setVMInstall(this.vmInstall);
    if (this.runtimeName == null || this.runtimeName.trim().length() == 0) {
        this.wizard.setMessage("You must give your runtime a name.", IMessageProvider.ERROR);
        setComplete(false);
        this.wizard.update();
        return;
    }

    // Install path
    boolean complete = false;
    if (this.installPath != null)
        this.runtimeWc.setLocation(new Path(this.installPath));
    else
        this.runtimeWc.setLocation(null);

    IStatus status = this.runtimeWc.validate(null);
    complete = status == null || status.getSeverity() != IStatus.ERROR;
    int severity = IMessageProvider.NONE;

    if (status != null) {
        if (status.getSeverity() == IStatus.ERROR)
            severity = IMessageProvider.ERROR;
        else if (status.getSeverity() == IStatus.WARNING)
            severity = IMessageProvider.WARNING;
        else if (status.getSeverity() == IStatus.INFO)
            severity = IMessageProvider.INFORMATION;
    }

    if (status != null && severity != IMessageProvider.NONE)
        this.wizard.setMessage(status.getMessage(), severity);
    else
        this.wizard.setMessage(null, IMessageProvider.ERROR);

    getTaskModel().putObject(TaskModel.TASK_RUNTIME, this.runtimeWc);
    setComplete(complete);
    this.wizard.update();
}

From source file:com.ebmwebsourcing.petals.services.sa.export.SaExportWizardPage.java

License:Open Source License

public void createControl(Composite parent) {

    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 10;//from  w  w  w  . j a va 2s  .com
    layout.marginWidth = 10;
    container.setLayout(layout);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    new Label(container, SWT.NONE).setText("Select the Service Assembly project(s) to export:");

    // Project viewer
    TableViewer viewer = new TableViewer(container, SWT.BORDER | SWT.CHECK);
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.heightHint = 180;
    viewer.getTable().setLayoutData(layoutData);
    viewer.setLabelProvider(new WorkbenchLabelProvider());
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setInput(this.saProjects.keySet());

    for (TableItem item : viewer.getTable().getItems()) {
        IProject p = (IProject) item.getData();
        if (this.saProjects.get(p))
            item.setChecked(true);
    }

    viewer.getTable().addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {

            boolean checked = ((TableItem) event.item).getChecked();
            IProject p = (IProject) ((TableItem) event.item).getData();
            SaExportWizardPage.this.saProjects.put(p, checked);
            validate();
        }
    });

    // Export mode
    Label label = new Label(container, SWT.NONE);
    label.setText("Select the export mode:");
    layoutData = new GridData();
    layoutData.verticalIndent = 17;
    label.setLayoutData(layoutData);

    // Export mode - one per project
    Button projectModeButton = new Button(container, SWT.RADIO);
    projectModeButton.setText("Export every selected Service Assembly in its project.");
    projectModeButton.setToolTipText(
            "The created archives will be placed at the root of the associated Service Assembly projects.");
    layoutData = new GridData();
    layoutData.verticalIndent = 3;
    projectModeButton.setLayoutData(layoutData);

    // Export mode - one per project, in a same directory
    Button separateModeButton = new Button(container, SWT.RADIO);
    separateModeButton.setText("Export the Service Assemblies separately, but in a same directory.");
    separateModeButton.setToolTipText("The created archive will be placed in the selected directory.");

    Composite subContainer = new Composite(container, SWT.NONE);
    layout = new GridLayout(3, false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.marginLeft = 16;
    subContainer.setLayout(layout);
    subContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    final Label dirLabel = new Label(subContainer, SWT.NONE);
    dirLabel.setText("Output directory:");
    layoutData = new GridData();
    layoutData.widthHint = 90;
    dirLabel.setLayoutData(layoutData);

    final Text dirText = new Text(subContainer, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
    dirText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    String loc = PetalsServicesPlugin.getDefault().getPreferenceStore().getString(PREF_DIRECTORY_LOC);
    if (loc.length() != 0) {
        dirText.setText(loc);
        this.outputFile = new File(loc);
    }

    dirText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            SaExportWizardPage.this.outputFile = new File(dirText.getText());
            validate();
        }
    });

    final Button browseDirButton = new Button(subContainer, SWT.PUSH);
    browseDirButton.setText("Browse...");
    browseDirButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            DirectoryDialog dlg = new DirectoryDialog(dirText.getShell());
            dlg.setText("Output Directory");
            dlg.setMessage("Select the output directory.");
            if (SaExportWizardPage.this.outputFile != null && SaExportWizardPage.this.outputFile.exists())
                dlg.setFilterPath(SaExportWizardPage.this.outputFile.getAbsolutePath());

            String loc = dlg.open();
            if (loc != null) {
                dirText.setText(loc);
                PetalsServicesPlugin.getDefault().getPreferenceStore().setValue(PREF_DIRECTORY_LOC, loc);
            }
        }
    });

    // Selection listeners
    projectModeButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {

            dirLabel.setEnabled(false);
            dirText.setEnabled(false);
            browseDirButton.setEnabled(false);
            dirText.setBackground(dirText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));

            SaExportWizardPage.this.outputFile = null;
            SaExportWizardPage.this.exportMode = SaExportMode.IN_PROJECT;
            validate();
        }
    });

    separateModeButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            widgetDefaultSelected(e);
        }

        public void widgetDefaultSelected(SelectionEvent e) {

            dirLabel.setEnabled(true);
            dirText.setEnabled(true);
            browseDirButton.setEnabled(true);
            dirText.setBackground(dirText.getDisplay().getSystemColor(SWT.COLOR_WHITE));

            SaExportWizardPage.this.outputFile = new File(dirText.getText());
            SaExportWizardPage.this.exportMode = SaExportMode.IN_SAME_LOCATION;
            validate();
        }
    });

    // Last UI details
    setControl(container);
    viewer.getTable().setFocus();
    projectModeButton.setSelection(true);
    projectModeButton.notifyListeners(SWT.Selection, new Event());

    String msg = getErrorMessage();
    if (msg != null) {
        setErrorMessage(null);
        setMessage(msg, IMessageProvider.INFORMATION);
    }
}